Skip to content

Commit

Permalink
Set pause delay via config file
Browse files Browse the repository at this point in the history
  • Loading branch information
gbalabasquer committed Apr 4, 2019
1 parent 00eb99a commit b6df9cc
Show file tree
Hide file tree
Showing 15 changed files with 57 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ PROXY_PAUSE_ACTIONS=$(dapp create TestchainPauseProxyActions)
seth send "$PROXY_REGISTRY" 'build()'

# Get a proxy for the deployer address
PROXY_DEPLOYER="$(seth call "$PROXY_REGISTRY" 'proxies(address)(address)' "$ETH_FROM")"
PROXY_DEPLOYER=0x"$(seth call "$PROXY_REGISTRY" 'proxies(address)(address)' "$ETH_FROM")"

# Elect the proxy address as the new chief hat
seth send "$MCD_ADM" 'vote(address[] memory)' ["${PROXY_DEPLOYER#0x}"]
Expand Down
2 changes: 1 addition & 1 deletion contracts/testchain-pause-proxy-actions
3 changes: 3 additions & 0 deletions kovan-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ done
# shellcheck source=/dev/null
./set-ilks-spotter-poke

# shellcheck source=/dev/null
./set-pause-delay

echo "KOVAN DEPLOYMENT COMPLETED SUCCESSFULLY"
1 change: 1 addition & 0 deletions kovan.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"description": "Kovan deployment",
"etherscanApiKey": "4PDDUF52BTUD32C3RJ7RJXRY7KIJFJ38RY",
"pauseDelay": "300",
"line": "1000000",
"tokens": {
"ETH": {
Expand Down
20 changes: 20 additions & 0 deletions set-pause-delay
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -ex

export ETH_GAS=${ETH_GAS:-"7000000"}

# Get config variables
CONFIG_FILE="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )/out/config.json"

delay=$(jq -r ".pauseDelay" "$CONFIG_FILE")

if [ "$delay" -gt 0 ]; then
# shellcheck source=/dev/null
. load-addresses

cd contracts/testchain-pause-proxy-actions
dapp build
action=$(dapp create ActionChangeDelay)
calldata="$(seth calldata 'changeDelay(address,address,uint256)' "$MCD_PAUSE" "$action" "$(seth --to-uint256 "$delay")")"
seth send "$PROXY_DEPLOYER" 'execute(address,bytes memory)' "$PROXY_PAUSE_ACTIONS" "$calldata"
fi
5 changes: 5 additions & 0 deletions step-1-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ for token in $tokens; do
fi
done

if [ "$CONFIG_STEP" = "step-1" ]; then
# shellcheck source=/dev/null
./set-pause-delay
fi

# Copy abi files
cp ./contracts/testchain-medians/out/Median.abi ./out/abi
cp ./contracts/osm/out/DSValue.abi ./out/abi
Expand Down
1 change: 1 addition & 0 deletions step-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"defaults": {},
"roles": ["CREATOR"],
"omniaFromAddr": "0xdc9A20F5a46AFE0802b361076BeFC51f787B2e58",
"pauseDelay": "0",
"tokens": {
"ETH": {
"pip": {
Expand Down
5 changes: 5 additions & 0 deletions step-2-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@ export CONFIG_STEP=${CONFIG_STEP:-"step-2"}
# shellcheck source=/dev/null
./poll-deploy

if [ "$CONFIG_STEP" = "step-2" ]; then
# shellcheck source=/dev/null
./set-pause-delay
fi

echo "STEP 2 COMPLETED SUCCESSFULLY"
1 change: 1 addition & 0 deletions step-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"defaults": {},
"roles": ["CREATOR"],
"omniaFromAddr": "0xdc9A20F5a46AFE0802b361076BeFC51f787B2e58",
"pauseDelay": "0",
"tokens": {
"ETH": {
"pip": {
Expand Down
5 changes: 5 additions & 0 deletions step-3-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@ export CONFIG_STEP=${CONFIG_STEP:-"step-3"}
# shellcheck source=/dev/null
./set-ilks-spell-line

if [ "$CONFIG_STEP" = "step-3" ]; then
# shellcheck source=/dev/null
./set-pause-delay
fi

echo "STEP 3 COMPLETED SUCCESSFULLY"
1 change: 1 addition & 0 deletions step-3.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"defaults": {},
"roles": ["CREATOR"],
"omniaFromAddr": "0xdc9A20F5a46AFE0802b361076BeFC51f787B2e58",
"pauseDelay": "0",
"line": "1500",
"tokens": {
"ETH": {
Expand Down
5 changes: 5 additions & 0 deletions step-4-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,9 @@ export CONFIG_STEP=${CONFIG_STEP:-"step-4"}
# shellcheck source=/dev/null
./set-ilks-spotter-poke

if [ "$CONFIG_STEP" = "step-4" ]; then
# shellcheck source=/dev/null
./set-pause-delay
fi

echo "STEP 4 COMPLETED SUCCESSFULLY"
1 change: 1 addition & 0 deletions step-4.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"defaults": {},
"roles": ["CREATOR"],
"omniaFromAddr": "0xdc9A20F5a46AFE0802b361076BeFC51f787B2e58",
"pauseDelay": "0",
"line": "1500",
"tokens": {
"ETH": {
Expand Down
6 changes: 6 additions & 0 deletions step-7-deploy
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ seth send "$MCD_SPOT" 'poke(bytes32)' "$(seth --to-bytes32 "$(seth --from-ascii
# Bite CDP
seth send "$MCD_CAT" 'bite(bytes32,address)' "$(seth --to-bytes32 "$(seth --from-ascii "${token}-${ilk}")")" "$URN"

# Set Pause Delay
if [ "$CONFIG_STEP" = "step-7" ]; then
# shellcheck source=/dev/null
./set-pause-delay
fi

echo "STEP 7 COMPLETED SUCCESSFULLY"
1 change: 1 addition & 0 deletions step-7.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"defaults": {},
"roles": ["CREATOR"],
"omniaFromAddr": "0xdc9A20F5a46AFE0802b361076BeFC51f787B2e58",
"pauseDelay": "0",
"line": "1500",
"tokens": {
"ETH": {
Expand Down

0 comments on commit b6df9cc

Please sign in to comment.