current position:Home>The BNB token transfer method is executed in the contract and reports an error

The BNB token transfer method is executed in the contract and reports an error

2022-02-04 00:10:36 Q & A of Denglian community

interface TokenInterface {    function balanceOf(address who) public constant returns (uint256);    function transfer(address to, uint256 value) public returns (bool);}contract CESHI is Pausable {    using SafeMath for *;    using Strings for *;    address constant public token_contract = 0xB8c77482e45F1F44dE1745F52C74426C631bDD52;    TokenInterface constant private tokenInterface = TokenInterface(token_contract);    function withdraw(uint256 amount) public returns(bool) {        tokenInterface.transfer(msg.sender, amount);        return true;    }}

Please ask , Transfer to the contract BNB After the token , Use this withdraw The method can't be turned out ,ropsten The test network uses standard ERC20 The tokens deployed in the template can be transferred out , Not at the official station ,BNB Non conformity of ERC20 Standard? ? Then how can I turn it out ? Thank you for the






Other answers 1:

copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202040010344671.html

Random recommended