Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 6 from a total of 6 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Update_address | 122805629 | 138 days ago | IN | 0 ETH | 0.00000265988 | ||||
Add_new_id | 122632310 | 142 days ago | IN | 0 ETH | 0.000000262154 | ||||
Update_address | 121868284 | 160 days ago | IN | 0 ETH | 0.000002678419 | ||||
Add_new_id | 120186183 | 199 days ago | IN | 0 ETH | 0.000001081463 | ||||
Add_new_ids | 118965726 | 227 days ago | IN | 0 ETH | 0.000011438559 | ||||
Add_new_ids | 118525486 | 237 days ago | IN | 0 ETH | 0.000170133504 |
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
118525481 | 237 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
CurveAddressProvider
Compiler Version
vyper:0.3.10
Contract Source Code (Vyper language format)
# pragma version 0.3.10 # pragma evm-version paris """ @title CurveAddressProvider @author Curve.Fi @license Copyright (c) Curve.Fi, 2020-2023 - all rights reserved @notice An entrypoint contract for Curve's various registries @dev Allows adding arbitrary IDs instead of sequential IDs. Mapping: 0: Stableswap Custom Pool Registry 1: PoolInfo Getters 2: Exchange Router 3: Stableswap Metapool Factory 4: Fee Distributor 5: Cryptoswap Custom Pool Registry 6: Twocrypto Factory 7: Metaregistry 8: Stableswap crvUSD Factory 9: 10: 11: TricryptoNG Factory 12: StableswapNG Factory 13: TwocryptoNG Factory 14: Stableswap Calculations Contract 15: Cryptoswap calculations Contract 16: LLAMMA Factory crvUSD 17: LLAMMA Factory OneWayLending 18: Rate Provider 19: CRV Token 20: Gauge Factory 21: Ownership Admin 22: Parameter Admin 23: Emergency Admin 24: CurveDAO Vault """ event NewEntry: id: indexed(uint256) addr: address description: String[64] event EntryModified: id: indexed(uint256) version: uint256 event EntryRemoved: id: indexed(uint256) event CommitNewAdmin: admin: indexed(address) event NewAdmin: admin: indexed(address) struct AddressInfo: addr: address description: String[256] version: uint256 last_modified: uint256 admin: public(address) future_admin: public(address) num_entries: public(uint256) check_id_exists: public(HashMap[uint256, bool]) _ids: DynArray[uint256, 1000] get_id_info: public(HashMap[uint256, AddressInfo]) @external def __init__(): self.admin = tx.origin # ------------------------------ View Methods -------------------------------- @view @external def ids() -> DynArray[uint256, 1000]: """ @notice returns IDs of active registry items in the AddressProvider. @returns An array of IDs. """ _ids: DynArray[uint256, 1000] = [] for _id in self._ids: if self.check_id_exists[_id]: _ids.append(_id) return _ids @view @external def get_address(_id: uint256) -> address: """ @notice Fetch the address associated with `_id` @dev Returns empty(address) if `_id` has not been defined, or has been unset @param _id Identifier to fetch an address for @return Current address associated to `_id` """ return self.get_id_info[_id].addr # -------------------------- State-Mutable Methods --------------------------- @internal def _update_entry_metadata(_id: uint256): version: uint256 = self.get_id_info[_id].version + 1 self.get_id_info[_id].version = version self.get_id_info[_id].last_modified = block.timestamp log EntryModified(_id, version) @internal def _remove_id(_id: uint256) -> bool: assert self.check_id_exists[_id] # dev: id does not exist # Clear ID: self.get_id_info[_id].addr = empty(address) self.get_id_info[_id].last_modified = 0 self.get_id_info[_id].description = '' self.get_id_info[_id].version = 0 self.check_id_exists[_id] = False # Reduce num entries: self.num_entries -= 1 # Emit 0 in version to notify removal of id: log EntryRemoved(_id) return True @internal def _add_new_id( _id: uint256, _address: address, _description: String[64] ): assert not self.check_id_exists[_id] # dev: id exists self.check_id_exists[_id] = True self._ids.append(_id) # Add entry: self.get_id_info[_id] = AddressInfo( { addr: _address, description: _description, version: 1, last_modified: block.timestamp, } ) self.num_entries += 1 log NewEntry(_id, _address, _description) @external def add_new_id( _id: uint256, _address: address, _description: String[64], ): """ @notice Enter a new registry item @param _id ID assigned to the address @param _address Address assigned to the ID @param _description Human-readable description of the ID """ assert msg.sender == self.admin # dev: admin-only function self._add_new_id(_id, _address, _description) @external def add_new_ids( _ids: DynArray[uint256, 25], _addresses: DynArray[address, 25], _descriptions: DynArray[String[64], 25], ): """ @notice Enter new registry items @param _ids IDs assigned to addresses @param _addresses Addresses assigned to corresponding IDs @param _descriptions Human-readable description of each of the IDs """ assert msg.sender == self.admin # dev: admin-only function # Check lengths assert len(_ids) == len(_addresses) assert len(_addresses) == len(_descriptions) for i in range(len(_ids), bound=20): self._add_new_id( _ids[i], _addresses[i], _descriptions[i] ) @external def update_id( _id: uint256, _new_address: address, _new_description: String[64], ): """ @notice Update entries at an ID @param _id Address assigned to the input _id @param _new_address Address assigned to the _id @param _new_description Human-readable description of the identifier """ assert msg.sender == self.admin # dev: admin-only function assert self.check_id_exists[_id] # dev: id does not exist # Update entry at _id: self.get_id_info[_id].addr = _new_address self.get_id_info[_id].description = _new_description # Update metadata (version, update time): self._update_entry_metadata(_id) @external def update_address(_id: uint256, _address: address): """ @notice Set a new address for an existing identifier @param _id Identifier to set the new address for @param _address Address to set """ assert msg.sender == self.admin # dev: admin-only function assert self.check_id_exists[_id] # dev: id does not exist # Update address: self.get_id_info[_id].addr = _address # Update metadata (version, update time): self._update_entry_metadata(_id) @external def update_description(_id: uint256, _description: String[256]): """ @notice Update description for an existing _id @param _id Identifier to set the new description for @param _description New description to set """ assert msg.sender == self.admin # dev: admin-only function assert self.check_id_exists[_id] # dev: id does not exist # Update description: self.get_id_info[_id].description = _description # Update metadata (version, update time): self._update_entry_metadata(_id) @external def remove_id(_id: uint256) -> bool: """ @notice Unset an existing identifier @param _id Identifier to unset @return bool success """ assert msg.sender == self.admin # dev: admin-only function return self._remove_id(_id) @external def remove_ids(_ids: DynArray[uint256, 20]) -> bool: """ @notice Unset existing identifiers @param _id DynArray of identifier to unset @return bool success """ assert msg.sender == self.admin # dev: admin-only function for _id in _ids: assert self._remove_id(_id) return True # ------------------------------ Admin Methods ------------------------------- @external def commit_transfer_ownership(_new_admin: address) -> bool: """ @notice Initiate a transfer of contract ownership @dev Once initiated, the actual transfer may be performed three days later @param _new_admin Address of the new owner account @return bool success """ assert msg.sender == self.admin # dev: admin-only function self.future_admin = _new_admin log CommitNewAdmin(_new_admin) return True @external def apply_transfer_ownership() -> bool: """ @notice Finalize a transfer of contract ownership @dev May only be called by the next owner @return bool success """ assert msg.sender == self.future_admin # dev: admin-only function new_admin: address = self.future_admin self.admin = new_admin log NewAdmin(new_admin) return True @external def revert_transfer_ownership() -> bool: """ @notice Revert a transfer of contract ownership @dev May only be called by the current owner @return bool success """ assert msg.sender == self.admin # dev: admin-only function self.future_admin = empty(address) return True
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"name":"NewEntry","inputs":[{"name":"id","type":"uint256","indexed":true},{"name":"addr","type":"address","indexed":false},{"name":"description","type":"string","indexed":false}],"anonymous":false,"type":"event"},{"name":"EntryModified","inputs":[{"name":"id","type":"uint256","indexed":true},{"name":"version","type":"uint256","indexed":false}],"anonymous":false,"type":"event"},{"name":"EntryRemoved","inputs":[{"name":"id","type":"uint256","indexed":true}],"anonymous":false,"type":"event"},{"name":"CommitNewAdmin","inputs":[{"name":"admin","type":"address","indexed":true}],"anonymous":false,"type":"event"},{"name":"NewAdmin","inputs":[{"name":"admin","type":"address","indexed":true}],"anonymous":false,"type":"event"},{"stateMutability":"nonpayable","type":"constructor","inputs":[],"outputs":[]},{"stateMutability":"view","type":"function","name":"ids","inputs":[],"outputs":[{"name":"","type":"uint256[]"}]},{"stateMutability":"view","type":"function","name":"get_address","inputs":[{"name":"_id","type":"uint256"}],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"nonpayable","type":"function","name":"add_new_id","inputs":[{"name":"_id","type":"uint256"},{"name":"_address","type":"address"},{"name":"_description","type":"string"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"add_new_ids","inputs":[{"name":"_ids","type":"uint256[]"},{"name":"_addresses","type":"address[]"},{"name":"_descriptions","type":"string[]"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"update_id","inputs":[{"name":"_id","type":"uint256"},{"name":"_new_address","type":"address"},{"name":"_new_description","type":"string"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"update_address","inputs":[{"name":"_id","type":"uint256"},{"name":"_address","type":"address"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"update_description","inputs":[{"name":"_id","type":"uint256"},{"name":"_description","type":"string"}],"outputs":[]},{"stateMutability":"nonpayable","type":"function","name":"remove_id","inputs":[{"name":"_id","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"remove_ids","inputs":[{"name":"_ids","type":"uint256[]"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"commit_transfer_ownership","inputs":[{"name":"_new_admin","type":"address"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"apply_transfer_ownership","inputs":[],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"nonpayable","type":"function","name":"revert_transfer_ownership","inputs":[],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"view","type":"function","name":"admin","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"future_admin","inputs":[],"outputs":[{"name":"","type":"address"}]},{"stateMutability":"view","type":"function","name":"num_entries","inputs":[],"outputs":[{"name":"","type":"uint256"}]},{"stateMutability":"view","type":"function","name":"check_id_exists","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"bool"}]},{"stateMutability":"view","type":"function","name":"get_id_info","inputs":[{"name":"arg0","type":"uint256"}],"outputs":[{"name":"","type":"tuple","components":[{"name":"addr","type":"address"},{"name":"description","type":"string"},{"name":"version","type":"uint256"},{"name":"last_modified","type":"uint256"}]}]}]
Contract Creation Code
3461001a5732600055610b0061001f61000039610b00610000f35b600080fd60003560e01c60026013820660011b610ada01601e39600051565b63f851a440811861084a5734610ad55760005460405260206040f361084a565b6317f7182a811861084a5734610ad55760015460405260206040f361084a565b63b7f1d527811861084a5734610ad55760025460405260206040f361084a565b6373250a69811861084a57602436103417610ad557600360043560205260005260406000205460405260206040f361084a565b6392668ecb811861016f57602436103417610ad5576020806040526103ed600435602052600052604060002081604001608082548252806020830152600183018183016020825401600081601f0160051c60098111610ad557801561012457905b808501548160051b85015260010181811861010e575b5050508051806020830101601f82600003163682375050601f19601f825160200101169050905081019050600a8301546040830152600b830154606083015290509050810190506040f35b63c5190845811861084a57608436103417610ad5576024358060a01c610ad557610180526044356004016040813511610ad557602081350180826101a03750506000543318610ad5576004356040526101805160605260206101a05101806080826101a060045afa50506101e16109ab565b0061084a565b63e7657e15811861084a5734610ad557600060405260006004546103e88111610ad557801561025e57905b8060050154617d60526003617d605160205260005260406000205415610253576040516103e78111610ad557617d60518160051b6060015260018101604052505b600101818118610212575b5050602080617d605280617d600160006040518083528060051b6000826103e88111610ad55780156102a957905b8060051b606001518160051b60208801015260010181811861028c575b50508201602001915050905081019050617d60f361084a565b63493f4f7481186102f257602436103417610ad5576103ed60043560205260005260406000205460405260206040f35b636b441a40811861084a57602436103417610ad5576004358060a01c610ad5576040526000543318610ad5576040516001556040517f0305c49816a5a9a099d81e90d76421c9a4a529e0640cd15297b6fc8f1c9ac6ff60006060a2600160605260206060f361084a565b6330bc35d8811861084a5760c436103417610ad5576004356004016019813511610ad557803560208160051b018083610180375050506024356004016019813511610ad557803560008160198111610ad55780156103dc57905b8060051b6020850101358060a01c610ad5578160051b6104e001526001018181186103b6575b5050806104c05250506044356004016019813511610ad557803560008160198111610ad557801561044057905b8060051b60208501013560208501016040813511610ad5576020813501606083026108200181838237505050600101818118610409575b5050806108005250506000543318610ad5576104c0516101805118610ad557610800516104c05118610ad55760006101805160148111610ad55780156104f557905b80611180526111805161018051811015610ad55760051b6101a00151604052611180516104c051811015610ad55760051b6104e0015160605260606111805161080051811015610ad55702610820016020815101806080828460045afa5050506104ea6109ab565b600101818118610482575b50500061084a565b632aa1c9f4811861084a57608436103417610ad5576024358060a01c610ad55760a0526044356004016040813511610ad5576020813501808260c03750506000543318610ad557600360043560205260005260406000205415610ad55760a0516103ed600435602052600052604060002055602060c051016103ed6004356020526000526040600020600181019050600082601f0160051c60038111610ad55780156105bc57905b8060051b60c00151818401556001018181186105a5575b505050506004356040526105ce610850565b0061084a565b639b8c87c8811861084a57604436103417610ad5576024358060a01c610ad55760a0526000543318610ad557600360043560205260005260406000205415610ad55760a0516103ed600435602052600052604060002055600435604052610639610850565b0061084a565b63606a9612811861084a57606436103417610ad557602435600401610100813511610ad5576020813501808260a03750506000543318610ad557600360043560205260005260406000205415610ad557602060a051016103ed6004356020526000526040600020600181019050600082601f0160051c60098111610ad55780156106dc57905b8060051b60a00151818401556001018181186106c5575b505050506004356040526106ee610850565b0061084a565b6357bbc662811861084a57602436103417610ad5576000543318610ad557602060043560405261072460806108dd565b6080f361084a565b6397ecb5f8811861084a57604436103417610ad5576004356004016014813511610ad557803560208160051b0180836080375050506000543318610ad557600060805160148111610ad55780156107b157905b8060051b60a00151610320526103205160405261079d6103406108dd565b6103405115610ad55760010181811861077f575b50506001610320526020610320f361084a565b636a1c05ae811861084a5734610ad5576001543318610ad5576001546040526040516000556040517f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60006060a2600160605260206060f361084a565b6386fbf193811861084a5734610ad5576000543318610ad5576000600155600160405260206040f35b60006000fd5b6103ed6040516020526000526040600020600a810190505460018101818110610ad55790506060526060516103ed6040516020526000526040600020600a8101905055426103ed6040516020526000526040600020600b81019050556040517f4f3b9988fc693b8d0ea535c1d768a3ac2ea49aca0f685397357a6a9b9ad13dce60605160805260206080a2565b600360405160205260005260406000205415610ad55760006103ed60405160205260005260406000205560006103ed6040516020526000526040600020600b810190505560006103ed60405160205260005260406000206001810190505560006103ed6040516020526000526040600020600a81019050556000600360405160205260005260406000205560025460018103818111610ad55790506002556040517f21706341bb0a4b16c93763b24238e8737928e6ebd1f83adb7cec56cf3fc184a360006060a26001815250565b6003604051602052600052604060002054610ad557600160036040516020526000526040600020556004546103e78111610ad557604051816005015560018101600455506103ed6040516020526000526040600020606051815560206080510160018201600082601f0160051c60038111610ad5578015610a3f57905b8060051b6080015181840155600101818118610a28575b505050506001600a82015542600b8201555060025460018101818110610ad55790506002556040517f126b1179a2f21d5e130df19f7483a0a854bb662e3c8ce5dc28e4e8e46dd72690604060605160e05280610100528060e001602060805101808282608060045afa50508051806020830101601f82600003163682375050601f19601f8251602001011690508101905060e0a2565b600080fd02c2003a084a084a06f4063f0821007a05d401e7072c00ad035c084a001a005a084a04fd07c484190b0081182600a16576797065728300030a0015
Deployed Bytecode
0x60003560e01c60026013820660011b610ada01601e39600051565b63f851a440811861084a5734610ad55760005460405260206040f361084a565b6317f7182a811861084a5734610ad55760015460405260206040f361084a565b63b7f1d527811861084a5734610ad55760025460405260206040f361084a565b6373250a69811861084a57602436103417610ad557600360043560205260005260406000205460405260206040f361084a565b6392668ecb811861016f57602436103417610ad5576020806040526103ed600435602052600052604060002081604001608082548252806020830152600183018183016020825401600081601f0160051c60098111610ad557801561012457905b808501548160051b85015260010181811861010e575b5050508051806020830101601f82600003163682375050601f19601f825160200101169050905081019050600a8301546040830152600b830154606083015290509050810190506040f35b63c5190845811861084a57608436103417610ad5576024358060a01c610ad557610180526044356004016040813511610ad557602081350180826101a03750506000543318610ad5576004356040526101805160605260206101a05101806080826101a060045afa50506101e16109ab565b0061084a565b63e7657e15811861084a5734610ad557600060405260006004546103e88111610ad557801561025e57905b8060050154617d60526003617d605160205260005260406000205415610253576040516103e78111610ad557617d60518160051b6060015260018101604052505b600101818118610212575b5050602080617d605280617d600160006040518083528060051b6000826103e88111610ad55780156102a957905b8060051b606001518160051b60208801015260010181811861028c575b50508201602001915050905081019050617d60f361084a565b63493f4f7481186102f257602436103417610ad5576103ed60043560205260005260406000205460405260206040f35b636b441a40811861084a57602436103417610ad5576004358060a01c610ad5576040526000543318610ad5576040516001556040517f0305c49816a5a9a099d81e90d76421c9a4a529e0640cd15297b6fc8f1c9ac6ff60006060a2600160605260206060f361084a565b6330bc35d8811861084a5760c436103417610ad5576004356004016019813511610ad557803560208160051b018083610180375050506024356004016019813511610ad557803560008160198111610ad55780156103dc57905b8060051b6020850101358060a01c610ad5578160051b6104e001526001018181186103b6575b5050806104c05250506044356004016019813511610ad557803560008160198111610ad557801561044057905b8060051b60208501013560208501016040813511610ad5576020813501606083026108200181838237505050600101818118610409575b5050806108005250506000543318610ad5576104c0516101805118610ad557610800516104c05118610ad55760006101805160148111610ad55780156104f557905b80611180526111805161018051811015610ad55760051b6101a00151604052611180516104c051811015610ad55760051b6104e0015160605260606111805161080051811015610ad55702610820016020815101806080828460045afa5050506104ea6109ab565b600101818118610482575b50500061084a565b632aa1c9f4811861084a57608436103417610ad5576024358060a01c610ad55760a0526044356004016040813511610ad5576020813501808260c03750506000543318610ad557600360043560205260005260406000205415610ad55760a0516103ed600435602052600052604060002055602060c051016103ed6004356020526000526040600020600181019050600082601f0160051c60038111610ad55780156105bc57905b8060051b60c00151818401556001018181186105a5575b505050506004356040526105ce610850565b0061084a565b639b8c87c8811861084a57604436103417610ad5576024358060a01c610ad55760a0526000543318610ad557600360043560205260005260406000205415610ad55760a0516103ed600435602052600052604060002055600435604052610639610850565b0061084a565b63606a9612811861084a57606436103417610ad557602435600401610100813511610ad5576020813501808260a03750506000543318610ad557600360043560205260005260406000205415610ad557602060a051016103ed6004356020526000526040600020600181019050600082601f0160051c60098111610ad55780156106dc57905b8060051b60a00151818401556001018181186106c5575b505050506004356040526106ee610850565b0061084a565b6357bbc662811861084a57602436103417610ad5576000543318610ad557602060043560405261072460806108dd565b6080f361084a565b6397ecb5f8811861084a57604436103417610ad5576004356004016014813511610ad557803560208160051b0180836080375050506000543318610ad557600060805160148111610ad55780156107b157905b8060051b60a00151610320526103205160405261079d6103406108dd565b6103405115610ad55760010181811861077f575b50506001610320526020610320f361084a565b636a1c05ae811861084a5734610ad5576001543318610ad5576001546040526040516000556040517f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60006060a2600160605260206060f361084a565b6386fbf193811861084a5734610ad5576000543318610ad5576000600155600160405260206040f35b60006000fd5b6103ed6040516020526000526040600020600a810190505460018101818110610ad55790506060526060516103ed6040516020526000526040600020600a8101905055426103ed6040516020526000526040600020600b81019050556040517f4f3b9988fc693b8d0ea535c1d768a3ac2ea49aca0f685397357a6a9b9ad13dce60605160805260206080a2565b600360405160205260005260406000205415610ad55760006103ed60405160205260005260406000205560006103ed6040516020526000526040600020600b810190505560006103ed60405160205260005260406000206001810190505560006103ed6040516020526000526040600020600a81019050556000600360405160205260005260406000205560025460018103818111610ad55790506002556040517f21706341bb0a4b16c93763b24238e8737928e6ebd1f83adb7cec56cf3fc184a360006060a26001815250565b6003604051602052600052604060002054610ad557600160036040516020526000526040600020556004546103e78111610ad557604051816005015560018101600455506103ed6040516020526000526040600020606051815560206080510160018201600082601f0160051c60038111610ad5578015610a3f57905b8060051b6080015181840155600101818118610a28575b505050506001600a82015542600b8201555060025460018101818110610ad55790506002556040517f126b1179a2f21d5e130df19f7483a0a854bb662e3c8ce5dc28e4e8e46dd72690604060605160e05280610100528060e001602060805101808282608060045afa50508051806020830101601f82600003163682375050601f19601f8251602001011690508101905060e0a2565b600080fd02c2003a084a084a06f4063f0821007a05d401e7072c00ad035c084a001a005a084a04fd07c4
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 29 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
[ 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.