Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 7 from a total of 7 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Add | 17877635 | 330 days ago | IN | 0 ETH | 0.00083832 | ||||
Add | 17877635 | 330 days ago | IN | 0 ETH | 0.00247985 | ||||
Add | 17666494 | 360 days ago | IN | 0 ETH | 0.00242581 | ||||
Add To Whitelist | 17666476 | 360 days ago | IN | 0 ETH | 0.00062723 | ||||
Add To Whitelist | 17666471 | 360 days ago | IN | 0 ETH | 0.00065178 | ||||
Add To Whitelist | 17666469 | 360 days ago | IN | 0 ETH | 0.00065282 | ||||
0x60406080 | 17665338 | 360 days ago | IN | Create: AddressManager | 0 ETH | 0.01327027 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
AddressManager
Compiler Version
v0.8.19+commit.7dd6d404
Optimization Enabled:
Yes with 2000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0 pragma solidity ^0.8.13; import "@solmate/auth/Owned.sol"; import "@solmate/utils/ReentrancyGuard.sol"; /// @title AddressManager /// @notice A contract that handles a whitelist of addresses and their indexes. /// @dev We assume no more than 65535 addresses will be added to the directory. contract AddressManager is Owned, ReentrancyGuard { event AddressAdded(address address_added); event AddressRemovedFromWhitelist(address address_removed); event AddressWhitelisted(address address_whitelisted); error AddressAlreadyAddedError(address _address); error AddressNotAddedError(address _address); mapping(address => uint16) private _directory; mapping(uint16 => address) private _inverseDirectory; mapping(address => bool) private _whitelist; uint16 private _lastAdded; constructor(address[] memory _original) Owned(msg.sender) { uint256 total = _original.length; for (uint256 i; i < total; ) { _add(_original[i]); unchecked { ++i; } } } /// @notice Adds an address to the directory. If it already exists, /// reverts. It assumes it's whitelisted. function add( address _entry ) external onlyOwner nonReentrant returns (uint16) { return _add(_entry); } /// @notice Whitelist an address that's already part of the directory. function addToWhitelist(address _entry) external onlyOwner { if (_directory[_entry] == 0) { revert AddressNotAddedError(_entry); } _whitelist[_entry] = true; emit AddressWhitelisted(_entry); } /// @notice Removes an address from the whitelist. We still keep it /// in the directory since this mapping is relevant across time. /// @param _entry The address to remove from the whitelist. function removeFromWhitelist(address _entry) external onlyOwner { _whitelist[_entry] = false; emit AddressRemovedFromWhitelist(_entry); } /// @param _address The address to get the index for. /// @return The index for a given address. function addressToIndex(address _address) external view returns (uint16) { return _directory[_address]; } /// @param _index The index to get the address for. /// @return The address for a given index. function indexToAddress(uint16 _index) external view returns (address) { return _inverseDirectory[_index]; } /// @param _entry The address to check if it's whitelisted. /// @return Whether the address is whitelisted or not. function isWhitelisted(address _entry) external view returns (bool) { return _whitelist[_entry]; } function _add(address _entry) private returns (uint16) { if (_directory[_entry] != 0) { revert AddressAlreadyAddedError(_entry); } ++_lastAdded; _directory[_entry] = _lastAdded; _inverseDirectory[_lastAdded] = _entry; _whitelist[_entry] = true; emit AddressAdded(_entry); return _lastAdded; } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Simple single owner authorization mixin. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/auth/Owned.sol) abstract contract Owned { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event OwnershipTransferred(address indexed user, address indexed newOwner); /*////////////////////////////////////////////////////////////// OWNERSHIP STORAGE //////////////////////////////////////////////////////////////*/ address public owner; modifier onlyOwner() virtual { require(msg.sender == owner, "UNAUTHORIZED"); _; } /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(address _owner) { owner = _owner; emit OwnershipTransferred(address(0), _owner); } /*////////////////////////////////////////////////////////////// OWNERSHIP LOGIC //////////////////////////////////////////////////////////////*/ function transferOwnership(address newOwner) public virtual onlyOwner { owner = newOwner; emit OwnershipTransferred(msg.sender, newOwner); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Gas optimized reentrancy protection for smart contracts. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/ReentrancyGuard.sol) /// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol) abstract contract ReentrancyGuard { uint256 private locked = 1; modifier nonReentrant() virtual { require(locked == 1, "REENTRANCY"); locked = 2; _; locked = 1; } }
{ "remappings": [ "@chainlink/=lib/chainlink/contracts/src/v0.8/", "@forge-std/=lib/forge-std/src/", "@manifoldxyz/=lib/v3/node_modules/@manifoldxyz/", "@openzeppelin/=lib/openzeppelin-contracts/contracts/", "@rari-capital/=lib/v3/node_modules/@rari-capital/", "@solmate/=lib/solmate/src/", "@zora/=lib/v3/contracts/", "chainlink/=lib/chainlink/", "ds-test/=lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/openzeppelin-contracts/contracts/", "solmate/=lib/solmate/src/", "test/=test/", "v3/=lib/v3/contracts/" ], "optimizer": { "enabled": true, "runs": 2000 }, "metadata": { "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "viaIR": true, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address[]","name":"_original","type":"address[]"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"AddressAlreadyAddedError","type":"error"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"AddressNotAddedError","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"address_added","type":"address"}],"name":"AddressAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"address_removed","type":"address"}],"name":"AddressRemovedFromWhitelist","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"address_whitelisted","type":"address"}],"name":"AddressWhitelisted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address","name":"_entry","type":"address"}],"name":"add","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_entry","type":"address"}],"name":"addToWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"addressToIndex","outputs":[{"internalType":"uint16","name":"","type":"uint16"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint16","name":"_index","type":"uint16"}],"name":"indexToAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_entry","type":"address"}],"name":"isWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_entry","type":"address"}],"name":"removeFromWhitelist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
604060808152346101f85761082e8038038061001a81610213565b92833981019060209081818403126101f85780516001600160401b03918282116101f857019280601f850112156101f85783519182116101fd5760059382851b908480610068818501610213565b8096815201928201019283116101f8578401905b8282106101d95750505060018060a01b031991600093338486541617855533857f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a3600193848055835193865b8581106100e05788516105f590816102398239f35b81518110156101c55780841b82018501516001600160a01b031680895260028087528a8a205461ffff919082166101ad57865490828216838114610199578b01831661ffff1992831681178955848d529089528c8c208054909216179055855416895260038652898920805485168217905580895260048652898920805460ff19168917905589519081528791907fa226db3f664042183ee0281230bba26cbf7b5057e50aee7f25a175ff45ce4d7f908790a1016100cb565b634e487b7160e01b8d52601160045260248dfd5b8b5163fa4b50ed60e01b815260048101849052602490fd5b634e487b7160e01b88526032600452602488fd5b81516001600160a01b03811681036101f857815290840190840161007c565b600080fd5b634e487b7160e01b600052604160045260246000fd5b6040519190601f01601f191682016001600160401b038111838210176101fd5760405256fe6040608081526004908136101561001557600080fd5b600091823560e01c80630a3b0a4f1461036e5780633af32abf146103205780638ab1d681146102a15780638da5cb5b1461026e578063d86cd42014610225578063e43252d71461015a578063f2fde38b146100c55763f667e0aa1461007957600080fd5b346100c15760206003193601126100c1573573ffffffffffffffffffffffffffffffffffffffff81168091036100c157818361ffff9260209552600285522054169051908152f35b8280fd5b838234610156576020600319360112610156573573ffffffffffffffffffffffffffffffffffffffff8082168092036100c1577fffffffffffffffffffffffff0000000000000000000000000000000000000000829161012a8554918216331461055a565b16178255337f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b5080fd5b5090346100c15760206003193601126100c15781359173ffffffffffffffffffffffffffffffffffffffff8084168094036102215761019d90855416331461055a565b828452600260205261ffff8285205416156101f357916020917f4f783c179409b4127238bc9c990bc99b9a651666a0d20b51d6c42849eb88466d938286528352808520600160ff1982541617905551908152a180f35b8260249251917f442fdff3000000000000000000000000000000000000000000000000000000008352820152fd5b8480fd5b50346100c15760206003193601126100c1573561ffff81168091036100c157818373ffffffffffffffffffffffffffffffffffffffff9260209552600385522054169051908152f35b50503461015657816003193601126101565773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5090346100c15760206003193601126100c157813573ffffffffffffffffffffffffffffffffffffffff91828216809203610221577f535611fb62fa2a833988f283b779e417e996813e44046f521d76c17b5943b08c93610308602094875416331461055a565b828652835280852060ff19815416905551908152a180f35b50346100c15760206003193601126100c157803573ffffffffffffffffffffffffffffffffffffffff811680910361036a578360ff92849260209652855220541690519015158152f35b8380fd5b5091903461015657602092836003193601126100c157803573ffffffffffffffffffffffffffffffffffffffff808216809203610221576103b390855416331461055a565b600193848054036104fe57600285558181526002865261ffff928385832054166104cf576005548481168581146104a357927fa226db3f664042183ee0281230bba26cbf7b5057e50aee7f25a175ff45ce4d7f94928792878a8c970116807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00008093161760055585845260028752848420918254161790558660055416825260038552828220847fffffffffffffffffffffffff00000000000000000000000000000000000000008254161790558382528452208660ff198254161790558451908152a16005541691805551908152f35b6024846011857f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b602490838651917ffa4b50ed000000000000000000000000000000000000000000000000000000008352820152fd5b606483878651917f08c379a0000000000000000000000000000000000000000000000000000000008352820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152fd5b1561056157565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152fdfea26469706673582212206b52698d2d6d451a6627166099b26dde0e68857fefdbfa82e1c4af486a5ed69d64736f6c6343000813003300000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Deployed Bytecode
0x6040608081526004908136101561001557600080fd5b600091823560e01c80630a3b0a4f1461036e5780633af32abf146103205780638ab1d681146102a15780638da5cb5b1461026e578063d86cd42014610225578063e43252d71461015a578063f2fde38b146100c55763f667e0aa1461007957600080fd5b346100c15760206003193601126100c1573573ffffffffffffffffffffffffffffffffffffffff81168091036100c157818361ffff9260209552600285522054169051908152f35b8280fd5b838234610156576020600319360112610156573573ffffffffffffffffffffffffffffffffffffffff8082168092036100c1577fffffffffffffffffffffffff0000000000000000000000000000000000000000829161012a8554918216331461055a565b16178255337f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b5080fd5b5090346100c15760206003193601126100c15781359173ffffffffffffffffffffffffffffffffffffffff8084168094036102215761019d90855416331461055a565b828452600260205261ffff8285205416156101f357916020917f4f783c179409b4127238bc9c990bc99b9a651666a0d20b51d6c42849eb88466d938286528352808520600160ff1982541617905551908152a180f35b8260249251917f442fdff3000000000000000000000000000000000000000000000000000000008352820152fd5b8480fd5b50346100c15760206003193601126100c1573561ffff81168091036100c157818373ffffffffffffffffffffffffffffffffffffffff9260209552600385522054169051908152f35b50503461015657816003193601126101565773ffffffffffffffffffffffffffffffffffffffff60209254169051908152f35b5090346100c15760206003193601126100c157813573ffffffffffffffffffffffffffffffffffffffff91828216809203610221577f535611fb62fa2a833988f283b779e417e996813e44046f521d76c17b5943b08c93610308602094875416331461055a565b828652835280852060ff19815416905551908152a180f35b50346100c15760206003193601126100c157803573ffffffffffffffffffffffffffffffffffffffff811680910361036a578360ff92849260209652855220541690519015158152f35b8380fd5b5091903461015657602092836003193601126100c157803573ffffffffffffffffffffffffffffffffffffffff808216809203610221576103b390855416331461055a565b600193848054036104fe57600285558181526002865261ffff928385832054166104cf576005548481168581146104a357927fa226db3f664042183ee0281230bba26cbf7b5057e50aee7f25a175ff45ce4d7f94928792878a8c970116807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00008093161760055585845260028752848420918254161790558660055416825260038552828220847fffffffffffffffffffffffff00000000000000000000000000000000000000008254161790558382528452208660ff198254161790558451908152a16005541691805551908152f35b6024846011857f4e487b7100000000000000000000000000000000000000000000000000000000835252fd5b602490838651917ffa4b50ed000000000000000000000000000000000000000000000000000000008352820152fd5b606483878651917f08c379a0000000000000000000000000000000000000000000000000000000008352820152600a60248201527f5245454e5452414e4359000000000000000000000000000000000000000000006044820152fd5b1561056157565b60646040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600c60248201527f554e415554484f52495a454400000000000000000000000000000000000000006044820152fdfea26469706673582212206b52698d2d6d451a6627166099b26dde0e68857fefdbfa82e1c4af486a5ed69d64736f6c63430008130033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
-----Decoded View---------------
Arg [0] : _original (address[]): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [2] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
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.