Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.

Commit e2a2646

Browse files
committed
Added Terminus deployment checklist for customer
1 parent 933bff4 commit e2a2646

1 file changed

Lines changed: 146 additions & 0 deletions

File tree

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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+
```json
14+
export TERMINUS_DIAMOND=""
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+
- [ ] `export DAO_NETWORK=matic`
33+
- [ ] `export DAO_OWNER=<path to keystore file for owner account>`
34+
- [ ] `export DAO_OWNER_ADDRESS=$(jq -r .address $DAO_OWNER)`
35+
- [ ] `export MAX_FEE_PER_GAS="10000 gwei"`
36+
- [ ] `export CONFIRMATIONS=5`
37+
- [ ] `export TERMINUS_ADDRESSES=.secrets/terminus-mainnet-diamond.json`
38+
- [ ] `export DIAMOND_CUT_FACET_ADDRESS=$(jq -r .DiamondCutFacet $TERMINUS_ADDRESSES)`
39+
- [ ] `export DIAMOND_LOUPE_FACET_ADDRESS=$(jq -r .DiamondLoupeFacet $TERMINUS_ADDRESSES)`
40+
- [ ] `export OWNERSHIP_FACET_ADDRESS=$(jq -r .OwnershipFacet $TERMINUS_ADDRESSES)`
41+
- [ ] `export TERMINUS_FACET_ADDRESS=0x9718FA06867D2939981151D193cF7ee2B924aec0`
42+
- [ ] `export TERMINUS_INITIALIZER_ADDRESS=0x7BcBEE435544bD6F2B2c892040d5B7cD1B00fec7`
43+
- [ ] `export WETH=0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619`
44+
- [ ] `export TERMINUS_POOL_BASE_PRICE=10000000000000000`
45+
46+
## Deployment
47+
48+
- [ ] Deploy diamond with all core facets
49+
50+
```bash
51+
dao core diamond deploy \
52+
--network $DAO_NETWORK \
53+
--sender $DAO_OWNER \
54+
--max-fee-per-gas "$MAX_FEE_PER_GAS" \
55+
--confirmations $CONFIRMATIONS \
56+
--owner $DAO_OWNER_ADDRESS \
57+
--contract-owner-arg $DAO_OWNER_ADDRESS \
58+
--diamond-cut-facet-arg $DIAMOND_CUT_FACET
59+
```
60+
61+
- [ ] Store JSON output under `Deployed addresses / Diamond addresses` above.
62+
63+
- [ ] Export diamond proxy address: `export TERMINUS_DIAMOND=""`
64+
65+
- [ ] Attach `DiamondLoupeFacet` to diamond:
66+
67+
```bash
68+
dao core facet-cut \
69+
--address $TERMINUS_DIAMOND \
70+
--network $DAO_NETWORK \
71+
--sender $DAO_OWNER \
72+
--max-fee-per-gas "$MAX_FEE_PER_GAS" \
73+
--confirmations $CONFIRMATIONS \
74+
--facet-name DiamondLoupeFacet \
75+
--facet-address $DIAMOND_LOUPE_FACET_ADDRESS \
76+
--action add
77+
```
78+
79+
- [ ] Attach `OwnershipFacet` to diamond:
80+
81+
```bash
82+
dao core facet-cut \
83+
--address $TERMINUS_DIAMOND \
84+
--network $DAO_NETWORK \
85+
--sender $DAO_OWNER \
86+
--max-fee-per-gas "$MAX_FEE_PER_GAS" \
87+
--confirmations $CONFIRMATIONS \
88+
--facet-name DiamondLoupeFacet \
89+
--facet-address $DIAMOND_LOUPE_FACET_ADDRESS \
90+
--action add
91+
```
92+
93+
- [ ] Attach `TerminusFacet` to diamond:
94+
95+
```bash
96+
dao core facet-cut \
97+
--address $TERMINUS_DIAMOND \
98+
--network $DAO_NETWORK \
99+
--sender $DAO_OWNER \
100+
--max-fee-per-gas "$MAX_FEE_PER_GAS" \
101+
--confirmations $CONFIRMATIONS \
102+
--facet-name TerminusFacet \
103+
--facet-address $TERMINUS_FACET_ADDRESS \
104+
--action add \
105+
--initializer-address $TERMINUS_INITIALIZER_ADDRESS
106+
```
107+
108+
- [ ] Check the number of pools on the Terminus contract: `dao terminus total-pools --network $DAO_NETWORK --address $TERMINUS_DIAMOND`
109+
110+
- [ ] Number of pools is `0`
111+
112+
- [ ] Check the Terminus controller: `dao terminus terminus-controller --network $DAO_NETWORK --address $TERMINUS_DIAMOND`
113+
114+
- [ ] Controller should be the same as `$DAO_OWNER_ADDRESS`
115+
116+
- [ ] Set pool base price:
117+
118+
```bash
119+
dao terminus set-pool-base-price \
120+
--network $DAO_NETWORK \
121+
--address $TERMINUS_DIAMOND \
122+
--sender $DAO_OWNER \
123+
--max-fee-per-gas "$MAX_FEE_PER_GAS" \
124+
--confirmations $CONFIRMATIONS \
125+
--new-base-price $TERMINUS_POOL_BASE_PRICE
126+
```
127+
128+
- [ ] Check pool base price: `dao terminus pool-base-price --network $DAO_NETWORK --address $TERMINUS_DIAMOND`
129+
130+
- [ ] Pool base price should be same as `$TERMINUS_POOL_BASE_PRICE`
131+
132+
- [ ] Set up payment token:
133+
134+
```bash
135+
dao terminus set-payment-token \
136+
--network $DAO_NETWORK \
137+
--address $TERMINUS_DIAMOND \
138+
--sender $DAO_OWNER \
139+
--max-fee-per-gas "$MAX_FEE_PER_GAS" \
140+
--confirmations $CONFIRMATIONS \
141+
--new-payment-token $WETH
142+
```
143+
144+
- [ ] Check payment token: `dao terminus payment-token --network $DAO_NETWORK --address $TERMINUS_DIAMOND`
145+
146+
- [ ] Payment token should be same as `$WETH`

0 commit comments

Comments
 (0)