7

BNB代币transfer方法在合约中执行报错

 3 years ago
source link: https://learnblockchain.cn/question/1923
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
BNB代币transfer方法在合约中执行报错 | 登链社区 | 技术问答

BNB代币transfer方法在合约中执行报错

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;
    }
}

麻烦问一下,向合约转入BNB代币后,用这个withdraw方法转不出来了,ropsten测试网用标准的ERC20模板部署的代币就可以转出来,到了正式站就不行了,BNB的不合符ERC20标准吗?那怎样才能转出来啊?谢谢了


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK