3

Try to run my contract in remix JavaScriptVM and faced with error. Contract code:

...
/**
 * @title Burnable Token
 * @dev Token that can be irreversibly burned (destroyed).
 */
contract BurnableToken is Standard223Token {

    /**
     * @dev Burns a specific amount of tokens.
     * @param _value The amount of token to be burned.
     */
    function burn(uint _value) public {
        require(_value > 0);
        require(_value <= balances[msg.sender]);
        address burner = msg.sender;
        balances[burner] = balances[burner].sub(_value);
        totalSupply = totalSupply.sub(_value);
        Burn(burner, _value);
    }

    function burnAll() public {
        address burner = msg.sender;
        totalSupply = totalSupply.sub(balances[burner]);
        Burn(burner, balances[burner]);
        balances[burner] = 0;
    }

    event Burn(address indexed burner, uint indexed value);

}


contract MFC_Token is BurnableToken {

    string public constant name = "MFC Coin Token";

    string public constant symbol = "MFC";

    uint32 public constant decimals = 18;

    uint256 public constant INITIAL_SUPPLY = 500000000000000000000000000;

    function MFC_Token() {
        totalSupply = INITIAL_SUPPLY;
        balances[msg.sender] = INITIAL_SUPPLY;
    }

}

contract ICO_controller is Ownable, ERC223Receiver {

    using SafeMath for uint256;
    // The token being sold
    MFC_Token public token = new MFC_Token();
    ...
}

I don't cite all the code contracts here because it's very large.
In my opinion - the main thing here is that the token standard ERC223, and the error is obtained on the line, which I last cited in the contract ICO_controller. The error occurs after the token constructor is executed.
Opcode which indicates the debugger before the revert happens:

00025 DUP1
00026 ISZERO
00027 ISZERO
00028 PUSH3 000025
00032 JUMPI
00033 PUSH1 00
00035 DUP1
00036 REVERT

To be honest, I don't really understand how to use debagger Remix correctly, maybe the error is obvious, but I don't see it. Tell me, what's wrong?

If I can still recommend good materials on using the debugger Remix, I would be very grateful.

If you do not have some data - write, I will add.

  • Did you get to the bottom of this? I have a similar problem where I can't understand how to see what happened to cause a revert. – fraxture May 13 '18 at 16:23
  • No, I couldn't find an answer then. The debugger did not help me. – savao May 15 '18 at 9:08

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.