From ddd68a8abb78ee582178d9cb957ebdbe41d2878d Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Mon, 18 Mar 2024 09:25:58 +0100 Subject: [PATCH 01/19] init --- .hypothesis/unicode_data/13.0.0/charmap.json.gz | Bin 0 -> 20988 bytes .../unicode_data/13.0.0/codec-utf-8.json.gz | Bin 0 -> 60 bytes contracts/AddressProviderNG.vy | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 .hypothesis/unicode_data/13.0.0/charmap.json.gz create mode 100644 .hypothesis/unicode_data/13.0.0/codec-utf-8.json.gz create mode 100644 contracts/AddressProviderNG.vy diff --git a/.hypothesis/unicode_data/13.0.0/charmap.json.gz b/.hypothesis/unicode_data/13.0.0/charmap.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..6f9a3290d7b76989931968c49068b79c1789ec56 GIT binary patch literal 20988 zcmbUIV{|25`0fkGcGBtCM#r|@vDvZFvD2|_t=P7$PC7PMY?~`5&))y{J$sDv<&5*? zs;g#I%{l9yg;Do!7I73D95@&l7{sTGouk(;cMd}{E(b6L{l8N~T~0pV1}%t(nzJkn z3CRN-Ks!m8kRn}Bj<=v+%LCKjl?4j(*)b#@RrEh5n0i4M0RN9H!;jmEr!2#m$I{Ma zulGYuyBwj9@*=~}N2ceF;WofXAG*ysuj%b`vxSVeXr#JOudeh30Ka3& z82{6>cy8P>Q1bCrXz^C4X@03f@#lJ5p!4UJyU?#Q#napkH{jjr)CZya52u@m%E9(q zqtAtEp7-7(zUJxaQC}?gAm=zge?48<&dbA&CmWh{_&a*_V{$ci76shuRTf zHHsC3fPl33iKiWZtpfa!T+WsFgQo*Q?g7`;UB|jidG6oMg0!u*?t|uH_TI#jV(^IW z?WxDh8|Ao~mSpqPp_^HYP2ieJ=0hhBg=!K)=r zshV0jop_JX5dR{+70p^;wIGF^H1F^G#LymHS2LTt@#_+oZdzaHS0p*`2#b}r)Xo$a zlAE4$4U0Bi8N|87+csV$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=lNL%Ms6Wq#W=kiMNE29Jj$(b?mjJy?Os z*cfnmG;w;kE|Kal-*)*e7UBZVOyw7X*HCd(aKMH06_Ktej}g=yan~Wc;4%53Fhg^d zC#0G;AtM_MliI3Q5hNixkU!LwKh#mip{tGq;R#*bo8w#H&)BYE!y-1yFgq+obCkJ- z>@4wapnkPc`U6g*Aq2y)lM9 z4=#PxJW0H2skJ6iek4_YBvF9mZkHtRd5ZNEgm|f(h{T(fs=<|D!Aa$#-1cBb*361I zUqyFsyD&fNcUS@T(s#HMTX$lE*>r10-mnI@V-%RX#ZHpQSIXn>pvx$C{Co^yq-S!> z-Ayz36!uaxIgIF~_=#)ziQNea*L;2lYucUVr7taLOp3eg8oNix_X7^_BhEC|LoMUe z%dKklg#*z1-sS7s#}LtHwdj? zZ-j$3*CS^v=1!Leaj|~+x1RyPG^*`->a2gh9e_oaFB&h3s(+nc6gwBiZkcMM1H32) zRE>-==Kn3%hhB$^>al@AnvW$)w%Q@U&;f6{4XY8r7O|iGxxO>qkf!3VkPYKF=egm6 zZaBHYHr$NE+6X26xpbx0T%iL6+0=y)pYu6*!4k@FY!+ z@PO;&l0C2J%VCVT+6RD7LD|0_aJycQcT87_l(E}`yDxoW*gVM#+A)lyf5Hm3H}0=4 zDd*ew0PstYco*{!|7?F@)!GYvk`GY2R7i6@gKx^s-gduZNK|)Q zU$aVvx_Ws{3&hjLafy)pG(m*l_|z1Vb~qLPqb3a}EM#nzB=P@BO&ob%36rDJB%kM| zqkDKhgYPslt30efY5b?BS*<)G&O0X1s2l`NN{{gF2*P~2fig$MR*uQ2Yme9S+_`7+ zS)5lS^9cBS?5yj85Z=~_7+l=Yx*!Y7z~0srcxUVEVW-%km#{n{vVUP7}@RP006a6#aaLW literal 0 HcmV?d00001 diff --git a/.hypothesis/unicode_data/13.0.0/codec-utf-8.json.gz b/.hypothesis/unicode_data/13.0.0/codec-utf-8.json.gz new file mode 100644 index 0000000000000000000000000000000000000000..f5ad51c1ac27cc5d6082d0b8ad434df18daed27a GIT binary patch literal 60 zcmb2|=HOstU|?YSUy@spl2c+ Date: Mon, 18 Mar 2024 09:27:06 +0100 Subject: [PATCH 02/19] init --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 866cf27..a0266f5 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ __pycache__/ venv/ bvenv/ .env +.hypothesis \ No newline at end of file From abec4aa0a1bcd30a6a6a8530bf45fdf20d11431e Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Mon, 18 Mar 2024 10:36:38 +0100 Subject: [PATCH 03/19] adding types --- contracts/AddressProviderNG.vy | 225 +++++++++++++++++++++++++++++++++ 1 file changed, 225 insertions(+) diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index e69de29..998d2c8 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -0,0 +1,225 @@ +# @version 0.3.10 +""" +@title CurveAddressProvider +@author Curve.Fi +@license Copyright (c) Curve.Fi, 2020-2023 - all rights reserved +@notice An entrypoint contract for Curve's various registries +""" + +event NewAddressIdentifier: + id: indexed(uint256) + addr: address + description: String[64] + +event AddressModified: + id: indexed(uint256) + new_address: address + version: uint256 + +event CommitNewAdmin: + deadline: indexed(uint256) + admin: indexed(address) + +event NewAdmin: + admin: indexed(address) + + +struct AddressInfo: + addr: address + type: String[64] + description: String[256] + version: uint256 + is_active: bool + last_modified: uint256 + + +registry: address +admin: public(address) +transfer_ownership_deadline: public(uint256) +future_admin: public(address) + +queue_length: uint256 +get_id_info: public(HashMap[uint256, AddressInfo]) +get_ids_for_type: public(HashMap[String[64], DynArray[uint256, 1000]]) + + +@external +def __init__(_admin: address): + self.admin = _admin + + +# -------------------------- State-Mutable Methods --------------------------- + + +@view +@external +def max_id() -> uint256: + """ + @notice Get the highest ID set within the address provider + @return uint256 max ID + """ + return self.queue_length - 1 + + +@view +@external +def get_address(_id: uint256) -> address: + """ + @notice Fetch the address associated with `_id` + @dev Returns ZERO_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 --------------------------- + + +@external +def add_new_type(_new_type: String[64]): + self.types + + +@external +def add_new_id( + _address: address, + _type: String[64], + _id: uint256, + _description: String[64] +) -> uint256: + """ + @notice Add a new identifier to the registry + @param _address Initial address to assign to new identifier + @param _type keccak hash of the type of entry. For e.g. keccak(b'StableSwap') + @param _id ID to assign the address to + @param _description Human-readable description of the identifier + @return uint256 identifier + """ + assert msg.sender == self.admin # dev: admin-only function + assert self.get_id_info[_id].addr == empty(address) # dev: id occupied + + id: uint256 = self.queue_length + self.get_id_info[id] = AddressInfo({ + addr: _address, + type: String[64], + description: _description, + version: 1, + is_active: True, + last_modified: block.timestamp, + }) + self.queue_length = id + 1 + + log NewAddressIdentifier(id, _address, _description) + + return id + + +@external +def set_address(_id: uint256, _address: address) -> bool: + """ + @notice Set a new address for an existing identifier + @param _id Identifier to set the new address for + @param _address Address to set + @return bool success + """ + assert msg.sender == self.admin # dev: admin-only function + assert _address.is_contract # dev: not a contract + assert self.queue_length > _id # dev: id does not exist + + version: uint256 = self.get_id_info[_id].version + 1 + + self.get_id_info[_id].addr = _address + self.get_id_info[_id].is_active = True + self.get_id_info[_id].version = version + self.get_id_info[_id].last_modified = block.timestamp + + if _id == 0: + self.registry = _address + + log AddressModified(_id, _address, version) + + return True + + +@external +def unset_address(_id: uint256) -> bool: + """ + @notice Unset an existing identifier + @dev An identifier cannot ever be removed, it can only have the + address unset so that it returns empty(address) + @param _id Identifier to unset + @return bool success + """ + assert msg.sender == self.admin # dev: admin-only function + assert self.get_id_info[_id].is_active # dev: not active + + self.get_id_info[_id].is_active = False + self.get_id_info[_id].addr = empty(address) + self.get_id_info[_id].last_modified = block.timestamp + self.get_id_info[_id].description = empty(String[64]) + + if _id == 0: + self.registry = empty(address) + + log AddressModified(_id, empty(address), self.get_id_info[_id].version) + + 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 + assert self.transfer_ownership_deadline == 0 # dev: transfer already active + + deadline: uint256 = block.timestamp + 3*86400 + self.transfer_ownership_deadline = deadline + self.future_admin = _new_admin + + log CommitNewAdmin(deadline, _new_admin) + + return True + + +@external +def apply_transfer_ownership() -> bool: + """ + @notice Finalize a transfer of contract ownership + @dev May only be called by the current owner, three days after a + call to `commit_transfer_ownership` + @return bool success + """ + assert msg.sender == self.admin # dev: admin-only function + assert self.transfer_ownership_deadline != 0 # dev: transfer not active + assert block.timestamp >= self.transfer_ownership_deadline # dev: now < deadline + + new_admin: address = self.future_admin + self.admin = new_admin + self.transfer_ownership_deadline = 0 + + 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.transfer_ownership_deadline = 0 + + return True \ No newline at end of file From c0c153d3ed796468f89d0e94c2c2175c6028c92e Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:09:43 +0100 Subject: [PATCH 04/19] initial implementation --- contracts/AddressProviderNG.vy | 195 ++++++++++++++++++++++----------- 1 file changed, 130 insertions(+), 65 deletions(-) diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index 998d2c8..b9f5191 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -6,14 +6,13 @@ @notice An entrypoint contract for Curve's various registries """ -event NewAddressIdentifier: +event NewEntry: id: indexed(uint256) addr: address description: String[64] -event AddressModified: +event EntryModified: id: indexed(uint256) - new_address: address version: uint256 event CommitNewAdmin: @@ -26,21 +25,23 @@ event NewAdmin: struct AddressInfo: addr: address - type: String[64] description: String[256] + tags: DynArray[String[64], 20] version: uint256 - is_active: bool last_modified: uint256 -registry: address admin: public(address) transfer_ownership_deadline: public(uint256) future_admin: public(address) -queue_length: uint256 +num_entries: public(uint256) +check_tag_exists: public(HashMap[String[64], bool]) +check_id_exists: public(HashMap[uint256, bool]) +ids: public(DynArray[uint256, 1000]) +tags: public(DynArray[String[64], 1000]) +id_tag_mapping: HashMap[bytes32, bool] get_id_info: public(HashMap[uint256, AddressInfo]) -get_ids_for_type: public(HashMap[String[64], DynArray[uint256, 1000]]) @external @@ -48,102 +49,163 @@ def __init__(_admin: address): self.admin = _admin -# -------------------------- State-Mutable Methods --------------------------- +# ------------------------------ View Methods -------------------------------- @view @external -def max_id() -> uint256: +def get_address(_id: uint256) -> address: """ - @notice Get the highest ID set within the address provider - @return uint256 max ID + @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.queue_length - 1 + return self.get_id_info[_id].addr @view @external -def get_address(_id: uint256) -> address: +def get_addresses_for_tags(_tag: String[64]) -> DynArray[address, 100]: """ - @notice Fetch the address associated with `_id` - @dev Returns ZERO_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` + @notice Fetch all addresses that are tagged with `_tag` + @param _tag tag to fetch an address for + @return Array of addresses tagged with `_tag` """ - return self.get_id_info[_id].addr + + tagged_ids: DynArray[address, 100] = [] + for _id in self.ids: + if self.id_tag_mapping[keccak256(concat(uint2str(_id), _tag))]: + tagged_ids.append(self.get_id_info[_id].addr) + + return tagged_ids # -------------------------- State-Mutable Methods --------------------------- @external -def add_new_type(_new_type: String[64]): - self.types +def add_new_tags(_new_tags: DynArray[String[64], 20]): + """ + @notice Add new tag + @dev method allows a max number of entry of 20 + @param _new_tags An array of types to add to the registry + e.g. ['StableSwap', 'CryptoSwap', ...] + """ + for _new_tag in _new_tags: + if not self.check_tag_exists[_new_tag]: + self.check_tag_exists[_new_tag] = True + self.tags.append(_new_tag) + + +@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) @external def add_new_id( _address: address, - _type: String[64], _id: uint256, - _description: String[64] -) -> uint256: + _tags: DynArray[String[64], 20], + _description: String[64], +): """ - @notice Add a new identifier to the registry - @param _address Initial address to assign to new identifier - @param _type keccak hash of the type of entry. For e.g. keccak(b'StableSwap') - @param _id ID to assign the address to + @notice Enter a new registry item + @param _address Address assigned to the _id + @param _id Address assigned to the input _id + @param _tags tags defining the entry. e.g. ['StableSwap', 'Factory'] + Entry can have a maximum of 20 tags. Tags need to be + added to the AddressProvider via `add_new_tags` before id can be added. @param _description Human-readable description of the identifier - @return uint256 identifier """ assert msg.sender == self.admin # dev: admin-only function - assert self.get_id_info[_id].addr == empty(address) # dev: id occupied - - id: uint256 = self.queue_length - self.get_id_info[id] = AddressInfo({ - addr: _address, - type: String[64], - description: _description, - version: 1, - is_active: True, - last_modified: block.timestamp, - }) - self.queue_length = id + 1 - - log NewAddressIdentifier(id, _address, _description) - - return id + assert not self.check_id_exists[_id] # dev: id exists + assert len(_tags) > 0 # dev: entry needs at least one tag + + self.check_id_exists[_id] = True + self.ids.append(_id) + + # Check if tags are correct and add them to tag > id mapping: + for _tag in _tags: + assert self.check_tag_exists[_tag] # dev: unrecognised tag + self.id_tag_mapping[ + keccak256(concat(uint2str(_id), _tag)) + ] = True + + # Add entry: + self.get_id_info[_id] = AddressInfo( + { + addr: _address, + description: _description, + tags: _tags, + version: 1, + last_modified: block.timestamp, + } + ) + self.num_entries += 1 + + log NewEntry(_id, _address, _description) @external -def set_address(_id: uint256, _address: address) -> bool: +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 - @return bool success """ assert msg.sender == self.admin # dev: admin-only function - assert _address.is_contract # dev: not a contract - assert self.queue_length > _id # dev: id does not exist - - version: uint256 = self.get_id_info[_id].version + 1 + # Update address: self.get_id_info[_id].addr = _address - self.get_id_info[_id].is_active = True - self.get_id_info[_id].version = version - self.get_id_info[_id].last_modified = block.timestamp - if _id == 0: - self.registry = _address + # Update metadata (version, update time): + self._update_entry_metadata(_id) - log AddressModified(_id, _address, version) - return True +@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.get_id_info[_id].addr != empty(address) # dev: id is empty + + # Update description: + self.get_id_info[_id].description = _description + + # Update metadata (version, update time): + self._update_entry_metadata(_id) @external -def unset_address(_id: uint256) -> bool: +def update_tags(_id: uint256, _tags: DynArray[String[64], 20]): + """ + @notice Update tags for an existing _id + @param _id Identifier to set the new description for + @param _tags New tags to set to + """ + assert msg.sender == self.admin # dev: admin-only function + assert self.get_id_info[_id].addr != empty(address) # dev: id is empty + + # Update tags: + self.get_id_info[_id].tags = _tags + + # Update metadata (version, update time): + self._update_entry_metadata(_id) + + + +@external +def remove_id(_id: uint256) -> bool: """ @notice Unset an existing identifier @dev An identifier cannot ever be removed, it can only have the @@ -152,17 +214,20 @@ def unset_address(_id: uint256) -> bool: @return bool success """ assert msg.sender == self.admin # dev: admin-only function - assert self.get_id_info[_id].is_active # dev: not active + assert self.get_id_info[_id].addr != empty(address) # dev: inactive id - self.get_id_info[_id].is_active = False self.get_id_info[_id].addr = empty(address) self.get_id_info[_id].last_modified = block.timestamp - self.get_id_info[_id].description = empty(String[64]) + self.get_id_info[_id].description = '' + self.get_id_info[_id].tags = [] + self.get_id_info[_id].version = 0 + + self.num_entries -= 1 - if _id == 0: - self.registry = empty(address) + self.check_id_exists[_id] = False - log AddressModified(_id, empty(address), self.get_id_info[_id].version) + # Emit 0 in version to notify removal of id: + log EntryModified(_id, 0) return True From d0a68ad591b155c8ac0324630358a34f62022a31 Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:13:12 +0100 Subject: [PATCH 05/19] remove hypothesis --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a0266f5..9ad4300 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ __pycache__/ venv/ bvenv/ .env -.hypothesis \ No newline at end of file +.hypothesis/ +*.gz \ No newline at end of file From 82fd29685d10ea3b5a59e02d69210b58b19d550f Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Mon, 18 Mar 2024 16:14:12 +0100 Subject: [PATCH 06/19] add more extensions to ignore --- .gitignore | 3 ++- .hypothesis/unicode_data/13.0.0/charmap.json.gz | Bin 20988 -> 0 bytes .../unicode_data/13.0.0/codec-utf-8.json.gz | Bin 60 -> 0 bytes 3 files changed, 2 insertions(+), 1 deletion(-) delete mode 100644 .hypothesis/unicode_data/13.0.0/charmap.json.gz delete mode 100644 .hypothesis/unicode_data/13.0.0/codec-utf-8.json.gz diff --git a/.gitignore b/.gitignore index 9ad4300..40b609c 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ venv/ bvenv/ .env .hypothesis/ -*.gz \ No newline at end of file +.gz +.json.gz \ No newline at end of file diff --git a/.hypothesis/unicode_data/13.0.0/charmap.json.gz b/.hypothesis/unicode_data/13.0.0/charmap.json.gz deleted file mode 100644 index 6f9a3290d7b76989931968c49068b79c1789ec56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20988 zcmbUIV{|25`0fkGcGBtCM#r|@vDvZFvD2|_t=P7$PC7PMY?~`5&))y{J$sDv<&5*? zs;g#I%{l9yg;Do!7I73D95@&l7{sTGouk(;cMd}{E(b6L{l8N~T~0pV1}%t(nzJkn z3CRN-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|0_aJycQcT87_l(E}`yDxoW*gVM#+A)lyf5Hm3H}0=4 zDd*ew0PstYco*{!|7?F@)!GYvk`GY2R7i6@gKx^s-gduZNK|)Q zU$aVvx_Ws{3&hjLafy)pG(m*l_|z1Vb~qLPqb3a}EM#nzB=P@BO&ob%36rDJB%kM| zqkDKhgYPslt30efY5b?BS*<)G&O0X1s2l`NN{{gF2*P~2fig$MR*uQ2Yme9S+_`7+ zS)5lS^9cBS?5yj85Z=~_7+l=Yx*!Y7z~0srcxUVEVW-%km#{n{vVUP7}@RP006a6#aaLW diff --git a/.hypothesis/unicode_data/13.0.0/codec-utf-8.json.gz b/.hypothesis/unicode_data/13.0.0/codec-utf-8.json.gz deleted file mode 100644 index f5ad51c1ac27cc5d6082d0b8ad434df18daed27a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 60 zcmb2|=HOstU|?YSUy@spl2c+ Date: Tue, 19 Mar 2024 16:40:24 +0100 Subject: [PATCH 07/19] fix: update admin change logic; fix: update mapping when updating tags --- contracts/AddressProviderNG.vy | 70 ++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 11 deletions(-) diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index b9f5191..dc049b3 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -38,8 +38,8 @@ future_admin: public(address) num_entries: public(uint256) check_tag_exists: public(HashMap[String[64], bool]) check_id_exists: public(HashMap[uint256, bool]) -ids: public(DynArray[uint256, 1000]) -tags: public(DynArray[String[64], 1000]) +_ids: DynArray[uint256, 1000] +_tags: DynArray[String[64], 1000] id_tag_mapping: HashMap[bytes32, bool] get_id_info: public(HashMap[uint256, AddressInfo]) @@ -52,6 +52,36 @@ def __init__(_admin: address): # ------------------------------ View Methods -------------------------------- +@view +@external +def tags() -> DynArray[String[64], 1000]: + """ + @notice Returns active tags registered in the AddressProvider. + @returns An array of tags. + """ + _tags: DynArray[String[64], 1000] = [] + for _tag in self._tags: + if self.check_tag_exists[_tag]: + _tags.append(_tag) + + return _tags + + +@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: @@ -74,7 +104,7 @@ def get_addresses_for_tags(_tag: String[64]) -> DynArray[address, 100]: """ tagged_ids: DynArray[address, 100] = [] - for _id in self.ids: + for _id in self._ids: if self.id_tag_mapping[keccak256(concat(uint2str(_id), _tag))]: tagged_ids.append(self.get_id_info[_id].addr) @@ -95,7 +125,7 @@ def add_new_tags(_new_tags: DynArray[String[64], 20]): for _new_tag in _new_tags: if not self.check_tag_exists[_new_tag]: self.check_tag_exists[_new_tag] = True - self.tags.append(_new_tag) + self._tags.append(_new_tag) @internal @@ -129,7 +159,7 @@ def add_new_id( assert len(_tags) > 0 # dev: entry needs at least one tag self.check_id_exists[_id] = True - self.ids.append(_id) + self._ids.append(_id) # Check if tags are correct and add them to tag > id mapping: for _tag in _tags: @@ -187,23 +217,36 @@ def update_description(_id: uint256, _description: String[256]): @external -def update_tags(_id: uint256, _tags: DynArray[String[64], 20]): +def update_tags(_id: uint256, _new_tags: DynArray[String[64], 20]): """ @notice Update tags for an existing _id @param _id Identifier to set the new description for - @param _tags New tags to set to + @param _new_tags New tags to set to """ assert msg.sender == self.admin # dev: admin-only function assert self.get_id_info[_id].addr != empty(address) # dev: id is empty + # Add mapping if new tag is added: + _old_tags: DynArray[String[64], 20] = self.get_id_info[_id].tags + for _tag in _new_tags: + assert self.check_tag_exists[_tag] # dev: unauthorised tag + key: bytes32 = keccak256(concat(uint2str(_id), _tag)) + if not self.id_tag_mapping[key]: + self.id_tag_mapping[key] = True + + # Remove mapping if tag was removed: + for _tag in _old_tags: + key: bytes32 = keccak256(concat(uint2str(_id), _tag)) + if self.id_tag_mapping[key]: + self.id_tag_mapping[key] = False + # Update tags: - self.get_id_info[_id].tags = _tags + self.get_id_info[_id].tags = _new_tags # Update metadata (version, update time): self._update_entry_metadata(_id) - @external def remove_id(_id: uint256) -> bool: """ @@ -263,7 +306,7 @@ def apply_transfer_ownership() -> bool: call to `commit_transfer_ownership` @return bool success """ - assert msg.sender == self.admin # dev: admin-only function + assert msg.sender in [self.admin, self.future_admin] # dev: admin-only function assert self.transfer_ownership_deadline != 0 # dev: transfer not active assert block.timestamp >= self.transfer_ownership_deadline # dev: now < deadline @@ -287,4 +330,9 @@ def revert_transfer_ownership() -> bool: self.transfer_ownership_deadline = 0 - return True \ No newline at end of file + return True + + +# TODO: Add remove_tags +# TODO: Add update_id that consolidates all updates into a single method. +# TODO: When removing an id, update id_tag_mapping From d557f6cc43bfa63c85d5436afbb756bab5808d5c Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Wed, 20 Mar 2024 09:34:08 +0100 Subject: [PATCH 08/19] remove id tag mapping when removing id; simplify admin transfer --- contracts/AddressProviderNG.vy | 35 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index dc049b3..84bf66d 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -16,7 +16,6 @@ event EntryModified: version: uint256 event CommitNewAdmin: - deadline: indexed(uint256) admin: indexed(address) event NewAdmin: @@ -32,7 +31,6 @@ struct AddressInfo: admin: public(address) -transfer_ownership_deadline: public(uint256) future_admin: public(address) num_entries: public(uint256) @@ -237,8 +235,7 @@ def update_tags(_id: uint256, _new_tags: DynArray[String[64], 20]): # Remove mapping if tag was removed: for _tag in _old_tags: key: bytes32 = keccak256(concat(uint2str(_id), _tag)) - if self.id_tag_mapping[key]: - self.id_tag_mapping[key] = False + self.id_tag_mapping[key] = False # Update tags: self.get_id_info[_id].tags = _new_tags @@ -259,16 +256,24 @@ def remove_id(_id: uint256) -> bool: assert msg.sender == self.admin # dev: admin-only function assert self.get_id_info[_id].addr != empty(address) # dev: inactive id + # Remove id > Tag mapping: + _tags: DynArray[String[64], 20] = self.get_id_info[_id].tags + for _tag in _tags: + key: bytes32 = keccak256(concat(uint2str(_id), _tag)) + self.id_tag_mapping[key] = False + + # Clear ID: self.get_id_info[_id].addr = empty(address) self.get_id_info[_id].last_modified = block.timestamp self.get_id_info[_id].description = '' self.get_id_info[_id].tags = [] self.get_id_info[_id].version = 0 - self.num_entries -= 1 - self.check_id_exists[_id] = False + # Reduce num entries: + self.num_entries -= 1 + # Emit 0 in version to notify removal of id: log EntryModified(_id, 0) @@ -287,13 +292,9 @@ def commit_transfer_ownership(_new_admin: address) -> bool: @return bool success """ assert msg.sender == self.admin # dev: admin-only function - assert self.transfer_ownership_deadline == 0 # dev: transfer already active - - deadline: uint256 = block.timestamp + 3*86400 - self.transfer_ownership_deadline = deadline self.future_admin = _new_admin - log CommitNewAdmin(deadline, _new_admin) + log CommitNewAdmin(_new_admin) return True @@ -302,17 +303,13 @@ def commit_transfer_ownership(_new_admin: address) -> bool: def apply_transfer_ownership() -> bool: """ @notice Finalize a transfer of contract ownership - @dev May only be called by the current owner, three days after a - call to `commit_transfer_ownership` + @dev May only be called by the next owner @return bool success """ - assert msg.sender in [self.admin, self.future_admin] # dev: admin-only function - assert self.transfer_ownership_deadline != 0 # dev: transfer not active - assert block.timestamp >= self.transfer_ownership_deadline # dev: now < deadline + assert msg.sender == self.future_admin # dev: admin-only function new_admin: address = self.future_admin self.admin = new_admin - self.transfer_ownership_deadline = 0 log NewAdmin(new_admin) @@ -327,12 +324,10 @@ def revert_transfer_ownership() -> bool: @return bool success """ assert msg.sender == self.admin # dev: admin-only function - - self.transfer_ownership_deadline = 0 + self.future_admin = empty(address) return True # TODO: Add remove_tags # TODO: Add update_id that consolidates all updates into a single method. -# TODO: When removing an id, update id_tag_mapping From 90245756b1607b683bf1178f272cf695ee5beed3 Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Wed, 20 Mar 2024 09:42:58 +0100 Subject: [PATCH 09/19] allow remove tags --- contracts/AddressProviderNG.vy | 45 +++++++++++++++++++++++++--------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index 84bf66d..450a093 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -112,10 +112,20 @@ def get_addresses_for_tags(_tag: String[64]) -> DynArray[address, 100]: # -------------------------- 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) + + @external def add_new_tags(_new_tags: DynArray[String[64], 20]): """ - @notice Add new tag + @notice Add new tags @dev method allows a max number of entry of 20 @param _new_tags An array of types to add to the registry e.g. ['StableSwap', 'CryptoSwap', ...] @@ -126,16 +136,6 @@ def add_new_tags(_new_tags: DynArray[String[64], 20]): self._tags.append(_new_tag) -@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) - - @external def add_new_id( _address: address, @@ -280,6 +280,27 @@ def remove_id(_id: uint256) -> bool: return True +@external +def remove_tags(_tags_to_remove: DynArray[String[64], 20]): + """ + @notice Remove tags and clear id > tag mappings. + @dev method allows a max number of entry of 20 + @param _tags_to_remove An array of types to removed from the registry + e.g. ['StableSwap', 'CryptoSwap', ...] + """ + + for _tag in _tags_to_remove: + + # Check if tag is valid + if self.check_tag_exists[_tag]: + + # Remove Tag + self.check_tag_exists[_tag] = False + + # Clear id > tag mapping: + for _id in self._ids: + self.id_tag_mapping[keccak256(concat(uint2str(_id), _tag))] = False + # ------------------------------ Admin Methods ------------------------------- @@ -329,5 +350,5 @@ def revert_transfer_ownership() -> bool: return True -# TODO: Add remove_tags # TODO: Add update_id that consolidates all updates into a single method. +# TODO: Separate tags away from AddressInfo \ No newline at end of file From 77f76b4eb254963c063526cb4e402348c49fa267 Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:04:59 +0100 Subject: [PATCH 10/19] update tags and id metadata when tags are removed --- contracts/AddressProviderNG.vy | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index 450a093..df0550f 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -301,6 +301,19 @@ def remove_tags(_tags_to_remove: DynArray[String[64], 20]): for _id in self._ids: self.id_tag_mapping[keccak256(concat(uint2str(_id), _tag))] = False + # Update tags per id: + for _id in self._ids: + _id_tags: DynArray[String[64], 20] = self.get_id_info[_id].tags + _new_tags: DynArray[String[64], 20] = [] + + for _id_tag in _id_tags: + if self.check_tag_exists[_id_tag]: + _new_tags.append(_id_tag) + + self.get_id_info[_id].tags = _new_tags + self._update_entry_metadata(_id) + + # ------------------------------ Admin Methods ------------------------------- From 8ae0dfe5292a065385d8317363b50efaf762ffba Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:17:46 +0100 Subject: [PATCH 11/19] added update_id method --- contracts/AddressProviderNG.vy | 52 +++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 4 deletions(-) diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index df0550f..af9d453 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -138,15 +138,15 @@ def add_new_tags(_new_tags: DynArray[String[64], 20]): @external def add_new_id( - _address: address, _id: uint256, + _address: address, _tags: DynArray[String[64], 20], _description: String[64], ): """ @notice Enter a new registry item - @param _address Address assigned to the _id @param _id Address assigned to the input _id + @param _address Address assigned to the _id @param _tags tags defining the entry. e.g. ['StableSwap', 'Factory'] Entry can have a maximum of 20 tags. Tags need to be added to the AddressProvider via `add_new_tags` before id can be added. @@ -181,6 +181,50 @@ def add_new_id( log NewEntry(_id, _address, _description) +@external +def update_id( + _id: uint256, + _new_address: address, + _new_tags: DynArray[String[64], 20], + _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_tags tags defining the entry. e.g. ['StableSwap', 'Factory'] + Entry can have a maximum of 20 tags. Tags need to be + added to the AddressProvider via `add_new_tags` before id can be added. + @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 + assert len(_new_tags) > 0 # dev: entry needs at least one tag + + # Update entry at _id: + self.get_id_info[_id].addr = _new_address + self.get_id_info[_id].description = _new_description + + # Update id > tag mapping + _old_tags: DynArray[String[64], 20] = self.get_id_info[_id].tags + for _tag in _new_tags: + assert self.check_tag_exists[_tag] # dev: unauthorised tag + key: bytes32 = keccak256(concat(uint2str(_id), _tag)) + if not self.id_tag_mapping[key]: + self.id_tag_mapping[key] = True + + # Remove mapping if tag was removed: + for _tag in _old_tags: + key: bytes32 = keccak256(concat(uint2str(_id), _tag)) + self.id_tag_mapping[key] = False + + # Update tags: + self.get_id_info[_id].tags = _new_tags + + # Update metadata (version, update time): + self._update_entry_metadata(_id) + + @external def update_address(_id: uint256, _address: address): """ @@ -289,6 +333,7 @@ def remove_tags(_tags_to_remove: DynArray[String[64], 20]): e.g. ['StableSwap', 'CryptoSwap', ...] """ + # Remove tags from mapping and invalidate each tag: for _tag in _tags_to_remove: # Check if tag is valid @@ -363,5 +408,4 @@ def revert_transfer_ownership() -> bool: return True -# TODO: Add update_id that consolidates all updates into a single method. -# TODO: Separate tags away from AddressInfo \ No newline at end of file +# TODO: Separate tags away from AddressInfo From 5f01e719ce888f39981bb7ca79b3c5ab0e91cf8c Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Wed, 3 Apr 2024 11:33:11 +0200 Subject: [PATCH 12/19] remove tagging (incorporating feedback) --- contracts/AddressProviderNG.vy | 168 ++------------------------------- 1 file changed, 6 insertions(+), 162 deletions(-) diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index af9d453..00c33af 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -4,6 +4,7 @@ @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. """ event NewEntry: @@ -15,6 +16,9 @@ event EntryModified: id: indexed(uint256) version: uint256 +event EntryRemoved: + id: indexed(uint256) + event CommitNewAdmin: admin: indexed(address) @@ -25,7 +29,6 @@ event NewAdmin: struct AddressInfo: addr: address description: String[256] - tags: DynArray[String[64], 20] version: uint256 last_modified: uint256 @@ -34,11 +37,8 @@ admin: public(address) future_admin: public(address) num_entries: public(uint256) -check_tag_exists: public(HashMap[String[64], bool]) check_id_exists: public(HashMap[uint256, bool]) _ids: DynArray[uint256, 1000] -_tags: DynArray[String[64], 1000] -id_tag_mapping: HashMap[bytes32, bool] get_id_info: public(HashMap[uint256, AddressInfo]) @@ -49,22 +49,6 @@ def __init__(_admin: address): # ------------------------------ View Methods -------------------------------- - -@view -@external -def tags() -> DynArray[String[64], 1000]: - """ - @notice Returns active tags registered in the AddressProvider. - @returns An array of tags. - """ - _tags: DynArray[String[64], 1000] = [] - for _tag in self._tags: - if self.check_tag_exists[_tag]: - _tags.append(_tag) - - return _tags - - @view @external def ids() -> DynArray[uint256, 1000]: @@ -92,23 +76,6 @@ def get_address(_id: uint256) -> address: return self.get_id_info[_id].addr -@view -@external -def get_addresses_for_tags(_tag: String[64]) -> DynArray[address, 100]: - """ - @notice Fetch all addresses that are tagged with `_tag` - @param _tag tag to fetch an address for - @return Array of addresses tagged with `_tag` - """ - - tagged_ids: DynArray[address, 100] = [] - for _id in self._ids: - if self.id_tag_mapping[keccak256(concat(uint2str(_id), _tag))]: - tagged_ids.append(self.get_id_info[_id].addr) - - return tagged_ids - - # -------------------------- State-Mutable Methods --------------------------- @@ -122,56 +89,29 @@ def _update_entry_metadata(_id: uint256): log EntryModified(_id, version) -@external -def add_new_tags(_new_tags: DynArray[String[64], 20]): - """ - @notice Add new tags - @dev method allows a max number of entry of 20 - @param _new_tags An array of types to add to the registry - e.g. ['StableSwap', 'CryptoSwap', ...] - """ - for _new_tag in _new_tags: - if not self.check_tag_exists[_new_tag]: - self.check_tag_exists[_new_tag] = True - self._tags.append(_new_tag) - - @external def add_new_id( _id: uint256, _address: address, - _tags: DynArray[String[64], 20], _description: String[64], ): """ @notice Enter a new registry item @param _id Address assigned to the input _id @param _address Address assigned to the _id - @param _tags tags defining the entry. e.g. ['StableSwap', 'Factory'] - Entry can have a maximum of 20 tags. Tags need to be - added to the AddressProvider via `add_new_tags` before id can be added. @param _description Human-readable description of the identifier """ assert msg.sender == self.admin # dev: admin-only function assert not self.check_id_exists[_id] # dev: id exists - assert len(_tags) > 0 # dev: entry needs at least one tag self.check_id_exists[_id] = True self._ids.append(_id) - # Check if tags are correct and add them to tag > id mapping: - for _tag in _tags: - assert self.check_tag_exists[_tag] # dev: unrecognised tag - self.id_tag_mapping[ - keccak256(concat(uint2str(_id), _tag)) - ] = True - # Add entry: self.get_id_info[_id] = AddressInfo( { addr: _address, description: _description, - tags: _tags, version: 1, last_modified: block.timestamp, } @@ -185,42 +125,21 @@ def add_new_id( def update_id( _id: uint256, _new_address: address, - _new_tags: DynArray[String[64], 20], _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_tags tags defining the entry. e.g. ['StableSwap', 'Factory'] - Entry can have a maximum of 20 tags. Tags need to be - added to the AddressProvider via `add_new_tags` before id can be added. @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 - assert len(_new_tags) > 0 # dev: entry needs at least one tag # Update entry at _id: self.get_id_info[_id].addr = _new_address self.get_id_info[_id].description = _new_description - # Update id > tag mapping - _old_tags: DynArray[String[64], 20] = self.get_id_info[_id].tags - for _tag in _new_tags: - assert self.check_tag_exists[_tag] # dev: unauthorised tag - key: bytes32 = keccak256(concat(uint2str(_id), _tag)) - if not self.id_tag_mapping[key]: - self.id_tag_mapping[key] = True - - # Remove mapping if tag was removed: - for _tag in _old_tags: - key: bytes32 = keccak256(concat(uint2str(_id), _tag)) - self.id_tag_mapping[key] = False - - # Update tags: - self.get_id_info[_id].tags = _new_tags - # Update metadata (version, update time): self._update_entry_metadata(_id) @@ -258,36 +177,6 @@ def update_description(_id: uint256, _description: String[256]): self._update_entry_metadata(_id) -@external -def update_tags(_id: uint256, _new_tags: DynArray[String[64], 20]): - """ - @notice Update tags for an existing _id - @param _id Identifier to set the new description for - @param _new_tags New tags to set to - """ - assert msg.sender == self.admin # dev: admin-only function - assert self.get_id_info[_id].addr != empty(address) # dev: id is empty - - # Add mapping if new tag is added: - _old_tags: DynArray[String[64], 20] = self.get_id_info[_id].tags - for _tag in _new_tags: - assert self.check_tag_exists[_tag] # dev: unauthorised tag - key: bytes32 = keccak256(concat(uint2str(_id), _tag)) - if not self.id_tag_mapping[key]: - self.id_tag_mapping[key] = True - - # Remove mapping if tag was removed: - for _tag in _old_tags: - key: bytes32 = keccak256(concat(uint2str(_id), _tag)) - self.id_tag_mapping[key] = False - - # Update tags: - self.get_id_info[_id].tags = _new_tags - - # Update metadata (version, update time): - self._update_entry_metadata(_id) - - @external def remove_id(_id: uint256) -> bool: """ @@ -300,17 +189,10 @@ def remove_id(_id: uint256) -> bool: assert msg.sender == self.admin # dev: admin-only function assert self.get_id_info[_id].addr != empty(address) # dev: inactive id - # Remove id > Tag mapping: - _tags: DynArray[String[64], 20] = self.get_id_info[_id].tags - for _tag in _tags: - key: bytes32 = keccak256(concat(uint2str(_id), _tag)) - self.id_tag_mapping[key] = False - # Clear ID: self.get_id_info[_id].addr = empty(address) - self.get_id_info[_id].last_modified = block.timestamp + self.get_id_info[_id].last_modified = 0 self.get_id_info[_id].description = '' - self.get_id_info[_id].tags = [] self.get_id_info[_id].version = 0 self.check_id_exists[_id] = False @@ -319,46 +201,11 @@ def remove_id(_id: uint256) -> bool: self.num_entries -= 1 # Emit 0 in version to notify removal of id: - log EntryModified(_id, 0) + log EntryRemoved(_id) return True -@external -def remove_tags(_tags_to_remove: DynArray[String[64], 20]): - """ - @notice Remove tags and clear id > tag mappings. - @dev method allows a max number of entry of 20 - @param _tags_to_remove An array of types to removed from the registry - e.g. ['StableSwap', 'CryptoSwap', ...] - """ - - # Remove tags from mapping and invalidate each tag: - for _tag in _tags_to_remove: - - # Check if tag is valid - if self.check_tag_exists[_tag]: - - # Remove Tag - self.check_tag_exists[_tag] = False - - # Clear id > tag mapping: - for _id in self._ids: - self.id_tag_mapping[keccak256(concat(uint2str(_id), _tag))] = False - - # Update tags per id: - for _id in self._ids: - _id_tags: DynArray[String[64], 20] = self.get_id_info[_id].tags - _new_tags: DynArray[String[64], 20] = [] - - for _id_tag in _id_tags: - if self.check_tag_exists[_id_tag]: - _new_tags.append(_id_tag) - - self.get_id_info[_id].tags = _new_tags - self._update_entry_metadata(_id) - - # ------------------------------ Admin Methods ------------------------------- @@ -406,6 +253,3 @@ def revert_transfer_ownership() -> bool: self.future_admin = empty(address) return True - - -# TODO: Separate tags away from AddressInfo From e47073bc97b738bfb7bf6b42c97bded0a585210f Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:06:27 +0200 Subject: [PATCH 13/19] gathering addresses ... --- scripts/deploy_addressprovider_and_setup.py | 191 ++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 scripts/deploy_addressprovider_and_setup.py diff --git a/scripts/deploy_addressprovider_and_setup.py b/scripts/deploy_addressprovider_and_setup.py new file mode 100644 index 0000000..8c72be9 --- /dev/null +++ b/scripts/deploy_addressprovider_and_setup.py @@ -0,0 +1,191 @@ +""" +Sets up the metaregistry. + +Usage for fork mode: + scripts/setup_metaregistry.py + requires the RPC_ETHEREUM environment variable to be set +Usage for prod mode: + scripts/setup_metaregistry.py --prod + requires the URL and ACCOUNT environment variables to be set +""" +import sys + +import boa +from rich.console import Console as RichConsole + +# This is the layout as of deploying the new addressprovider. +# The key is _id, the value is _description +ADDRESS_PROVIDER_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", +} + +# These are the addresses that will go into the addressprovider for each chain: + +addresses = { + "ethereum": { + 0: "0x90E00ACe148ca3b23Ac1bC8C240C2a7Dd9c2d7f5", + 1: "0xe64608E223433E8a03a1DaaeFD8Cb638C14B552C", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0xB9fC157394Af804a3578134A6585C0dc9cc990d4", + 4: "0xA464e6DCda8AC41e03616F95f4BC98a13b8922Dc", + 5: "0x8F942C20D02bEfc377D41445793068908E2250D0", + 6: "0xF18056Bbd320E96A48e3Fbf8bC061322531aac99", + 7: "0xF98B45FA17DE75FB1aD0e7aFD971b0ca00e379fC", + 8: "0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d", + 11: "0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963", # Tricrypto NG + 12: "0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf", # Stableswap NG + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", # Twocrypto NG + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 16: "0xc9332fdcb1c491dcc683bae86fe3cb70360738bc", # call controllerFactory.amm(id) to get AMM address + 17: "0xeA6876DDE9e3467564acBeE1Ed5bac88783205E0", # same as (16) + }, + "arbitrum": { + 0: "0x445FE580eF8d70FF569aB36e80c647af338db351", + 1: "0x78CF256256C8089d68Cde634Cf7cDEFb39286470", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0xb17b674D9c5CB2e441F8e196a2f048A81355d031", + 4: "0xd4F94D0aaa640BBb72b5EEc2D85F6D114D81a88E", + 5: "0x0E9fBb167DF83EdE3240D6a5fa5d40c6C6851e15", + 11: "0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8", + 12: "0x9AF14D26075f142eb3F292D5065EB3faa646167b", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 17: "0xcaEC110C784c9DF37240a8Ce096D352A75922DeA", + }, + "optimism": { + 0: "0xC5cfaDA84E902aD92DD40194f0883ad49639b023", + 1: "0x54e8A25d0Ac0E4945b697C80b8372445FEA17A62", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0x2db0E83599a91b508Ac268a6197b8B14F5e72840", + 4: "0xbF7E49483881C76487b0989CD7d9A8239B20CA41", + 5: "0x7DA64233Fefb352f8F501B357c018158ED8aA455", + 11: "0xc6C09471Ee39C7E30a067952FcC89c8922f9Ab53", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + }, + "polygon": { + 0: "0x094d12e5b541784701FD8d65F11fc0598FBC6332", + 1: "0x7544Fe3d184b6B55D6B36c3FCA1157eE0Ba30287", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0x722272D36ef0Da72FF51c5A65Db7b870E2e8D4ee", + 4: "0x774D1Dba98cfBD1F2Bc3A1F59c494125e07C48F9", + 5: "0x47bB542B9dE58b970bA50c9dae444DDB4c16751a", + 6: "0xE5De15A9C9bBedb4F5EC13B131E61245f2983A69", + 11: "0xC1b393EfEF38140662b91441C6710Aa704973228", # Tricrypto NG + 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + }, + "base": { + 2: "0xd6681e74eEA20d196c15038C580f721EF2aB6320", + 3: "0x3093f9B57A428F3EB6285a589cb35bEA6e78c336", + 4: "0xe8269B33E47761f552E1a3070119560d5fa8bBD6", + 6: "0x5EF72230578b3e399E6C6F4F6360edF95e83BBfd", + 11: "0xA5961898870943c68037F6848d2D866Ed2016bcB", + 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", + 13: "0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F", + 14: "0x5552b631e2aD801fAa129Aacf4B701071cC9D1f7", + 15: "0xEfadDdE5B43917CcC738AdE6962295A0B343f7CE", + }, + "fraxtal": { + 2: "0x4f37A9d177470499A2dD084621020b023fcffc1F", + 4: "0x8b3EFBEfa6eD222077455d6f0DCdA3bF4f3F57A6", + 11: "0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F", + 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0x69522fb5337663d3B4dFB0030b881c1A750Adb4f", + }, + "linea": { + 11: "0xd125E7a0cEddF89c6473412d85835450897be6Dc", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, + "mantle": { + 11: "0x0C9D8c7e486e822C29488Ff51BFf0167B4650953", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, + "scroll": { + 11: "0xC1b393EfEF38140662b91441C6710Aa704973228", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, + "pzkevm": { + 11: "0x76303e4fDcA0AbF28aB3ee42Ce086E6503431F1D", + 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, + "bsc": { + 11: "0x38f8D93406fA2d9924DcFcB67dB5B0521Fb20F7D", + 12: "0xd7E72f3615aa65b92A4DBdC211E296a35512988B", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0x0fE38dCC905eC14F6099a83Ac5C93BF2601300CF", + 15: "0xd6681e74eEA20d196c15038C580f721EF2aB6320", + }, + "gnosis": { + 11: "0xb47988ad49dce8d909c6f9cf7b26caf04e1445c8", + 12: "0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + }, + "fantom": { + 11: "0x9AF14D26075f142eb3F292D5065EB3faa646167b", + 12: "0xe61Fb97Ef6eBFBa12B36Ffd7be785c1F5A2DE66b", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + }, + "avax": { + 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", + 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + }, + "aurora": { + 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + }, + "celo": { + 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", + 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + }, + "kava": { + 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", + 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + }, +} From a1ed312a7f83bd60b6f880987d23a0cbee887307 Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Wed, 3 Apr 2024 17:07:58 +0200 Subject: [PATCH 14/19] add todo --- .gitignore | 2 +- contracts/AddressProviderNG.vy | 4 ++-- scripts/deploy_addressprovider_and_setup.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 40b609c..173eb82 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,4 @@ bvenv/ .env .hypothesis/ .gz -.json.gz \ No newline at end of file +.json.gz diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index 00c33af..2e9f1b5 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -92,7 +92,7 @@ def _update_entry_metadata(_id: uint256): @external def add_new_id( _id: uint256, - _address: address, + _address: address, _description: String[64], ): """ @@ -124,7 +124,7 @@ def add_new_id( @external def update_id( _id: uint256, - _new_address: address, + _new_address: address, _new_description: String[64], ): """ diff --git a/scripts/deploy_addressprovider_and_setup.py b/scripts/deploy_addressprovider_and_setup.py index 8c72be9..16bd53e 100644 --- a/scripts/deploy_addressprovider_and_setup.py +++ b/scripts/deploy_addressprovider_and_setup.py @@ -35,6 +35,7 @@ 16: "LLAMMA Factory crvUSD", 17: "LLAMMA Factory OneWayLending", 18: "Rate Provider", + # TODO: add DAO-related contracts, CRV token per chain, gauge factories, ... } # These are the addresses that will go into the addressprovider for each chain: @@ -53,7 +54,7 @@ 11: "0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963", # Tricrypto NG 12: "0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf", # Stableswap NG 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", # Twocrypto NG - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", 16: "0xc9332fdcb1c491dcc683bae86fe3cb70360738bc", # call controllerFactory.amm(id) to get AMM address 17: "0xeA6876DDE9e3467564acBeE1Ed5bac88783205E0", # same as (16) From 2d5c309bc5a11c9d20bee68ec14665dddbbbfafe Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Wed, 3 Apr 2024 23:11:21 +0200 Subject: [PATCH 15/19] wip --- scripts/deploy_addressprovider_and_setup.py | 94 +++++++++++++-------- 1 file changed, 58 insertions(+), 36 deletions(-) diff --git a/scripts/deploy_addressprovider_and_setup.py b/scripts/deploy_addressprovider_and_setup.py index 16bd53e..7af754e 100644 --- a/scripts/deploy_addressprovider_and_setup.py +++ b/scripts/deploy_addressprovider_and_setup.py @@ -1,18 +1,3 @@ -""" -Sets up the metaregistry. - -Usage for fork mode: - scripts/setup_metaregistry.py - requires the RPC_ETHEREUM environment variable to be set -Usage for prod mode: - scripts/setup_metaregistry.py --prod - requires the URL and ACCOUNT environment variables to be set -""" -import sys - -import boa -from rich.console import Console as RichConsole - # This is the layout as of deploying the new addressprovider. # The key is _id, the value is _description ADDRESS_PROVIDER_MAPPING = { @@ -56,7 +41,7 @@ 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", # Twocrypto NG 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - 16: "0xc9332fdcb1c491dcc683bae86fe3cb70360738bc", # call controllerFactory.amm(id) to get AMM address + 16: "0xc9332fdcb1c491dcc683bae86fe3cb70360738bc", # call controllerFactory.amm(id) 17: "0xeA6876DDE9e3467564acBeE1Ed5bac88783205E0", # same as (16) }, "arbitrum": { @@ -120,27 +105,11 @@ 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0x69522fb5337663d3B4dFB0030b881c1A750Adb4f", }, - "linea": { - 11: "0xd125E7a0cEddF89c6473412d85835450897be6Dc", - 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - }, - "mantle": { - 11: "0x0C9D8c7e486e822C29488Ff51BFf0167B4650953", - 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - }, - "scroll": { - 11: "0xC1b393EfEF38140662b91441C6710Aa704973228", - 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - }, - "pzkevm": { - 11: "0x76303e4fDcA0AbF28aB3ee42Ce086E6503431F1D", - 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - }, "bsc": { + 2: "0x69522fb5337663d3B4dFB0030b881c1A750Adb4f", + 3: "0xEfDE221f306152971D8e9f181bFe998447975810", + 4: "0x98B4029CaBEf7Fd525A36B0BF8555EC1d42ec0B6", + 6: "0xBd5fBd2FA58cB15228a9Abdac9ec994f79E3483C", 11: "0x38f8D93406fA2d9924DcFcB67dB5B0521Fb20F7D", 12: "0xd7E72f3615aa65b92A4DBdC211E296a35512988B", 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", @@ -148,6 +117,12 @@ 15: "0xd6681e74eEA20d196c15038C580f721EF2aB6320", }, "gnosis": { + 0: "0x55e91365697eb8032f98290601847296ec847210", + 1: "0xf1755aadb82dc7a45ab4e754f67412dc75576dc7", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0xd19baeadc667cf2015e395f2b08668ef120f41f5", + 4: "0xB055EbbAcc8Eefc166c169e9Ce2886D0406aB49b", + 5: "0x8a4694401be8f8fccbc542a3219af1591f87ce17", 11: "0xb47988ad49dce8d909c6f9cf7b26caf04e1445c8", 12: "0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8", 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", @@ -155,6 +130,12 @@ 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", }, "fantom": { + 0: "0x0f854EA9F38ceA4B1c2FC79047E9D0134419D5d6", + 1: "0x8cC6e2144906e81F496429A1590Ef5f86bb7558f", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0x686d67265703d1f124c45e33d47d794c566889ba", + 4: "0x2B039565B2b7a1A9192D4847fbd33B25b836B950", + 5: "0x4fb93D7d320E8A263F22f62C2059dFC2A8bCbC4c", 11: "0x9AF14D26075f142eb3F292D5065EB3faa646167b", 12: "0xe61Fb97Ef6eBFBa12B36Ffd7be785c1F5A2DE66b", 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", @@ -162,6 +143,11 @@ 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", }, "avax": { + 0: "0x8474DdbE98F5aA3179B3B3F5942D724aFcdec9f6", + 1: "0xADf698e4d8Df08b3E2c79682891636eF00F6e205", + 2: "0xBff334F8D5912AC5c4f2c590A2396d1C5d990123", + 3: "0xb17b674D9c5CB2e441F8e196a2f048A81355d031", + 4: "0x06534b0BF7Ff378F162d4F348390BDA53b15fA35", 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", @@ -169,6 +155,10 @@ 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", }, "aurora": { + 0: "0x5b5cfe992adac0c9d48e05854b2d91c73a003858", + 1: "0x0f9cb53ebe405d49a0bbdbd291a65ff571bc83e1", + 2: "0x6600e98b71dabfd4a8cac03b302b0189adb86afb", + 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", @@ -176,6 +166,8 @@ 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", }, "celo": { + 3: "0x5277A0226d10392295E8D383E9724D6E416d6e6C", + 4: "0x56bc95Ded2BEF162131905dfd600F2b9F1B380a4", 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", @@ -183,10 +175,40 @@ 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", }, "kava": { + 0: "0xc1C49622b63B961ce1D352ecb7D8261Ab5556695", + 1: "0x4244eB811D6e0Ef302326675207A95113dB4E1F8", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0x40bc62805471eF53DdD5C5cF99ed3d9e5aa81b48", + 4: "0x1f0e8445Ebe0D0F60A96A7cd5BB095533cb15B58", 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", }, + # No UI: + "linea": { + 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", + 11: "0xd125E7a0cEddF89c6473412d85835450897be6Dc", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, + "mantle": { + 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", + 11: "0x0C9D8c7e486e822C29488Ff51BFf0167B4650953", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, + "scroll": { + 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", + 11: "0xC1b393EfEF38140662b91441C6710Aa704973228", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, + "pzkevm": { + 4: "0x8b3EFBEfa6eD222077455d6f0DCdA3bF4f3F57A6", + 11: "0x76303e4fDcA0AbF28aB3ee42Ce086E6503431F1D", + 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, } From cfcff77e899e119e2ac2228b94d753d157f06ffe Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:49:54 +0200 Subject: [PATCH 16/19] add dao and gauge related addresses --- scripts/deploy_addressprovider_and_setup.py | 63 ++++++++++++++++++++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git a/scripts/deploy_addressprovider_and_setup.py b/scripts/deploy_addressprovider_and_setup.py index 7af754e..2c0533d 100644 --- a/scripts/deploy_addressprovider_and_setup.py +++ b/scripts/deploy_addressprovider_and_setup.py @@ -20,7 +20,12 @@ 16: "LLAMMA Factory crvUSD", 17: "LLAMMA Factory OneWayLending", 18: "Rate Provider", - # TODO: add DAO-related contracts, CRV token per chain, gauge factories, ... + 19: "CRV Token", + 20: "Gauge Factory", + 21: "Ownership Admin", + 22: "Parameter Admin", + 23: "Emergency Admin", + 24: "DAO Vault", # Holds funds } # These are the addresses that will go into the addressprovider for each chain: @@ -43,6 +48,10 @@ 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", 16: "0xc9332fdcb1c491dcc683bae86fe3cb70360738bc", # call controllerFactory.amm(id) 17: "0xeA6876DDE9e3467564acBeE1Ed5bac88783205E0", # same as (16) + 19: "0xD533a949740bb3306d119CC777fa900bA034cd52", + 21: "0x40907540d8a6C65c637785e8f8B742ae6b0b9968", # CurveDAO Ownership Agent + 22: "0x4eeb3ba4f221ca16ed4a0cc7254e2e32df948c5f", # CurveDAO Parameter Agent + 23: "0x00669DF67E4827FCc0E48A1838a8d5AB79281909", # CurveDAO Emergency Agent }, "arbitrum": { 0: "0x445FE580eF8d70FF569aB36e80c647af338db351", @@ -57,6 +66,12 @@ 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", 17: "0xcaEC110C784c9DF37240a8Ce096D352A75922DeA", + 19: "0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + 21: "0x452030a5D962d37D97A9D65487663cD5fd9C2B32", + 22: "0x5ccbB27FB594c5cF6aC0670bbcb360c0072F6839", + 23: "0x2CB6E1Adf22Af1A38d7C3370441743a123991EC3", + 24: "0x25877b9413Cc7832A6d142891b50bd53935feF82", }, "optimism": { 0: "0xC5cfaDA84E902aD92DD40194f0883ad49639b023", @@ -70,6 +85,12 @@ 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 19: "0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + 21: "0x28c4A1Fa47EEE9226F8dE7D6AF0a41C62Ca98267", + 22: "0xE7F2B72E94d1c2497150c24EA8D65aFFf1027b9b", + 23: "0x9fF1ddE4BE9BbD891836863d227248047B3D881b", + 24: "0xD166EEdf272B860E991d331B71041799379185D5", }, "polygon": { 0: "0x094d12e5b541784701FD8d65F11fc0598FBC6332", @@ -84,6 +105,11 @@ 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 19: "0x172370d5cd63279efa6d502dab29171933a610af", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + 21: "0x8cB05bFEd65b522a7cF98d590F1711A9Db43af71", + 22: "0x3CF7c393519ea55D1E1F2c55a6395be63b1A9F9C", + 23: "0x9FD6E204e08867170ddE54a8374083fF592eBD3E", }, "base": { 2: "0xd6681e74eEA20d196c15038C580f721EF2aB6320", @@ -95,6 +121,12 @@ 13: "0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F", 14: "0x5552b631e2aD801fAa129Aacf4B701071cC9D1f7", 15: "0xEfadDdE5B43917CcC738AdE6962295A0B343f7CE", + 19: "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + 21: "0x2c163fe0f079d138b9c04f780d735289344C8B80", + 22: "0x7Ea4B72f04D8B02994F4EdB171Ce5F56eEdF457F", + 23: "0x95F0f720CAdDED982E6998b3390E6D3788c2CE5C", + 24: "0xA4c0eA0fb8eb652e11C8123E589197E18Ca78AA8", }, "fraxtal": { 2: "0x4f37A9d177470499A2dD084621020b023fcffc1F", @@ -104,6 +136,8 @@ 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0x69522fb5337663d3B4dFB0030b881c1A750Adb4f", + 19: "0x331B9182088e2A7d6D3Fe4742AbA1fB231aEcc56", + 20: "0xeF672bD94913CB6f1d2812a6e18c1fFdEd8eFf5c", }, "bsc": { 2: "0x69522fb5337663d3B4dFB0030b881c1A750Adb4f", @@ -115,6 +149,12 @@ 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", 14: "0x0fE38dCC905eC14F6099a83Ac5C93BF2601300CF", 15: "0xd6681e74eEA20d196c15038C580f721EF2aB6320", + 19: "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415", + 20: "0xDb205f215f568ADf21b9573b62566f6d9a40bed6", + 21: "0xC97E2328c5701572C0DFB199b9f860d6ccD74199", + 22: "0x618a38a556B66FdDdcB5495Be412Df911D18eA1d", + 23: "0xC940CE179f1F1bdC1EA1c02A2d0481bfD84C3280", + 24: "0x44C927BacD65da570cB1F0A2F625367049525022", }, "gnosis": { 0: "0x55e91365697eb8032f98290601847296ec847210", @@ -128,6 +168,8 @@ 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 19: "0x712b3d230f3c1c19db860d80619288b1f0bdd0bd", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", }, "fantom": { 0: "0x0f854EA9F38ceA4B1c2FC79047E9D0134419D5d6", @@ -141,6 +183,12 @@ 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 19: "0x1E4F97b9f9F913c46F1632781732927B9019C68b", + 20: "0xDb205f215f568ADf21b9573b62566f6d9a40bed6", + 21: "0xd62Ade30F740de7ef766008258B4b2F574A084F7", + 22: "0x837814ba42c6f3B39f0A5060168F7027695DDAb1", + 23: "0x42113C6818ACb87ca3CaFDbBc6a6ae396f1548E6", + 24: "0x49C8De2D10C9A56DD9A59ab5Ca1216111276394C", }, "avax": { 0: "0x8474DdbE98F5aA3179B3B3F5942D724aFcdec9f6", @@ -153,6 +201,11 @@ 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 20: "0xDb205f215f568ADf21b9573b62566f6d9a40bed6", + 21: "0xeD953C2849785A8AEd7bC2ee8cf5fdE776E1Dc07", + 22: "0x33F9A2F3B85e7D4Ff4f9286a9a8525060100D855", + 23: "0x1309DB123020F0533aFAfaF11D26286d5871bEB0", + 24: "0xad422855ac8010f82F08696CA7750EfE061aa6D6", }, "aurora": { 0: "0x5b5cfe992adac0c9d48e05854b2d91c73a003858", @@ -185,6 +238,10 @@ 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + 21: "0xeC6a886148B38C233B07cc6732142dccaBF1051D", + 22: "0x6e53131F68a034873b6bFA15502aF094Ef0c5854", + 23: "0xA177D2bd2BD723878bD95982c0855291953f74C9", }, # No UI: "linea": { @@ -198,6 +255,10 @@ 11: "0x0C9D8c7e486e822C29488Ff51BFf0167B4650953", 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 21: "0xfe87a6cdca1eeb90987c6a196a1c5f5c76f5f2b0", + 22: "0x024d362f7aa162d8591304016fd60a209efc527e", + 23: "0x4339b53cf7f6eec1a997ceea81165e45c1244429", + 24: "0x77A214bd4ee3650e5608339BBbE04b09f5546ECF", }, "scroll": { 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", From 9faa0b689e8016354fa07edeaa33e94f7c56e03f Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Tue, 9 Apr 2024 11:44:23 +0200 Subject: [PATCH 17/19] deploy addressprovider --- abi/create2deployer.json | 218 ++++++++++++ contracts/AddressProviderNG.vy | 139 ++++++-- scripts/address_provider_constants.py | 275 +++++++++++++++ scripts/deploy_addressprovider_and_setup.py | 361 +++++--------------- 4 files changed, 693 insertions(+), 300 deletions(-) create mode 100644 abi/create2deployer.json create mode 100644 scripts/address_provider_constants.py diff --git a/abi/create2deployer.json b/abi/create2deployer.json new file mode 100644 index 0000000..27f4869 --- /dev/null +++ b/abi/create2deployer.json @@ -0,0 +1,218 @@ +[ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "codeHash", + "type": "bytes32" + } + ], + "name": "computeAddress", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "codeHash", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "deployer", + "type": "address" + } + ], + "name": "computeAddressWithDeployer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "pure", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "code", + "type": "bytes" + } + ], + "name": "deploy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + } + ], + "name": "deployERC1820Implementer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address payable", + "name": "payoutAddress", + "type": "address" + } + ], + "name": "killCreate2Deployer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ] diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index 2e9f1b5..17f33f3 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -1,10 +1,37 @@ -# @version 0.3.10 +# 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: @@ -43,8 +70,8 @@ get_id_info: public(HashMap[uint256, AddressInfo]) @external -def __init__(_admin: address): - self.admin = _admin +def __init__(): + self.admin = tx.origin # ------------------------------ View Methods -------------------------------- @@ -89,19 +116,35 @@ def _update_entry_metadata(_id: uint256): log EntryModified(_id, version) -@external -def add_new_id( +@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], + _description: String[64] ): - """ - @notice Enter a new registry item - @param _id Address assigned to the input _id - @param _address Address assigned to the _id - @param _description Human-readable description of the identifier - """ - assert msg.sender == self.admin # dev: admin-only function + assert not self.check_id_exists[_id] # dev: id exists self.check_id_exists[_id] = True @@ -121,6 +164,49 @@ def add_new_id( 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, @@ -152,6 +238,7 @@ def update_address(_id: uint256, _address: address): @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 @@ -168,7 +255,7 @@ def update_description(_id: uint256, _description: String[256]): @param _description New description to set """ assert msg.sender == self.admin # dev: admin-only function - assert self.get_id_info[_id].addr != empty(address) # dev: id is empty + assert self.check_id_exists[_id] # dev: id does not exist # Update description: self.get_id_info[_id].description = _description @@ -181,27 +268,25 @@ def update_description(_id: uint256, _description: String[256]): def remove_id(_id: uint256) -> bool: """ @notice Unset an existing identifier - @dev An identifier cannot ever be removed, it can only have the - address unset so that it returns empty(address) @param _id Identifier to unset @return bool success """ assert msg.sender == self.admin # dev: admin-only function - assert self.get_id_info[_id].addr != empty(address) # dev: inactive id - # 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 + return self._remove_id(_id) - self.check_id_exists[_id] = False - # Reduce num entries: - self.num_entries -= 1 +@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 - # Emit 0 in version to notify removal of id: - log EntryRemoved(_id) + for _id in _ids: + assert self._remove_id(_id) return True diff --git a/scripts/address_provider_constants.py b/scripts/address_provider_constants.py new file mode 100644 index 0000000..b610d7b --- /dev/null +++ b/scripts/address_provider_constants.py @@ -0,0 +1,275 @@ +# This is the layout as of deploying the new addressprovider. +# The key is _id, the value is _description +ADDRESS_PROVIDER_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: "Spot Rate Provider", + 19: "CRV Token", + 20: "Gauge Factory", + 21: "Ownership Admin", + 22: "Parameter Admin", + 23: "Emergency Admin", + 24: "CurveDAO Vault", # Holds funds +} + +# These are the addresses that will go into the addressprovider for each chain: + +addresses = { + "ethereum": { + 0: "0x90E00ACe148ca3b23Ac1bC8C240C2a7Dd9c2d7f5", + 1: "0xe64608E223433E8a03a1DaaeFD8Cb638C14B552C", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0xB9fC157394Af804a3578134A6585C0dc9cc990d4", + 4: "0xA464e6DCda8AC41e03616F95f4BC98a13b8922Dc", + 5: "0x8F942C20D02bEfc377D41445793068908E2250D0", + 6: "0xF18056Bbd320E96A48e3Fbf8bC061322531aac99", + 7: "0xF98B45FA17DE75FB1aD0e7aFD971b0ca00e379fC", + 8: "0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d", + 11: "0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963", # Tricrypto NG + 12: "0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf", # Stableswap NG + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", # Twocrypto NG + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 16: "0xc9332fdcb1c491dcc683bae86fe3cb70360738bc", # call controllerFactory.amm(id) + 17: "0xeA6876DDE9e3467564acBeE1Ed5bac88783205E0", # same as (16) + 19: "0xD533a949740bb3306d119CC777fa900bA034cd52", + 21: "0x40907540d8a6C65c637785e8f8B742ae6b0b9968", # CurveDAO Ownership Agent + 22: "0x4eeb3ba4f221ca16ed4a0cc7254e2e32df948c5f", # CurveDAO Parameter Agent + 23: "0x00669DF67E4827FCc0E48A1838a8d5AB79281909", # CurveDAO Emergency Agent + }, + "arbitrum": { + 0: "0x445FE580eF8d70FF569aB36e80c647af338db351", + 1: "0x78CF256256C8089d68Cde634Cf7cDEFb39286470", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0xb17b674D9c5CB2e441F8e196a2f048A81355d031", + 4: "0xd4F94D0aaa640BBb72b5EEc2D85F6D114D81a88E", + 5: "0x0E9fBb167DF83EdE3240D6a5fa5d40c6C6851e15", + 11: "0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8", + 12: "0x9AF14D26075f142eb3F292D5065EB3faa646167b", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 17: "0xcaEC110C784c9DF37240a8Ce096D352A75922DeA", + 19: "0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + 21: "0x452030a5D962d37D97A9D65487663cD5fd9C2B32", + 22: "0x5ccbB27FB594c5cF6aC0670bbcb360c0072F6839", + 23: "0x2CB6E1Adf22Af1A38d7C3370441743a123991EC3", + 24: "0x25877b9413Cc7832A6d142891b50bd53935feF82", + }, + "optimism": { + 0: "0xC5cfaDA84E902aD92DD40194f0883ad49639b023", + 1: "0x54e8A25d0Ac0E4945b697C80b8372445FEA17A62", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0x2db0E83599a91b508Ac268a6197b8B14F5e72840", + 4: "0xbF7E49483881C76487b0989CD7d9A8239B20CA41", + 5: "0x7DA64233Fefb352f8F501B357c018158ED8aA455", + 11: "0xc6C09471Ee39C7E30a067952FcC89c8922f9Ab53", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 19: "0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + 21: "0x28c4A1Fa47EEE9226F8dE7D6AF0a41C62Ca98267", + 22: "0xE7F2B72E94d1c2497150c24EA8D65aFFf1027b9b", + 23: "0x9fF1ddE4BE9BbD891836863d227248047B3D881b", + 24: "0xD166EEdf272B860E991d331B71041799379185D5", + }, + "polygon": { + 0: "0x094d12e5b541784701FD8d65F11fc0598FBC6332", + 1: "0x7544Fe3d184b6B55D6B36c3FCA1157eE0Ba30287", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0x722272D36ef0Da72FF51c5A65Db7b870E2e8D4ee", + 4: "0x774D1Dba98cfBD1F2Bc3A1F59c494125e07C48F9", + 5: "0x47bB542B9dE58b970bA50c9dae444DDB4c16751a", + 6: "0xE5De15A9C9bBedb4F5EC13B131E61245f2983A69", + 11: "0xC1b393EfEF38140662b91441C6710Aa704973228", # Tricrypto NG + 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 19: "0x172370d5cd63279efa6d502dab29171933a610af", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + 21: "0x8cB05bFEd65b522a7cF98d590F1711A9Db43af71", + 22: "0x3CF7c393519ea55D1E1F2c55a6395be63b1A9F9C", + 23: "0x9FD6E204e08867170ddE54a8374083fF592eBD3E", + }, + "base": { + 2: "0xd6681e74eEA20d196c15038C580f721EF2aB6320", + 3: "0x3093f9B57A428F3EB6285a589cb35bEA6e78c336", + 4: "0xe8269B33E47761f552E1a3070119560d5fa8bBD6", + 6: "0x5EF72230578b3e399E6C6F4F6360edF95e83BBfd", + 11: "0xA5961898870943c68037F6848d2D866Ed2016bcB", + 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", + 13: "0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F", + 14: "0x5552b631e2aD801fAa129Aacf4B701071cC9D1f7", + 15: "0xEfadDdE5B43917CcC738AdE6962295A0B343f7CE", + 19: "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + 21: "0x2c163fe0f079d138b9c04f780d735289344C8B80", + 22: "0x7Ea4B72f04D8B02994F4EdB171Ce5F56eEdF457F", + 23: "0x95F0f720CAdDED982E6998b3390E6D3788c2CE5C", + 24: "0xA4c0eA0fb8eb652e11C8123E589197E18Ca78AA8", + }, + "fraxtal": { + 2: "0x4f37A9d177470499A2dD084621020b023fcffc1F", + 4: "0x8b3EFBEfa6eD222077455d6f0DCdA3bF4f3F57A6", + 11: "0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F", + 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0x69522fb5337663d3B4dFB0030b881c1A750Adb4f", + 19: "0x331B9182088e2A7d6D3Fe4742AbA1fB231aEcc56", + 20: "0xeF672bD94913CB6f1d2812a6e18c1fFdEd8eFf5c", + }, + "bsc": { + 2: "0x69522fb5337663d3B4dFB0030b881c1A750Adb4f", + 3: "0xEfDE221f306152971D8e9f181bFe998447975810", + 4: "0x98B4029CaBEf7Fd525A36B0BF8555EC1d42ec0B6", + 6: "0xBd5fBd2FA58cB15228a9Abdac9ec994f79E3483C", + 11: "0x38f8D93406fA2d9924DcFcB67dB5B0521Fb20F7D", + 12: "0xd7E72f3615aa65b92A4DBdC211E296a35512988B", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0x0fE38dCC905eC14F6099a83Ac5C93BF2601300CF", + 15: "0xd6681e74eEA20d196c15038C580f721EF2aB6320", + 19: "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415", + 20: "0xDb205f215f568ADf21b9573b62566f6d9a40bed6", + 21: "0xC97E2328c5701572C0DFB199b9f860d6ccD74199", + 22: "0x618a38a556B66FdDdcB5495Be412Df911D18eA1d", + 23: "0xC940CE179f1F1bdC1EA1c02A2d0481bfD84C3280", + 24: "0x44C927BacD65da570cB1F0A2F625367049525022", + }, + "gnosis": { + 0: "0x55e91365697eb8032f98290601847296ec847210", + 1: "0xf1755aadb82dc7a45ab4e754f67412dc75576dc7", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0xd19baeadc667cf2015e395f2b08668ef120f41f5", + 4: "0xB055EbbAcc8Eefc166c169e9Ce2886D0406aB49b", + 5: "0x8a4694401be8f8fccbc542a3219af1591f87ce17", + 11: "0xb47988ad49dce8d909c6f9cf7b26caf04e1445c8", + 12: "0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 19: "0x712b3d230f3c1c19db860d80619288b1f0bdd0bd", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + }, + "fantom": { + 0: "0x0f854EA9F38ceA4B1c2FC79047E9D0134419D5d6", + 1: "0x8cC6e2144906e81F496429A1590Ef5f86bb7558f", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0x686d67265703d1f124c45e33d47d794c566889ba", + 4: "0x2B039565B2b7a1A9192D4847fbd33B25b836B950", + 5: "0x4fb93D7d320E8A263F22f62C2059dFC2A8bCbC4c", + 11: "0x9AF14D26075f142eb3F292D5065EB3faa646167b", + 12: "0xe61Fb97Ef6eBFBa12B36Ffd7be785c1F5A2DE66b", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 19: "0x1E4F97b9f9F913c46F1632781732927B9019C68b", + 20: "0xDb205f215f568ADf21b9573b62566f6d9a40bed6", + 21: "0xd62Ade30F740de7ef766008258B4b2F574A084F7", + 22: "0x837814ba42c6f3B39f0A5060168F7027695DDAb1", + 23: "0x42113C6818ACb87ca3CaFDbBc6a6ae396f1548E6", + 24: "0x49C8De2D10C9A56DD9A59ab5Ca1216111276394C", + }, + "avalanche": { + 0: "0x8474DdbE98F5aA3179B3B3F5942D724aFcdec9f6", + 1: "0xADf698e4d8Df08b3E2c79682891636eF00F6e205", + 2: "0xBff334F8D5912AC5c4f2c590A2396d1C5d990123", + 3: "0xb17b674D9c5CB2e441F8e196a2f048A81355d031", + 4: "0x06534b0BF7Ff378F162d4F348390BDA53b15fA35", + 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", + 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 20: "0xDb205f215f568ADf21b9573b62566f6d9a40bed6", + 21: "0xeD953C2849785A8AEd7bC2ee8cf5fdE776E1Dc07", + 22: "0x33F9A2F3B85e7D4Ff4f9286a9a8525060100D855", + 23: "0x1309DB123020F0533aFAfaF11D26286d5871bEB0", + 24: "0xad422855ac8010f82F08696CA7750EfE061aa6D6", + }, + "aurora": { + 0: "0x5b5cfe992adac0c9d48e05854b2d91c73a003858", + 1: "0x0f9cb53ebe405d49a0bbdbd291a65ff571bc83e1", + 2: "0x6600e98b71dabfd4a8cac03b302b0189adb86afb", + 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", + 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + }, + "celo": { + 3: "0x5277A0226d10392295E8D383E9724D6E416d6e6C", + 4: "0x56bc95Ded2BEF162131905dfd600F2b9F1B380a4", + 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", + 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + }, + "kava": { + 0: "0xc1C49622b63B961ce1D352ecb7D8261Ab5556695", + 1: "0x4244eB811D6e0Ef302326675207A95113dB4E1F8", + 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", + 3: "0x40bc62805471eF53DdD5C5cF99ed3d9e5aa81b48", + 4: "0x1f0e8445Ebe0D0F60A96A7cd5BB095533cb15B58", + 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", + 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", + 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", + 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", + 21: "0xeC6a886148B38C233B07cc6732142dccaBF1051D", + 22: "0x6e53131F68a034873b6bFA15502aF094Ef0c5854", + 23: "0xA177D2bd2BD723878bD95982c0855291953f74C9", + }, + # No UI: + "linea": { + 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", + 11: "0xd125E7a0cEddF89c6473412d85835450897be6Dc", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, + "mantle": { + 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", + 11: "0x0C9D8c7e486e822C29488Ff51BFf0167B4650953", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + 21: "0xfe87a6cdca1eeb90987c6a196a1c5f5c76f5f2b0", + 22: "0x024d362f7aa162d8591304016fd60a209efc527e", + 23: "0x4339b53cf7f6eec1a997ceea81165e45c1244429", + 24: "0x77A214bd4ee3650e5608339BBbE04b09f5546ECF", + }, + "scroll": { + 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", + 11: "0xC1b393EfEF38140662b91441C6710Aa704973228", + 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, + "polygon-zkevm": { + 4: "0x8b3EFBEfa6eD222077455d6f0DCdA3bF4f3F57A6", + 11: "0x76303e4fDcA0AbF28aB3ee42Ce086E6503431F1D", + 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", + 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", + }, +} diff --git a/scripts/deploy_addressprovider_and_setup.py b/scripts/deploy_addressprovider_and_setup.py index 2c0533d..d36b5d8 100644 --- a/scripts/deploy_addressprovider_and_setup.py +++ b/scripts/deploy_addressprovider_and_setup.py @@ -1,275 +1,90 @@ -# This is the layout as of deploying the new addressprovider. -# The key is _id, the value is _description -ADDRESS_PROVIDER_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: "DAO Vault", # Holds funds -} +# Contract deployed at: https://etherscan.io/address/0x5ffe7FB82894076ECB99A30D6A32e969e6e35E98 +# Contract not deployed at: Kava, Aurora, Mantle yet -# These are the addresses that will go into the addressprovider for each chain: +import os +import sys -addresses = { - "ethereum": { - 0: "0x90E00ACe148ca3b23Ac1bC8C240C2a7Dd9c2d7f5", - 1: "0xe64608E223433E8a03a1DaaeFD8Cb638C14B552C", - 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", - 3: "0xB9fC157394Af804a3578134A6585C0dc9cc990d4", - 4: "0xA464e6DCda8AC41e03616F95f4BC98a13b8922Dc", - 5: "0x8F942C20D02bEfc377D41445793068908E2250D0", - 6: "0xF18056Bbd320E96A48e3Fbf8bC061322531aac99", - 7: "0xF98B45FA17DE75FB1aD0e7aFD971b0ca00e379fC", - 8: "0x4F8846Ae9380B90d2E71D5e3D042dff3E7ebb40d", - 11: "0x0c0e5f2fF0ff18a3be9b835635039256dC4B4963", # Tricrypto NG - 12: "0x6A8cbed756804B16E05E741eDaBd5cB544AE21bf", # Stableswap NG - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", # Twocrypto NG - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - 16: "0xc9332fdcb1c491dcc683bae86fe3cb70360738bc", # call controllerFactory.amm(id) - 17: "0xeA6876DDE9e3467564acBeE1Ed5bac88783205E0", # same as (16) - 19: "0xD533a949740bb3306d119CC777fa900bA034cd52", - 21: "0x40907540d8a6C65c637785e8f8B742ae6b0b9968", # CurveDAO Ownership Agent - 22: "0x4eeb3ba4f221ca16ed4a0cc7254e2e32df948c5f", # CurveDAO Parameter Agent - 23: "0x00669DF67E4827FCc0E48A1838a8d5AB79281909", # CurveDAO Emergency Agent - }, - "arbitrum": { - 0: "0x445FE580eF8d70FF569aB36e80c647af338db351", - 1: "0x78CF256256C8089d68Cde634Cf7cDEFb39286470", - 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", - 3: "0xb17b674D9c5CB2e441F8e196a2f048A81355d031", - 4: "0xd4F94D0aaa640BBb72b5EEc2D85F6D114D81a88E", - 5: "0x0E9fBb167DF83EdE3240D6a5fa5d40c6C6851e15", - 11: "0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8", - 12: "0x9AF14D26075f142eb3F292D5065EB3faa646167b", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - 17: "0xcaEC110C784c9DF37240a8Ce096D352A75922DeA", - 19: "0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978", - 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", - 21: "0x452030a5D962d37D97A9D65487663cD5fd9C2B32", - 22: "0x5ccbB27FB594c5cF6aC0670bbcb360c0072F6839", - 23: "0x2CB6E1Adf22Af1A38d7C3370441743a123991EC3", - 24: "0x25877b9413Cc7832A6d142891b50bd53935feF82", - }, - "optimism": { - 0: "0xC5cfaDA84E902aD92DD40194f0883ad49639b023", - 1: "0x54e8A25d0Ac0E4945b697C80b8372445FEA17A62", - 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", - 3: "0x2db0E83599a91b508Ac268a6197b8B14F5e72840", - 4: "0xbF7E49483881C76487b0989CD7d9A8239B20CA41", - 5: "0x7DA64233Fefb352f8F501B357c018158ED8aA455", - 11: "0xc6C09471Ee39C7E30a067952FcC89c8922f9Ab53", - 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - 19: "0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53", - 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", - 21: "0x28c4A1Fa47EEE9226F8dE7D6AF0a41C62Ca98267", - 22: "0xE7F2B72E94d1c2497150c24EA8D65aFFf1027b9b", - 23: "0x9fF1ddE4BE9BbD891836863d227248047B3D881b", - 24: "0xD166EEdf272B860E991d331B71041799379185D5", - }, - "polygon": { - 0: "0x094d12e5b541784701FD8d65F11fc0598FBC6332", - 1: "0x7544Fe3d184b6B55D6B36c3FCA1157eE0Ba30287", - 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", - 3: "0x722272D36ef0Da72FF51c5A65Db7b870E2e8D4ee", - 4: "0x774D1Dba98cfBD1F2Bc3A1F59c494125e07C48F9", - 5: "0x47bB542B9dE58b970bA50c9dae444DDB4c16751a", - 6: "0xE5De15A9C9bBedb4F5EC13B131E61245f2983A69", - 11: "0xC1b393EfEF38140662b91441C6710Aa704973228", # Tricrypto NG - 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - 19: "0x172370d5cd63279efa6d502dab29171933a610af", - 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", - 21: "0x8cB05bFEd65b522a7cF98d590F1711A9Db43af71", - 22: "0x3CF7c393519ea55D1E1F2c55a6395be63b1A9F9C", - 23: "0x9FD6E204e08867170ddE54a8374083fF592eBD3E", - }, - "base": { - 2: "0xd6681e74eEA20d196c15038C580f721EF2aB6320", - 3: "0x3093f9B57A428F3EB6285a589cb35bEA6e78c336", - 4: "0xe8269B33E47761f552E1a3070119560d5fa8bBD6", - 6: "0x5EF72230578b3e399E6C6F4F6360edF95e83BBfd", - 11: "0xA5961898870943c68037F6848d2D866Ed2016bcB", - 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", - 13: "0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F", - 14: "0x5552b631e2aD801fAa129Aacf4B701071cC9D1f7", - 15: "0xEfadDdE5B43917CcC738AdE6962295A0B343f7CE", - 19: "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415", - 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", - 21: "0x2c163fe0f079d138b9c04f780d735289344C8B80", - 22: "0x7Ea4B72f04D8B02994F4EdB171Ce5F56eEdF457F", - 23: "0x95F0f720CAdDED982E6998b3390E6D3788c2CE5C", - 24: "0xA4c0eA0fb8eb652e11C8123E589197E18Ca78AA8", - }, - "fraxtal": { - 2: "0x4f37A9d177470499A2dD084621020b023fcffc1F", - 4: "0x8b3EFBEfa6eD222077455d6f0DCdA3bF4f3F57A6", - 11: "0xc9Fe0C63Af9A39402e8a5514f9c43Af0322b665F", - 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0x69522fb5337663d3B4dFB0030b881c1A750Adb4f", - 19: "0x331B9182088e2A7d6D3Fe4742AbA1fB231aEcc56", - 20: "0xeF672bD94913CB6f1d2812a6e18c1fFdEd8eFf5c", - }, - "bsc": { - 2: "0x69522fb5337663d3B4dFB0030b881c1A750Adb4f", - 3: "0xEfDE221f306152971D8e9f181bFe998447975810", - 4: "0x98B4029CaBEf7Fd525A36B0BF8555EC1d42ec0B6", - 6: "0xBd5fBd2FA58cB15228a9Abdac9ec994f79E3483C", - 11: "0x38f8D93406fA2d9924DcFcB67dB5B0521Fb20F7D", - 12: "0xd7E72f3615aa65b92A4DBdC211E296a35512988B", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0x0fE38dCC905eC14F6099a83Ac5C93BF2601300CF", - 15: "0xd6681e74eEA20d196c15038C580f721EF2aB6320", - 19: "0x8Ee73c484A26e0A5df2Ee2a4960B789967dd0415", - 20: "0xDb205f215f568ADf21b9573b62566f6d9a40bed6", - 21: "0xC97E2328c5701572C0DFB199b9f860d6ccD74199", - 22: "0x618a38a556B66FdDdcB5495Be412Df911D18eA1d", - 23: "0xC940CE179f1F1bdC1EA1c02A2d0481bfD84C3280", - 24: "0x44C927BacD65da570cB1F0A2F625367049525022", - }, - "gnosis": { - 0: "0x55e91365697eb8032f98290601847296ec847210", - 1: "0xf1755aadb82dc7a45ab4e754f67412dc75576dc7", - 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", - 3: "0xd19baeadc667cf2015e395f2b08668ef120f41f5", - 4: "0xB055EbbAcc8Eefc166c169e9Ce2886D0406aB49b", - 5: "0x8a4694401be8f8fccbc542a3219af1591f87ce17", - 11: "0xb47988ad49dce8d909c6f9cf7b26caf04e1445c8", - 12: "0xbC0797015fcFc47d9C1856639CaE50D0e69FbEE8", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - 19: "0x712b3d230f3c1c19db860d80619288b1f0bdd0bd", - 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", - }, - "fantom": { - 0: "0x0f854EA9F38ceA4B1c2FC79047E9D0134419D5d6", - 1: "0x8cC6e2144906e81F496429A1590Ef5f86bb7558f", - 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", - 3: "0x686d67265703d1f124c45e33d47d794c566889ba", - 4: "0x2B039565B2b7a1A9192D4847fbd33B25b836B950", - 5: "0x4fb93D7d320E8A263F22f62C2059dFC2A8bCbC4c", - 11: "0x9AF14D26075f142eb3F292D5065EB3faa646167b", - 12: "0xe61Fb97Ef6eBFBa12B36Ffd7be785c1F5A2DE66b", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - 19: "0x1E4F97b9f9F913c46F1632781732927B9019C68b", - 20: "0xDb205f215f568ADf21b9573b62566f6d9a40bed6", - 21: "0xd62Ade30F740de7ef766008258B4b2F574A084F7", - 22: "0x837814ba42c6f3B39f0A5060168F7027695DDAb1", - 23: "0x42113C6818ACb87ca3CaFDbBc6a6ae396f1548E6", - 24: "0x49C8De2D10C9A56DD9A59ab5Ca1216111276394C", - }, - "avax": { - 0: "0x8474DdbE98F5aA3179B3B3F5942D724aFcdec9f6", - 1: "0xADf698e4d8Df08b3E2c79682891636eF00F6e205", - 2: "0xBff334F8D5912AC5c4f2c590A2396d1C5d990123", - 3: "0xb17b674D9c5CB2e441F8e196a2f048A81355d031", - 4: "0x06534b0BF7Ff378F162d4F348390BDA53b15fA35", - 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", - 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - 20: "0xDb205f215f568ADf21b9573b62566f6d9a40bed6", - 21: "0xeD953C2849785A8AEd7bC2ee8cf5fdE776E1Dc07", - 22: "0x33F9A2F3B85e7D4Ff4f9286a9a8525060100D855", - 23: "0x1309DB123020F0533aFAfaF11D26286d5871bEB0", - 24: "0xad422855ac8010f82F08696CA7750EfE061aa6D6", - }, - "aurora": { - 0: "0x5b5cfe992adac0c9d48e05854b2d91c73a003858", - 1: "0x0f9cb53ebe405d49a0bbdbd291a65ff571bc83e1", - 2: "0x6600e98b71dabfd4a8cac03b302b0189adb86afb", - 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", - 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", - 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - }, - "celo": { - 3: "0x5277A0226d10392295E8D383E9724D6E416d6e6C", - 4: "0x56bc95Ded2BEF162131905dfd600F2b9F1B380a4", - 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", - 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - }, - "kava": { - 0: "0xc1C49622b63B961ce1D352ecb7D8261Ab5556695", - 1: "0x4244eB811D6e0Ef302326675207A95113dB4E1F8", - 2: "0xF0d4c12A5768D806021F80a262B4d39d26C58b8D", - 3: "0x40bc62805471eF53DdD5C5cF99ed3d9e5aa81b48", - 4: "0x1f0e8445Ebe0D0F60A96A7cd5BB095533cb15B58", - 11: "0x3d6cB2F6DcF47CDd9C13E4e3beAe9af041d8796a", - 12: "0x1764ee18e8B3ccA4787249Ceb249356192594585", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 14: "0xCA8d0747B5573D69653C3aC22242e6341C36e4b4", - 15: "0xA72C85C258A81761433B4e8da60505Fe3Dd551CC", - 20: "0xabC000d88f23Bb45525E447528DBF656A9D55bf5", - 21: "0xeC6a886148B38C233B07cc6732142dccaBF1051D", - 22: "0x6e53131F68a034873b6bFA15502aF094Ef0c5854", - 23: "0xA177D2bd2BD723878bD95982c0855291953f74C9", - }, - # No UI: - "linea": { - 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", - 11: "0xd125E7a0cEddF89c6473412d85835450897be6Dc", - 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - }, - "mantle": { - 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", - 11: "0x0C9D8c7e486e822C29488Ff51BFf0167B4650953", - 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - 21: "0xfe87a6cdca1eeb90987c6a196a1c5f5c76f5f2b0", - 22: "0x024d362f7aa162d8591304016fd60a209efc527e", - 23: "0x4339b53cf7f6eec1a997ceea81165e45c1244429", - 24: "0x77A214bd4ee3650e5608339BBbE04b09f5546ECF", - }, - "scroll": { - 4: "0xf3A431008396df8A8b2DF492C913706BDB0874ef", - 11: "0xC1b393EfEF38140662b91441C6710Aa704973228", - 12: "0x5eeE3091f747E60a045a2E715a4c71e600e31F6E", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - }, - "pzkevm": { - 4: "0x8b3EFBEfa6eD222077455d6f0DCdA3bF4f3F57A6", - 11: "0x76303e4fDcA0AbF28aB3ee42Ce086E6503431F1D", - 12: "0xd2002373543Ce3527023C75e7518C274A51ce712", - 13: "0x98EE851a00abeE0d95D08cF4CA2BdCE32aeaAF7F", - }, -} +import boa +from boa.network import NetworkEnv +from eth_account import Account +from eth_utils import keccak +from rich.console import Console as RichConsole + +sys.path.append("./") + +from scripts.address_provider_constants import ( + ADDRESS_PROVIDER_MAPPING, + addresses, +) + +FIDDY_DEPLOYER = "0x2d12D0907A388811e3AA855A550F959501d303EE" + + +def fetch_url(network): + return os.getenv("DRPC_URL") % (network, os.getenv("DRPC_KEY")) + + +def get_create2_deployment_address(deployment_bytecode, salt, create2deployer): + return create2deployer.computeAddress(salt, keccak(deployment_bytecode)) + + +def deploy_via_create2_factory(deployment_bytecode, salt, create2deployer): + create2deployer.deploy(0, salt, deployment_bytecode) + + +def main(network, fork): + """ + Deploy the AddressProvider to the network. + """ + + console = RichConsole() + + if not fork: + # Prodmode + console.log("Running script in prod mode...") + boa.set_env(NetworkEnv(fetch_url(network))) + boa.env.add_account(Account.from_key(os.environ["FIDDYDEPLOYER"])) + + else: + # Forkmode + console.log("Simulation Mode. Writing to mainnet-fork.") + boa.env.fork(url=fetch_url(network)) + boa.env.eoa = FIDDY_DEPLOYER + + CREATE2DEPLOYER = boa.load_abi("abi/create2deployer.json").at( + "0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2" + ) + + console.log("Deploying AddressProviderNG ...") + address_provider_obj = boa.load_partial("contracts/AddressProviderNG.vy") + codehash = keccak(address_provider_obj.compiler_data.bytecode) + salt = keccak(42069) + deployment_address = CREATE2DEPLOYER.computeAddress(salt, codehash) + CREATE2DEPLOYER.deploy( + 0, salt, address_provider_obj.compiler_data.bytecode + ) + address_provider = address_provider_obj.at(deployment_address) + + # set up address provider + ids = [] + addresses_for_id = [] + descriptions = [] + for id in addresses[network].keys(): + address = addresses[network][id] + description = ADDRESS_PROVIDER_MAPPING[id] + + ids.append(id) + addresses_for_id.append(address) + descriptions.append(description) + + if len(ids) > 20: + raise + + address_provider.add_new_ids(ids, addresses_for_id, descriptions) + + +if __name__ == "__main__": + network = "ethereum" + fork = False + + main(network, fork) From fa3af0f4aab978d6c50014f16ca1ebe2f571638c Mon Sep 17 00:00:00 2001 From: Benny Date: Tue, 9 Apr 2024 20:53:19 +1000 Subject: [PATCH 18/19] Fix typo --- contracts/AddressProviderNG.vy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/AddressProviderNG.vy b/contracts/AddressProviderNG.vy index 17f33f3..06b1eff 100644 --- a/contracts/AddressProviderNG.vy +++ b/contracts/AddressProviderNG.vy @@ -22,7 +22,7 @@ 12: StableswapNG Factory 13: TwocryptoNG Factory 14: Stableswap Calculations Contract - 15: Cryptoswap calculations Contract + 15: Cryptoswap Calculations Contract 16: LLAMMA Factory crvUSD 17: LLAMMA Factory OneWayLending 18: Rate Provider From 3a4581e31c1651cae6ac262c4c30f929e6119f4f Mon Sep 17 00:00:00 2001 From: bout3fiddy <11488427+bout3fiddy@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:22:09 +0200 Subject: [PATCH 19/19] finished deployments --- scripts/deploy_addressprovider_and_setup.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/deploy_addressprovider_and_setup.py b/scripts/deploy_addressprovider_and_setup.py index d36b5d8..a682550 100644 --- a/scripts/deploy_addressprovider_and_setup.py +++ b/scripts/deploy_addressprovider_and_setup.py @@ -1,8 +1,10 @@ -# Contract deployed at: https://etherscan.io/address/0x5ffe7FB82894076ECB99A30D6A32e969e6e35E98 -# Contract not deployed at: Kava, Aurora, Mantle yet +# flake8 no-qa E402 +# Contract deployed at: 0x5ffe7FB82894076ECB99A30D6A32e969e6e35E98 +# Deployed at: Ethereum, Arbitrum, Optimism, Base, Bsc, Polygon, +# Fantom, Gnosis, Aurora, Celo, Mantle, +# Linea, Polygon zkEVM, Scroll, Fraxtal, Avalanche, Kava import os -import sys import boa from boa.network import NetworkEnv @@ -10,8 +12,8 @@ from eth_utils import keccak from rich.console import Console as RichConsole -sys.path.append("./") - +# import sys +# sys.path.append("./") from scripts.address_provider_constants import ( ADDRESS_PROVIDER_MAPPING, addresses, @@ -84,7 +86,7 @@ def main(network, fork): if __name__ == "__main__": - network = "ethereum" + network = "kava" fork = False main(network, fork)