@@ -18,22 +18,17 @@ Address: 0xced253B29527D62a1880b95C23F256CE78a73c06
1818Private key: 0x516d5e1c8f7e1da24379041b758b5d16fd066c8a8856791d3c5c0c79a81bad59
1919```
2020
21- ## Load env variables from kurtosis env
22-
23- ``` bash
24- echo l1_rpc_url=\" " http://" $( kurtosis port print cdk el-1-geth-lighthouse rpc) \"
25-
26- echo l2_rpc_url=\" $( kurtosis port print cdk op-el-1-op-geth-op-node-001 rpc) \"
27- ```
28-
2921## Prepare env variables
3022
3123``` bash
3224pre_funded_private_key=" 0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625"
3325pre_funded_address=" 0xE34aaF64b29273B7D567FCFc40544c014EEe9970"
3426
35- l1_rpc_url=" http://127.0.0.1:32804"
36- l2_rpc_url=" http://127.0.0.1:32814"
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) "
3732```
3833
3934## Sanity check for blocks
@@ -44,20 +39,74 @@ cast block-number --rpc-url "$l2_rpc_url"
4439```
4540
4641``` bash
47- 1029
48- 1694
42+ 259
43+ 140
4944```
5045
51- ## Check balance on L1, A and B
46+ ## Check balance on L1 and L2
5247
5348``` bash
5449cast balance --rpc-url " $l1_rpc_url " --ether " $pre_funded_address "
5550cast 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 "
5653```
5754
5855``` bash
59- 1999999.899935270835960337
56+ 1999999.899962054234851121
6057100300.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
61110```
62111
63112## Deploy ERC20 smart contract to L1
@@ -69,86 +118,171 @@ cd -
69118```
70119
71120``` bash
72- blockHash 0xfb70aeb59707f5806e393f0ac12693d37b67092e25e6fc387b3cbbbbcb54499e
73- blockNumber 1058
74- contractAddress 0x62bf798EdaE1B7FDe524276864757cc424A5c3dD
121+ blockHash 0xb98cd5153a007c32c3fe3ffc2d1d956e68e11be2a7a7cdae5f8914761e941ef5
122+ blockNumber 304
123+ contractAddress 0x9ceA3ee97f9eB1c39F3196060f24B7ED52bb7Ca3
75124cumulativeGasUsed 1270795
76125effectiveGasPrice 1000000007
77126from 0xE34aaF64b29273B7D567FCFc40544c014EEe9970
78127gasUsed 1270795
79- logs [{" address" :" 0x62bf798edae1b7fde524276864757cc424a5c3dd " ," topics" :[" 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef" ," 0x0000000000000000000000000000000000000000000000000000000000000000" ," 0x000000000000000000000000e34aaf64b29273b7d567fcfc40544c014eee9970" ]," data" :" 0x00000000000000000000000000000000000000000000d3c21bcecceda1000000" ," blockHash" :" 0xfb70aeb59707f5806e393f0ac12693d37b67092e25e6fc387b3cbbbbcb54499e " ," blockNumber" :" 0x422 " ," blockTimestamp" :" 0x68edf964 " ," transactionHash" :" 0xae7059755680615d60bec2f1529c7ddef0a81be33e80ba1976ee47540aacca50 " ," transactionIndex" :" 0x0" ," logIndex" :" 0x0" ," removed" :false}]
80- logsBloom 0x00000000000000000000000000000200000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000000000000000000800000000000000000000000010100000000000000000000000000000040000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000001000000000000000
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
81130root
82131status 1 (success)
83- transactionHash 0xae7059755680615d60bec2f1529c7ddef0a81be33e80ba1976ee47540aacca50
132+ transactionHash 0xedef82b2c4ca2e00b31610c84571e760c3a81733f0e40e23f95d0ca102229b31
84133transactionIndex 0
85134type 2
86135blobGasPrice
87136blobGasUsed
88137```
89138
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+
90172## Set contract address env var
91173
92174``` bash
93- l1_contract_addr=" 0x62bf798EdaE1B7FDe524276864757cc424A5c3dD"
175+ l1_contract_addr=" 0x9ceA3ee97f9eB1c39F3196060f24B7ED52bb7Ca3"
176+ l2_contract_addr=" 0x1f7ad7caA53e35b4f0D138dC5CBF91aC108a2674"
94177```
95178
96179## Check ERC20 Balance
97180
98181``` bash
99182cast 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 "
100186```
101187
102188``` bash
1031891000000000000000000000000 [1e24]
190+ 1000000000000000000000000 [1e24]
191+ 0
192+ 0
104193```
105194
106- ## Fund ERC20 to accounts
195+ ## Mint ERC20 tokens to funder
107196
108197``` bash
109- polycli fund --verbosity 700 --rate-limit 2000 --rpc-url " $l1_rpc_url " --private-key " $pre_funded_private_key " --seed " ephemeral_test" --token-address " $l1_contract_addr " --token-amount 1000 --number 5 --file " wallets-funded.json"
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 "
110200```
111201
202+ ## Check ERC20 Balance after mint
203+
112204``` bash
113- 4:27AM TRC Starting logger in console mode
114- 4:27AM INF Starting bulk funding wallets
115- 4:27AM TRC Input parameters params={" ApproveAmount" :1000000000000000000000," ApproveSpender" :" " ," FunderAddress" :" " ," FundingAmountInWei" :50000000000000000," KeyFile" :" " ," Multicall3Address" :" " ," OutputFile" :" wallets-funded.json" ," PrivateKey" :" 0x12d7de8621a77640c9241b2595ba78ce443d05e94090365ab3bb5e19df82c625" ," RateLimit" :2000," RpcUrl" :" http://127.0.0.1:32804" ," Seed" :" ephemeral_test" ," TokenAddress" :" 0x62bf798EdaE1B7FDe524276864757cc424A5c3dD" ," TokenAmount" :1000," UseHDDerivation" :true," WalletAddresses" :null," WalletsNumber" :5}
116- 4:27AM TRC Detected chain ID chainID=271828
117- 4:27AM INF Generating wallets from seed numWallets=5 seed=ephemeral_test
118- 4:27AM TRC New wallet generated from seed address=0x6705a7352c76b0c9d204b5ad9e9dc92e57c4d44c privateKey=ad7a39a4c7e10a4d55dd5307b10d42cb7afe8b43ba54e4fe70ea4e5efc67b958 seedWithIndex=ephemeral_test_0_20251014
119- 4:27AM TRC New wallet generated from seed address=0x26ee261781092a1833a4f09210bacf5826c975d1 privateKey=8c7d33f8401b89973d43d3da1457c02fc6502f46578ddaf4263c8d2edaffc5cb seedWithIndex=ephemeral_test_1_20251014
120- 4:27AM TRC New wallet generated from seed address=0x002b6fada0efeeed24b1b7197c3785426c6bdd75 privateKey=4e589278f20c280ebf570e215b6a416a8b169f0949a39ddf6186c88340667d01 seedWithIndex=ephemeral_test_2_20251014
121- 4:27AM TRC New wallet generated from seed address=0x4330ba531b0a8415552f1fafa02ccf390e66400b privateKey=f69c2a4d2374d3cc818aaca25e054f314db5b6b3ff98aef7b8e1966c87470382 seedWithIndex=ephemeral_test_3_20251014
122- 4:27AM TRC New wallet generated from seed address=0x80c70ba9ee3abd5f17282cb989730c5ee5d282e4 privateKey=99d057ffd5d15acf91766cc7df1ba568c06c8b14d2ea7c52e9683533387dae24 seedWithIndex=ephemeral_test_4_20251014
123- 4:27AM INF Wallet(s) generated from seed count=5
124- 4:27AM DBG checking if multicall3 is supported
125- 4:27AM INF Wallets' address(es) and private key(s) saved to file fileName=wallets-funded.json
126- 4:27AM INF multicall3 is supported and will be used to fund wallets address=0xe293A6b8F558422813499bb5C89B60adD8c54636
127- 4:27AM DBG funding wallets with multicall3
128- 4:27AM DBG multicall3 max accounts to fund per tx accsToFundPerTx=700
129- 4:27AM INF transaction to approve ERC20 token spending by multicall3 sent done=5 of=5 txHash=0xc0ef0c47461cac76609cb3880facd27e0fbebc02c7762fada8b57247035c4937
130- 4:27AM INF multicall3 transaction to fund accounts sent done=5 of=5 txHash=0x6afe1bf620b22b99f2483ed43e88846ae3deba945da57848d94838f10eba38c6
131- 4:27AM INF all funding transactions sent, waiting for confirmation...
132- 4:27AM INF transaction confirmed txHash=0xc0ef0c47461cac76609cb3880facd27e0fbebc02c7762fada8b57247035c4937
133- 4:27AM INF transaction confirmed txHash=0x6afe1bf620b22b99f2483ed43e88846ae3deba945da57848d94838f10eba38c6
134- 4:27AM INF Wallet(s) funded! 💸
135- 4:27AM INF Total execution time: 6.613848833s
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
136258```
137259
138260## Check wallets balances
139261
140262``` bash
141- jq -r ' .[].Address' wallets-funded.json \
263+ jq -r ' .[].Address' wallets-funded-l1 .json \
142264| while read -r addr; do
143265 bal=$( cast call " $l1_contract_addr " " balanceOf(address)(uint256)" " $addr " --rpc-url " $l1_rpc_url " )
144266 printf ' %s: %s\n' " $addr " " $bal "
145267 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
146274```
147275
148276``` bash
149- 0x6705a7352c76b0c9D204b5AD9E9Dc92E57c4D44C: 1000
150- 0x26ee261781092a1833A4f09210bACf5826C975D1: 1000
151- 0x002B6fADA0EFEEED24B1b7197C3785426C6BDd75: 1000
152- 0x4330ba531b0a8415552F1fAFa02cCF390e66400B: 1000
153- 0x80C70Ba9Ee3Abd5F17282Cb989730c5ee5D282e4: 1000
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
154288```
0 commit comments