Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert() fail in contract will cause tx to consume all the fees. #55

Open
hackfisher opened this issue Jan 21, 2019 · 0 comments
Open

Comments

@hackfisher
Copy link
Contributor

pragma solidity ^0.4.23;

contract Mortal {
    /* Define variable owner of the type address */
    address owner;
    uint256 x;

    /* This constructor is executed at initialization and sets the owner of the contract */
    constructor() public { owner = msg.sender; }

    /* Function to recover the funds on the contract */
    function testAssert(uint256 _x) public {
        assert(_x > 10 );
        x = _x;
    }
}
{"error":"Invalid operation code: opCode[fe];","transaction":{"txID":"9bb95d996b780f7b3755cb26af71be7385090a3dc594b0c803d9e0fad477618d","raw_data":{"contract":[{"parameter":{"value":{"data":"246ce3f90000000000000000000000000000000000000000000000000000000000000005","owner_address":"41ab4866d8833f1da588a87fecff71c00416732a9c","contract_address":"41883d6c063e4ba9302a32abbb9d933cb13b96c1b6"},"type_url":"type.googleapis.com/protocol.TriggerSmartContract"},"type":"TriggerSmartContract"}],"ref_block_bytes":"3b51","ref_block_hash":"433270fe36617e64","expiration":1548055197000,"fee_limit":1000000000,"timestamp":1548055139980},"signature":["53aadc11906defec73e2df98a6bceb1956bc32e1cf06a82b34c714e676f8a8efe82ef42867db4c6049a7be0de99b81ab9395cd6125f393c96a721a2adcbcfc8601"]},"output":{"id":"9bb95d996b780f7b3755cb26af71be7385090a3dc594b0c803d9e0fad477618d","fee":1000000000,"blockNumber":736083,"blockTimeStamp":1548055143000,"contractResult":[""],"contract_address":"41883d6c063e4ba9302a32abbb9d933cb13b96c1b6","receipt":{"energy_fee":1000000000,"energy_usage_total":100000000,"net_usage":314,"result":"ILLEGAL_OPERATION"},"result":"FAILED","resMessage":"496e76616c6964206f7065726174696f6e20636f64653a206f70436f64655b66655d3b"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant