diff --git a/README.md b/README.md index 59ca1e3..22665cc 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Oracle and Relayer based Message Protocol. |------------|--------------------------------------------| | ORMP | 0x009D223Aad560e72282db9c0438Ef1ef2bf7703D | | Oracle | 0x00BD655DDfA7aFeF4BB109FE1F938724527B49D8 | -| Relayer | 0x0065a081a11cc1f6e1692c2A08E9AF36b17973eC | +| Relayer | 0x003605167cd4C36063a7B63e604497e623Bb8B10 | ## Usage To install with [**Foundry**](https://github.com/gakonst/foundry): diff --git a/bin/deploy.sh b/bin/deploy.sh index f40a302..7ff13fe 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 c452536..af1aa31 100755 --- a/bin/verify.sh +++ b/bin/verify.sh @@ -5,7 +5,7 @@ set -eo pipefail deployer=0x0f14341A7f464320319025540E8Fe48Ad0fe5aec ormp=0x009D223Aad560e72282db9c0438Ef1ef2bf7703D oracle=0x00BD655DDfA7aFeF4BB109FE1F938724527B49D8 -relayer=0x0065a081a11cc1f6e1692c2A08E9AF36b17973eC +relayer=0x003605167cd4C36063a7B63e604497e623Bb8B10 verify() { local addr; addr=$1 diff --git a/script/deploy/Deploy.s.sol b/script/deploy/Deploy.s.sol index b1e472b..014b71c 100644 --- a/script/deploy/Deploy.s.sol +++ b/script/deploy/Deploy.s.sol @@ -35,8 +35,8 @@ contract Deploy is Common { address immutable ORACLE_ADDR = 0x00BD655DDfA7aFeF4BB109FE1F938724527B49D8; bytes32 immutable ORACLE_SALT = 0xfbb782802ad938a1df1c89407273c248c1d7af7b4f9e94704564a4ca792a4296; - address immutable RELAYER_ADDR = 0x0065a081a11cc1f6e1692c2A08E9AF36b17973eC; - bytes32 immutable RELAYER_SALT = 0x5f1532f1a200d9076629b2691489b82712c30ba913251eae5871243a0faa5062; + address immutable RELAYER_ADDR = 0x003605167cd4C36063a7B63e604497e623Bb8B10; + bytes32 immutable RELAYER_SALT = 0x5209fea465d02b614816418fde3b910357bae75dbcb0312a9b7a7b83718271cc; string config; string instanceId; @@ -69,16 +69,16 @@ contract Deploy is Common { function run() public { require(deployer == msg.sender, "!deployer"); - // deployProtocol(); - // deployOralce(); - // deployRelayer(); + deployProtocol(); + deployOralce(); + deployRelayer(); setConfig(); - // ScriptTools.exportContract(outputName, "DAO", dao); - // ScriptTools.exportContract(outputName, "ORMP", ORMP_ADDR); - // ScriptTools.exportContract(outputName, "ORACLE", ORMP_ADDR); - // ScriptTools.exportContract(outputName, "RELAYER", RELAYER_ADDR); + ScriptTools.exportContract(outputName, "DAO", dao); + ScriptTools.exportContract(outputName, "ORMP", ORMP_ADDR); + ScriptTools.exportContract(outputName, "ORACLE", ORMP_ADDR); + ScriptTools.exportContract(outputName, "RELAYER", RELAYER_ADDR); } /// @notice Deploy the protocol diff --git a/script/input/44/fee.c.json b/script/input/44/fee.c.json index 83d5139..d10d953 100644 --- a/script/input/44/fee.c.json +++ b/script/input/44/fee.c.json @@ -8,7 +8,7 @@ "421614": { "dstPriceRatio": 9000000000000000, "dstGasPriceInWei": 110000000, - "baseGas": 140000, + "baseGas": 1, "gasPerByte": 16 } } diff --git a/script/output/421614/deploy.a-latest.json b/script/output/421614/deploy.a-latest.json index 0a4ab58..1be82e2 100644 --- a/script/output/421614/deploy.a-latest.json +++ b/script/output/421614/deploy.a-latest.json @@ -2,5 +2,5 @@ "DAO": "0x0f14341A7f464320319025540E8Fe48Ad0fe5aec", "ORACLE": "0x00BD655DDfA7aFeF4BB109FE1F938724527B49D8", "ORMP": "0x009D223Aad560e72282db9c0438Ef1ef2bf7703D", - "RELAYER": "0x0065a081a11cc1f6e1692c2A08E9AF36b17973eC" -} \ No newline at end of file + "RELAYER": "0x003605167cd4C36063a7B63e604497e623Bb8B10" +} diff --git a/script/output/44/deploy.a-latest.json b/script/output/44/deploy.a-latest.json index 0a4ab58..628db39 100644 --- a/script/output/44/deploy.a-latest.json +++ b/script/output/44/deploy.a-latest.json @@ -1,6 +1,6 @@ { "DAO": "0x0f14341A7f464320319025540E8Fe48Ad0fe5aec", - "ORACLE": "0x00BD655DDfA7aFeF4BB109FE1F938724527B49D8", - "ORMP": "0x009D223Aad560e72282db9c0438Ef1ef2bf7703D", - "RELAYER": "0x0065a081a11cc1f6e1692c2A08E9AF36b17973eC" -} \ No newline at end of file + "ORACLE": "0x0002396F1D52323fcd1ae8079b38808F046882c3", + "RELAYER": "0x003605167cd4C36063a7B63e604497e623Bb8B10", + "ORMP": "0x0034607daf9c1dc6628f6e09E81bB232B6603A89" +} diff --git a/src/eco/Relayer.sol b/src/eco/Relayer.sol index 83391d3..6abcbc2 100644 --- a/src/eco/Relayer.sol +++ b/src/eco/Relayer.sol @@ -101,6 +101,7 @@ contract Relayer { DstPrice memory p = priceOf[toChainId]; DstConfig memory c = configOf[toChainId]; + require(c.baseGas != 0, "!baseGas"); // remoteToken = dstGasPriceInWei * (baseGas + extraGas) uint256 remoteToken = p.dstGasPriceInWei * (c.baseGas + extraGas); // dstPriceRatio = dstPrice / localPrice * 10^10 diff --git a/test/bench/ORMP.b.sol b/test/bench/ORMP.b.sol index 6e6052c..94b96d9 100644 --- a/test/bench/ORMP.b.sol +++ b/test/bench/ORMP.b.sol @@ -28,7 +28,7 @@ contract ORMPBenchmarkTest is Test { using Chains for uint256; ORMP ormp = ORMP(0x009D223Aad560e72282db9c0438Ef1ef2bf7703D); - Relayer relayer = Relayer(payable(0x0065a081a11cc1f6e1692c2A08E9AF36b17973eC)); + Relayer relayer = Relayer(payable(0x003605167cd4C36063a7B63e604497e623Bb8B10)); Oracle oracle = Oracle(payable(0x00BD655DDfA7aFeF4BB109FE1F938724527B49D8)); bytes32 root; @@ -54,7 +54,7 @@ contract ORMPBenchmarkTest is Test { test_recv(fromChainId, toChainId, encoded); } - function test_recv(uint256 fromChainId, uint256 toChainId, bytes calldata encoded) public { + function test_recv(uint256 fromChainId, uint256 toChainId, bytes calldata encoded) internal { perform_send(fromChainId, toChainId, encoded); Message memory message = Message({