Contract 0x0000000000170ccc93903185be5a2094c870df62

Contract Overview

Balance:
0 Ether
Txn Hash Method
Block
From
To
Value
0x0f59f89501d06d0a05529cbf5555b8c0322af92cb8e4aae56c199f8b88e6cf1dTransfer249145162021-05-18 14:23:486 hrs 51 mins ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000515591
0x48ced9744ab9b04332930000f1bce1f66d734e510b758c80d724baabe12e78e6Transfer249141592021-05-18 13:59:327 hrs 16 mins ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000268591
0xa27605e413e13b656e9ee73c3565e694d166e0652d23ebb8a93bc70c170defcaTransfer247659992021-05-10 8:33:088 days 12 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000517591
0x7c84685ffabb22bcb3280e1e97518fc1dcb6aaf36935e6fd2a575b2c0caa15a3Mint247659792021-05-10 8:31:088 days 12 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0022260841
0xd02b5228eca01cf983cc23fcac6158902263af00ff838da185ea5674c9ee5aafTransfer247659162021-05-10 8:24:488 days 12 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000230851
0x3627012a2339fa352eaeeb9ab5f54df178487a97bc46fe6a481efb488e2af55dTransfer247655702021-05-10 7:50:448 days 13 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000367591
0x83e07f6e3e39e9c136da477f9e9e276d1ef9211e41c4b58de8b21e5d39ab516eTransfer247649252021-05-10 6:47:568 days 14 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000517471
0xc0bbd4f1793fbee48b362fbfa0363feae7a125a2e72dbe61c6f84df7b490fbfeTransfer247649152021-05-10 6:46:568 days 14 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000517591
0x4565f617a16d56e02fb48e8e4ff5b993fb1c581e3efac6d1ebaff7d944fd2f3aTransfer247648872021-05-10 6:44:128 days 14 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000367591
0xb8140ec1c8485e3f57cf494df10f90b19970b14d27a4fda11b135034160e9aaaMint247648662021-05-10 6:42:208 days 14 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0022260841
0x4fdab778fba3abf1c54ce9e0a4605837471b4626a89f1a2baa2b72cddd2061c5Transfer247648392021-05-10 6:39:448 days 14 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000517591
0x851840c3b3507629cc59f2211063a7e1eca9d9516a3e79106a55c1401b3c2542Transfer247155342021-05-07 16:19:4011 days 4 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000517591
0x7d79d6d57811d3962b3fbde8cd8aaf9525761dc78df6d9fd78ab6ac023e3787bTransfer247149712021-05-07 15:41:2811 days 5 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000367591
0x3f0c87a40a434052dbff7ef65c06b1df0d0b6fb0e82a4188eea34574d0c5fe11Transfer247149432021-05-07 15:39:3611 days 5 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000517591
0x4fd97243e3ff5bfcad517168e3f28a9f42baf73b0215b6c300f8c0cab2f70fb7Transfer247144842021-05-07 15:09:0011 days 6 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000517591
0xefa2ddb09961db7a73dde83b4a657a0f074416bec404ec7bcd5df623f8e828c3Mint247143102021-05-07 14:57:1611 days 6 hrs ago0x0446ed937d46a5d69e38942fb8b59ed8d16bab39 IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0022410841
0x61c6a4cf7978caff3782469305c6c5e5cb505108f8cc506ce5891f902759f38cApprove246935922021-05-06 15:01:4412 days 6 hrs ago0x40cef25ef75ef2f6e50103d69733be328aad31fb IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0001349073
0x67a0637e00e36b11343c7605db0304e0769398ac0cd91ea36ea0e26df2f87d15Approve246927292021-05-06 14:01:5612 days 7 hrs ago0x40cef25ef75ef2f6e50103d69733be328aad31fb IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0001349073
0x343db33644a18be6d847e287b6ae19ea5a484b051710bc163c62e3066b06ed16Approve246893642021-05-06 10:00:5212 days 11 hrs ago0x40cef25ef75ef2f6e50103d69733be328aad31fb IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0001349073
0xfa0c908b967d86b937ea4a15c173bb7c70c8840fd345541b8849a6a521a3089aApprove246883892021-05-06 8:54:4412 days 12 hrs ago0x40cef25ef75ef2f6e50103d69733be328aad31fb IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0001349073
0x30ba3d32f950a88f7ad2f4c4b95782d5f0ba6d94cd1459c2e2b5f7ce003cf511Approve246882412021-05-06 8:44:4012 days 12 hrs ago0x40cef25ef75ef2f6e50103d69733be328aad31fb IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0001349073
0x753cd93fdce0da772ed067f3ba2f68a041eae4a9c1c3191f3b44920b0a19d753Approve246882072021-05-06 8:42:2412 days 12 hrs ago0x40cef25ef75ef2f6e50103d69733be328aad31fb IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0001349073
0x74d2bb4cd3c7deacada43d7c85dcf35286a42e54b0eff9584d9eb35195af465bApprove246881252021-05-06 8:36:5212 days 12 hrs ago0x40cef25ef75ef2f6e50103d69733be328aad31fb IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000449691
0x0b8f3d8d9c44b24d0b274baafad2e653a3d8a6bc899f221e086d8053c406decbApprove246877432021-05-06 8:10:5612 days 13 hrs ago0x40cef25ef75ef2f6e50103d69733be328aad31fb IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000449691
0xd7b66f001d33e524c239955ad5ce07e32bb231e611f6560eb1a78eb8c7f681e1Approve246872752021-05-06 7:39:2812 days 13 hrs ago0x40cef25ef75ef2f6e50103d69733be328aad31fb IN  0x0000000000170ccc93903185be5a2094c870df620 Ether0.0000449691
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x36e30ade37e0f4433cddc0f664fd83809a09da5601f7d33d9f9d59feaf2d3d8a249118612021-05-18 11:26:169 hrs 49 mins ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x25bdf1449c32e656f480c5ad2d4b8c530380aee000a037d1f529a1780dfe3eaf249104072021-05-18 9:49:2011 hrs 26 mins ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0xd2af86abcd00115a7dca4e2302ff61c2f096e66857a5417e78cb095be668d908249103612021-05-18 9:46:1611 hrs 29 mins ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0xfc39bfbc1aa4952e41a6cd83f0c03ea55f8162be023cbd704e8c8b8236e84dbd249099502021-05-18 9:18:5211 hrs 56 mins ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x6b444c4d74804fd431e86ced65fe36113c1ffe9904389bd5c1ed37a4cb8eae17249085852021-05-18 7:47:4013 hrs 28 mins ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x49ca9c84d903bfd023b9f75957fd34cfa6f0277f079ce1f2e74490077c766914249085082021-05-18 7:42:3213 hrs 33 mins ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x9da58615bce107c2fb45b4878c79ab82842a316c5742547fa33961fbf96f55f8249084812021-05-18 7:40:4413 hrs 35 mins ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x505da3ab9e5646d2d81d4669ab49ef46bd4263a5e1e476273cb5515406938b79249081662021-05-18 7:19:4413 hrs 56 mins ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x61e848e966f933c3999049c150ee3118bf0129a620ea80681ebb779d930fc510249054352021-05-18 4:17:4016 hrs 58 mins ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x8d83dfb382dd718c15d09e184b868ff683e56f2dbb4dab43c3ac2f98b63f4c09249054072021-05-18 4:15:4816 hrs 59 mins ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x9eaa78f9cb6f7208ca72161a670982842fdd00a37c9db1a8916ac2793190cae5248912162021-05-17 12:29:121 day 8 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x1e923bf43a31cfcca67187ee05ab248b50d8707dd25c6fa13650e555941ea747248912042021-05-17 12:28:241 day 8 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0xf4c9c43721efb93bd22802a6d49de338aa881de31793f97de94865c8df1f4c00248911772021-05-17 12:26:361 day 8 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x97d49f0af9de6e76d8fd71208cf7775b2b52cba22f6d1cbb109db10e223109bf248902032021-05-17 11:21:241 day 9 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0xbd3f47f3ccd9f96642b29a2ef27b36b2cbe2de44fbcdf0cf1c19e24e25a42faf248901632021-05-17 11:18:441 day 9 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x99fed72e904eaf64cd2443d5eaec2ef63a3632c82f79d8343e85c9f9c2d2b68a248901612021-05-17 11:18:361 day 9 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x9ebcf79ddd84c1e7eed45fcd5f1b4f1fe7bb5a9bb3f3ddf811a93effa31d18b7248858522021-05-17 6:31:161 day 14 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0xa7f5e857d1a9ecb4aca0714b24a70ca0942cc1a656c8e09b6d01bab9af4ec9e5248852862021-05-17 5:53:281 day 15 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0xc18c2b1335efdfdd4a308cd9a73a27a20d7fa0481164c9dd30bb88f055466a60248852062021-05-17 5:48:081 day 15 hrs ago 0x718099d292b1ad14555e25889a91e7d11552ec0c 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x569f407f0ed0297ddfbabffaabb2268530a8b76f520adaaae985f80892a77bc1248851632021-05-17 5:45:161 day 15 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x1054b2f1f1dda700cfed5242e4bf0b6a0398395e8ddc2e1e683ba20908ef9c6d248848552021-05-17 5:24:441 day 15 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0xfbb02778b6d7f256d6b3a9180670473f1dadef5aa471b9bc2da0003528748e11248844462021-05-17 4:57:281 day 16 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x5af3ac59232ded7d110f787336b344f829fceec7f61d9ce653c714a27f2cd983248841692021-05-17 4:39:001 day 16 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0xaa9b0904c2022e55460a5b70859617e29273133ac2e6adabca12c57a680ea2d5247976682021-05-12 11:37:486 days 9 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
0x039e80c6f1ce109928a5ef57968dc531b796c222710ba3bc215343e63289a111247972192021-05-12 10:53:326 days 10 hrs ago 0x2e971c73f7a3c030147b00970731e1de83b37aa7 0x0000000000170ccc93903185be5a2094c870df620 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GasToken2Kovan

Compiler Version
v0.4.16+commit.d7661dd9

Optimization Enabled:
No with 200 runs

Other Settings:
default evmVersion
/**
 *Submitted for verification at Etherscan.io on 2018-04-06
*/

pragma solidity ^0.4.10;

contract GasToken2Kovan {
    //////////////////////////////////////////////////////////////////////////
    // RLP.sol
    // Due to some unexplained bug, we get a slightly different bytecode if 
    // we use an import, and are then unable to verify the code in Etherscan
    //////////////////////////////////////////////////////////////////////////
    
    uint256 constant ADDRESS_BYTES = 20;
    uint256 constant MAX_SINGLE_BYTE = 128;
    uint256 constant MAX_NONCE = 256**9 - 1;

    // count number of bytes required to represent an unsigned integer
    function count_bytes(uint256 n) constant internal returns (uint256 c) {
        uint i = 0;
        uint mask = 1;
        while (n >= mask) {
            i += 1;
            mask *= 256;
        }

        return i;
    }

    function mk_contract_address(address a, uint256 n) constant internal returns (address rlp) {
        /*
         * make sure the RLP encoding fits in one word:
         * total_length      1 byte
         * address_length    1 byte
         * address          20 bytes
         * nonce_length      1 byte (or 0)
         * nonce           1-9 bytes
         *                ==========
         *                24-32 bytes
         */
        require(n <= MAX_NONCE);

        // number of bytes required to write down the nonce
        uint256 nonce_bytes;
        // length in bytes of the RLP encoding of the nonce
        uint256 nonce_rlp_len;

        if (0 < n && n < MAX_SINGLE_BYTE) {
            // nonce fits in a single byte
            // RLP(nonce) = nonce
            nonce_bytes = 1;
            nonce_rlp_len = 1;
        } else {
            // RLP(nonce) = [num_bytes_in_nonce nonce]
            nonce_bytes = count_bytes(n);
            nonce_rlp_len = nonce_bytes + 1;
        }

        // [address_length(1) address(20) nonce_length(0 or 1) nonce(1-9)]
        uint256 tot_bytes = 1 + ADDRESS_BYTES + nonce_rlp_len;

        // concatenate all parts of the RLP encoding in the leading bytes of
        // one 32-byte word
        uint256 word = ((192 + tot_bytes) * 256**31) +
                       ((128 + ADDRESS_BYTES) * 256**30) +
                       (uint256(a) * 256**10);

        if (0 < n && n < MAX_SINGLE_BYTE) {
            word += n * 256**9;
        } else {
            word += (128 + nonce_bytes) * 256**9;
            word += n * 256**(9 - nonce_bytes);
        }

        uint256 hash;

        assembly {
            let mem_start := mload(0x40)        // get a pointer to free memory
            mstore(0x40, add(mem_start, 0x20))  // update the pointer

            mstore(mem_start, word)             // store the rlp encoding
            hash := sha3(mem_start,
                         add(tot_bytes, 1))     // hash the rlp encoding
        }

        // interpret hash as address (20 least significant bytes)
        return address(hash);
    }
    
    //////////////////////////////////////////////////////////////////////////
    // Generic ERC20
    //////////////////////////////////////////////////////////////////////////

    // owner -> amount
    mapping(address => uint256) s_balances;
    // owner -> spender -> max amount
    mapping(address => mapping(address => uint256)) s_allowances;

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(address indexed owner, address indexed spender, uint256 value);

    // Spec: Get the account balance of another account with address `owner`
    function balanceOf(address owner) public constant returns (uint256 balance) {
        return s_balances[owner];
    }

    function internalTransfer(address from, address to, uint256 value) internal returns (bool success) {
        if (value <= s_balances[from]) {
            s_balances[from] -= value;
            s_balances[to] += value;
            Transfer(from, to, value);
            return true;
        } else {
            return false;
        }
    }

    // Spec: Send `value` amount of tokens to address `to`
    function transfer(address to, uint256 value) public returns (bool success) {
        address from = msg.sender;
        return internalTransfer(from, to, value);
    }

    // Spec: Send `value` amount of tokens from address `from` to address `to`
    function transferFrom(address from, address to, uint256 value) public returns (bool success) {
        address spender = msg.sender;
        if(value <= s_allowances[from][spender] && internalTransfer(from, to, value)) {
            s_allowances[from][spender] -= value;
            return true;
        } else {
            return false;
        }
    }

    // Spec: Allow `spender` to withdraw from your account, multiple times, up
    // to the `value` amount. If this function is called again it overwrites the
    // current allowance with `value`.
    function approve(address spender, uint256 value) public returns (bool success) {
        address owner = msg.sender;
        if (value != 0 && s_allowances[owner][spender] != 0) {
            return false;
        }
        s_allowances[owner][spender] = value;
        Approval(owner, spender, value);
        return true;
    }

    // Spec: Returns the `amount` which `spender` is still allowed to withdraw
    // from `owner`.
    // What if the allowance is higher than the balance of the `owner`?
    // Callers should be careful to use min(allowance, balanceOf) to make sure
    // that the allowance is actually present in the account!
    function allowance(address owner, address spender) public constant returns (uint256 remaining) {
        return s_allowances[owner][spender];
    }

    //////////////////////////////////////////////////////////////////////////
    // GasToken specifics
    //////////////////////////////////////////////////////////////////////////

    uint8 constant public decimals = 2;
    string constant public name = "Gastoken.io";
    string constant public symbol = "GST2";

    // We build a queue of nonces at which child contracts are stored. s_head is
    // the nonce at the head of the queue, s_tail is the nonce behind the tail
    // of the queue. The queue grows at the head and shrinks from the tail.
    // Note that when and only when a contract CREATEs another contract, the
    // creating contract's nonce is incremented.
    // The first child contract is created with nonce == 1, the second child
    // contract is created with nonce == 2, and so on...
    // For example, if there are child contracts at nonces [2,3,4],
    // then s_head == 4 and s_tail == 1. If there are no child contracts,
    // s_head == s_tail.
    uint256 s_head;
    uint256 s_tail;

    // totalSupply gives  the number of tokens currently in existence
    // Each token corresponds to one child contract that can be SELFDESTRUCTed
    // for a gas refund.
    function totalSupply() public constant returns (uint256 supply) {
        return s_head - s_tail;
    }

    // Creates a child contract that can only be destroyed by this contract.
    function makeChild() internal returns (address addr) {
        assembly {
            // EVM assembler of runtime portion of child contract:
            //     ;; Pseudocode: if (msg.sender != 0x0000000000170ccc93903185be5a2094c870df62) { throw; }
            //     ;;             suicide(msg.sender)
            //     PUSH15 0x170ccc93903185be5a2094c870df62 ;; hardcoded address of this contract
            //     CALLER
            //     XOR
            //     PC
            //     JUMPI
            //     CALLER
            //     SELFDESTRUCT
            // Or in binary: 6e170ccc93903185be5a2094c870df623318585733ff
            // Since the binary is so short (22 bytes), we can get away
            // with a very simple initcode:
            //     PUSH22 0x6e170ccc93903185be5a2094c870df623318585733ff
            //     PUSH1 0
            //     MSTORE ;; at this point, memory locations mem[10] through
            //            ;; mem[31] contain the runtime portion of the child
            //            ;; contract. all that's left to do is to RETURN this
            //            ;; chunk of memory.
            //     PUSH1 22 ;; length
            //     PUSH1 10 ;; offset
            //     RETURN
            // Or in binary: 756e170ccc93903185be5a2094c870df623318585733ff6000526016600af3
            // Almost done! All we have to do is put this short (31 bytes) blob into
            // memory and call CREATE with the appropriate offsets.
            let solidity_free_mem_ptr := mload(0x40)
            mstore(solidity_free_mem_ptr, 0x00756e170ccc93903185be5a2094c870df623318585733ff6000526016600af3)
            addr := create(0, add(solidity_free_mem_ptr, 1), 31)
        }
    }

    // Mints `value` new sub-tokens (e.g. cents, pennies, ...) by creating `value`
    // new child contracts. The minted tokens are owned by the caller of this
    // function.
    function mint(uint256 value) public {
        for (uint256 i = 0; i < value; i++) {
            makeChild();
        }
        s_head += value;
        s_balances[msg.sender] += value;
    }

    // Destroys `value` child contracts and updates s_tail.
    //
    // This function is affected by an issue in solc: https://github.com/ethereum/solidity/issues/2999
    // The `mk_contract_address(this, i).call();` doesn't forward all available gas, but only GAS - 25710.
    // As a result, when this line is executed with e.g. 30000 gas, the callee will have less than 5000 gas
    // available and its SELFDESTRUCT operation will fail leading to no gas refund occurring.
    // The remaining ~29000 gas left after the call is enough to update s_tail and the caller's balance.
    // Hence tokens will have been destroyed without a commensurate gas refund.
    // Fortunately, there is a simple workaround:
    // Whenever you call free, freeUpTo, freeFrom, or freeUpToFrom, ensure that you pass at least
    // 25710 + `value` * (1148 + 5722 + 150) gas. (It won't all be used)
    function destroyChildren(uint256 value) internal {
        uint256 tail = s_tail;
        // tail points to slot behind the last contract in the queue
        for (uint256 i = tail + 1; i <= tail + value; i++) {
            mk_contract_address(this, i).call();
        }

        s_tail = tail + value;
    }

    // Frees `value` sub-tokens (e.g. cents, pennies, ...) belonging to the
    // caller of this function by destroying `value` child contracts, which
    // will trigger a partial gas refund.
    // You should ensure that you pass at least 25710 + `value` * (1148 + 5722 + 150) gas
    // when calling this function. For details, see the comment above `destroyChilden`.
    function free(uint256 value) public returns (bool success) {
        uint256 from_balance = s_balances[msg.sender];
        if (value > from_balance) {
            return false;
        }

        destroyChildren(value);

        s_balances[msg.sender] = from_balance - value;

        return true;
    }

    // Frees up to `value` sub-tokens. Returns how many tokens were freed.
    // Otherwise, identical to free.
    // You should ensure that you pass at least 25710 + `value` * (1148 + 5722 + 150) gas
    // when calling this function. For details, see the comment above `destroyChilden`.
    function freeUpTo(uint256 value) public returns (uint256 freed) {
        uint256 from_balance = s_balances[msg.sender];
        if (value > from_balance) {
            value = from_balance;
        }

        destroyChildren(value);

        s_balances[msg.sender] = from_balance - value;

        return value;
    }

    // Frees `value` sub-tokens owned by address `from`. Requires that `msg.sender`
    // has been approved by `from`.
    // You should ensure that you pass at least 25710 + `value` * (1148 + 5722 + 150) gas
    // when calling this function. For details, see the comment above `destroyChilden`.
    function freeFrom(address from, uint256 value) public returns (bool success) {
        address spender = msg.sender;
        uint256 from_balance = s_balances[from];
        if (value > from_balance) {
            return false;
        }

        mapping(address => uint256) from_allowances = s_allowances[from];
        uint256 spender_allowance = from_allowances[spender];
        if (value > spender_allowance) {
            return false;
        }

        destroyChildren(value);

        s_balances[from] = from_balance - value;
        from_allowances[spender] = spender_allowance - value;

        return true;
    }

    // Frees up to `value` sub-tokens owned by address `from`. Returns how many tokens were freed.
    // Otherwise, identical to `freeFrom`.
    // You should ensure that you pass at least 25710 + `value` * (1148 + 5722 + 150) gas
    // when calling this function. For details, see the comment above `destroyChilden`.
    function freeFromUpTo(address from, uint256 value) public returns (uint256 freed) {
        address spender = msg.sender;
        uint256 from_balance = s_balances[from];
        if (value > from_balance) {
            value = from_balance;
        }

        mapping(address => uint256) from_allowances = s_allowances[from];
        uint256 spender_allowance = from_allowances[spender];
        if (value > spender_allowance) {
            value = spender_allowance;
        }

        destroyChildren(value);

        s_balances[from] = from_balance - value;
        from_allowances[spender] = spender_allowance - value;

        return value;
    }
}

Contract ABI

[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"value","type":"uint256"}],"name":"freeFromUpTo","outputs":[{"name":"freed","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"spender","type":"address"},{"name":"value","type":"uint256"}],"name":"approve","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"supply","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"from","type":"address"},{"name":"value","type":"uint256"}],"name":"freeFrom","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"freeUpTo","outputs":[{"name":"freed","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"mint","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"to","type":"address"},{"name":"value","type":"uint256"}],"name":"transfer","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"value","type":"uint256"}],"name":"free","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"}]

6060604052341561000f57600080fd5b5b61125d8061001f6000396000f300606060405236156100ce576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d3578063079d229f14610162578063095ea7b3146101b857806318160ddd1461021257806323b872dd1461023b578063313ce567146102b45780635f2e2b45146102e35780636366b9361461033d57806370a082311461037457806395d89b41146103c1578063a0712d6814610450578063a9059cbb14610473578063d8ccd0f3146104cd578063dd62ed3e14610508575b600080fd5b34156100de57600080fd5b6100e6610574565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101275780820151818401525b60208101905061010b565b50505050905090810190601f1680156101545780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561016d57600080fd5b6101a2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ad565b6040518082815260200191505060405180910390f35b34156101c357600080fd5b6101f8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610734565b604051808215151515815260200191505060405180910390f35b341561021d57600080fd5b6102256108c8565b6040518082815260200191505060405180910390f35b341561024657600080fd5b61029a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108d7565b604051808215151515815260200191505060405180910390f35b34156102bf57600080fd5b6102c7610a1a565b604051808260ff1660ff16815260200191505060405180910390f35b34156102ee57600080fd5b610323600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a1f565b604051808215151515815260200191505060405180910390f35b341561034857600080fd5b61035e6004808035906020019091905050610bb1565b6040518082815260200191505060405180910390f35b341561037f57600080fd5b6103ab600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c59565b6040518082815260200191505060405180910390f35b34156103cc57600080fd5b6103d4610ca2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104155780820151818401525b6020810190506103f9565b50505050905090810190601f1680156104425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561045b57600080fd5b6104716004808035906020019091905050610cdb565b005b341561047e57600080fd5b6104b3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d61565b604051808215151515815260200191505060405180910390f35b34156104d857600080fd5b6104ee6004808035906020019091905050610d7c565b604051808215151515815260200191505060405180910390f35b341561051357600080fd5b61055e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610e2a565b6040518082815260200191505060405180910390f35b6040805190810160405280600b81526020017f476173746f6b656e2e696f00000000000000000000000000000000000000000081525081565b60008060008060003393506000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054925082861115610605578295505b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080861115610693578095505b61069c86610eb2565b8583036000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508581038260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508594505b5050505092915050565b600080339050600083141580156107c857506000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156107d657600091506108c1565b82600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a3600191505b5092915050565b60006003546002540390505b90565b600080339050600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311158015610970575061096f858585610f22565b5b15610a085782600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555060019150610a12565b60009150610a12565b5b509392505050565b600281565b60008060008060003393506000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054925082861115610a7c5760009450610ba7565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002091508160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080861115610b0f5760009450610ba7565b610b1886610eb2565b8583036000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508581038260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600194505b5050505092915050565b6000806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610c01578092505b610c0a83610eb2565b8281036000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508291505b50919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b919050565b6040805190810160405280600481526020017f475354320000000000000000000000000000000000000000000000000000000081525081565b60008090505b81811015610d0057610cf1611082565b505b8080600101915050610ce1565b81600260008282540192505081905550816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b5050565b600080339050610d72818585610f22565b91505b5092915050565b6000806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610dd15760009150610e24565b610dda83610eb2565b8281036000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600191505b50919050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b92915050565b60008060035491506001820190505b82820181111515610f1357610ed630826110b9565b73ffffffffffffffffffffffffffffffffffffffff1660405160006040518083038160008661646e5a03f1915050505b8080600101915050610ec1565b8282016003819055505b505050565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151561107157816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905061107b565b6000905061107b565b5b9392505050565b60006040517e756e170ccc93903185be5a2094c870df623318585733ff6000526016600af38152601f600182016000f09150505b90565b60008060008060008068ffffffffffffffffff87111515156110da57600080fd5b8660001080156110ea5750608087105b156110fc57600194506001935061110e565b611105876111fe565b94506001850193505b8360146001010192506a01000000000000000000008873ffffffffffffffffffffffffffffffffffffffff16027e010000000000000000000000000000000000000000000000000000000000006014608001027f01000000000000000000000000000000000000000000000000000000000000008560c001020101915086600010801561119b5750608087105b156111b65769010000000000000000008702820191506111d9565b6901000000000000000000856080010282019150846009036101000a8702820191505b604051602081016040528281526001840181209150508095505b505050505092915050565b6000806000809150600190505b8084101515611226576001820191506101008102905061120b565b8192505b50509190505600a165627a7a723058205b8e25aacd58d9db374e3f1c66d18e37c4ad0743d59bfcfefe99957ef0c95eaf0029

Swarm Source

bzzr://5b8e25aacd58d9db374e3f1c66d18e37c4ad0743d59bfcfefe99957ef0c95eaf
Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading