Skip to content

Commit 6e27881

Browse files
committed
Fix issue minting MCD_GOV and settings permission
1 parent cb7c073 commit 6e27881

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

scripts/base-deploy

+17-13
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,28 @@ export MCD_PAUSE_DELAY=0
3434
# Make sure there is not $MCD_ADM set, so a temporary roles is created as authority (to handle variables set up easier)
3535
unset MCD_ADM
3636

37+
if [[ -z "$MCD_GOV" ]]; then
38+
# It means the GOV token will be created now in the next deployment script call, then we can send funds to the Faucet and set permissions to FLOP
39+
newGovToken=true
40+
else
41+
newGovToken=false
42+
fi
43+
3744
# Deploy MCD Core Contratcs (solc optimized)
3845
deploy-core
3946
# shellcheck source=/dev/null
4047
. "load-mcd-$(seth chain)"
4148
rm "load-mcd-$(seth chain)"
4249

50+
# Mint Gov Token, send to the Faucet and set permissions if a new token
51+
if [[ "$newGovToken" == true ]]; then
52+
seth send "$MCD_GOV" 'mint(address,uint256)' "$FAUCET" "$(seth --to-uint256 "$(seth --to-wei 1000000 ETH)")"
53+
seth send "$MCD_GOV" 'setAuthority(address)' "$MCD_GOV_GUARD"
54+
seth send "$FAUCET" 'gulp(address)' "$MCD_GOV"
55+
# Allow Flop to mint Gov token
56+
seth send "$MCD_GOV_GUARD" 'permit(address,address,bytes32)' "$MCD_FLOP" "$MCD_GOV" "$(seth --to-bytes32 "$(seth sig 'mint(address,uint256)')")"
57+
fi
58+
4359
# Deploy Collaterals (no solc optimization)
4460
tokens=$(jq -r ".tokens | keys_unsorted[]" "$CONFIG_FILE")
4561
for token in $tokens; do
@@ -88,19 +104,6 @@ PROXY_ACTIONS=$(dappCreate dss-proxy-actions DssProxyActions)
88104
CDP_MANAGER=$(dappCreate dss-proxy-actions DssCdpManager "$MCD_VAT")
89105
GET_CDPS=$(dappCreate dss-proxy-actions GetCdps)
90106

91-
dappBuild ds-chief
92-
93-
# Deploy Gov token if doesn't exist
94-
if [[ -z "$MCD_GOV" ]]; then
95-
MCD_GOV=$(dappCreate ds-chief DSToken "$(seth --to-bytes32 "$(seth --from-ascii "MKR")")")
96-
export MCD_GOV
97-
seth send "$MCD_GOV" 'mint(address,uint256)' "$FAUCET" "$(seth --to-uint256 "$(seth --to-wei 1000000 ETH)")"
98-
seth send "$MCD_GOV" 'setAuthority(address)' "$MCD_GOV_GUARD"
99-
seth send "$FAUCET" 'gulp(address)' "$MCD_GOV"
100-
# Allow Flop to mint Gov token
101-
seth send "$MCD_GOV_GUARD" 'permit(address,address,bytes32)' "$MCD_FLOP" "$MCD_GOV" "$(seth --to-bytes32 "$(seth sig 'mint(address,uint256)')")"
102-
fi
103-
104107
# Deploy Pause Proxy Actions (support contract for executing initial set up of the dss system)
105108
dappBuild testchain-pause-proxy-actions
106109

@@ -114,6 +117,7 @@ PROXY_DEPLOYER=0x"$(seth call "$PROXY_REGISTRY" 'proxies(address)(address)' "$ET
114117
seth send "$MCD_ADM" 'setRootUser(address,bool)' "$PROXY_DEPLOYER" true
115118

116119
# Deploy chief as new $MCD_ADM (no solc optimization)
120+
dappBuild ds-chief
117121
MCD_IOU=$(dappCreate ds-chief DSToken "$(seth --to-bytes32 "$(seth --from-ascii "IOU")")")
118122
seth send "$MCD_IOU" 'setAuthority(address)' "$MCD_GOV_GUARD"
119123
MCD_ADM=$(dappCreate ds-chief DSChief "$MCD_GOV" "$MCD_IOU" 5)

0 commit comments

Comments
 (0)