|
| 1 | +# Deploy the Terminus contract |
| 2 | + |
| 3 | +The Terminus contract is deployed as an EIP2535 Diamond proxy contract with a Terminus facet attached to it. |
| 4 | + |
| 5 | +This checklist describes how to deploy the contract. |
| 6 | + |
| 7 | +## Deployed addresses |
| 8 | + |
| 9 | +You will modify this section as you go through the checklist |
| 10 | + |
| 11 | +### Diamond addresses |
| 12 | + |
| 13 | +``` |
| 14 | +export TERMINUS_DIAMOND="0x99A558BDBdE247C2B2716f0D4cFb0E246DFB697D" |
| 15 | +``` |
| 16 | + |
| 17 | +### `TerminusInitializer` address |
| 18 | + |
| 19 | +``` |
| 20 | +export TERMINUS_INITIALIZER_ADDRESS="0x7BcBEE435544bD6F2B2c892040d5B7cD1B00fec7" |
| 21 | +``` |
| 22 | + |
| 23 | + |
| 24 | +### `TerminusFacet` address |
| 25 | + |
| 26 | +``` |
| 27 | +export TERMINUS_FACET_ADDRESS="0x63Cf75b3ffE339Ec30524F204a5FfB97813bF9fB" |
| 28 | +``` |
| 29 | + |
| 30 | +## Environment variables |
| 31 | + |
| 32 | +- [x] `export DAO_NETWORK=matic` |
| 33 | +- [x] `export DAO_OWNER=<path to keystore file for owner account>` |
| 34 | +- [x] `export DAO_OWNER_ADDRESS=$(jq -r .address $DAO_OWNER)` |
| 35 | +- [x] `export MAX_FEE_PER_GAS="1000 gwei"` |
| 36 | +- [x] `export MAX_PRIORITY_FEE_PER_GAS="35 gwei"` |
| 37 | +- [x] `export CONFIRMATIONS=5` |
| 38 | +- [x] `export TERMINUS_ADDRESSES=.secrets/terminus-mainnet-diamond.json` |
| 39 | +- [x] `export DIAMOND_CUT_FACET_ADDRESS=$(jq -r .DiamondCutFacet $TERMINUS_ADDRESSES)` |
| 40 | +- [x] `export DIAMOND_LOUPE_FACET_ADDRESS=$(jq -r .DiamondLoupeFacet $TERMINUS_ADDRESSES)` |
| 41 | +- [x] `export OWNERSHIP_FACET_ADDRESS=$(jq -r .OwnershipFacet $TERMINUS_ADDRESSES)` |
| 42 | +- [x] `export TERMINUS_FACET_ADDRESS=0x9718FA06867D2939981151D193cF7ee2B924aec0` |
| 43 | +- [x] `export TERMINUS_INITIALIZER_ADDRESS=0x7BcBEE435544bD6F2B2c892040d5B7cD1B00fec7` |
| 44 | +- [x] `export WETH=0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619` |
| 45 | +- [x] `export TERMINUS_POOL_BASE_PRICE=10000000000000000` |
| 46 | + |
| 47 | +## Deployment |
| 48 | + |
| 49 | +- [x] Deploy diamond |
| 50 | + |
| 51 | +```bash |
| 52 | +dao core diamond deploy \ |
| 53 | + --network $DAO_NETWORK \ |
| 54 | + --sender $DAO_OWNER \ |
| 55 | + --max-fee-per-gas "$MAX_FEE_PER_GAS" \ |
| 56 | + --max-priority-fee-per-gas "$MAX_PRIORITY_FEE_PER_GAS" \ |
| 57 | + --confirmations $CONFIRMATIONS \ |
| 58 | + --contract-owner-arg $DAO_OWNER_ADDRESS \ |
| 59 | + --diamond-cut-facet-arg $DIAMOND_CUT_FACET_ADDRESS |
| 60 | +``` |
| 61 | + |
| 62 | +- [x] Store JSON output under `Deployed addresses / Diamond addresses` above. |
| 63 | + |
| 64 | +- [x] Export diamond proxy address: `export TERMINUS_DIAMOND="0x99A558BDBdE247C2B2716f0D4cFb0E246DFB697D"` |
| 65 | + |
| 66 | +- [x] Attach `DiamondLoupeFacet` to diamond: |
| 67 | + |
| 68 | +```bash |
| 69 | +dao core facet-cut \ |
| 70 | + --address $TERMINUS_DIAMOND \ |
| 71 | + --network $DAO_NETWORK \ |
| 72 | + --sender $DAO_OWNER \ |
| 73 | + --max-fee-per-gas "$MAX_FEE_PER_GAS" \ |
| 74 | + --max-priority-fee-per-gas "$MAX_PRIORITY_FEE_PER_GAS" \ |
| 75 | + --confirmations $CONFIRMATIONS \ |
| 76 | + --facet-name DiamondLoupeFacet \ |
| 77 | + --facet-address $DIAMOND_LOUPE_FACET_ADDRESS \ |
| 78 | + --action add |
| 79 | +``` |
| 80 | + |
| 81 | +- [x] Attach `OwnershipFacet` to diamond: |
| 82 | + |
| 83 | +```bash |
| 84 | +dao core facet-cut \ |
| 85 | + --address $TERMINUS_DIAMOND \ |
| 86 | + --network $DAO_NETWORK \ |
| 87 | + --sender $DAO_OWNER \ |
| 88 | + --max-fee-per-gas "$MAX_FEE_PER_GAS" \ |
| 89 | + --max-priority-fee-per-gas "$MAX_PRIORITY_FEE_PER_GAS" \ |
| 90 | + --confirmations $CONFIRMATIONS \ |
| 91 | + --facet-name OwnershipFacet \ |
| 92 | + --facet-address $OWNERSHIP_FACET_ADDRESS \ |
| 93 | + --action add |
| 94 | +``` |
| 95 | + |
| 96 | +- [x] Attach `TerminusFacet` to diamond: |
| 97 | + |
| 98 | +```bash |
| 99 | +dao core facet-cut \ |
| 100 | + --address $TERMINUS_DIAMOND \ |
| 101 | + --network $DAO_NETWORK \ |
| 102 | + --sender $DAO_OWNER \ |
| 103 | + --max-fee-per-gas "$MAX_FEE_PER_GAS" \ |
| 104 | + --max-priority-fee-per-gas "$MAX_PRIORITY_FEE_PER_GAS" \ |
| 105 | + --confirmations $CONFIRMATIONS \ |
| 106 | + --facet-name TerminusFacet \ |
| 107 | + --facet-address $TERMINUS_FACET_ADDRESS \ |
| 108 | + --action add \ |
| 109 | + --initializer-address $TERMINUS_INITIALIZER_ADDRESS |
| 110 | +``` |
| 111 | + |
| 112 | +- [x] Check the number of pools on the Terminus contract: `dao terminus total-pools --network $DAO_NETWORK --address $TERMINUS_DIAMOND` |
| 113 | + |
| 114 | +- [x] Number of pools is `0` |
| 115 | + |
| 116 | +- [x] Check the Terminus controller: `dao terminus terminus-controller --network $DAO_NETWORK --address $TERMINUS_DIAMOND` |
| 117 | + |
| 118 | +- [x] Controller should be the same as `$DAO_OWNER_ADDRESS` |
| 119 | + |
| 120 | +- [x] Set pool base price: |
| 121 | + |
| 122 | +```bash |
| 123 | +dao terminus set-pool-base-price \ |
| 124 | + --network $DAO_NETWORK \ |
| 125 | + --address $TERMINUS_DIAMOND \ |
| 126 | + --sender $DAO_OWNER \ |
| 127 | + --max-fee-per-gas "$MAX_FEE_PER_GAS" \ |
| 128 | + --max-priority-fee-per-gas "$MAX_PRIORITY_FEE_PER_GAS" \ |
| 129 | + --confirmations $CONFIRMATIONS \ |
| 130 | + --new-base-price $TERMINUS_POOL_BASE_PRICE |
| 131 | +``` |
| 132 | + |
| 133 | +- [x] Check pool base price: `dao terminus pool-base-price --network $DAO_NETWORK --address $TERMINUS_DIAMOND` |
| 134 | + |
| 135 | +- [x] Pool base price should be same as `$TERMINUS_POOL_BASE_PRICE` |
| 136 | + |
| 137 | +- [x] Set up payment token: |
| 138 | + |
| 139 | +```bash |
| 140 | +dao terminus set-payment-token \ |
| 141 | + --network $DAO_NETWORK \ |
| 142 | + --address $TERMINUS_DIAMOND \ |
| 143 | + --sender $DAO_OWNER \ |
| 144 | + --max-fee-per-gas "$MAX_FEE_PER_GAS" \ |
| 145 | + --max-priority-fee-per-gas "$MAX_PRIORITY_FEE_PER_GAS" \ |
| 146 | + --confirmations $CONFIRMATIONS \ |
| 147 | + --new-payment-token $WETH |
| 148 | +``` |
| 149 | + |
| 150 | +- [x] Check payment token: `dao terminus payment-token --network $DAO_NETWORK --address $TERMINUS_DIAMOND` |
| 151 | + |
| 152 | +- [x] Payment token should be same as `$WETH` |
0 commit comments