Skip to content

Commit

Permalink
Read addrs from json (#78)
Browse files Browse the repository at this point in the history
* read addrs from json

* read addrs from json

* fix path

* fix
  • Loading branch information
hujw77 authored Nov 7, 2023
1 parent 9f46d79 commit aff5554
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 15 deletions.
4 changes: 2 additions & 2 deletions bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 6 additions & 4 deletions bin/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 16 additions & 9 deletions script/deploy/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand Down
9 changes: 9 additions & 0 deletions script/input/c3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"DEPLOYER": "0x0f14341A7f464320319025540E8Fe48Ad0fe5aec",
"ORMP_ADDR": "0x00000000001523057a05d6293C1e5171eE33eE0A",
"ORMP_SALT": "0x4d629bbdb40d29206f12a51aa81faf14553b218f96845742a89e02e55ecfcef6",
"ORACLE_ADDR": "0x0000000000ba03146Cc235509E802873D418a6bc",
"ORACLE_SALT": "0x7945140b3deab397a3ed2a87a716d03930e85e019b9bd2c21d28713feb5ab1de",
"RELAYER_ADDR": "0x0000000000808fE9bDCc1d180EfbF5C53552a6b1",
"RELATER_SALT": "0x9d38bcb32422a45bc9c08605d4457bcd3dadddfee1573a352ace5f1defa45621"
}

0 comments on commit aff5554

Please sign in to comment.