From c3b6ba54c723cc5592e497b3cb8d6d63cc27b10d Mon Sep 17 00:00:00 2001 From: Neeraj Kashyap Date: Thu, 20 Jan 2022 23:03:46 -0800 Subject: [PATCH 1/3] Small checklist fix for Terminus Mumbai update --- operations/terminus-update-mumbai-20211224-1652.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operations/terminus-update-mumbai-20211224-1652.md b/operations/terminus-update-mumbai-20211224-1652.md index 2d791a2..8dafac9 100644 --- a/operations/terminus-update-mumbai-20211224-1652.md +++ b/operations/terminus-update-mumbai-20211224-1652.md @@ -44,7 +44,7 @@ dao core facet-cut \ - [x] Check out relevant commit and `brownie compile`. -- [ ] Deploy `TerminusFacet` contract +- [x] Deploy `TerminusFacet` contract ```bash dao terminus deploy \ From ce9d083a81e27b4cb97d4b5172b0c461eb097416 Mon Sep 17 00:00:00 2001 From: Neeraj Kashyap Date: Thu, 20 Jan 2022 23:40:37 -0800 Subject: [PATCH 2/3] Deployed Terminus to Polygon mainnet --- operations/templates/terminus-deploy.md | 2 +- .../terminus-deploy-mainnet-20220121-0704.md | 127 ++++++++++++++++++ .../terminus-setup-mainnet-20220121-0704.md | 49 +++++++ 3 files changed, 177 insertions(+), 1 deletion(-) create mode 100644 operations/terminus-deploy-mainnet-20220121-0704.md create mode 100644 operations/terminus-setup-mainnet-20220121-0704.md diff --git a/operations/templates/terminus-deploy.md b/operations/templates/terminus-deploy.md index aed0d10..b4be717 100644 --- a/operations/templates/terminus-deploy.md +++ b/operations/templates/terminus-deploy.md @@ -59,7 +59,7 @@ dao core gogogo \ - [ ] Deploy `TerminusInitializer` contract ```bash -dao moonstream-initializer deploy \ +dao terminus-initializer deploy \ --network $DAO_NETWORK \ --sender $DAO_OWNER \ --gas-price "$GAS_PRICE" \ diff --git a/operations/terminus-deploy-mainnet-20220121-0704.md b/operations/terminus-deploy-mainnet-20220121-0704.md new file mode 100644 index 0000000..e18b256 --- /dev/null +++ b/operations/terminus-deploy-mainnet-20220121-0704.md @@ -0,0 +1,127 @@ +# Deploy the Terminus contract + +The Terminus contract is deployed as an EIP2535 Diamond proxy contract with a Terminus facet attached to it. + +This checklist describes how to deploy the contract. + +## Deployed addresses + +You will modify this section as you go through the checklist + +### Diamond addresses + +```json +{ + "DiamondCutFacet": "0x539d0E4A68F720b35c1670B6421673a852de52DB", + "Diamond": "0x062BEc5e84289Da2CD6147E0e4DA402B33B8f796", + "DiamondLoupeFacet": "0x024e974B4524f245fE3da60CbD70EC62875f8194", + "OwnershipFacet": "0x35f2d4877C7a468eA76f2D6666d3D8a487D73A9B", + "attached": [ + "DiamondLoupeFacet", + "OwnershipFacet" + ] +} +``` + +### `TerminusInitializer` address + +``` +export TERMINUS_INITIALIZER_ADDRESS="0x7BcBEE435544bD6F2B2c892040d5B7cD1B00fec7" +``` + + +### `TerminusFacet` address + +``` +export TERMINUS_FACET_ADDRESS="0x63Cf75b3ffE339Ec30524F204a5FfB97813bF9fB" +``` + +## Environment variables + +- [x] `export DAO_NETWORK=matic` +- [x] `export DAO_OWNER=` +- [x] `export DAO_OWNER_ADDRESS=$(jq -r .address $DAO_OWNER)` +- [x] `export GAS_PRICE="300 gwei"` +- [x] `export CONFIRMATIONS=5` +- [x] `export TERMINUS_ADDRESSES=.secrets/terminus-mainnet-diamond.json` + +## Deploy diamond proxy + +- [x] Deploy diamond with all core facets + +```bash +dao core gogogo \ + --network $DAO_NETWORK \ + --sender $DAO_OWNER \ + --gas-price "$GAS_PRICE" \ + --confirmations $CONFIRMATIONS \ + --owner $DAO_OWNER_ADDRESS \ + --outfile $TERMINUS_ADDRESSES +``` + +- [x] Store JSON output under `Deployed addresses / Diamond addresses` above. + +- [x] Export diamond proxy address: `export TERMINUS_DIAMOND="$(jq -r .Diamond $TERMINUS_ADDRESSES)"` + + +## Deploy `TerminusInitializer` + +- [x] Deploy `TerminusInitializer` contract + +```bash +dao terminus-initializer deploy \ + --network $DAO_NETWORK \ + --sender $DAO_OWNER \ + --gas-price "$GAS_PRICE" \ + --confirmations $CONFIRMATIONS +``` + +- [x] Export address of deployed contract as `export TERMINUS_INITIALIZER_ADDRESS=0x7BcBEE435544bD6F2B2c892040d5B7cD1B00fec7` + +- [x] Store address of deployed contract under `Deployed addresses / TerminusInitializer address` above + +### Notes + +Accidentally deployed `ERC20Initializer` to this address: `0x838a510A2A93E1878149760Ed1540A8e7B77D596`. + +Fixed the typo in the `terminus-deploy` template. + + +## Deploy `TerminusFacet` + +- [x] Deploy `TerminusFacet` contract + +```bash +dao terminus deploy \ + --network $DAO_NETWORK \ + --sender $DAO_OWNER \ + --gas-price "$GAS_PRICE" \ + --confirmations $CONFIRMATIONS +``` + +- [x] Export address of deployed contract as `export TERMINUS_FACET_ADDRESS=0x63Cf75b3ffE339Ec30524F204a5FfB97813bF9fB` + +- [x] Store address of deployed contract under `Deployed addresses / TerminusFacet address` above + +- [x] Attach `TerminusFacet` to diamond: + +```bash +dao core facet-cut \ + --address $TERMINUS_DIAMOND \ + --network $DAO_NETWORK \ + --sender $DAO_OWNER \ + --gas-price "$GAS_PRICE" \ + --confirmations $CONFIRMATIONS \ + --facet-name TerminusFacet \ + --facet-address $TERMINUS_FACET_ADDRESS \ + --action add \ + --initializer-address $TERMINUS_INITIALIZER_ADDRESS +``` + +- [x] Check the number of pools on the Terminus contract: `dao terminus total-pools --network $DAO_NETWORK --address $TERMINUS_DIAMOND` + +- [x] Number of pools is `0` + +- [x] Check the Terminus controller: `dao terminus terminus-controller --network $DAO_NETWORK --address $TERMINUS_DIAMOND` + +- [x] Controller should be the same as `$DAO_OWNER_ADDRESS` diff --git a/operations/terminus-setup-mainnet-20220121-0704.md b/operations/terminus-setup-mainnet-20220121-0704.md new file mode 100644 index 0000000..719c601 --- /dev/null +++ b/operations/terminus-setup-mainnet-20220121-0704.md @@ -0,0 +1,49 @@ +# Set up the Terminus contract + +This checklist describes how to activate the Terminus contract so that projects can start using it for +decentralized authorization. + +## Environment variables + +- [x] `export DAO_NETWORK=matic` +- [x] `export DAO_OWNER=` +- [x] `export DAO_OWNER_ADDRESS=$(jq -r .address $DAO_OWNER)` +- [x] `export GAS_PRICE="300 gwei"` +- [x] `export CONFIRMATIONS=5` +- [x] `export WETH=0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619` +- [x] `export TERMINUS_DIAMOND=0x062BEc5e84289Da2CD6147E0e4DA402B33B8f796` +- [x] `export TERMINUS_POOL_BASE_PRICE=10000000000000000` + +## Set up Terminus so that people can create pools + +- [x] Set pool base price: + +```bash +dao terminus set-pool-base-price \ + --network $DAO_NETWORK \ + --address $TERMINUS_DIAMOND \ + --sender $DAO_OWNER \ + --gas-price "$GAS_PRICE" \ + --confirmations $CONFIRMATIONS \ + --new-base-price $TERMINUS_POOL_BASE_PRICE +``` + +- [x] Check pool base price: `dao terminus pool-base-price --network $DAO_NETWORK --address $TERMINUS_DIAMOND` + +- [x] Pool base price should be same as `$TERMINUS_POOL_BASE_PRICE` + +- [x] Set up payment token: + +```bash +dao terminus set-payment-token \ + --network $DAO_NETWORK \ + --address $TERMINUS_DIAMOND \ + --sender $DAO_OWNER \ + --gas-price "$GAS_PRICE" \ + --confirmations $CONFIRMATIONS \ + --new-payment-token $WETH +``` + +- [x] Check payment token: `dao terminus payment-token --network $DAO_NETWORK --address $TERMINUS_DIAMOND` + +- [x] Payment token should be same as `$WETH` From c0c6b8e79f179c3bc158d71386fcdc4348cb1730 Mon Sep 17 00:00:00 2001 From: Neeraj Kashyap Date: Thu, 20 Jan 2022 23:44:26 -0800 Subject: [PATCH 3/3] Updated operations README --- operations/README.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/operations/README.md b/operations/README.md index 5074d65..7e81a38 100644 --- a/operations/README.md +++ b/operations/README.md @@ -5,6 +5,24 @@ blockchains. Unless otherwise specified, all operations are executed from the `main` branch of this repository. +## Polygon mainnet + +### Current addresses + +Terminus: `0x062BEc5e84289Da2CD6147E0e4DA402B33B8f796` + +### Operations + +- [Deployment of Terminus contract](./terminus-deploy-mainnet-20220121-0704.md) +- [Terminus contract setup](./terminus-setup-mainnet-20220121-0704.md) + +### Parameters + +Terminus payment token: Wrapped Ether at `0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619` + +Terminus pool base price: `0.01 WETH` + + ## Polygon Mumbai testnet ### Current addresses @@ -18,7 +36,7 @@ Terminus: `0x040Cf7Ee9752936d8d280062a447eB53808EBc08` - [Deployment of Moonstream platform token](./moonstream-deploy-mumbai-20211218-1633.md) - December 18, 2021 - [Update to Moonstream platform token](./moonstream-update-mumbai-20211221-1912.md) - December 21, 2021 - [Deployment of Terminus contract](./terminus-deploy-mumbai-20211222-2028.md) - December 22, 2021 -- [Terminus contract setup](terminus-setup-20211222-2049.md) - December 22, 2021 +- [Terminus contract setup](./terminus-setup-20211222-2049.md) - December 22, 2021 ## Templates