Skip to content

Commit

Permalink
✨ Update Deployment Scripts For Pre Gen Addresses And Permissioned Up…
Browse files Browse the repository at this point in the history
…loaders (#20)

* change neutron config to support pre gen addr

* change osmosis config to support pre gen addr

* Change deploy script to use pre gen entry point addr

* add python nb if dep issues

* update osmosis testnet addresses

* update neutron testnet deployed contracts

* Update neutron mainnet contracts

* update neutron miannet rest url

* add osmosis mainnet deployed contracts

* Update deploy script to account for salt and permissioned uploaders

* pass salt from config update neutron

* update notebook to match script

* Update osmosis config

* Update commit hash

* Update deployment steps in readme
  • Loading branch information
NotJeremyLiu authored Jul 18, 2023
1 parent 80f8044 commit 07ccce8
Show file tree
Hide file tree
Showing 9 changed files with 686 additions and 85 deletions.
21 changes: 19 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,24 @@ To deploy the Skip Swap contracts, the steps are as follows:
MNEMONIC = "<YOUR MNEMONIC HERE>"
```

7. Run the deploy script with the following format (changing the chain [options: osmosis, neutron] and network [options: testnet, mainnet] depending on what is to be deployed):
7. Generate the entry point contract address using `instatiate2` which generates determinsitic cosmwasm contract addresses. This is necessary to allow the adapter contracts to whitelist the entry point contract before it is instantiated. To do this, you will need the daemon of the respective chain you are deploying on, and running the following command for the chain's CLI (replace osmosisd with network client being used):
```
osmosisd query wasm build-address <CHECK SUM HASH OF CONTRACT> <ADDRESS THAT WILL INSTANTIATE> <SALT AS HEX STRING (31 is b'1')>
```
8. Add the generated entry point address in the respective chain's config toml file
``` toml
# @DEV MUST CHANGE SALT ACCORDINGLY TO OBTAIN THIS PRE GENERATED ADDRESS
ENTRY_POINT_PRE_GENERATED_ADDRESS = "<PRE GENERATED ADDRESS HERE>"
```

9. Update the salt used in the config if needed (default is "1", which is 31 in the chain daemon generator)
``` toml
# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"
```

10. Run the deploy script with the following format (changing the chain [options: osmosis, neutron] and network [options: testnet, mainnet] depending on what is to be deployed):
``` bash
python deploy.py <CHAIN> <NETWORK>
```
Expand All @@ -170,7 +187,7 @@ To deploy the Skip Swap contracts, the steps are as follows:
python deploy.py osmosis testnet
```

8. After running the deploy script, a toml file will be added/updated in the deployed-contracts/{CHAIN} folder with all relevant info for the deployment.
11. After running the deploy script, a toml file will be added/updated in the deployed-contracts/{CHAIN} folder with all relevant info for the deployment.

# About Skip

Expand Down
38 changes: 19 additions & 19 deletions deployed-contracts/neutron/mainnet.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
[info]
chain_id = "neutron-1"
network = "mainnet"
deploy_date = "28/06/2023 15:37:37"
commit_hash = "4c6211e7b70eee07f17bd1c8f3a000c5b0731b53"
deploy_date = "18/07/2023 15:34:18"
commit_hash = "80f8044b4400f727c9c765dc72c74ff88508eb68"

[checksums]
"skip_swap_entry_point-aarch64.wasm" = "599f3ebacaf7a56d6f703c4bd2a7ce2dc27e31f416fc35aa5b1f352c50985bb3"
"skip_swap_neutron_astroport_swap-aarch64.wasm" = "74287287bee3c3b8732de6571b7aadd50e9fadf10999be0faee73f53dd4f452d"
"skip_swap_neutron_ibc_transfer-aarch64.wasm" = "71de927903eb3073fd8e71e19a4570d547f3bc9c91c3182a55c4824e648dcc73"
"skip_swap_osmosis_ibc_transfer-aarch64.wasm" = "16ab3cbf84617b78bb21b408292d51d5cd68afac680e0b0dd2781e77e29152c0"
"skip_swap_osmosis_poolmanager_swap-aarch64.wasm" = "b6752f85ec262b6f6b60e0b3c501a167a0b2337efc8aed06692ad02ffe64ebdc"
"skip_swap_entry_point-aarch64.wasm" = "57169cdff38440deb5bfa4f6c3f564d3dec3ae06e69e3dc46cc41c3c6d9dad92"
"skip_swap_neutron_astroport_swap-aarch64.wasm" = "e259ceae0b68d957717e19fb49cbc0aee5142e64728ff3d9175c8fc1ff68ed21"
"skip_swap_neutron_ibc_transfer-aarch64.wasm" = "8a8ed75e29e668beb0cb1b4c82935d67143c20234fd562ff9eecef86a6427aac"
"skip_swap_osmosis_ibc_transfer-aarch64.wasm" = "fd5ff827d82f7ad80c5ed61b7a8449a2ced99c6f0e813358b9867e443ebd82a3"
"skip_swap_osmosis_poolmanager_swap-aarch64.wasm" = "0e241fc025a63a88953b677ae6d9ea320c87a48890368bb2d91ee09e074b609b"

[code-ids]
swap_adapter_contract_code_id = 63
ibc_transfer_adapter_contract_code_id = 64
entry_point_contract_code_id = 65
swap_adapter_contract_code_id = 111
ibc_transfer_adapter_contract_code_id = 112
entry_point_contract_code_id = 113

[contract-addresses]
swap_adapter_contract_address = "neutron1khswzgxzjfeqesff3mk0ghs7m6904e70ddfhn6n3evhu5jadg58s7pve5u"
ibc_transfer_adapter_contract_address = "neutron1kuu469eu03v7dsgaptrcnhl8q8jqh5rta006lzlgyxxlxmsp3gaq3vleht"
entry_point_contract_address = "neutron1grhx4mkt04aay5vnufyxxc98q44va72c80dgxdwu9dv29sxvq3usv9z8yv"
swap_adapter_contract_address = "neutron1c7w7ezltfjyhvkrtdraee09pmtlpwnffnj7zrpg9yh77z0v5dmzq7dg6pt"
ibc_transfer_adapter_contract_address = "neutron1exel4g6q4y0agdj92ksujlphwentk6lmkw38yc06dq3mxmwet77sttl3j3"
entry_point_contract_address = "neutron1mrm80xxdv8yhrt6gqvx2n638vjh23j023xj5yufha9y02gvskmaq6prr8z"

[tx-hashes]
store_swap_adapter_tx_hash = "21D205FBFF53C7DE772B719AA813ECCC595495CD2CBDFEBAD81563143036267D"
store_ibc_transfer_adapter_tx_hash = "B27BC47AB9A054B428EECF02E9810B6454D72FEFE5F9473FB3323561FC61C6E2"
store_entry_point_tx_hash = "069BB89A1FCD8E51B0BF700E32B49CB5B44D0EBBB3E6BB82D474D4BA1688A6BC"
instantiate_swap_adapter_tx_hash = "75D9557E6439B6DC0D957FE8D7410BC0C83A2BD4498C4EC7321AA67AC725DCB5"
instantiate_ibc_transfer_adapter_tx_hash = "BD53B83506B5E335C06540308273A19F1C1A2678F5DE452B8C41209C44293D9B"
instantiate_entry_point_tx_hash = "A950B3CAD0B1ED1EAB3CDF0B37D211F8EB1F3014BA62D569AC5137B7D1620CAF"
store_swap_adapter_tx_hash = "B43FFF7AEF57B97971A7C42786EAC32A2A75253A189CFEE78501B1E85E9E0327"
store_ibc_transfer_adapter_tx_hash = "30073E133F79968D770FE93276F2D7BAA1717D86816B98F38B4B39385798F5BC"
store_entry_point_tx_hash = "D93CF9CC1AFA6009162893A014D7B6D9364C9DE5267477D265CF9EFB7FAAE0D6"
instantiate_swap_adapter_tx_hash = "C8CDAB38F789C6FBF7A2CE55D8E327D8FCB0CAD683CC8876CC1F899FB98B444A"
instantiate_ibc_transfer_adapter_tx_hash = "6AF3777A460045BDC81C5F6B3E54D87D4842CF9E314374371AC2F127077B9EB2"
instantiate_entry_point_tx_hash = "4D58BAEAFD7770F6DCD1E1EB6A84DE7E352F50E56594E6AED72EF5C18B093A89"
38 changes: 25 additions & 13 deletions deployed-contracts/neutron/testnet.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
# Chain ID
[info]
chain_id = "pion-1"
network = "testnet"
deploy_date = "18/07/2023 15:11:44"
commit_hash = "80f8044b4400f727c9c765dc72c74ff88508eb68"

# Deployment date
deployment_date = "2023-06-20"
[checksums]
"skip_swap_entry_point-aarch64.wasm" = "57169cdff38440deb5bfa4f6c3f564d3dec3ae06e69e3dc46cc41c3c6d9dad92"
"skip_swap_neutron_astroport_swap-aarch64.wasm" = "e259ceae0b68d957717e19fb49cbc0aee5142e64728ff3d9175c8fc1ff68ed21"
"skip_swap_neutron_ibc_transfer-aarch64.wasm" = "8a8ed75e29e668beb0cb1b4c82935d67143c20234fd562ff9eecef86a6427aac"
"skip_swap_osmosis_ibc_transfer-aarch64.wasm" = "fd5ff827d82f7ad80c5ed61b7a8449a2ced99c6f0e813358b9867e443ebd82a3"
"skip_swap_osmosis_poolmanager_swap-aarch64.wasm" = "0e241fc025a63a88953b677ae6d9ea320c87a48890368bb2d91ee09e074b609b"

# Repo commit hash
repo_commit_hash = "211833bc821e93216e1fedc7fd8ee8b2899932b4"
[code-ids]
swap_adapter_contract_code_id = 1200
ibc_transfer_adapter_contract_code_id = 1201
entry_point_contract_code_id = 1202

# Deployment checksums
entry_point_contract_checksum = "b6c516e3d7001d6e5bafe6b13ef980884c951efcf44dbf8ec93e2f1c3a1f3089"
astroport_swap_adapter_checksum = "a9ba9e6a9c01d63f172ed05fd0d72283bac097423f394119d2a097d4b5ea9715"
ibc_transfer_adapter_checksum = "74b33690465bb3e0ef46ad8017e4263c962d213ebeb522529bc9e9aec004b0c3"
[contract-addresses]
swap_adapter_contract_address = "neutron1hurlj68ult8cq68j7cayg7hpy02wt4rty48x88z0lhw48s4qfqqql4x34n"
ibc_transfer_adapter_contract_address = "neutron10ww4dqrr6hm0fll84jjlz88gnp63c5dwq98dxeq7vujhlhvudmfqen6frv"
entry_point_contract_address = "neutron1mrm80xxdv8yhrt6gqvx2n638vjh23j023xj5yufha9y02gvskmaq6prr8z"

# Deployed contracts addresses
entry_point_contract_address = "neutron1a0f2kt344udfry93s9jflvjfjpl84fmxxzhhku565hpapaclz7jqg5vmr6"
astroport_swap_adapter_contract_address = "neutron1yqxqqv89vdkr4lxd4rt4qkkcr50u655caylvexgfnvjggex8f0eqtgr29s"
ibc_transfer_adapter_contract_address = "neutron1sdxzpn5rjzgjcxg6u5vhka9gwvzq05lfchx5pkx4nle6znx4z9cq8wtf9q"
[tx-hashes]
store_swap_adapter_tx_hash = "5035D0790D8B33A55845849A6E219E26C9226F94B84F71D594EA789C7A2E9084"
store_ibc_transfer_adapter_tx_hash = "3592C57B8863EFE546A3E7261D017A83AEC75F323F7EB236B6399FFA2B3C50CD"
store_entry_point_tx_hash = "3D4B490DBD30090F8DE2A4056404AFDE6B0D5C37B35CE3D926EE6E2A7C39CB88"
instantiate_swap_adapter_tx_hash = "AA78F95DD3F4FF50BCED921526E97BBAAFAAC37AEB5203852B08AAA0C9444F0F"
instantiate_ibc_transfer_adapter_tx_hash = "56DFD51153D2ADDDFBD6F1F333A67798BA1C59B97205159A236742CB133B564F"
instantiate_entry_point_tx_hash = "9A63558CFDBDAA7125387FFD9F982EB82D7596BF01CC72643C2724F85D012D70"
30 changes: 30 additions & 0 deletions deployed-contracts/osmosis/mainnet.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[info]
chain_id = "osmosis-1"
network = "mainnet"
deploy_date = "18/07/2023 16:42:31"
commit_hash = "80f8044b4400f727c9c765dc72c74ff88508eb68"

[checksums]
"skip_swap_entry_point-aarch64.wasm" = "57169cdff38440deb5bfa4f6c3f564d3dec3ae06e69e3dc46cc41c3c6d9dad92"
"skip_swap_neutron_astroport_swap-aarch64.wasm" = "e259ceae0b68d957717e19fb49cbc0aee5142e64728ff3d9175c8fc1ff68ed21"
"skip_swap_neutron_ibc_transfer-aarch64.wasm" = "8a8ed75e29e668beb0cb1b4c82935d67143c20234fd562ff9eecef86a6427aac"
"skip_swap_osmosis_ibc_transfer-aarch64.wasm" = "fd5ff827d82f7ad80c5ed61b7a8449a2ced99c6f0e813358b9867e443ebd82a3"
"skip_swap_osmosis_poolmanager_swap-aarch64.wasm" = "0e241fc025a63a88953b677ae6d9ea320c87a48890368bb2d91ee09e074b609b"

[code-ids]
swap_adapter_contract_code_id = 131
ibc_transfer_adapter_contract_code_id = 132
entry_point_contract_code_id = 133

[contract-addresses]
swap_adapter_contract_address = "osmo19fe8w8rmdty8cg3yyr74n43w7fezkyfzuj85gfrhpx3g7etacmrsypya4l"
ibc_transfer_adapter_contract_address = "osmo1f2z35h7pyuluwcmhm4kkhrc23mnmt206478jtnwvh6w7f3u32crq5g4d63"
entry_point_contract_address = "osmo1mrm80xxdv8yhrt6gqvx2n638vjh23j023xj5yufha9y02gvskmaqwn2lw8"

[tx-hashes]
store_swap_adapter_tx_hash = "465E952B22FAEC7F8D442193C9521E684A16669394BD01929BFBD8D1DCE7474B"
store_ibc_transfer_adapter_tx_hash = "175EEC0779F442E21457BDA017E776559C3DD4CEEF5DBD7AD7B40DBC9AA1CC39"
store_entry_point_tx_hash = "25D0520C7EB0C9F54BA00FD3496D6A633461D4392066CEFAE204ED43B456F4BD"
instantiate_swap_adapter_tx_hash = "93A013F008964D871ED51BD17BCD732ED078A9BB24B54B608C8A6B851C9141B1"
instantiate_ibc_transfer_adapter_tx_hash = "2CEA6DBBAB96D62B1F0D18957634D84E3B6F4F9146D8E43BB45D4E528B142C21"
instantiate_entry_point_tx_hash = "6A2290069FBC3D76636E28383E91C68BA69AC5D105CAC58D1932F11B496DE630"
38 changes: 19 additions & 19 deletions deployed-contracts/osmosis/testnet.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
[info]
chain_id = "osmo-test-5"
network = "testnet"
deploy_date = "28/06/2023 15:31:41"
commit_hash = "4c6211e7b70eee07f17bd1c8f3a000c5b0731b53"
deploy_date = "18/07/2023 14:38:43"
commit_hash = "80f8044b4400f727c9c765dc72c74ff88508eb68"

[checksums]
"skip_swap_entry_point-aarch64.wasm" = "599f3ebacaf7a56d6f703c4bd2a7ce2dc27e31f416fc35aa5b1f352c50985bb3"
"skip_swap_neutron_astroport_swap-aarch64.wasm" = "74287287bee3c3b8732de6571b7aadd50e9fadf10999be0faee73f53dd4f452d"
"skip_swap_neutron_ibc_transfer-aarch64.wasm" = "71de927903eb3073fd8e71e19a4570d547f3bc9c91c3182a55c4824e648dcc73"
"skip_swap_osmosis_ibc_transfer-aarch64.wasm" = "16ab3cbf84617b78bb21b408292d51d5cd68afac680e0b0dd2781e77e29152c0"
"skip_swap_osmosis_poolmanager_swap-aarch64.wasm" = "b6752f85ec262b6f6b60e0b3c501a167a0b2337efc8aed06692ad02ffe64ebdc"
"skip_swap_entry_point-aarch64.wasm" = "57169cdff38440deb5bfa4f6c3f564d3dec3ae06e69e3dc46cc41c3c6d9dad92"
"skip_swap_neutron_astroport_swap-aarch64.wasm" = "e259ceae0b68d957717e19fb49cbc0aee5142e64728ff3d9175c8fc1ff68ed21"
"skip_swap_neutron_ibc_transfer-aarch64.wasm" = "8a8ed75e29e668beb0cb1b4c82935d67143c20234fd562ff9eecef86a6427aac"
"skip_swap_osmosis_ibc_transfer-aarch64.wasm" = "fd5ff827d82f7ad80c5ed61b7a8449a2ced99c6f0e813358b9867e443ebd82a3"
"skip_swap_osmosis_poolmanager_swap-aarch64.wasm" = "0e241fc025a63a88953b677ae6d9ea320c87a48890368bb2d91ee09e074b609b"

[code-ids]
swap_adapter_contract_code_id = 1392
ibc_transfer_adapter_contract_code_id = 1393
entry_point_contract_code_id = 1394
swap_adapter_contract_code_id = 2172
ibc_transfer_adapter_contract_code_id = 2173
entry_point_contract_code_id = 2174

[contract-addresses]
swap_adapter_contract_address = "osmo1ttv6e7mv3hwsy8u7erzfxhvfx55nxz5w422705jht6xk6hly745sj6aala"
ibc_transfer_adapter_contract_address = "osmo16yn7gmgmsq55tlvly27tqnyrz2jry8m720k34w88jrfr0nhpgmhq4vec03"
entry_point_contract_address = "osmo1hjzln3e58qtfljce4g3c9e9x7p8wygvlu55d9edcwukpd2uww4ssqqg7m6"
swap_adapter_contract_address = "osmo1rgxller7ze4p6e38fgzwkt0a7sj49pwszmfx64u2xhrsh2amf9eq8jjpw5"
ibc_transfer_adapter_contract_address = "osmo15uwuxf8v20wheu55z2gdlfl3f43ej7z6qx8dxmug48vak088p2rs0q30e6"
entry_point_contract_address = "osmo1xejlghtmd379g5w9luteje0vtc6aeywfkkk6v0g0um8w8w8u5m0suqj500"

[tx-hashes]
store_swap_adapter_tx_hash = "C93124E834B2C4375291E94A00D4878EC44179547436722F4A265C330ED70EB4"
store_ibc_transfer_adapter_tx_hash = "A3FB27B49FBDFA36D9A610F1AB4178FFDE5E6D42DB6BC221899E57B14D4C251C"
store_entry_point_tx_hash = "5245009F303710198C82140E6AB73AE14849FC367C2FAD49996976D6254D1143"
instantiate_swap_adapter_tx_hash = "9E5D552A7D3DB1E94EFEA7C3FC058A496B9AB745D38B98566995121C925BB4AD"
instantiate_ibc_transfer_adapter_tx_hash = "FC33E4C08498DF8DBB6608838A692C163AE8C4892F1A72DF9374517EE2474262"
instantiate_entry_point_tx_hash = "C3CDF6E9B47E18FBE14196022764AA351AC39C0FEEA06904BC77713502AB8AC3"
store_swap_adapter_tx_hash = "4DA371576FF1ED2F2B2FD24ECA3F342872CDF55AE81561EB8E6793E24F962317"
store_ibc_transfer_adapter_tx_hash = "8031247717F1DCBCB091B0FB2FF748F6C0BB8174F5158AA74F31E9DDDBD339AC"
store_entry_point_tx_hash = "834CCD734545D749861A9461917D525620B4AF23039A5AABD1BF07FD9A701DD0"
instantiate_swap_adapter_tx_hash = "C2A6561E693823328542B5397E54C9E9005A9F7CB614E2057E02A3E49FBF43FA"
instantiate_ibc_transfer_adapter_tx_hash = "3B4638184C4FFC21677C4C04E4BAF7BE83BE03A3F5C75CB1AB60982AA0AE3F72"
instantiate_entry_point_tx_hash = "98F9413FB93B0B2E363AD0868041EB2C327DFB4116F2C08D71CADB780368DD43"
10 changes: 8 additions & 2 deletions scripts/configs/neutron.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
MNEMONIC = "<YOUR MNEMONIC HERE>"

# Commut Hash
COMMIT_HASH = "4c6211e7b70eee07f17bd1c8f3a000c5b0731b53"
COMMIT_HASH = "80f8044b4400f727c9c765dc72c74ff88508eb68"

MAINNET_REST_URL = "rest+https://neutron-api.lavenderfive.com"
MAINNET_REST_URL = "rest+https://rest-kralum.neutron-1.neutron.org"
MAINNET_CHAIN_ID = "neutron-1"

TESTNET_REST_URL = "rest+https://rest-palvus.pion-1.ntrn.tech"
Expand All @@ -19,6 +19,12 @@ ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_swap_entry_point-aarch64.wasm"
SWAP_ADAPTER_PATH = "../artifacts/skip_swap_neutron_astroport_swap-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_swap_neutron_ibc_transfer-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"

# @DEV MUST CHANGE SALT ACCORDINGLY TO OBTAIN THIS PRE GENERATED ADDRESS
ENTRY_POINT_PRE_GENERATED_ADDRESS = "<PRE GENERATED ADDRESS HERE>"

[[swap_venues]]
name = "neutron-astroport"
router_contract_address = "neutron1eeyntmsq448c68ez06jsy6h2mtjke5tpuplnwtjfwcdznqmw72kswnlmm0"
11 changes: 10 additions & 1 deletion scripts/configs/osmosis.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
MNEMONIC = "<YOUR MNEMONIC HERE>"

# Commut Hash
COMMIT_HASH = "4c6211e7b70eee07f17bd1c8f3a000c5b0731b53"
COMMIT_HASH = "80f8044b4400f727c9c765dc72c74ff88508eb68"

MAINNET_REST_URL = "rest+https://lcd.osmosis.zone/"
MAINNET_CHAIN_ID = "osmosis-1"
Expand All @@ -19,5 +19,14 @@ ENTRY_POINT_CONTRACT_PATH = "../artifacts/skip_swap_entry_point-aarch64.wasm"
SWAP_ADAPTER_PATH = "../artifacts/skip_swap_osmosis_poolmanager_swap-aarch64.wasm"
IBC_TRANSFER_ADAPTER_PATH = "../artifacts/skip_swap_osmosis_ibc_transfer-aarch64.wasm"

# SALT USED TO GENERATE A DETERMINSTIC ADDRESS
SALT = "1"

# @DEV MUST CHANGE SALT ACCORDINGLY TO OBTAIN THIS PRE GENERATED ADDRESS
ENTRY_POINT_PRE_GENERATED_ADDRESS = "<PRE GENERATED ADDRESS HERE>"

# ADDRESS GRANTED PERMISSION BY GOVERNANCE TO UPLOAD CONTRACATS
PERMISSIONED_UPLOADER_ADDRESS = "osmo1raa4kyx5ypz75qqk3566c6slx2mw3qzsu6rymw"

[[swap_venues]]
name = "osmosis-poolmanager"
Loading

0 comments on commit 07ccce8

Please sign in to comment.