|
| 1 | +# Aggkit Bridge Service Manual Test |
| 2 | + |
| 3 | +## Create account |
| 4 | + |
| 5 | +```bash |
| 6 | +cast wallet new-mnemonic |
| 7 | +``` |
| 8 | + |
| 9 | +```bash |
| 10 | +Generating mnemonic from provided entropy... |
| 11 | +Successfully generated a new mnemonic. |
| 12 | +Phrase: |
| 13 | +plastic cram delay outdoor metal kit carry radar vital retreat embark happy |
| 14 | + |
| 15 | +Accounts: |
| 16 | +- Account 0: |
| 17 | +Address: 0xced253B29527D62a1880b95C23F256CE78a73c06 |
| 18 | +Private key: 0x516d5e1c8f7e1da24379041b758b5d16fd066c8a8856791d3c5c0c79a81bad59 |
| 19 | +``` |
| 20 | + |
| 21 | +## Prepare env variables |
| 22 | + |
| 23 | +```bash |
| 24 | +pre_funded_private_key="0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" |
| 25 | +pre_funded_address="0xE34aaF64b29273B7D567FCFc40544c014EEe9970" |
| 26 | + |
| 27 | +funder_private_key="0x516d5e1c8f7e1da24379041b758b5d16fd066c8a8856791d3c5c0c79a81bad59" |
| 28 | +funder_address="0xced253B29527D62a1880b95C23F256CE78a73c06" |
| 29 | + |
| 30 | +l1_rpc_url="http://$(kurtosis port print cdk el-1-geth-lighthouse rpc)" |
| 31 | +l2_rpc_url="$(kurtosis port print cdk op-el-1-op-geth-op-node-001 rpc)" |
| 32 | +``` |
| 33 | + |
| 34 | +## Sanity check for blocks |
| 35 | + |
| 36 | +```bash |
| 37 | +cast block-number --rpc-url "$l1_rpc_url" |
| 38 | +cast block-number --rpc-url "$l2_rpc_url" |
| 39 | +``` |
| 40 | + |
| 41 | +```bash |
| 42 | +259 |
| 43 | +140 |
| 44 | +``` |
| 45 | + |
| 46 | +## Check balance on L1 and L2 |
| 47 | + |
| 48 | +```bash |
| 49 | +cast balance --rpc-url "$l1_rpc_url" --ether "$pre_funded_address" |
| 50 | +cast balance --rpc-url "$l2_rpc_url" --ether "$pre_funded_address" |
| 51 | +cast balance --rpc-url "$l1_rpc_url" --ether "$funder_address" |
| 52 | +cast balance --rpc-url "$l2_rpc_url" --ether "$funder_address" |
| 53 | +``` |
| 54 | + |
| 55 | +```bash |
| 56 | +1999999.899962054234851121 |
| 57 | +100300.000000000000000000 |
| 58 | +0.000000000000000000 |
| 59 | +0.000000000000000000 |
| 60 | +``` |
| 61 | + |
| 62 | +## Fund account on L1 |
| 63 | + |
| 64 | +```bash |
| 65 | +polycli fund --addresses "$funder_address" --eth-amount 1000000000000000000 --private-key "$pre_funded_private_key" --rpc-url "$l1_rpc_url" |
| 66 | +``` |
| 67 | + |
| 68 | +```bash |
| 69 | +10:57AM INF Starting bulk funding wallets |
| 70 | +10:57AM INF Using addresses provided by the user |
| 71 | +10:57AM INF multicall3 is supported and will be used to fund wallets address=0x62bf798EdaE1B7FDe524276864757cc424A5c3dD |
| 72 | +10:57AM INF multicall3 transaction to fund accounts sent done=1 of=1 txHash=0xbcc4356af43a1c418d676a2aa00b60852599913cecbdeadd172b2d383d292a36 |
| 73 | +10:57AM INF all funding transactions sent, waiting for confirmation... |
| 74 | +10:57AM INF transaction confirmed txHash=0xbcc4356af43a1c418d676a2aa00b60852599913cecbdeadd172b2d383d292a36 |
| 75 | +10:57AM INF Wallet(s) funded! 💸 |
| 76 | +10:57AM INF Total execution time: 4.921481542s |
| 77 | +``` |
| 78 | + |
| 79 | +## Fund account on L2 |
| 80 | + |
| 81 | +```bash |
| 82 | +polycli fund --addresses "$funder_address" --eth-amount 1000000000000000000 --private-key "$pre_funded_private_key" --rpc-url "$l2_rpc_url" |
| 83 | +``` |
| 84 | + |
| 85 | +```bash |
| 86 | +10:58AM INF Starting bulk funding wallets |
| 87 | +10:58AM INF Using addresses provided by the user |
| 88 | +10:58AM INF multicall3 is supported and will be used to fund wallets address=0xcA11bde05977b3631167028862bE2a173976CA11 |
| 89 | +10:58AM INF multicall3 transaction to fund accounts sent done=1 of=1 txHash=0x08a708dd4a9c2e6a795bda456deae29a5f638bc30cdc2d1c75db7fdf679a9d1f |
| 90 | +10:58AM INF all funding transactions sent, waiting for confirmation... |
| 91 | +10:58AM INF transaction confirmed txHash=0x08a708dd4a9c2e6a795bda456deae29a5f638bc30cdc2d1c75db7fdf679a9d1f |
| 92 | +10:58AM INF Wallet(s) funded! 💸 |
| 93 | +10:58AM INF Total execution time: 2.282900083s |
| 94 | +``` |
| 95 | + |
| 96 | +## Check balance on L1 and L2 after fund |
| 97 | + |
| 98 | +```bash |
| 99 | +cast balance --rpc-url "$l1_rpc_url" --ether "$pre_funded_address" |
| 100 | +cast balance --rpc-url "$l2_rpc_url" --ether "$pre_funded_address" |
| 101 | +cast balance --rpc-url "$l1_rpc_url" --ether "$funder_address" |
| 102 | +cast balance --rpc-url "$l2_rpc_url" --ether "$funder_address" |
| 103 | +``` |
| 104 | + |
| 105 | +```bash |
| 106 | +1999998.899962054224359841 |
| 107 | +100298.999974038322447806 |
| 108 | +1.000000000000000000 |
| 109 | +1.000000000000000000 |
| 110 | +``` |
| 111 | + |
| 112 | +## Deploy ERC20 smart contract to L1 |
| 113 | + |
| 114 | +```bash |
| 115 | +cd ./contracts/src/tokens |
| 116 | +cast send --private-key "$pre_funded_private_key" --rpc-url "$l1_rpc_url" --create $(forge build ERC20.sol --json | jq -r ".contracts.\"/Users/thiago/github.com/0xPolygon/polygon-cli/contracts/ERC20.sol\".ERC20[0].contract.evm.bytecode.object") |
| 117 | +cd - |
| 118 | +``` |
| 119 | + |
| 120 | +```bash |
| 121 | +blockHash 0xb98cd5153a007c32c3fe3ffc2d1d956e68e11be2a7a7cdae5f8914761e941ef5 |
| 122 | +blockNumber 304 |
| 123 | +contractAddress 0x9ceA3ee97f9eB1c39F3196060f24B7ED52bb7Ca3 |
| 124 | +cumulativeGasUsed 1270795 |
| 125 | +effectiveGasPrice 1000000007 |
| 126 | +from 0xE34aaF64b29273B7D567FCFc40544c014EEe9970 |
| 127 | +gasUsed 1270795 |
| 128 | +logs [{"address":"0x9cea3ee97f9eb1c39f3196060f24b7ed52bb7ca3","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000e34aaf64b29273b7d567fcfc40544c014eee9970"],"data":"0x00000000000000000000000000000000000000000000d3c21bcecceda1000000","blockHash":"0xb98cd5153a007c32c3fe3ffc2d1d956e68e11be2a7a7cdae5f8914761e941ef5","blockNumber":"0x130","blockTimestamp":"0x68f0fa11","transactionHash":"0xedef82b2c4ca2e00b31610c84571e760c3a81733f0e40e23f95d0ca102229b31","transactionIndex":"0x0","logIndex":"0x0","removed":false}] |
| 129 | +logsBloom 0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000001000000000000000000000000000000000000008000000000000000000000000000000000000000000100000020000000000000000000800000000000000000000000010000000000000000000000000000000000000000000000000000000200000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000001000000000000000 |
| 130 | +root |
| 131 | +status 1 (success) |
| 132 | +transactionHash 0xedef82b2c4ca2e00b31610c84571e760c3a81733f0e40e23f95d0ca102229b31 |
| 133 | +transactionIndex 0 |
| 134 | +type 2 |
| 135 | +blobGasPrice |
| 136 | +blobGasUsed |
| 137 | +``` |
| 138 | + |
| 139 | +## Deploy ERC20 smart contract to L2 |
| 140 | + |
| 141 | +```bash |
| 142 | +cd ./contracts/src/tokens |
| 143 | +cast send --private-key "$pre_funded_private_key" --rpc-url "$l2_rpc_url" --create $(forge build ERC20.sol --json | jq -r ".contracts.\"/Users/thiago/github.com/0xPolygon/polygon-cli/contracts/ERC20.sol\".ERC20[0].contract.evm.bytecode.object") |
| 144 | +cd - |
| 145 | +``` |
| 146 | + |
| 147 | +```bash |
| 148 | +blockHash 0x561b9a5eb1175cadc62dacb8f2d8f774a089272a5cbfef795e7c5c5da1bfb02d |
| 149 | +blockNumber 234 |
| 150 | +contractAddress 0x1f7ad7caA53e35b4f0D138dC5CBF91aC108a2674 |
| 151 | +cumulativeGasUsed 1316879 |
| 152 | +effectiveGasPrice 393291005 |
| 153 | +from 0xE34aaF64b29273B7D567FCFc40544c014EEe9970 |
| 154 | +gasUsed 1270795 |
| 155 | +logs [{"address":"0x1f7ad7caa53e35b4f0d138dc5cbf91ac108a2674","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x000000000000000000000000e34aaf64b29273b7d567fcfc40544c014eee9970"],"data":"0x00000000000000000000000000000000000000000000d3c21bcecceda1000000","blockHash":"0x561b9a5eb1175cadc62dacb8f2d8f774a089272a5cbfef795e7c5c5da1bfb02d","blockNumber":"0xea","transactionHash":"0x3c9883145b121d80c65d74a4b097d0f0d8b095eab981eed586c1e94b3240d963","transactionIndex":"0x1","logIndex":"0x0","removed":false}] |
| 156 | +logsBloom 0x00000000000000000000000008000000000000000000000000000000000000000008000000000000000008000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010000000000000000000000000000000000100000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000001000000000000000 |
| 157 | +root |
| 158 | +status 1 (success) |
| 159 | +transactionHash 0x3c9883145b121d80c65d74a4b097d0f0d8b095eab981eed586c1e94b3240d963 |
| 160 | +transactionIndex 1 |
| 161 | +type 2 |
| 162 | +blobGasPrice |
| 163 | +blobGasUsed |
| 164 | +l1BaseFeeScalar 1368 |
| 165 | +l1BlobBaseFee 1 |
| 166 | +l1BlobBaseFeeScalar 810949 |
| 167 | +l1Fee 3088 |
| 168 | +l1GasPrice 7 |
| 169 | +l1GasUsed 51248 |
| 170 | +``` |
| 171 | + |
| 172 | +## Set contract address env var |
| 173 | + |
| 174 | +```bash |
| 175 | +l1_contract_addr="0x9ceA3ee97f9eB1c39F3196060f24B7ED52bb7Ca3" |
| 176 | +l2_contract_addr="0x1f7ad7caA53e35b4f0D138dC5CBF91aC108a2674" |
| 177 | +``` |
| 178 | + |
| 179 | +## Check ERC20 Balance |
| 180 | + |
| 181 | +```bash |
| 182 | +cast call "$l1_contract_addr" "balanceOf(address)(uint256)" "$pre_funded_address" --rpc-url "$l1_rpc_url" |
| 183 | +cast call "$l2_contract_addr" "balanceOf(address)(uint256)" "$pre_funded_address" --rpc-url "$l2_rpc_url" |
| 184 | +cast call "$l1_contract_addr" "balanceOf(address)(uint256)" "$funder_address" --rpc-url "$l1_rpc_url" |
| 185 | +cast call "$l2_contract_addr" "balanceOf(address)(uint256)" "$funder_address" --rpc-url "$l2_rpc_url" |
| 186 | +``` |
| 187 | + |
| 188 | +```bash |
| 189 | +1000000000000000000000000 [1e24] |
| 190 | +1000000000000000000000000 [1e24] |
| 191 | +0 |
| 192 | +0 |
| 193 | +``` |
| 194 | + |
| 195 | +## Mint ERC20 tokens to funder |
| 196 | + |
| 197 | +```bash |
| 198 | +cast send "$l1_contract_addr" "mint(uint256)" "1000000000000" --private-key "$funder_private_key" --rpc-url "$l1_rpc_url" |
| 199 | +cast send "$l2_contract_addr" "mint(uint256)" "1000000000000" --private-key "$funder_private_key" --rpc-url "$l2_rpc_url" |
| 200 | +``` |
| 201 | + |
| 202 | +## Check ERC20 Balance after mint |
| 203 | + |
| 204 | +```bash |
| 205 | +cast call "$l1_contract_addr" "balanceOf(address)(uint256)" "$pre_funded_address" --rpc-url "$l1_rpc_url" |
| 206 | +cast call "$l2_contract_addr" "balanceOf(address)(uint256)" "$pre_funded_address" --rpc-url "$l2_rpc_url" |
| 207 | +cast call "$l1_contract_addr" "balanceOf(address)(uint256)" "$funder_address" --rpc-url "$l1_rpc_url" |
| 208 | +cast call "$l2_contract_addr" "balanceOf(address)(uint256)" "$funder_address" --rpc-url "$l2_rpc_url" |
| 209 | +``` |
| 210 | + |
| 211 | +```bash |
| 212 | +1000000000000000000000000 [1e24] |
| 213 | +1000000000000000000000000 [1e24] |
| 214 | +1000000000000 [1e12] |
| 215 | +1000000000000 [1e12] |
| 216 | +``` |
| 217 | + |
| 218 | +## Fund ERC20 to accounts on L1 |
| 219 | + |
| 220 | +```bash |
| 221 | +polycli fund --rpc-url "$l1_rpc_url" --private-key "$funder_private_key" --seed "ephemeral_test_l1" --token-address "$l1_contract_addr" --token-amount 1000 --number 5 --file "wallets-funded-l1.json" |
| 222 | +``` |
| 223 | + |
| 224 | +```bash |
| 225 | +11:00AM INF Starting bulk funding wallets |
| 226 | +11:00AM INF Generating wallets from seed numWallets=5 seed=ephemeral_test_l1 |
| 227 | +11:00AM INF Wallet(s) generated from seed count=5 |
| 228 | +11:00AM INF Wallets' address(es) and private key(s) saved to file fileName=wallets-funded-l1.json |
| 229 | +11:00AM INF multicall3 is supported and will be used to fund wallets address=0xaEd7FE0a652395C4d8F9AbD038375b13e632BF85 |
| 230 | +11:00AM INF transaction to approve ERC20 token spending by multicall3 sent done=5 of=5 txHash=0xb25298b5a87cdced5d9e68b2670b4dbd5359527b2a664d637ea49e367ca80470 |
| 231 | +11:00AM INF multicall3 transaction to fund accounts sent done=5 of=5 txHash=0x21a81ac529acaab8ada53e72a1e523cd1291fe5e91875c5df73ede01992ff5b4 |
| 232 | +11:00AM INF all funding transactions sent, waiting for confirmation... |
| 233 | +11:00AM INF transaction confirmed txHash=0xb25298b5a87cdced5d9e68b2670b4dbd5359527b2a664d637ea49e367ca80470 |
| 234 | +11:00AM INF transaction confirmed txHash=0x21a81ac529acaab8ada53e72a1e523cd1291fe5e91875c5df73ede01992ff5b4 |
| 235 | +11:00AM INF Wallet(s) funded! 💸 |
| 236 | +11:00AM INF Total execution time: 6.397935959s |
| 237 | +``` |
| 238 | +
|
| 239 | +## Fund ERC20 to accounts on L2 |
| 240 | +
|
| 241 | +```bash |
| 242 | +polycli fund --rpc-url "$l2_rpc_url" --private-key "$funder_private_key" --seed "ephemeral_test_l2" --token-address "$l2_contract_addr" --token-amount 1000 --number 5 --file "wallets-funded-l2.json" |
| 243 | +``` |
| 244 | +
|
| 245 | +```bash |
| 246 | +11:00AM INF Starting bulk funding wallets |
| 247 | +11:00AM INF Generating wallets from seed numWallets=5 seed=ephemeral_test_l2 |
| 248 | +11:00AM INF Wallet(s) generated from seed count=5 |
| 249 | +11:00AM INF Wallets' address(es) and private key(s) saved to file fileName=wallets-funded-l2.json |
| 250 | +11:00AM INF multicall3 is supported and will be used to fund wallets address=0xcA11bde05977b3631167028862bE2a173976CA11 |
| 251 | +11:00AM INF transaction to approve ERC20 token spending by multicall3 sent done=5 of=5 txHash=0x5ee4b0ad173ef28bdeb34047cfbe01e645fc266e97001fcdc07b73e1b44b3e71 |
| 252 | +11:00AM INF multicall3 transaction to fund accounts sent done=5 of=5 txHash=0xa81c5305c4d7d08b4a0b340d6ce6efa904d0310d2c7f919e12d4b3f27df2357a |
| 253 | +11:00AM INF all funding transactions sent, waiting for confirmation... |
| 254 | +11:00AM INF transaction confirmed txHash=0x5ee4b0ad173ef28bdeb34047cfbe01e645fc266e97001fcdc07b73e1b44b3e71 |
| 255 | +11:00AM INF transaction confirmed txHash=0xa81c5305c4d7d08b4a0b340d6ce6efa904d0310d2c7f919e12d4b3f27df2357a |
| 256 | +11:00AM INF Wallet(s) funded! 💸 |
| 257 | +11:00AM INF Total execution time: 3.990132417s |
| 258 | +``` |
| 259 | + |
| 260 | +## Check wallets balances |
| 261 | + |
| 262 | +```bash |
| 263 | +jq -r '.[].Address' wallets-funded-l1.json \ |
| 264 | +| while read -r addr; do |
| 265 | + bal=$(cast call "$l1_contract_addr" "balanceOf(address)(uint256)" "$addr" --rpc-url "$l1_rpc_url") |
| 266 | + printf '%s: %s\n' "$addr" "$bal" |
| 267 | + done |
| 268 | +echo "" |
| 269 | +jq -r '.[].Address' wallets-funded-l2.json \ |
| 270 | +| while read -r addr; do |
| 271 | + bal=$(cast call "$l2_contract_addr" "balanceOf(address)(uint256)" "$addr" --rpc-url "$l2_rpc_url") |
| 272 | + printf '%s: %s\n' "$addr" "$bal" |
| 273 | + done |
| 274 | +``` |
| 275 | + |
| 276 | +```bash |
| 277 | +0xA663Fc82FF0e336014f2e51265845DeB90FDC67E: 1000 |
| 278 | +0xA7FEBaBde379b056E82fC3780EAFB2564346e110: 1000 |
| 279 | +0xb3bF95FF2598FD6B7713216e631Fa66A11cc59AE: 1000 |
| 280 | +0xD29dbA4Eb80A5514Ca5e60B7017461C63Ab66671: 1000 |
| 281 | +0x432456de21797DFb3A21DFaa555143cEAc9c106B: 1000 |
| 282 | + |
| 283 | +0x0EDD8143d2519326eC89FCF3d20C1b67d6793AB8: 1000 |
| 284 | +0x7c387d821aD71B5B34C456fa4907Ba3065372290: 1000 |
| 285 | +0xAfD4Da29Ac08C205d0c514704F80bDF762BaC6A3: 1000 |
| 286 | +0x05725B2f384e7FA1c92C15e95d575070a6202B02: 1000 |
| 287 | +0x232D5A236D1810928FEB0D9F7b1AFa178598e34a: 1000 |
| 288 | +``` |
0 commit comments