ETH Price: $3,281.50 (+1.39%)

Contract

0x59C628E832C27989B58bc1896a784436Eb9e4774
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
IterableMapping

Compiler Version
v0.8.19+commit.7dd6d404

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license
/**
 *Submitted for verification at Etherscan.io on 2023-05-02
*/

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

[]

6104e361003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c806317e142d1146100715780634c60db9c14610097578063732a2ccf146100b9578063bc2b405c146100e6578063d1aa9e7e14610106578063deb3d89614610131575b600080fd5b61008461007f3660046103c4565b610143565b6040519081526020015b60405180910390f35b8180156100a357600080fd5b506100b76100b23660046103c4565b610191565b005b6100846100c73660046103c4565b6001600160a01b03166000908152600191909101602052604090205490565b8180156100f257600080fd5b506100b76101013660046103f0565b6102cc565b610119610114366004610425565b610375565b6040516001600160a01b03909116815260200161008e565b61008461013f366004610447565b5490565b6001600160a01b038116600090815260038301602052604081205460ff1661016e575060001961018b565b506001600160a01b03811660009081526002830160205260409020545b92915050565b6001600160a01b038116600090815260038301602052604090205460ff166101b7575050565b6001600160a01b03811660009081526003830160209081526040808320805460ff191690556001808601835281842084905560028601909252822054845490929161020191610460565b9050600084600001828154811061021a5761021a610481565b60009182526020808320909101546001600160a01b0390811680845260028901909252604080842087905590871683528220919091558554909150819086908590811061026957610269610481565b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905584548590806102a3576102a3610497565b600082815260209020810160001990810180546001600160a01b03191690550190555050505050565b6001600160a01b038216600090815260038401602052604090205460ff1615610311576001600160a01b03821660009081526001840160205260409020819055505050565b6001600160a01b03821660008181526003850160209081526040808320805460ff19166001908117909155878101835281842086905587546002890184529184208290558101875586835291200180546001600160a01b0319169091179055505050565b600082600001828154811061038c5761038c610481565b6000918252602090912001546001600160a01b03169392505050565b80356001600160a01b03811681146103bf57600080fd5b919050565b600080604083850312156103d757600080fd5b823591506103e7602084016103a8565b90509250929050565b60008060006060848603121561040557600080fd5b83359250610415602085016103a8565b9150604084013590509250925092565b6000806040838503121561043857600080fd5b50508035926020909101359150565b60006020828403121561045957600080fd5b5035919050565b8181038181111561018b57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220db4e127c1a68d5bc1765aa48fc41f130edc53b478f33c582a3aa8f9d8b23fbd964736f6c63430008130033

Deployed Bytecode

0x7359c628e832c27989b58bc1896a784436eb9e4774301460806040526004361061006c5760003560e01c806317e142d1146100715780634c60db9c14610097578063732a2ccf146100b9578063bc2b405c146100e6578063d1aa9e7e14610106578063deb3d89614610131575b600080fd5b61008461007f3660046103c4565b610143565b6040519081526020015b60405180910390f35b8180156100a357600080fd5b506100b76100b23660046103c4565b610191565b005b6100846100c73660046103c4565b6001600160a01b03166000908152600191909101602052604090205490565b8180156100f257600080fd5b506100b76101013660046103f0565b6102cc565b610119610114366004610425565b610375565b6040516001600160a01b03909116815260200161008e565b61008461013f366004610447565b5490565b6001600160a01b038116600090815260038301602052604081205460ff1661016e575060001961018b565b506001600160a01b03811660009081526002830160205260409020545b92915050565b6001600160a01b038116600090815260038301602052604090205460ff166101b7575050565b6001600160a01b03811660009081526003830160209081526040808320805460ff191690556001808601835281842084905560028601909252822054845490929161020191610460565b9050600084600001828154811061021a5761021a610481565b60009182526020808320909101546001600160a01b0390811680845260028901909252604080842087905590871683528220919091558554909150819086908590811061026957610269610481565b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905584548590806102a3576102a3610497565b600082815260209020810160001990810180546001600160a01b03191690550190555050505050565b6001600160a01b038216600090815260038401602052604090205460ff1615610311576001600160a01b03821660009081526001840160205260409020819055505050565b6001600160a01b03821660008181526003850160209081526040808320805460ff19166001908117909155878101835281842086905587546002890184529184208290558101875586835291200180546001600160a01b0319169091179055505050565b600082600001828154811061038c5761038c610481565b6000918252602090912001546001600160a01b03169392505050565b80356001600160a01b03811681146103bf57600080fd5b919050565b600080604083850312156103d757600080fd5b823591506103e7602084016103a8565b90509250929050565b60008060006060848603121561040557600080fd5b83359250610415602085016103a8565b9150604084013590509250925092565b6000806040838503121561043857600080fd5b50508035926020909101359150565b60006020828403121561045957600080fd5b5035919050565b8181038181111561018b57634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fdfea2646970667358221220db4e127c1a68d5bc1765aa48fc41f130edc53b478f33c582a3aa8f9d8b23fbd964736f6c63430008130033

Deployed Bytecode Sourcemap

0:1627:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;378:195;;;;;;:::i;:::-;;:::i;:::-;;;623:25:1;;;611:2;596:18;378:195:0;;;;;;;;1151:473;;;;;;;;;;-1:-1:-1;1151:473:0;;;;;:::i;:::-;;:::i;:::-;;259:111;;;;;;:::i;:::-;-1:-1:-1;;;;;347:15:0;323:4;347:15;;;:10;;;;;:15;;;;;;;259:111;819:324;;;;;;;;;;-1:-1:-1;819:324:0;;;;;:::i;:::-;;:::i;581:123::-;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;1641:32:1;;;1623:51;;1611:2;1596:18;581:123:0;1469:211:1;712:99:0;;;;;;:::i;:::-;788:15;;712:99;378:195;-1:-1:-1;;;;;472:17:0;;452:3;472:17;;;:12;;;:17;;;;;;;;468:59;;-1:-1:-1;;;506:9:0;;468:59;-1:-1:-1;;;;;;548:16:0;;;;;;:11;;;:16;;;;;;378:195;;;;;:::o;1151:473::-;-1:-1:-1;;;;;1220:17:0;;;;;;:12;;;:17;;;;;;;;1215:57;;1151:473;;:::o;1215:57::-;-1:-1:-1;;;;;1291:17:0;;;;;;:12;;;:17;;;;;;;;1284:24;;-1:-1:-1;;1284:24:0;;;;1326:10;;;:15;;;;;1319:22;;;1367:11;;;:16;;;;;;1411:15;;1367:16;;1291:17;1411:19;;;:::i;:::-;1394:36;;1441:15;1459:3;:8;;1468:9;1459:19;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;1459:19:0;;;1491:20;;;:11;;;:20;;;;;;;:28;;;1537:16;;;;;;;1530:23;;;;1566:15;;1459:19;;-1:-1:-1;1459:19:0;;1491:3;;1514:5;;1566:15;;;;;;:::i;:::-;;;;;;;;;;:25;;-1:-1:-1;;;;;;1566:25:0;-1:-1:-1;;;;;1566:25:0;;;;;;;;;;1602:14;;;;;;;;;:::i;:::-;;;;;;;;;;-1:-1:-1;;1602:14:0;;;;;-1:-1:-1;;;;;;1602:14:0;;;;;;-1:-1:-1;;;;;1151:473:0:o;819:324::-;-1:-1:-1;;;;;894:17:0;;;;;;:12;;;:17;;;;;;;;890:246;;;-1:-1:-1;;;;;928:15:0;;;;;;:10;;;:15;;;;;:21;;;819:324;;;:::o;890:246::-;-1:-1:-1;;;;;982:17:0;;;;;;:12;;;:17;;;;;;;;:24;;-1:-1:-1;;982:24:0;1002:4;982:24;;;;;;1021:10;;;:15;;;;;:21;;;1076:15;;1057:11;;;:16;;;;;:34;;;1106:18;;;;;;;;;;;;-1:-1:-1;;;;;;1106:18:0;;;;;;819:324;;;:::o;581:123::-;654:7;681:3;:8;;690:5;681:15;;;;;;;;:::i;:::-;;;;;;;;;;;-1:-1:-1;;;;;681:15:0;;581:123;-1:-1:-1;;;581:123:0:o;14:173:1:-;82:20;;-1:-1:-1;;;;;131:31:1;;121:42;;111:70;;177:1;174;167:12;111:70;14:173;;;:::o;192:274::-;280:6;288;341:2;329:9;320:7;316:23;312:32;309:52;;;357:1;354;347:12;309:52;393:9;380:23;370:33;;422:38;456:2;445:9;441:18;422:38;:::i;:::-;412:48;;192:274;;;;;:::o;849:342::-;946:6;954;962;1015:2;1003:9;994:7;990:23;986:32;983:52;;;1031:1;1028;1021:12;983:52;1067:9;1054:23;1044:33;;1096:38;1130:2;1119:9;1115:18;1096:38;:::i;:::-;1086:48;;1181:2;1170:9;1166:18;1153:32;1143:42;;849:342;;;;;:::o;1196:268::-;1284:6;1292;1345:2;1333:9;1324:7;1320:23;1316:32;1313:52;;;1361:1;1358;1351:12;1313:52;-1:-1:-1;;1384:23:1;;;1454:2;1439:18;;;1426:32;;-1:-1:-1;1196:268:1:o;1685:200::-;1764:6;1817:2;1805:9;1796:7;1792:23;1788:32;1785:52;;;1833:1;1830;1823:12;1785:52;-1:-1:-1;1856:23:1;;1685:200;-1:-1:-1;1685:200:1:o;1890:225::-;1957:9;;;1978:11;;;1975:134;;;2031:10;2026:3;2022:20;2019:1;2012:31;2066:4;2063:1;2056:15;2094:4;2091:1;2084:15;2120:127;2181:10;2176:3;2172:20;2169:1;2162:31;2212:4;2209:1;2202:15;2236:4;2233:1;2226:15;2252:127;2313:10;2308:3;2304:20;2301:1;2294:31;2344:4;2341:1;2334:15;2368:4;2365:1;2358:15

Swarm Source

ipfs://db4e127c1a68d5bc1765aa48fc41f130edc53b478f33c582a3aa8f9d8b23fbd9

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.