3.3 KiB
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
{
"DiamondCutFacet": "0xda30781C3c8d4c81804E6Bf5c02D5E7898180dd7",
"Diamond": "0x040Cf7Ee9752936d8d280062a447eB53808EBc08",
"DiamondLoupeFacet": "0xEC5d886Bc5A7Fc31C76A5aB144c65C75AFa73Aea",
"OwnershipFacet": "0x2725E9FE8f5C97400d324C529e9ACBAd213E68b9",
"attached": [
"DiamondLoupeFacet",
"OwnershipFacet"
]
}
TerminusInitializer
address
export TERMINUS_INITIALIZER_ADDRESS="0xba71CB745C499D4A4f42Fd7aA40044b3b27Da6D4"
TerminusFacet
address
export TERMINUS_FACET_ADDRESS="0x9784e26967779e62450Eb204077EF70B4c7A3612"
Environment variables
export DAO_NETWORK=polygon-test
export DAO_OWNER=.secrets/dao-dev.json
export DAO_OWNER_ADDRESS=$(jq -r .address $DAO_OWNER)
export GAS_PRICE="35 gwei"
export CONFIRMATIONS=2
export TERMINUS_ADDRESSES=.secrets/terminus-mumbai-diamond.json
Deploy diamond proxy
- Deploy diamond with all core facets
dao core gogogo \
--network $DAO_NETWORK \
--sender $DAO_OWNER \
--gas-price "$GAS_PRICE" \
--confirmations $CONFIRMATIONS \
--owner $DAO_OWNER_ADDRESS \
--outfile $TERMINUS_ADDRESSES
-
Store JSON output under
Deployed addresses / Diamond addresses
above. -
Export diamond proxy address:
export TERMINUS_DIAMOND="$(jq -r .Diamond $TERMINUS_ADDRESSES)"
Deploy TerminusInitializer
- Deploy
TerminusInitializer
contract
dao terminus-initializer deploy \
--network $DAO_NETWORK \
--sender $DAO_OWNER \
--gas-price "$GAS_PRICE" \
--confirmations $CONFIRMATIONS
-
Export address of deployed contract as
export TERMINUS_INITIALIZER_ADDRESS=0xba71CB745C499D4A4f42Fd7aA40044b3b27Da6D4
-
Store address of deployed contract under
Deployed addresses / TerminusInitializer address
above
Deploy TerminusFacet
- Deploy
TerminusFacet
contract
dao terminus deploy \
--network $DAO_NETWORK \
--sender $DAO_OWNER \
--gas-price "$GAS_PRICE" \
--confirmations $CONFIRMATIONS
-
Export address of deployed contract as
export TERMINUS_FACET_ADDRESS=0x9784e26967779e62450Eb204077EF70B4c7A3612
-
Store address of deployed contract under
Deployed addresses / TerminusFacet address
above -
Attach
TerminusFacet
to diamond:
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
-
Check the number of pools on the Terminus contract:
dao terminus total-pools --network $DAO_NETWORK --address $TERMINUS_DIAMOND
-
Number of pools is
0
-
Check the Terminus controller:
dao terminus terminus-controller --network $DAO_NETWORK --address $TERMINUS_DIAMOND
-
Controller should be the same as
$DAO_OWNER_ADDRESS