Contract Overview
Balance:
0 Ether
More Info
My Name Tag:
Not Available
Txn Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
0xd40980b0ff0ca376331fa79d6bb312d68652a66baaf267fc2994f28f7b088f84 | Add Addresses | 8545609 | 423 days 4 hrs ago | 0x3f0556bca55bdbb78a9316936067a47fd4c4c4f4 | IN | 0xf76f17682888a738a6df40aa63ac2b4b1a380831 | 0 Ether | 0.00012546 | |
0x81ff110d72e6b9715d983d56168e80db3987e083b312506150b017976654b79c | 0x60806040 | 8545608 | 423 days 4 hrs ago | 0x3f0556bca55bdbb78a9316936067a47fd4c4c4f4 | IN | Contract Creation | 0 Ether | 0.00085791 |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Similar Match Source Code
Note: This contract matches the deployed ByteCode of the Source Code for Contract 0xB917f266424B803F389c79B86609710247a0370f
Contract Name:
AddressRegistry
Compiler Version
v0.7.6+commit.7338295f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with GSN meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.12 <=0.7.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "./utils/MappedSinglyLinkedList.sol"; ///@notice A registry to hold Contract addresses. Underlying data structure is a singly linked list. contract AddressRegistry is Ownable { using MappedSinglyLinkedList for MappedSinglyLinkedList.Mapping; MappedSinglyLinkedList.Mapping internal addressList; /// @notice Emmitted when a contract has been added to the registry event AddressAdded(address indexed _address); /// @notice Emmitted when a contract has been removed to the registry event AddressRemoved(address indexed _address); /// @notice Emitted when all the registry addresses are cleared event AllAddressesCleared(); /// @notice Storage field for what type of contract this Registry is storing string public addressType; /// @notice Contract constructor sets addressType, intializes list and transfers ownership /// @param _addressType The type of contracts stored in this registry /// @param _owner The address to set as owner of the contract constructor(string memory _addressType, address _owner) Ownable() { addressType = _addressType; addressList.initialize(); transferOwnership(_owner); } /// @notice Returns an array of all contract addresses in the linked list /// @return Array of contract addresses function getAddresses() view external returns(address[] memory) { return addressList.addressArray(); } /// @notice Adds addresses to the linked list. Will revert if the address is already in the list. Can only be called by the Registry owner. /// @param _addresses Array of contract addresses to be added function addAddresses(address[] calldata _addresses) public onlyOwner { for(uint256 _address = 0; _address < _addresses.length; _address++ ){ addressList.addAddress(_addresses[_address]); emit AddressAdded(_addresses[_address]); } } /// @notice Removes an address from the linked list. Can only be called by the Registry owner. /// @param _previousContract The address positionally located before the address that will be deleted. This may be the SENTINEL address if the list contains one contract address /// @param _address The address to remove from the linked list. function removeAddress(address _previousContract, address _address) public onlyOwner { addressList.removeAddress(_previousContract, _address); emit AddressRemoved(_address); } /// @notice Removes every address from the list function clearAll() public onlyOwner { addressList.clearAll(); emit AllAddressesCleared(); } /// @notice Determines whether the list contains the given address /// @param _addr The address to check /// @return True if the address is contained, false otherwise. function contains(address _addr) public returns (bool) { return addressList.contains(_addr); } /// @notice Gives the address at the start of the list /// @return The address at the start of the list function start() public view returns (address) { return addressList.start(); } /// @notice Exposes the internal next() iterator /// @param current The current address /// @return Returns the next address in the list function next(address current) public view returns (address) { return addressList.next(current); } /// @notice Exposes the end of the list /// @return The sentinel address function end() public view returns (address) { return addressList.end(); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.7.6; /// @notice An efficient implementation of a singly linked list of addresses /// @dev A mapping(address => address) tracks the 'next' pointer. A special address called the SENTINEL is used to denote the beginning and end of the list. library MappedSinglyLinkedList { /// @notice The special value address used to denote the end of the list address public constant SENTINEL = address(0x1); /// @notice The data structure to use for the list. struct Mapping { uint256 count; mapping(address => address) addressMap; } /// @notice Initializes the list. /// @dev It is important that this is called so that the SENTINEL is correctly setup. function initialize(Mapping storage self) internal { require(self.count == 0, "Already init"); self.addressMap[SENTINEL] = SENTINEL; } function start(Mapping storage self) internal view returns (address) { return self.addressMap[SENTINEL]; } function next(Mapping storage self, address current) internal view returns (address) { return self.addressMap[current]; } function end(Mapping storage) internal pure returns (address) { return SENTINEL; } function addAddresses(Mapping storage self, address[] memory addresses) internal { for (uint256 i = 0; i < addresses.length; i++) { addAddress(self, addresses[i]); } } /// @notice Adds an address to the front of the list. /// @param self The Mapping struct that this function is attached to /// @param newAddress The address to shift to the front of the list function addAddress(Mapping storage self, address newAddress) internal { require(newAddress != SENTINEL && newAddress != address(0), "Invalid address"); require(self.addressMap[newAddress] == address(0), "Already added"); self.addressMap[newAddress] = self.addressMap[SENTINEL]; self.addressMap[SENTINEL] = newAddress; self.count = self.count + 1; } /// @notice Removes an address from the list /// @param self The Mapping struct that this function is attached to /// @param prevAddress The address that precedes the address to be removed. This may be the SENTINEL if at the start. /// @param addr The address to remove from the list. function removeAddress(Mapping storage self, address prevAddress, address addr) internal { require(addr != SENTINEL && addr != address(0), "Invalid address"); require(self.addressMap[prevAddress] == addr, "Invalid prevAddress"); self.addressMap[prevAddress] = self.addressMap[addr]; delete self.addressMap[addr]; self.count = self.count - 1; } /// @notice Determines whether the list contains the given address /// @param self The Mapping struct that this function is attached to /// @param addr The address to check /// @return True if the address is contained, false otherwise. function contains(Mapping storage self, address addr) internal view returns (bool) { return addr != SENTINEL && addr != address(0) && self.addressMap[addr] != address(0); } /// @notice Returns an address array of all the addresses in this list /// @dev Contains a for loop, so complexity is O(n) wrt the list size /// @param self The Mapping struct that this function is attached to /// @return An array of all the addresses function addressArray(Mapping storage self) internal view returns (address[] memory) { address[] memory array = new address[](self.count); uint256 count; address currentAddress = self.addressMap[SENTINEL]; while (currentAddress != address(0) && currentAddress != SENTINEL) { array[count] = currentAddress; currentAddress = self.addressMap[currentAddress]; count++; } return array; } /// @notice Removes every address from the list /// @param self The Mapping struct that this function is attached to function clearAll(Mapping storage self) internal { address currentAddress = self.addressMap[SENTINEL]; while (currentAddress != address(0) && currentAddress != SENTINEL) { address nextAddress = self.addressMap[currentAddress]; delete self.addressMap[currentAddress]; currentAddress = nextAddress; } self.addressMap[SENTINEL] = SENTINEL; self.count = 0; } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } } }
[{"inputs":[{"internalType":"string","name":"_addressType","type":"string"},{"internalType":"address","name":"_owner","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"}],"name":"AddressAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_address","type":"address"}],"name":"AddressRemoved","type":"event"},{"anonymous":false,"inputs":[],"name":"AllAddressesCleared","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"address[]","name":"_addresses","type":"address[]"}],"name":"addAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"addressType","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"clearAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"}],"name":"contains","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"end","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAddresses","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"current","type":"address"}],"name":"next","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_previousContract","type":"address"},{"internalType":"address","name":"_address","type":"address"}],"name":"removeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"start","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b50604051620010ef380380620010ef833981810160405260408110156200003757600080fd5b81019080805160405193929190846401000000008211156200005857600080fd5b9083019060208201858111156200006e57600080fd5b82516401000000008111828201881017156200008957600080fd5b82525081516020918201929091019080838360005b83811015620000b85781810151838201526020016200009e565b50505050905090810190601f168015620000e65780820380516001836020036101000a031916815260200191505b5060405260200151915060009050620000fe62000177565b600080546001600160a01b0319166001600160a01b038316908117825560405192935091600080516020620010cf833981519152908290a35081516200014c906003906020850190620002fd565b506200016460016200017b60201b620007c31760201c565b6200016f81620001e4565b5050620003a9565b3390565b805415620001bf576040805162461bcd60e51b815260206004820152600c60248201526b105b1c9958591e481a5b9a5d60a21b604482015290519081900360640190fd5b60016000818152918101602052604090912080546001600160a01b0319169091179055565b620001ee62000177565b6001600160a01b031662000201620002ee565b6001600160a01b0316146200025d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116620002a45760405162461bcd60e51b8152600401808060200182810382526026815260200180620010a96026913960400191505060405180910390fd5b600080546040516001600160a01b0380851693921691600080516020620010cf83398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031690565b828054600181600116156101000203166002900490600052602060002090601f01602090048101928262000335576000855562000380565b82601f106200035057805160ff191683800117855562000380565b8280016001018555821562000380579182015b828111156200038057825182559160200191906001019062000363565b506200038e92915062000392565b5090565b5b808211156200038e576000815560010162000393565b610cf080620003b96000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063ab73e31611610071578063ab73e31614610266578063b6fac15a1461028c578063be9a6555146102ba578063ebb689a1146102c2578063efbe1c1c146102ca578063f2fde38b146102d2576100b4565b80633628731c146100b9578063506cd1071461012b5780635dbe47e8146101a8578063715018a6146101e25780638da5cb5b146101ea578063a39fac121461020e575b600080fd5b610129600480360360208110156100cf57600080fd5b8101906020810181356401000000008111156100ea57600080fd5b8201836020820111156100fc57600080fd5b8035906020019184602083028401116401000000008311171561011e57600080fd5b5090925090506102f8565b005b6101336103f2565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016d578181015183820152602001610155565b50505050905090810190601f16801561019a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ce600480360360208110156101be57600080fd5b50356001600160a01b0316610480565b604080519115158252519081900360200190f35b610129610493565b6101f261053f565b604080516001600160a01b039092168252519081900360200190f35b61021661054e565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561025257818101518382015260200161023a565b505050509050019250505060405180910390f35b6101f26004803603602081101561027c57600080fd5b50356001600160a01b031661055f565b610129600480360360408110156102a257600080fd5b506001600160a01b038135811691602001351661056c565b6101f2610612565b61012961061e565b6101f26106b5565b610129600480360360208110156102e857600080fd5b50356001600160a01b03166106c1565b61030061082b565b6001600160a01b031661031161053f565b6001600160a01b03161461035a576040805162461bcd60e51b81526020600482018190526024820152600080516020610c9b833981519152604482015290519081900360640190fd5b60005b818110156103ed5761039483838381811061037457fe5b905060200201356001600160a01b0316600161082f90919063ffffffff16565b8282828181106103a057fe5b905060200201356001600160a01b03166001600160a01b03167fa226db3f664042183ee0281230bba26cbf7b5057e50aee7f25a175ff45ce4d7f60405160405180910390a260010161035d565b505050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104785780601f1061044d57610100808354040283529160200191610478565b820191906000526020600020905b81548152906001019060200180831161045b57829003601f168201915b505050505081565b600061048d600183610943565b92915050565b61049b61082b565b6001600160a01b03166104ac61053f565b6001600160a01b0316146104f5576040805162461bcd60e51b81526020600482018190526024820152600080516020610c9b833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b606061055a6001610995565b905090565b600061048d600183610a76565b61057461082b565b6001600160a01b031661058561053f565b6001600160a01b0316146105ce576040805162461bcd60e51b81526020600482018190526024820152600080516020610c9b833981519152604482015290519081900360640190fd5b6105da60018383610a99565b6040516001600160a01b038216907f24a12366c02e13fe4a9e03d86a8952e85bb74a456c16e4a18b6d8295700b74bb90600090a25050565b600061055a6001610bb5565b61062661082b565b6001600160a01b031661063761053f565b6001600160a01b031614610680576040805162461bcd60e51b81526020600482018190526024820152600080516020610c9b833981519152604482015290519081900360640190fd5b61068a6001610bd2565b6040517fd2246837fc932fb127be794938f83245f3a8fc7fa8be0abfcddde9b07875d02090600090a1565b600061055a6001610c6e565b6106c961082b565b6001600160a01b03166106da61053f565b6001600160a01b031614610723576040805162461bcd60e51b81526020600482018190526024820152600080516020610c9b833981519152604482015290519081900360640190fd5b6001600160a01b0381166107685760405162461bcd60e51b8152600401808060200182810382526026815260200180610c756026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b805415610806576040805162461bcd60e51b815260206004820152600c60248201526b105b1c9958591e481a5b9a5d60a21b604482015290519081900360640190fd5b60016000818152918101602052604090912080546001600160a01b0319169091179055565b3390565b6001600160a01b03811660011480159061085157506001600160a01b03811615155b610894576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6001600160a01b03818116600090815260018401602052604090205416156108f3576040805162461bcd60e51b815260206004820152600d60248201526c105b1c9958591e481859191959609a1b604482015290519081900360640190fd5b60016000818152838201602052604080822080546001600160a01b039586168085529284208054969091166001600160a01b03199687161790559183905281549093169092179091558154019055565b60006001600160a01b03821660011480159061096757506001600160a01b03821615155b801561098e57506001600160a01b0382811660009081526001850160205260409020541615155b9392505050565b60606000826000015467ffffffffffffffff811180156109b457600080fd5b506040519080825280602002602001820160405280156109de578160200160208202803683370190505b50600160008181529085016020526040812054919250906001600160a01b03165b6001600160a01b03811615801590610a2157506001600160a01b038116600114155b15610a6d5780838381518110610a3357fe5b6001600160a01b039283166020918202929092018101919091529181166000908152600180880190935260409020549290910191166109ff565b50909392505050565b6001600160a01b0380821660009081526001840160205260409020541692915050565b6001600160a01b038116600114801590610abb57506001600160a01b03811615155b610afe576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b6001600160a01b038281166000908152600185016020526040902054811690821614610b67576040805162461bcd60e51b8152602060048201526013602482015272496e76616c696420707265764164647265737360681b604482015290519081900360640190fd5b6001600160a01b039081166000818152600185016020526040808220805495851683529082208054959094166001600160a01b03199586161790935552805490911690558054600019019055565b60016000818152910160205260409020546001600160a01b031690565b6001600081815290820160205260409020546001600160a01b03165b6001600160a01b03811615801590610c1057506001600160a01b038116600114155b15610c46576001600160a01b039081166000908152600183016020526040902080546001600160a01b0319811690915516610bee565b50600160008181528282016020526040812080546001600160a01b0319169092179091559055565b5060019056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a264697066735822122005e960356a54c8dc2474d3387a8d11ac1eaaa9db9f47abdc7b1cbbbd33c18cdf64736f6c634300070600334f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573738be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e000000000000000000000000000000000000000000000000000000000000000400000000000000000000000003f0556bca55bdbb78a9316936067a47fd4c4c4f40000000000000000000000000000000000000000000000000000000000000004506f647300000000000000000000000000000000000000000000000000000000
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.