Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
- Contract name:
- MintedDomainNames
- Optimization enabled
- true
- Compiler version
- v0.8.19+commit.7dd6d404
- Optimization runs
- 200
- Verified at
- 2023-04-27T00:22:20.596653Z
Constructor Arguments
000000000000000000000000ec05ae7f013a66725a846c4c85617a418e3aea8e
Arg [0] (address) : 0xec05ae7f013a66725a846c4c85617a418e3aea8e
src/ethregistrar/MintedDomainNames.sol
pragma solidity >=0.8.4; import "./IMintedDomainNames.sol"; contract MintedDomainNames is IMintedDomainNames { mapping(address => IMintedDomainNames.Data[]) mintedDomainNames; address immutable baseRegistrar; /** * @dev Iniitalize this contract with the address of the baseRegistrar, so only that contract * can append to the mintedIds mapping */ constructor(address _baseRegistrar) { baseRegistrar = _baseRegistrar; } /** * @dev Get the length of minted ids for a given address * @param owner The address to return the length of minted ids of * @return the number of minted ids for the provided address */ function getLength(address owner) external view returns (uint) { return mintedDomainNames[owner].length; } /** * @dev Get all user minted domain names * @param owner The address to return the list of minted ids of * @return the list of domain names minted by the provided address */ function getAll(address owner) external view returns (IMintedDomainNames.Data[] memory) { return mintedDomainNames[owner]; } /** * @dev Add a user minted domain name, gated to the baseRegistrar contract * @param owner The address to add the id to * @param id the id of the registered domain name * @param expiry the expiry timestamp of the registered domain name * @param label the lable of the registered domain name */ function add( address owner, uint256 id, uint256 expiry, string calldata label) external { require(msg.sender == baseRegistrar); mintedDomainNames[owner].push(IMintedDomainNames.Data(id, expiry, label)); } }
src/ethregistrar/IMintedDomainNames.sol
pragma solidity >=0.8.4; interface IMintedDomainNames { struct Data { uint256 id; uint256 expiry; string label; } function getAll(address owner) external view returns (IMintedDomainNames.Data[] memory); function add(address owner, uint256 id, uint256 expiry, string calldata label) external; }
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_baseRegistrar","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"add","inputs":[{"type":"address","name":"owner","internalType":"address"},{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"expiry","internalType":"uint256"},{"type":"string","name":"label","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple[]","name":"","internalType":"struct IMintedDomainNames.Data[]","components":[{"type":"uint256","name":"id","internalType":"uint256"},{"type":"uint256","name":"expiry","internalType":"uint256"},{"type":"string","name":"label","internalType":"string"}]}],"name":"getAll","inputs":[{"type":"address","name":"owner","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLength","inputs":[{"type":"address","name":"owner","internalType":"address"}]}]
Contract Creation Code
0x60a060405234801561001057600080fd5b5060405161066e38038061066e83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b6080516105e461008a600039600060c601526105e46000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063c78a573814610046578063eb0773421461005b578063fe611a0714610084575b600080fd5b6100596100543660046102e2565b6100bb565b005b61006e610069366004610376565b6101ad565b60405161007b9190610398565b60405180910390f35b6100ad610092366004610376565b6001600160a01b031660009081526020819052604090205490565b60405190815260200161007b565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146100f057600080fd5b600080866001600160a01b03166001600160a01b03168152602001908152602001600020604051806060016040528086815260200185815260200184848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250508354600181810186559482526020918290208451600390920201908155908301519381019390935550604081015190919060028201906101a390826104ee565b5050505050505050565b6001600160a01b038116600090815260208181526040808320805482518185028101850190935280835260609492939192909184015b828210156102bb5783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201805461022a90610465565b80601f016020809104026020016040519081016040528092919081815260200182805461025690610465565b80156102a35780601f10610278576101008083540402835291602001916102a3565b820191906000526020600020905b81548152906001019060200180831161028657829003601f168201915b505050505081525050815260200190600101906101e3565b505050509050919050565b80356001600160a01b03811681146102dd57600080fd5b919050565b6000806000806000608086880312156102fa57600080fd5b610303866102c6565b94506020860135935060408601359250606086013567ffffffffffffffff8082111561032e57600080fd5b818801915088601f83011261034257600080fd5b81358181111561035157600080fd5b89602082850101111561036357600080fd5b9699959850939650602001949392505050565b60006020828403121561038857600080fd5b610391826102c6565b9392505050565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b8481101561044057898403603f1901865282518051855288810151898601528701516060888601819052815190860181905283905b80821015610413578282018b015187830160800152908a01906103f5565b8681016080908101869052988b0198601f909101601f1916909601909501945050918701916001016103c0565b50919998505050505050505050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061047957607f821691505b60208210810361049957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156104e957600081815260208120601f850160051c810160208610156104c65750805b601f850160051c820191505b818110156104e5578281556001016104d2565b5050505b505050565b815167ffffffffffffffff8111156105085761050861044f565b61051c816105168454610465565b8461049f565b602080601f83116001811461055157600084156105395750858301515b600019600386901b1c1916600185901b1785556104e5565b600085815260208120601f198616915b8281101561058057888601518255948401946001909101908401610561565b508582101561059e5787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fea2646970667358221220afa4ffb7f6ff4b18ad50f8b27875e7721fbb04af8fe40e579e19aee2a542802164736f6c63430008130033000000000000000000000000ec05ae7f013a66725a846c4c85617a418e3aea8e
Deployed ByteCode
0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063c78a573814610046578063eb0773421461005b578063fe611a0714610084575b600080fd5b6100596100543660046102e2565b6100bb565b005b61006e610069366004610376565b6101ad565b60405161007b9190610398565b60405180910390f35b6100ad610092366004610376565b6001600160a01b031660009081526020819052604090205490565b60405190815260200161007b565b336001600160a01b037f000000000000000000000000ec05ae7f013a66725a846c4c85617a418e3aea8e16146100f057600080fd5b600080866001600160a01b03166001600160a01b03168152602001908152602001600020604051806060016040528086815260200185815260200184848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250508354600181810186559482526020918290208451600390920201908155908301519381019390935550604081015190919060028201906101a390826104ee565b5050505050505050565b6001600160a01b038116600090815260208181526040808320805482518185028101850190935280835260609492939192909184015b828210156102bb5783829060005260206000209060030201604051806060016040529081600082015481526020016001820154815260200160028201805461022a90610465565b80601f016020809104026020016040519081016040528092919081815260200182805461025690610465565b80156102a35780601f10610278576101008083540402835291602001916102a3565b820191906000526020600020905b81548152906001019060200180831161028657829003601f168201915b505050505081525050815260200190600101906101e3565b505050509050919050565b80356001600160a01b03811681146102dd57600080fd5b919050565b6000806000806000608086880312156102fa57600080fd5b610303866102c6565b94506020860135935060408601359250606086013567ffffffffffffffff8082111561032e57600080fd5b818801915088601f83011261034257600080fd5b81358181111561035157600080fd5b89602082850101111561036357600080fd5b9699959850939650602001949392505050565b60006020828403121561038857600080fd5b610391826102c6565b9392505050565b60006020808301818452808551808352604092508286019150828160051b8701018488016000805b8481101561044057898403603f1901865282518051855288810151898601528701516060888601819052815190860181905283905b80821015610413578282018b015187830160800152908a01906103f5565b8681016080908101869052988b0198601f909101601f1916909601909501945050918701916001016103c0565b50919998505050505050505050565b634e487b7160e01b600052604160045260246000fd5b600181811c9082168061047957607f821691505b60208210810361049957634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156104e957600081815260208120601f850160051c810160208610156104c65750805b601f850160051c820191505b818110156104e5578281556001016104d2565b5050505b505050565b815167ffffffffffffffff8111156105085761050861044f565b61051c816105168454610465565b8461049f565b602080601f83116001811461055157600084156105395750858301515b600019600386901b1c1916600185901b1785556104e5565b600085815260208120601f198616915b8281101561058057888601518255948401946001909101908401610561565b508582101561059e5787850151600019600388901b60f8161c191681555b5050505050600190811b0190555056fea2646970667358221220afa4ffb7f6ff4b18ad50f8b27875e7721fbb04af8fe40e579e19aee2a542802164736f6c63430008130033