0

I copied the GNT, ZIL, GTO token code from mainnet and deployed each token to rinkeby.

  • GNT token contract : 0x861783a4B946026e3180FCA173261d937aa2fabF
  • ZIL token contract : 0x1dD42376F6902F812E03C3861Da3c8654462c267
  • GTO token contract : 0x8970fd3E01504D5b83d48faFbad92547AE9B6630

TestContract1 and TestContract2 and TestContract3 were distributed using Remix as shown below.

After depositing a token in each contract, I called the transfer() function

But,

  • TestContract1 : transaction success
  • TestContract2 : transaction fail
  • TestContract3 : transaction fail

TestContract2 and TestContract3 had an error (Gas estimation failed) in Remix, but it did send transaction.

I'm so frustrated because I can not figure out the cause of the failure, so I want to get expert advice.


pragma solidity ^0.4.21;

contract Token {
    function transfer(address _to, uint _value) public returns (bool success);
}

contract TestContract1 {

    function transfer(address _to, uint _amount) public returns (bool success) {
    // GNT token contract 
        address tokenContract = 0x861783a4B946026e3180FCA173261d937aa2fabF;

        Token _tokenSomething = Token(tokenContract);

        _tokenSomething.transfer(_to, _amount);

        return true;
    }
}

contract TestContract2 {

    function transfer(address _to, uint _amount) public returns (bool success) {
    // ZIL token contract 
        address tokenContract = 0x1dD42376F6902F812E03C3861Da3c8654462c267

        Token _tokenSomething = Token(tokenContract);

        _tokenSomething.transfer(_to, _amount);

        return true;
    }
}

contract TestContract3 {

    function transfer(address _to, uint _amount) public returns (bool success) {
    // GTO token contract 
        address tokenContract = 0x8970fd3E01504D5b83d48faFbad92547AE9B6630

        Token _tokenSomething = Token(tokenContract);

        _tokenSomething.transfer(_to, _amount);

        return true;
    }
}

TestContract1 transaction result : https://rinkeby.etherscan.io/tx/0xdef60351224e0b3ca298888878aefc975787a67cfea3d5428f94ba74759205df

TestContract2 transaction result : https://rinkeby.etherscan.io/tx/0x9975ab7bb92447e865e0e34bbc670e3f2a34e8d31c40ecdac35185408abe2bd0

  • Have you solved it? I have the same problem – Jinyang Dong Jun 3 '18 at 3:17
  • No, not yet. I have no idea yet. :( – Shavrany Jun 4 '18 at 12:30
  • Is that the full code? It does not implement the RC20 standard. – Florian Castelain Jun 15 '18 at 12:18
  • I found my mistake. Token contract deployment was incorrect. It works fine. – Shavrany Jun 18 '18 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.