Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
IterableMapping
Compiler Version
v0.8.7+commit.e28d00a7
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; 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(); } }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract Creation Code
6104e761003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe730000000000000000000000000000000000000000301460806040526004361061006c5760003560e01c806317e142d1146100715780634c60db9c14610097578063732a2ccf146100b9578063bc2b405c146100e6578063d1aa9e7e14610106578063deb3d89614610131575b600080fd5b61008461007f3660046103dd565b610143565b6040519081526020015b60405180910390f35b8180156100a357600080fd5b506100b76100b23660046103dd565b610191565b005b6100846100c73660046103dd565b6001600160a01b03166000908152600191909101602052604090205490565b8180156100f257600080fd5b506100b7610101366004610409565b6102cc565b61011961011436600461043e565b610375565b6040516001600160a01b03909116815260200161008e565b61008461013f3660046103c4565b5490565b6001600160a01b038116600090815260038301602052604081205460ff1661016e575060001961018b565b506001600160a01b03811660009081526002830160205260409020545b92915050565b6001600160a01b038116600090815260038301602052604090205460ff166101b7575050565b6001600160a01b03811660009081526003830160209081526040808320805460ff191690556001808601835281842084905560028601909252822054845490929161020191610460565b9050600084600001828154811061021a5761021a61049b565b60009182526020808320909101546001600160a01b039081168084526002890190925260408084208790559087168352822091909155855490915081908690859081106102695761026961049b565b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905584548590806102a3576102a3610485565b600082815260209020810160001990810180546001600160a01b03191690550190555050505050565b6001600160a01b038216600090815260038401602052604090205460ff1615610311576001600160a01b03821660009081526001840160205260409020819055505050565b6001600160a01b03821660008181526003850160209081526040808320805460ff19166001908117909155878101835281842086905587546002890184529184208290558101875586835291200180546001600160a01b0319169091179055505050565b600082600001828154811061038c5761038c61049b565b6000918252602090912001546001600160a01b03169392505050565b80356001600160a01b03811681146103bf57600080fd5b919050565b6000602082840312156103d657600080fd5b5035919050565b600080604083850312156103f057600080fd5b82359150610400602084016103a8565b90509250929050565b60008060006060848603121561041e57600080fd5b8335925061042e602085016103a8565b9150604084013590509250925092565b6000806040838503121561045157600080fd5b50508035926020909101359150565b60008282101561048057634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea26469706673582212209cc0beb4e385f5ba742f836ed5fa42eaeecea63b7fc1ff9ac66660b964b1e6a964736f6c63430008070033
Deployed Bytecode
0x739e5188e9570ecf3f8c241cccaf9bc194bb176038301460806040526004361061006c5760003560e01c806317e142d1146100715780634c60db9c14610097578063732a2ccf146100b9578063bc2b405c146100e6578063d1aa9e7e14610106578063deb3d89614610131575b600080fd5b61008461007f3660046103dd565b610143565b6040519081526020015b60405180910390f35b8180156100a357600080fd5b506100b76100b23660046103dd565b610191565b005b6100846100c73660046103dd565b6001600160a01b03166000908152600191909101602052604090205490565b8180156100f257600080fd5b506100b7610101366004610409565b6102cc565b61011961011436600461043e565b610375565b6040516001600160a01b03909116815260200161008e565b61008461013f3660046103c4565b5490565b6001600160a01b038116600090815260038301602052604081205460ff1661016e575060001961018b565b506001600160a01b03811660009081526002830160205260409020545b92915050565b6001600160a01b038116600090815260038301602052604090205460ff166101b7575050565b6001600160a01b03811660009081526003830160209081526040808320805460ff191690556001808601835281842084905560028601909252822054845490929161020191610460565b9050600084600001828154811061021a5761021a61049b565b60009182526020808320909101546001600160a01b039081168084526002890190925260408084208790559087168352822091909155855490915081908690859081106102695761026961049b565b600091825260209091200180546001600160a01b0319166001600160a01b039290921691909117905584548590806102a3576102a3610485565b600082815260209020810160001990810180546001600160a01b03191690550190555050505050565b6001600160a01b038216600090815260038401602052604090205460ff1615610311576001600160a01b03821660009081526001840160205260409020819055505050565b6001600160a01b03821660008181526003850160209081526040808320805460ff19166001908117909155878101835281842086905587546002890184529184208290558101875586835291200180546001600160a01b0319169091179055505050565b600082600001828154811061038c5761038c61049b565b6000918252602090912001546001600160a01b03169392505050565b80356001600160a01b03811681146103bf57600080fd5b919050565b6000602082840312156103d657600080fd5b5035919050565b600080604083850312156103f057600080fd5b82359150610400602084016103a8565b90509250929050565b60008060006060848603121561041e57600080fd5b8335925061042e602085016103a8565b9150604084013590509250925092565b6000806040838503121561045157600080fd5b50508035926020909101359150565b60008282101561048057634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fdfea26469706673582212209cc0beb4e385f5ba742f836ed5fa42eaeecea63b7fc1ff9ac66660b964b1e6a964736f6c63430008070033
Deployed Bytecode Sourcemap
56:1404:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;389:172;;;;;;:::i;:::-;;:::i;:::-;;;1664:25:1;;;1652:2;1637:18;389:172:0;;;;;;;;1054:404;;;;;;;;;;-1:-1:-1;1054:404:0;;;;;:::i;:::-;;:::i;:::-;;282:103;;;;;;:::i;:::-;-1:-1:-1;;;;;365:15:0;346:4;365:15;;;:10;;;;;:15;;;;;;;282:103;779:271;;;;;;;;;;-1:-1:-1;779:271:0;;;;;:::i;:::-;;:::i;565:115::-;;;;;;:::i;:::-;;:::i;:::-;;;-1:-1:-1;;;;;1468:32:1;;;1450:51;;1438:2;1423:18;565:115:0;1296:211:1;684:91:0;;;;;;:::i;:::-;755:15;;684:91;389:172;-1:-1:-1;;;;;478:17:0;;463:3;478:17;;;:12;;;:17;;;;;;;;474:49;;-1:-1:-1;;;507:9:0;;474:49;-1:-1:-1;;;;;;539:16:0;;;;;;:11;;;:16;;;;;;389:172;;;;;:::o;1054:404::-;-1:-1:-1;;;;;1118:17:0;;;;;;:12;;;:17;;;;;;;;1113:45;;1054:404;;:::o;1113:45::-;-1:-1:-1;;;;;1171:17:0;;;;;;:12;;;:17;;;;;;;;1164:24;;-1:-1:-1;;1164:24:0;;;;1201:10;;;:15;;;;;1194:22;;;1236:11;;;:16;;;;;;1275:15;;1236:16;;1171:17;1275:19;;;:::i;:::-;1258:36;;1300:15;1318:3;:8;;1327:9;1318:19;;;;;;;;:::i;:::-;;;;;;;;;;;;;-1:-1:-1;;;;;1318:19:0;;;1344:20;;;:11;;;:20;;;;;;;:28;;;1385:16;;;;;;;1378:23;;;;1408:15;;1318:19;;-1:-1:-1;1318:19:0;;1344:3;;1367:5;;1408:15;;;;;;:::i;:::-;;;;;;;;;;:25;;-1:-1:-1;;;;;;1408:25:0;-1:-1:-1;;;;;1408:25:0;;;;;;;;;;1439:14;;;;;;;;;:::i;:::-;;;;;;;;;;-1:-1:-1;;1439:14:0;;;;;-1:-1:-1;;;;;;1439:14:0;;;;;;-1:-1:-1;;;;;1054:404:0:o;779:271::-;-1:-1:-1;;;;;849:17:0;;;;;;:12;;;:17;;;;;;;;845:201;;;-1:-1:-1;;;;;876:15:0;;;;;;:10;;;:15;;;;;:21;;;779:271;;;:::o;845:201::-;-1:-1:-1;;;;;918:17:0;;;;;;:12;;;:17;;;;;;;;:24;;-1:-1:-1;;918:24:0;938:4;918:24;;;;;;950:10;;;:15;;;;;:21;;;998:15;;979:11;;;:16;;;;;:34;;;1021:18;;;;;;;;;;;;-1:-1:-1;;;;;;1021:18:0;;;;;;779:271;;;:::o;565:115::-;638:7;660:3;:8;;669:5;660:15;;;;;;;;:::i;:::-;;;;;;;;;;;-1:-1:-1;;;;;660:15:0;;565:115;-1:-1:-1;;;565:115: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:200::-;271:6;324:2;312:9;303:7;299:23;295:32;292:52;;;340:1;337;330:12;292:52;-1:-1:-1;363:23:1;;192:200;-1:-1:-1;192:200:1:o;397:274::-;485:6;493;546:2;534:9;525:7;521:23;517:32;514:52;;;562:1;559;552:12;514:52;598:9;585:23;575:33;;627:38;661:2;650:9;646:18;627:38;:::i;:::-;617:48;;397:274;;;;;:::o;676:342::-;773:6;781;789;842:2;830:9;821:7;817:23;813:32;810:52;;;858:1;855;848:12;810:52;894:9;881:23;871:33;;923:38;957:2;946:9;942:18;923:38;:::i;:::-;913:48;;1008:2;997:9;993:18;980:32;970:42;;676:342;;;;;:::o;1023:268::-;1111:6;1119;1172:2;1160:9;1151:7;1147:23;1143:32;1140:52;;;1188:1;1185;1178:12;1140:52;-1:-1:-1;;1211:23:1;;;1281:2;1266:18;;;1253:32;;-1:-1:-1;1023:268:1:o;1890:222::-;1930:4;1958:1;1955;1952:8;1949:131;;;2002:10;1997:3;1993:20;1990:1;1983:31;2037:4;2034:1;2027:15;2065:4;2062:1;2055:15;1949:131;-1:-1:-1;2097:9:1;;1890:222::o;2117:127::-;2178:10;2173:3;2169:20;2166:1;2159:31;2209:4;2206:1;2199:15;2233:4;2230:1;2223:15;2249:127;2310:10;2305:3;2301:20;2298:1;2291:31;2341:4;2338:1;2331:15;2365:4;2362:1;2355:15
Swarm Source
ipfs://9cc0beb4e385f5ba742f836ed5fa42eaeecea63b7fc1ff9ac66660b964b1e6a9
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.