Bxpana pfp
Bxpana
@bxpana
๐Ÿค” Curious about your token balances on @ZKsync ? Let's use Foundry's cast tool to check balances directly from the command line! Quick, efficient, and no GUI needed. ๐Ÿงต๐Ÿ‘‡
0 reply
0 recast
0 reaction

Bxpana pfp
Bxpana
@bxpana
Step 1: Use a Rich Wallet When you run `era_test_node fork mainnet` it provides you with rich wallets preloaded with ETH on the ZKsync mainnet fork. Let's use one of these for testing!
0 reply
0 recast
0 reaction

Bxpana pfp
Bxpana
@bxpana
Step 2: Add Rich Wallet to .env Update your .env file with the rich wallet's address and private key. This way, you have funds to play with on your local fork. Remember, never use real private keys for testing! ๐Ÿ”‘
0 reply
0 recast
0 reaction

Bxpana pfp
Bxpana
@bxpana
Step 3: Load the Environment Variables In your terminal, load the variables (youโ€™ll need to do this anytime changes are made to your .env) and verify they are set. You should see your rich wallet's address and private key. โœ…
0 reply
0 recast
0 reaction

Bxpana pfp
Bxpana
@bxpana
Step 4: Check ETH Balance Now, check your ETH balance. You'll see your balance in wei. To convert to ETH, divide by 1e18. โž— You can use something like https://eth-converter.com as well
0 reply
0 recast
0 reaction

Bxpana pfp
Bxpana
@bxpana
Step 5: Check WETH Balance Use cast call to check your WETH balance, which should be 0โ€ฆ for now ๐Ÿ˜
0 reply
0 recast
0 reaction

Bxpana pfp
Bxpana
@bxpana
Step 6: Explore Other Contract Calls cast call isn't limited to balances. You can read any public data from contracts. For example, get the total supply of WETH. Knowledge is power! ๐Ÿฆพ You can verify on the explorer: https://era.zksync.network/address/0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91#readProxyContract
0 reply
0 recast
0 reaction

Bxpana pfp
Bxpana
@bxpana
With cast, you have the power to query the blockchain at your fingertips! Next, we'll learn how to get WETH on our local fork. Stay tuned! โšก
0 reply
0 recast
0 reaction