diff --git a/devnet/eth-devnet.yaml b/devnet/eth-devnet.yaml index d4b1c10ef0..697ca1ae9f 100644 --- a/devnet/eth-devnet.yaml +++ b/devnet/eth-devnet.yaml @@ -33,13 +33,16 @@ spec: containers: - name: anvil image: eth-node + # This command generates additional accounts compared to the default of 10. The purpose is to use dedicated + # accounts for different aspects of the test suite. When adding new integration tests, consider increasing + # the number of accounts below and using a fresh key for the new tests. command: - anvil - --silent - --mnemonic=myth like bonus scare over problem client lizard pioneer submit female collect - --block-time=1 - --host=0.0.0.0 - - --accounts=13 + - --accounts=14 - --chain-id=1337 ports: - containerPort: 8545 diff --git a/devnet/eth-devnet2.yaml b/devnet/eth-devnet2.yaml index 22ca588d54..3dd507a813 100644 --- a/devnet/eth-devnet2.yaml +++ b/devnet/eth-devnet2.yaml @@ -34,13 +34,16 @@ spec: containers: - name: anvil image: eth-node + # This command generates additional accounts compared to the default of 10. The purpose is to use dedicated + # accounts for different aspects of the test suite. When adding new integration tests, consider increasing + # the number of accounts below and using a fresh key for the new tests. command: - anvil - --silent - --mnemonic=myth like bonus scare over problem client lizard pioneer submit female collect - --block-time=1 - --host=0.0.0.0 - - --accounts=13 + - --accounts=14 - --chain-id=1397 ports: - containerPort: 8545 diff --git a/devnet/tx-verifier-monitor/transfer-verifier-test.sh b/devnet/tx-verifier-monitor/transfer-verifier-test.sh index 6d5e7f2341..18e98bef1e 100755 --- a/devnet/tx-verifier-monitor/transfer-verifier-test.sh +++ b/devnet/tx-verifier-monitor/transfer-verifier-test.sh @@ -18,14 +18,14 @@ ERC20_ADDR="0x47bdB2D7d6528C760b6f228b3B8F9F650169a10f" # Test token A VALUE="1000" # Wei value sent as msg.value TRANSFER_AMOUNT="10" -# Account reported by anvil when run using $MNEMONIC. -# The account at index 0 is used by other tests in the test suite, so -# account[1] is used here to help encapsulate the tests -ANVIL_USER="0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0" +# This account is generated by anvil and can be confirmed by running `anvil --accounts=13`. +# The accounts at other indices are used by other tests in the test suite, so +# account[13] is used here to help encapsulate the tests. +ANVIL_USER="0x64E078A8Aa15A41B85890265648e965De686bAE6" ETH_WHALE="${ANVIL_USER}" FROM="${ETH_WHALE}" # Anvil user1 normalized to Wormhole size. (The value itself it unchecked but must have this format.) -RECIPIENT="0x000000000000000000000000FFcf8FDEE72ac11b5c542428B35EEF5769C409f0" +RECIPIENT="0x00000000000000000000000064E078A8Aa15A41B85890265648e965De686bAE6" NONCE="234" # arbitrary # Build the payload for token transfers. Declared on multiple lines to @@ -60,12 +60,12 @@ echo "- VALUE=${VALUE}" echo "- RECIPIENT=${RECIPIENT}" echo -# Fund the token bridge from User0 -echo "Start impersonating User0" +# Fund the token bridge from the user +echo "Start impersonating Anvil key: ${ANVIL_USER}" cast rpc \ anvil_impersonateAccount "${ANVIL_USER}" \ --rpc-url "${RPC}" -echo "Funding token bridge using user0's balance" +echo "Funding token bridge using the user's balance" cast send --unlocked \ --rpc-url "${RPC}" \ --from $ANVIL_USER \ diff --git a/ethereum/forge-scripts/DeployTestToken.s.sol b/ethereum/forge-scripts/DeployTestToken.s.sol index 12d07df77b..9ee1d0f6b9 100644 --- a/ethereum/forge-scripts/DeployTestToken.s.sol +++ b/ethereum/forge-scripts/DeployTestToken.s.sol @@ -42,7 +42,7 @@ contract DeployTestToken is Script { address transferVerificationTokenA ) { - address[] memory accounts = new address[](13); + address[] memory accounts = new address[](14); accounts[0] = 0x90F8bf6A479f320ead074411a4B0e7944Ea8c9C1; accounts[1] = 0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0; accounts[2] = 0x22d491Bde2303f2f43325b2108D26f1eAbA1e32b; @@ -56,6 +56,8 @@ contract DeployTestToken is Script { accounts[10] = 0x610Bb1573d1046FCb8A70Bbbd395754cD57C2b60; accounts[11] = 0x855FA758c77D68a04990E992aA4dcdeF899F654A; accounts[12] = 0xfA2435Eacf10Ca62ae6787ba2fB044f8733Ee843; + accounts[13] = 0x64E078A8Aa15A41B85890265648e965De686bAE6; + ERC20PresetMinterPauser token = new ERC20PresetMinterPauser( "Ethereum Test Token", @@ -98,24 +100,26 @@ contract DeployTestToken is Script { // mint 1000 units accountantToken.mint(accounts[9], 1_000_000_000_000_000_000_000); + for(uint16 i=0; i<11; i++) { + // Give the accounts enough eth to send transactions + vm.deal(accounts[i], 1e18); + } + // Deploy a test token for Transfer Verification ERC20PresetMinterPauser deployedA = new ERC20PresetMinterPauser( "TransferVerifier Test Token A", "TVA" ); - console.log("Test token A deployed at: ", address(deployedA)); - // Mint test tokens to Anvil's default account at index 1. - // The account at index 0 is used for other tests in the devnet, so - // using account 1 to send transfers will hopefully cause things to be + // Mint Eth and test tokens to Anvil's default account at index 13. + // This will be used for Transfer Verification integration tests. + // The other accounts created by Anvil are used for other tests in the devnet, so + // using account 14 to send transfers will hopefully cause things to be // better encapsulated. - deployedA.mint(accounts[1], 1_000_000_000_000_000_000_000); - - for(uint16 i=0; i<11; i++) { - // Give the accounts enough eth to send transactions - vm.deal(accounts[i], 1e18); - } + deployedA.mint(accounts[13], 1_000_000_000_000_000_000_000); + token.mint(accounts[13], 1_000_000_000_000_000_000_000); + vm.deal(accounts[13], 1e18); return ( address(token),