0

I am reading the source code of this erc20 token:

https://etherscan.io/address/0xfdfd5db568f2ecf9b06a16116b9201b0500735b4#code

the code is like this:

contract VelixIDToken is ReleasableToken, BurnableToken {
    ...

    function transfer(address _to, uint _value) public returns (bool success) {
        // Call StandardToken.transfer()
        CanTransferChecked(released || transferAgents[msg.sender], msg.sender, transferAgents[msg.sender], released);
        if (released || transferAgents[msg.sender]) {
            return super.transfer(_to, _value);
        } else {
            return false;
        }
    }

    ...
}

contract ReleasableToken is ERC20, Ownable {
    ...

    function transfer(address _to, uint _value) public returns (bool success) {
        // Call StandardToken.transfer()
        CanTransferChecked(released || transferAgents[msg.sender], msg.sender, transferAgents[msg.sender], released);
        if (released || transferAgents[msg.sender]) {revert();}
        return super.transfer(_to, _value);
    }

    ...
}

in my understanding, the token transfer() can never really happen, released is false now, so in VelixIDToken, only transferAgent can pass the check:

if (released || transferAgents[msg.sender]),

well in ReleasableToken, the call will revert cause :

if (released || transferAgents[msg.sender]) {revert();}.

but I see successful token transfer on etherscan:

https://etherscan.io/tx/0xfa76397fc5d1d5e155fa969f56095d4ecdad4dc90a64798ca79fa2773923fb07

so where am I wrong?

ps. I even wondered if the source code uploaded to etherscan is wrong, can this happen?

2

I believe that super.transfer refers to the transfer implementation in BurnableToken, not the transfer in ReleasableToken. From https://solidity.readthedocs.io/en/v0.4.24/contracts.html#multiple-inheritance-and-linearization:

Especially, the order in which the base classes are given in the is directive is important: You have to list the direct base contracts in the order from “most base-like” to “most derived”.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.