From c035373077742d8b33d67814cfa5f44ead2827af Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 14 Feb 2024 17:54:28 +0100 Subject: [PATCH 1/3] Add sig check to CI --- package.json | 1 + scripts/signatures_test.bash | 17 ++++++++++++ test/signatures/L1AtomicTokenBridgeCreator | 25 +++++++++++++++++ test/signatures/L1CustomGateway | 24 +++++++++++++++++ test/signatures/L1ERC20Gateway | 20 ++++++++++++++ test/signatures/L1GatewayRouter | 24 +++++++++++++++++ test/signatures/L1OrbitCustomGateway | 27 +++++++++++++++++++ test/signatures/L1OrbitERC20Gateway | 20 ++++++++++++++ test/signatures/L1OrbitGatewayRouter | 28 ++++++++++++++++++++ test/signatures/L1OrbitReverseCustomGateway | 27 +++++++++++++++++++ test/signatures/L1ReverseCustomGateway | 24 +++++++++++++++++ test/signatures/L1TokenBridgeRetryableSender | 7 +++++ test/signatures/L1WethGateway | 19 +++++++++++++ test/signatures/L2AtomicTokenBridgeFactory | 3 +++ test/signatures/L2CustomGateway | 14 ++++++++++ test/signatures/L2ERC20Gateway | 15 +++++++++++ test/signatures/L2GatewayRouter | 16 +++++++++++ test/signatures/L2ReverseCustomGateway | 14 ++++++++++ test/signatures/L2WethGateway | 14 ++++++++++ test/signatures/StandardArbERC20 | 23 ++++++++++++++++ 20 files changed, 362 insertions(+) create mode 100755 scripts/signatures_test.bash create mode 100644 test/signatures/L1AtomicTokenBridgeCreator create mode 100644 test/signatures/L1CustomGateway create mode 100644 test/signatures/L1ERC20Gateway create mode 100644 test/signatures/L1GatewayRouter create mode 100644 test/signatures/L1OrbitCustomGateway create mode 100644 test/signatures/L1OrbitERC20Gateway create mode 100644 test/signatures/L1OrbitGatewayRouter create mode 100644 test/signatures/L1OrbitReverseCustomGateway create mode 100644 test/signatures/L1ReverseCustomGateway create mode 100644 test/signatures/L1TokenBridgeRetryableSender create mode 100644 test/signatures/L1WethGateway create mode 100644 test/signatures/L2AtomicTokenBridgeFactory create mode 100644 test/signatures/L2CustomGateway create mode 100644 test/signatures/L2ERC20Gateway create mode 100644 test/signatures/L2GatewayRouter create mode 100644 test/signatures/L2ReverseCustomGateway create mode 100644 test/signatures/L2WethGateway create mode 100644 test/signatures/StandardArbERC20 diff --git a/package.json b/package.json index 74526530ac..e80ec24486 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "test:unit": "forge test", "test:e2e:local-env": "yarn hardhat test test-e2e/*", "test:storage": "./scripts/storage_layout_test.bash", + "test:signatures": "./scripts/signatures_test.bash", "test:mutation": "ts-node test-mutation/gambitTester.ts", "deploy:local:token-bridge": "ts-node ./scripts/local-deployment/deployCreatorAndCreateTokenBridge.ts", "deploy:token-bridge-creator": "ts-node ./scripts/deployment/deployTokenBridgeCreator.ts", diff --git a/scripts/signatures_test.bash b/scripts/signatures_test.bash new file mode 100755 index 0000000000..f728e5d512 --- /dev/null +++ b/scripts/signatures_test.bash @@ -0,0 +1,17 @@ +#!/bin/bash +output_dir="./test/signatures" +for CONTRACTNAME in L1ERC20Gateway L1CustomGateway L1ReverseCustomGateway L1WethGateway L2ERC20Gateway L2CustomGateway L2ReverseCustomGateway L2WethGateway L1GatewayRouter L2GatewayRouter StandardArbERC20 L1AtomicTokenBridgeCreator L1TokenBridgeRetryableSender L2AtomicTokenBridgeFactory L1OrbitCustomGateway L1OrbitERC20Gateway L1OrbitGatewayRouter L1OrbitReverseCustomGateway +do + echo "Checking for signature changes in $CONTRACTNAME" + [ -f "$output_dir/$CONTRACTNAME" ] && mv "$output_dir/$CONTRACTNAME" "$output_dir/$CONTRACTNAME-old" + forge inspect "$CONTRACTNAME" methods > "$output_dir/$CONTRACTNAME" + diff "$output_dir/$CONTRACTNAME-old" "$output_dir/$CONTRACTNAME" + if [[ $? != "0" ]] + then + CHANGED=1 + fi +done +if [[ $CHANGED == 1 ]] +then + exit 1 +fi \ No newline at end of file diff --git a/test/signatures/L1AtomicTokenBridgeCreator b/test/signatures/L1AtomicTokenBridgeCreator new file mode 100644 index 0000000000..9d2ac7cc5e --- /dev/null +++ b/test/signatures/L1AtomicTokenBridgeCreator @@ -0,0 +1,25 @@ +{ + "canonicalL2FactoryAddress()": "bfd3e518", + "createTokenBridge(address,address,uint256,uint256)": "8277742b", + "gasLimitForL2FactoryDeployment()": "888139d4", + "getRouter(address)": "8369166d", + "inboxToL1Deployment(address)": "d9ce0ef9", + "inboxToL2Deployment(address)": "46052706", + "initialize(address)": "c4d66de8", + "l1Multicall()": "b1460a71", + "l1Templates()": "a5595da9", + "l1Weth()": "146bf4b1", + "l2CustomGatewayTemplate()": "41083186", + "l2MulticallTemplate()": "8c99e31c", + "l2RouterTemplate()": "381c9d99", + "l2StandardGatewayTemplate()": "d7eee6ca", + "l2TokenBridgeFactoryTemplate()": "1aeef2e2", + "l2WethGatewayTemplate()": "9095765e", + "l2WethTemplate()": "fd40ad85", + "owner()": "8da5cb5b", + "renounceOwnership()": "715018a6", + "retryableSender()": "36dddb97", + "setDeployment(address,(address,address,address,address,address),(address,address,address,address,address,address,address,address,address))": "4c149671", + "setTemplates((address,address,address,address,address,address,address,address),address,address,address,address,address,address,address,address,address,uint256)": "81fb9184", + "transferOwnership(address)": "f2fde38b" +} diff --git a/test/signatures/L1CustomGateway b/test/signatures/L1CustomGateway new file mode 100644 index 0000000000..e756b93455 --- /dev/null +++ b/test/signatures/L1CustomGateway @@ -0,0 +1,24 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "encodeWithdrawal(uint256,address)": "020a6058", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "forceRegisterTokenToL2(address[],address[],uint256,uint256,uint256)": "1d3a689f", + "getExternalCall(uint256,address,bytes)": "f68a9082", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "inbox()": "fb0e722b", + "initialize(address,address,address,address)": "f8c8765e", + "l1ToL2Token(address)": "8a2dc014", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "outboundTransferCustomRefund(address,address,address,uint256,uint256,uint256,bytes)": "4fb1a07b", + "owner()": "8da5cb5b", + "postUpgradeInit()": "95fcea78", + "redirectedExits(bytes32)": "bcf2e6eb", + "registerTokenToL2(address,uint256,uint256,uint256)": "f26bdead", + "registerTokenToL2(address,uint256,uint256,uint256,address)": "ca346d4a", + "router()": "f887ea40", + "setOwner(address)": "13af4035", + "supportsInterface(bytes4)": "01ffc9a7", + "transferExitAndCall(uint256,address,address,bytes,bytes)": "bd5f3e7d", + "whitelist()": "93e59dc1" +} diff --git a/test/signatures/L1ERC20Gateway b/test/signatures/L1ERC20Gateway new file mode 100644 index 0000000000..98c9bb6125 --- /dev/null +++ b/test/signatures/L1ERC20Gateway @@ -0,0 +1,20 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "cloneableProxyHash()": "97881f8d", + "counterpartGateway()": "2db09c1c", + "encodeWithdrawal(uint256,address)": "020a6058", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "getExternalCall(uint256,address,bytes)": "f68a9082", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "inbox()": "fb0e722b", + "initialize(address,address,address,bytes32,address)": "a01893bf", + "l2BeaconProxyFactory()": "70fc045f", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "outboundTransferCustomRefund(address,address,address,uint256,uint256,uint256,bytes)": "4fb1a07b", + "postUpgradeInit()": "95fcea78", + "redirectedExits(bytes32)": "bcf2e6eb", + "router()": "f887ea40", + "supportsInterface(bytes4)": "01ffc9a7", + "transferExitAndCall(uint256,address,address,bytes,bytes)": "bd5f3e7d", + "whitelist()": "93e59dc1" +} diff --git a/test/signatures/L1GatewayRouter b/test/signatures/L1GatewayRouter new file mode 100644 index 0000000000..428467cc21 --- /dev/null +++ b/test/signatures/L1GatewayRouter @@ -0,0 +1,24 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "defaultGateway()": "03295802", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "getGateway(address)": "bda009fe", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "inbox()": "fb0e722b", + "initialize(address,address,address,address,address)": "1459457a", + "l1TokenToGateway(address)": "ed08fdc6", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "outboundTransferCustomRefund(address,address,address,uint256,uint256,uint256,bytes)": "4fb1a07b", + "owner()": "8da5cb5b", + "postUpgradeInit()": "95fcea78", + "router()": "f887ea40", + "setDefaultGateway(address,uint256,uint256,uint256)": "5625a952", + "setGateway(address,uint256,uint256,uint256)": "dd614569", + "setGateway(address,uint256,uint256,uint256,address)": "2d67b72d", + "setGateways(address[],address[],uint256,uint256,uint256)": "658b53f4", + "setOwner(address)": "13af4035", + "supportsInterface(bytes4)": "01ffc9a7", + "updateWhitelistSource(address)": "47466f98", + "whitelist()": "93e59dc1" +} diff --git a/test/signatures/L1OrbitCustomGateway b/test/signatures/L1OrbitCustomGateway new file mode 100644 index 0000000000..678bff837f --- /dev/null +++ b/test/signatures/L1OrbitCustomGateway @@ -0,0 +1,27 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "encodeWithdrawal(uint256,address)": "020a6058", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "forceRegisterTokenToL2(address[],address[],uint256,uint256,uint256)": "1d3a689f", + "forceRegisterTokenToL2(address[],address[],uint256,uint256,uint256,uint256)": "85f25597", + "getExternalCall(uint256,address,bytes)": "f68a9082", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "inbox()": "fb0e722b", + "initialize(address,address,address,address)": "f8c8765e", + "l1ToL2Token(address)": "8a2dc014", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "outboundTransferCustomRefund(address,address,address,uint256,uint256,uint256,bytes)": "4fb1a07b", + "owner()": "8da5cb5b", + "postUpgradeInit()": "95fcea78", + "redirectedExits(bytes32)": "bcf2e6eb", + "registerTokenToL2(address,uint256,uint256,uint256)": "f26bdead", + "registerTokenToL2(address,uint256,uint256,uint256,address)": "ca346d4a", + "registerTokenToL2(address,uint256,uint256,uint256,address,uint256)": "37daacad", + "registerTokenToL2(address,uint256,uint256,uint256,uint256)": "3e8ee3df", + "router()": "f887ea40", + "setOwner(address)": "13af4035", + "supportsInterface(bytes4)": "01ffc9a7", + "transferExitAndCall(uint256,address,address,bytes,bytes)": "bd5f3e7d", + "whitelist()": "93e59dc1" +} diff --git a/test/signatures/L1OrbitERC20Gateway b/test/signatures/L1OrbitERC20Gateway new file mode 100644 index 0000000000..98c9bb6125 --- /dev/null +++ b/test/signatures/L1OrbitERC20Gateway @@ -0,0 +1,20 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "cloneableProxyHash()": "97881f8d", + "counterpartGateway()": "2db09c1c", + "encodeWithdrawal(uint256,address)": "020a6058", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "getExternalCall(uint256,address,bytes)": "f68a9082", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "inbox()": "fb0e722b", + "initialize(address,address,address,bytes32,address)": "a01893bf", + "l2BeaconProxyFactory()": "70fc045f", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "outboundTransferCustomRefund(address,address,address,uint256,uint256,uint256,bytes)": "4fb1a07b", + "postUpgradeInit()": "95fcea78", + "redirectedExits(bytes32)": "bcf2e6eb", + "router()": "f887ea40", + "supportsInterface(bytes4)": "01ffc9a7", + "transferExitAndCall(uint256,address,address,bytes,bytes)": "bd5f3e7d", + "whitelist()": "93e59dc1" +} diff --git a/test/signatures/L1OrbitGatewayRouter b/test/signatures/L1OrbitGatewayRouter new file mode 100644 index 0000000000..db159e0dd5 --- /dev/null +++ b/test/signatures/L1OrbitGatewayRouter @@ -0,0 +1,28 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "defaultGateway()": "03295802", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "getGateway(address)": "bda009fe", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "inbox()": "fb0e722b", + "initialize(address,address,address,address,address)": "1459457a", + "l1TokenToGateway(address)": "ed08fdc6", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "outboundTransferCustomRefund(address,address,address,uint256,uint256,uint256,bytes)": "4fb1a07b", + "owner()": "8da5cb5b", + "postUpgradeInit()": "95fcea78", + "router()": "f887ea40", + "setDefaultGateway(address,uint256,uint256,uint256)": "5625a952", + "setDefaultGateway(address,uint256,uint256,uint256,uint256)": "c9a96997", + "setGateway(address,uint256,uint256,uint256)": "dd614569", + "setGateway(address,uint256,uint256,uint256,address)": "2d67b72d", + "setGateway(address,uint256,uint256,uint256,address,uint256)": "d7f7459c", + "setGateway(address,uint256,uint256,uint256,uint256)": "dc121927", + "setGateways(address[],address[],uint256,uint256,uint256)": "658b53f4", + "setGateways(address[],address[],uint256,uint256,uint256,uint256)": "55654af8", + "setOwner(address)": "13af4035", + "supportsInterface(bytes4)": "01ffc9a7", + "updateWhitelistSource(address)": "47466f98", + "whitelist()": "93e59dc1" +} diff --git a/test/signatures/L1OrbitReverseCustomGateway b/test/signatures/L1OrbitReverseCustomGateway new file mode 100644 index 0000000000..678bff837f --- /dev/null +++ b/test/signatures/L1OrbitReverseCustomGateway @@ -0,0 +1,27 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "encodeWithdrawal(uint256,address)": "020a6058", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "forceRegisterTokenToL2(address[],address[],uint256,uint256,uint256)": "1d3a689f", + "forceRegisterTokenToL2(address[],address[],uint256,uint256,uint256,uint256)": "85f25597", + "getExternalCall(uint256,address,bytes)": "f68a9082", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "inbox()": "fb0e722b", + "initialize(address,address,address,address)": "f8c8765e", + "l1ToL2Token(address)": "8a2dc014", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "outboundTransferCustomRefund(address,address,address,uint256,uint256,uint256,bytes)": "4fb1a07b", + "owner()": "8da5cb5b", + "postUpgradeInit()": "95fcea78", + "redirectedExits(bytes32)": "bcf2e6eb", + "registerTokenToL2(address,uint256,uint256,uint256)": "f26bdead", + "registerTokenToL2(address,uint256,uint256,uint256,address)": "ca346d4a", + "registerTokenToL2(address,uint256,uint256,uint256,address,uint256)": "37daacad", + "registerTokenToL2(address,uint256,uint256,uint256,uint256)": "3e8ee3df", + "router()": "f887ea40", + "setOwner(address)": "13af4035", + "supportsInterface(bytes4)": "01ffc9a7", + "transferExitAndCall(uint256,address,address,bytes,bytes)": "bd5f3e7d", + "whitelist()": "93e59dc1" +} diff --git a/test/signatures/L1ReverseCustomGateway b/test/signatures/L1ReverseCustomGateway new file mode 100644 index 0000000000..e756b93455 --- /dev/null +++ b/test/signatures/L1ReverseCustomGateway @@ -0,0 +1,24 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "encodeWithdrawal(uint256,address)": "020a6058", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "forceRegisterTokenToL2(address[],address[],uint256,uint256,uint256)": "1d3a689f", + "getExternalCall(uint256,address,bytes)": "f68a9082", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "inbox()": "fb0e722b", + "initialize(address,address,address,address)": "f8c8765e", + "l1ToL2Token(address)": "8a2dc014", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "outboundTransferCustomRefund(address,address,address,uint256,uint256,uint256,bytes)": "4fb1a07b", + "owner()": "8da5cb5b", + "postUpgradeInit()": "95fcea78", + "redirectedExits(bytes32)": "bcf2e6eb", + "registerTokenToL2(address,uint256,uint256,uint256)": "f26bdead", + "registerTokenToL2(address,uint256,uint256,uint256,address)": "ca346d4a", + "router()": "f887ea40", + "setOwner(address)": "13af4035", + "supportsInterface(bytes4)": "01ffc9a7", + "transferExitAndCall(uint256,address,address,bytes,bytes)": "bd5f3e7d", + "whitelist()": "93e59dc1" +} diff --git a/test/signatures/L1TokenBridgeRetryableSender b/test/signatures/L1TokenBridgeRetryableSender new file mode 100644 index 0000000000..15829bde49 --- /dev/null +++ b/test/signatures/L1TokenBridgeRetryableSender @@ -0,0 +1,7 @@ +{ + "initialize()": "8129fc1c", + "owner()": "8da5cb5b", + "renounceOwnership()": "715018a6", + "sendRetryable((address,address,address,address,uint256,uint256),(address,address,address,address,address,address,address),(address,address,address,address,address),address,address,address,address,bool)": "d5402e89", + "transferOwnership(address)": "f2fde38b" +} diff --git a/test/signatures/L1WethGateway b/test/signatures/L1WethGateway new file mode 100644 index 0000000000..c6b0853293 --- /dev/null +++ b/test/signatures/L1WethGateway @@ -0,0 +1,19 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "encodeWithdrawal(uint256,address)": "020a6058", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "getExternalCall(uint256,address,bytes)": "f68a9082", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "inbox()": "fb0e722b", + "initialize(address,address,address,address,address)": "1459457a", + "l1Weth()": "146bf4b1", + "l2Weth()": "247b2768", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "outboundTransferCustomRefund(address,address,address,uint256,uint256,uint256,bytes)": "4fb1a07b", + "postUpgradeInit()": "95fcea78", + "redirectedExits(bytes32)": "bcf2e6eb", + "router()": "f887ea40", + "supportsInterface(bytes4)": "01ffc9a7", + "transferExitAndCall(uint256,address,address,bytes,bytes)": "bd5f3e7d" +} diff --git a/test/signatures/L2AtomicTokenBridgeFactory b/test/signatures/L2AtomicTokenBridgeFactory new file mode 100644 index 0000000000..2aa137afc0 --- /dev/null +++ b/test/signatures/L2AtomicTokenBridgeFactory @@ -0,0 +1,3 @@ +{ + "deployL2Contracts((bytes,bytes,bytes,bytes,bytes,bytes,bytes),address,address,address,address,address,address,address,address)": "b1c7a870" +} diff --git a/test/signatures/L2CustomGateway b/test/signatures/L2CustomGateway new file mode 100644 index 0000000000..058d61b578 --- /dev/null +++ b/test/signatures/L2CustomGateway @@ -0,0 +1,14 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "exitNum()": "015234ab", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "initialize(address,address)": "485cc955", + "l1ToL2Token(address)": "8a2dc014", + "outboundTransfer(address,address,uint256,bytes)": "7b3a3c8b", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "postUpgradeInit()": "95fcea78", + "registerTokenFromL1(address[],address[])": "d4f5532f", + "router()": "f887ea40" +} diff --git a/test/signatures/L2ERC20Gateway b/test/signatures/L2ERC20Gateway new file mode 100644 index 0000000000..a6128af74f --- /dev/null +++ b/test/signatures/L2ERC20Gateway @@ -0,0 +1,15 @@ +{ + "beaconProxyFactory()": "c05e6a95", + "calculateL2TokenAddress(address)": "a7e28d48", + "cloneableProxyHash()": "97881f8d", + "counterpartGateway()": "2db09c1c", + "exitNum()": "015234ab", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "getUserSalt(address)": "569f26ff", + "initialize(address,address,address)": "c0c53b8b", + "outboundTransfer(address,address,uint256,bytes)": "7b3a3c8b", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "postUpgradeInit()": "95fcea78", + "router()": "f887ea40" +} diff --git a/test/signatures/L2GatewayRouter b/test/signatures/L2GatewayRouter new file mode 100644 index 0000000000..6a86a7a947 --- /dev/null +++ b/test/signatures/L2GatewayRouter @@ -0,0 +1,16 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "defaultGateway()": "03295802", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "getGateway(address)": "bda009fe", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "initialize(address,address)": "485cc955", + "l1TokenToGateway(address)": "ed08fdc6", + "outboundTransfer(address,address,uint256,bytes)": "7b3a3c8b", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "postUpgradeInit()": "95fcea78", + "router()": "f887ea40", + "setDefaultGateway(address)": "f7c9362f", + "setGateway(address[],address[])": "4201f985" +} diff --git a/test/signatures/L2ReverseCustomGateway b/test/signatures/L2ReverseCustomGateway new file mode 100644 index 0000000000..058d61b578 --- /dev/null +++ b/test/signatures/L2ReverseCustomGateway @@ -0,0 +1,14 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "exitNum()": "015234ab", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "initialize(address,address)": "485cc955", + "l1ToL2Token(address)": "8a2dc014", + "outboundTransfer(address,address,uint256,bytes)": "7b3a3c8b", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "postUpgradeInit()": "95fcea78", + "registerTokenFromL1(address[],address[])": "d4f5532f", + "router()": "f887ea40" +} diff --git a/test/signatures/L2WethGateway b/test/signatures/L2WethGateway new file mode 100644 index 0000000000..860455a628 --- /dev/null +++ b/test/signatures/L2WethGateway @@ -0,0 +1,14 @@ +{ + "calculateL2TokenAddress(address)": "a7e28d48", + "counterpartGateway()": "2db09c1c", + "exitNum()": "015234ab", + "finalizeInboundTransfer(address,address,address,uint256,bytes)": "2e567b36", + "getOutboundCalldata(address,address,address,uint256,bytes)": "a0c76a96", + "initialize(address,address,address,address)": "f8c8765e", + "l1Weth()": "146bf4b1", + "l2Weth()": "247b2768", + "outboundTransfer(address,address,uint256,bytes)": "7b3a3c8b", + "outboundTransfer(address,address,uint256,uint256,uint256,bytes)": "d2ce7d65", + "postUpgradeInit()": "95fcea78", + "router()": "f887ea40" +} diff --git a/test/signatures/StandardArbERC20 b/test/signatures/StandardArbERC20 new file mode 100644 index 0000000000..eb0e443c53 --- /dev/null +++ b/test/signatures/StandardArbERC20 @@ -0,0 +1,23 @@ +{ + "DOMAIN_SEPARATOR()": "3644e515", + "allowance(address,address)": "dd62ed3e", + "approve(address,uint256)": "095ea7b3", + "balanceOf(address)": "70a08231", + "bridgeBurn(address,uint256)": "74f4f547", + "bridgeInit(address,bytes)": "189db7d2", + "bridgeMint(address,uint256)": "8c2a993e", + "decimals()": "313ce567", + "decreaseAllowance(address,uint256)": "a457c2d7", + "increaseAllowance(address,uint256)": "39509351", + "isMaster()": "6f791d29", + "l1Address()": "c2eeeebd", + "l2Gateway()": "8fa74a0e", + "name()": "06fdde03", + "nonces(address)": "7ecebe00", + "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)": "d505accf", + "symbol()": "95d89b41", + "totalSupply()": "18160ddd", + "transfer(address,uint256)": "a9059cbb", + "transferAndCall(address,uint256,bytes)": "4000aea0", + "transferFrom(address,address,uint256)": "23b872dd" +} From 1fd833efb9e26f7e4838a49e677b6500035c0915 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 14 Feb 2024 17:59:23 +0100 Subject: [PATCH 2/3] Add check to workflow --- .github/workflows/build-test.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index adfa6f41c2..1278fb0379 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -66,8 +66,8 @@ jobs: - name: Run integration tests run: yarn test - test-storage: - name: Test storage layout + test-contracts: + name: Test storage layout and signatures runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -95,6 +95,9 @@ jobs: - name: Test Storage Layouts run: yarn run test:storage + - name: Test function signatures + run: yarn run test:signatures + test-e2e: name: Test e2e runs-on: ubuntu-latest From c597648b6d068a6949292bc67d7f8ba83bdc4381 Mon Sep 17 00:00:00 2001 From: Goran Vladika Date: Wed, 14 Feb 2024 18:10:35 +0100 Subject: [PATCH 3/3] Update gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 74466b7179..6b590d4029 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ forge-cache/ #Storage layout test files test/storage/*-old.dot test/storage/*-old +test/signatures/*-old # local deployment files network.json