From aff5554ae1f95b620ce930155c70614eac2372ff Mon Sep 17 00:00:00 2001 From: echo Date: Tue, 7 Nov 2023 13:43:44 +0800 Subject: [PATCH] Read addrs from json (#78) * read addrs from json * read addrs from json * fix path * fix --- bin/deploy.sh | 4 ++-- bin/verify.sh | 10 ++++++---- script/deploy/Deploy.s.sol | 25 ++++++++++++++++--------- script/input/c3.json | 9 +++++++++ 4 files changed, 33 insertions(+), 15 deletions(-) create mode 100644 script/input/c3.json diff --git a/bin/deploy.sh b/bin/deploy.sh index 7ff13fe..f3b54c7 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -2,5 +2,5 @@ set -eo pipefail -# forge script script/deploy/Deploy.s.sol:Deploy --chain-id 44 --broadcast --verify -forge script script/deploy/Deploy.s.sol:Deploy --chain-id 421614 --broadcast --verify # --skip-simulation +forge script script/deploy/Deploy.s.sol:Deploy --chain-id 44 # --broadcast --verify +forge script script/deploy/Deploy.s.sol:Deploy --chain-id 421614 # --broadcast --verify # --skip-simulation diff --git a/bin/verify.sh b/bin/verify.sh index af1aa31..5ddb9db 100755 --- a/bin/verify.sh +++ b/bin/verify.sh @@ -2,10 +2,12 @@ set -eo pipefail -deployer=0x0f14341A7f464320319025540E8Fe48Ad0fe5aec -ormp=0x009D223Aad560e72282db9c0438Ef1ef2bf7703D -oracle=0x00BD655DDfA7aFeF4BB109FE1F938724527B49D8 -relayer=0x003605167cd4C36063a7B63e604497e623Bb8B10 +c3=$PWD/script/input/c3.json + +deployer=$(jq -r ".DEPLOYER" $C3) +ormp=$(jq -r ".ORMP_ADDR" $c3) +oracle=$(jq -r ".ORACLE_ADDR" $c3) +relayer=$(jq -r ".RELAYER_ADDR" $c3) verify() { local addr; addr=$1 diff --git a/script/deploy/Deploy.s.sol b/script/deploy/Deploy.s.sol index d3f5f8b..cece37b 100644 --- a/script/deploy/Deploy.s.sol +++ b/script/deploy/Deploy.s.sol @@ -29,15 +29,14 @@ contract Deploy is Common { using stdJson for string; using ScriptTools for string; - address immutable ORMP_ADDR = 0x009D223Aad560e72282db9c0438Ef1ef2bf7703D; - bytes32 immutable ORMP_SALT = 0x0a68f3af806b448a1e6e4b5b2fced6f144cff5e1bfd733bcb51916a6d696e7aa; - - address immutable ORACLE_ADDR = 0x00BD655DDfA7aFeF4BB109FE1F938724527B49D8; - bytes32 immutable ORACLE_SALT = 0xfbb782802ad938a1df1c89407273c248c1d7af7b4f9e94704564a4ca792a4296; - - address immutable RELAYER_ADDR = 0x003605167cd4C36063a7B63e604497e623Bb8B10; - bytes32 immutable RELAYER_SALT = 0x5209fea465d02b614816418fde3b910357bae75dbcb0312a9b7a7b83718271cc; - + address ORMP_ADDR; + bytes32 ORMP_SALT; + address ORACLE_ADDR; + bytes32 ORACLE_SALT; + address RELAYER_ADDR; + bytes32 RELAYER_SALT; + + string c3; string config; string instanceId; string outputName; @@ -58,6 +57,14 @@ contract Deploy is Common { instanceId = vm.envOr("INSTANCE_ID", string("deploy.c")); outputName = "deploy.a"; config = ScriptTools.readInput(instanceId); + c3 = ScriptTools.readInput("../c3"); + + ORMP_ADDR = c3.readAddress("ORMP_ADDR"); + ORMP_SALT = c3.readBytes32("ORMP_SALT"); + ORACLE_ADDR = c3.readAddress("ORACLE_ADDR"); + ORACLE_SALT = c3.readBytes32("ORACLE_SALT"); + RELAYER_ADDR = c3.readAddress("RELAYER_ADDR"); + RELAYER_SALT = c3.readBytes32("RELAYER_SALT"); deployer = config.readAddress(".DEPLOYER"); dao = config.readAddress(".DAO"); diff --git a/script/input/c3.json b/script/input/c3.json new file mode 100644 index 0000000..6e3186a --- /dev/null +++ b/script/input/c3.json @@ -0,0 +1,9 @@ +{ + "DEPLOYER": "0x0f14341A7f464320319025540E8Fe48Ad0fe5aec", + "ORMP_ADDR": "0x00000000001523057a05d6293C1e5171eE33eE0A", + "ORMP_SALT": "0x4d629bbdb40d29206f12a51aa81faf14553b218f96845742a89e02e55ecfcef6", + "ORACLE_ADDR": "0x0000000000ba03146Cc235509E802873D418a6bc", + "ORACLE_SALT": "0x7945140b3deab397a3ed2a87a716d03930e85e019b9bd2c21d28713feb5ab1de", + "RELAYER_ADDR": "0x0000000000808fE9bDCc1d180EfbF5C53552a6b1", + "RELATER_SALT": "0x9d38bcb32422a45bc9c08605d4457bcd3dadddfee1573a352ace5f1defa45621" +}