Contract 0xf9edb34aabf1f632003ad6d137f2b5fd3435b6c8

 
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0xfec3036d9dcfd8fe00ced5f7c168406d8bd61a6941fcc3f3b9dc5290a09eaeb70x6104ed61172209332021-07-24 14:32:35677 days 17 hrs ago0xb03f1337e233f0bdf2c6e4c0f9bdbde9ac6f57d1 IN  Create: IterableMapping0 MATIC0.0009768813
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
IterableMapping

Compiler Version
v0.8.4+commit.c7e474f2

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at polygonscan.com on 2021-07-24
*/

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

library IterableMapping {
    // Iterable mapping from address to uint;
    struct Map {
        address[] keys;
        mapping(address => uint) values;
        mapping(address => uint) indexOf;
        mapping(address => bool) inserted;
    }

    function get(Map storage map, address key) public view returns (uint) {
        return map.values[key];
    }

    function getIndexOfKey(Map storage map, address key) public view returns (int) {
        if(!map.inserted[key]) {
            return -1;
        }
        return int(map.indexOf[key]);
    }

    function getKeyAtIndex(Map storage map, uint index) public view returns (address) {
        return map.keys[index];
    }

    function size(Map storage map) public view returns (uint) {
        return map.keys.length;
    }

    function set(Map storage map, address key, uint val) public {
        if (map.inserted[key]) {
            map.values[key] = val;
        } else {
            map.inserted[key] = true;
            map.values[key] = val;
            map.indexOf[key] = map.keys.length;
            map.keys.push(key);
        }
    }

    function remove(Map storage map, address key) public {
        if (!map.inserted[key]) {
            return;
        }

        delete map.inserted[key];
        delete map.values[key];

        uint index = map.indexOf[key];
        uint lastIndex = map.keys.length - 1;
        address lastKey = map.keys[lastIndex];

        map.indexOf[lastKey] = index;
        delete map.indexOf[key];

        map.keys[index] = lastKey;
        map.keys.pop();
    }
}

Contract Security Audit

Contract ABI

[]

6104ed61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c806317e142d1146100715780634c60db9c14610097578063732a2ccf146100b9578063bc2b405c146100e6578063d1aa9e7e14610106578063deb3d89614610131575b600080fd5b61008461007f366004610414565b610143565b6040519081526020015b60405180910390f35b8180156100a357600080fd5b506100b76100b2366004610414565b610191565b005b6100846100c7366004610414565b6001600160a01b03166000908152600191909101602052604090205490565b8180156100f257600080fd5b506100b761010136600461043f565b6102f6565b610119610114366004610473565b61039f565b6040516001600160a01b03909116815260200161008e565b61008461013f3660046103fc565b5490565b6001600160a01b038116600090815260038301602052604081205460ff1661016e575060001961018b565b506001600160a01b03811660009081526002830160205260409020545b92915050565b6001600160a01b038116600090815260038301602052604090205460ff166101b7575050565b6001600160a01b03811660009081526003830160209081526040808320805460ff191690556001808601835281842084905560028601909252822054845490929161020191610494565b9050600084600001828154811061022857634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0390811680845260028901909252604080842087905590871683528220919091558554909150819086908590811061028557634e487b7160e01b600052603260045260246000fd5b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905584548590806102cd57634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b03191690550190555050505050565b6001600160a01b038216600090815260038401602052604090205460ff161561033b576001600160a01b03821660009081526001840160205260409020819055505050565b6001600160a01b03821660008181526003850160209081526040808320805460ff19166001908117909155878101835281842086905587546002890184529184208290558101875586835291200180546001600160a01b0319169091179055505050565b60008260000182815481106103c457634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03169392505050565b80356001600160a01b03811681146103f757600080fd5b919050565b60006020828403121561040d578081fd5b5035919050565b60008060408385031215610426578081fd5b82359150610436602084016103e0565b90509250929050565b600080600060608486031215610453578081fd5b83359250610463602085016103e0565b9150604084013590509250925092565b60008060408385031215610485578182fd5b50508035926020909101359150565b6000828210156104b257634e487b7160e01b81526011600452602481fd5b50039056fea2646970667358221220f996d2779d09dcda7ad26a5cea986dd3ce508a936b8cf1bf7c3b2de01a9105bf64736f6c63430008040033

Deployed ByteCode Sourcemap

60:1627:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;438:195;;;;;;:::i;:::-;;:::i;:::-;;;1704:25:1;;;1692:2;1677:18;438:195:0;;;;;;;;1211:473;;;;;;;;;;-1:-1:-1;1211:473:0;;;;;:::i;:::-;;:::i;:::-;;319:111;;;;;;:::i;:::-;-1:-1:-1;;;;;407:15:0;383:4;407:15;;;:10;;;;;:15;;;;;;;319:111;879:324;;;;;;;;;;-1:-1:-1;879:324:0;;;;;:::i;:::-;;:::i;641:123::-;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;1508:32:1;;;1490:51;;1478:2;1463:18;641:123:0;1445:102:1;772:99:0;;;;;;:::i;:::-;848:15;;772:99;438:195;-1:-1:-1;;;;;532:17:0;;512:3;532:17;;;:12;;;:17;;;;;;;;528:59;;-1:-1:-1;;;566:9:0;;528:59;-1:-1:-1;;;;;;608:16:0;;;;;;:11;;;:16;;;;;;438:195;;;;;:::o;1211:473::-;-1:-1:-1;;;;;1280:17:0;;;;;;:12;;;:17;;;;;;;;1275:57;;1211:473;;:::o;1275:57::-;-1:-1:-1;;;;;1351:17:0;;;;;;:12;;;:17;;;;;;;;1344:24;;-1:-1:-1;;1344:24:0;;;;1386:10;;;:15;;;;;1379:22;;;1427:11;;;:16;;;;;;1471:15;;1427:16;;1351:17;1471:19;;;:::i;:::-;1454:36;;1501:15;1519:3;:8;;1528:9;1519:19;;;;;;-1:-1:-1;;;1519:19:0;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;1519:19:0;;;1551:20;;;:11;;;:20;;;;;;;:28;;;1597:16;;;;;;;1590:23;;;;1626:15;;1519:19;;-1:-1:-1;1519:19:0;;1551:3;;1574:5;;1626:15;;;;-1:-1:-1;;;1626:15:0;;;;;;;;;;;;;;;;;;:25;;-1:-1:-1;;;;;;1626:25:0;-1:-1:-1;;;;;1626:25:0;;;;;;;;;;1662:14;;;;;;;-1:-1:-1;;;1662:14:0;;;;;;;;;;;;;;;;;;-1:-1:-1;;1662:14:0;;;;;-1:-1:-1;;;;;;1662:14:0;;;;;;-1:-1:-1;;;;;1211:473:0:o;879:324::-;-1:-1:-1;;;;;954:17:0;;;;;;:12;;;:17;;;;;;;;950:246;;;-1:-1:-1;;;;;988:15:0;;;;;;:10;;;:15;;;;;:21;;;879:324;;;:::o;950:246::-;-1:-1:-1;;;;;1042:17:0;;;;;;:12;;;:17;;;;;;;;:24;;-1:-1:-1;;1042:24:0;1062:4;1042:24;;;;;;1081:10;;;:15;;;;;:21;;;1136:15;;1117:11;;;:16;;;;;:34;;;1166:18;;;;;;;;;;;;-1:-1:-1;;;;;;1166:18:0;;;;;;879:324;;;:::o;641:123::-;714:7;741:3;:8;;750:5;741:15;;;;;;-1:-1:-1;;;741:15:0;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;741:15:0;;641:123;-1:-1:-1;;;641:123:0:o;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:2;;177:1;174;167:12;111:2;63:124;;;:::o;192:210::-;271:6;324:2;312:9;303:7;299:23;295:32;292:2;;;345:6;337;330:22;292:2;-1:-1:-1;373:23:1;;282:120;-1:-1:-1;282:120:1:o;407:284::-;495:6;503;556:2;544:9;535:7;531:23;527:32;524:2;;;577:6;569;562:22;524:2;618:9;605:23;595:33;;647:38;681:2;670:9;666:18;647:38;:::i;:::-;637:48;;514:177;;;;;:::o;696:352::-;793:6;801;809;862:2;850:9;841:7;837:23;833:32;830:2;;;883:6;875;868:22;830:2;924:9;911:23;901:33;;953:38;987:2;976:9;972:18;953:38;:::i;:::-;943:48;;1038:2;1027:9;1023:18;1010:32;1000:42;;820:228;;;;;:::o;1053:278::-;1141:6;1149;1202:2;1190:9;1181:7;1177:23;1173:32;1170:2;;;1223:6;1215;1208:22;1170:2;-1:-1:-1;;1251:23:1;;;1321:2;1306:18;;;1293:32;;-1:-1:-1;1160:171:1:o;1930:228::-;1970:4;1998:1;1995;1992:8;1989:2;;;-1:-1:-1;;;2023:34:1;;2080:4;2077:1;2070:15;2111:4;2030;2098:18;1989:2;-1:-1:-1;2143:9:1;;1979:179::o

Swarm Source

ipfs://f996d2779d09dcda7ad26a5cea986dd3ce508a936b8cf1bf7c3b2de01a9105bf
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.