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
@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
@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
@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
@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
@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
@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