Alex Ni | Flow 4D (2024-05-17)
I'm trying to get ERC721 balance for a specific address in evm, but the command throws an error:
cast call 0xa7aF43d9AB4dcbEcf1326BF3a4E4c206d203404 \ --rpc-url https://previewnet.evm.nodes.onflow.org \ "balanceOf(address)(uint256)" \ 0x00000000000000000000000250b5f4961ea72c2c
5 Replies
I've created a thread for your message. Please continue any relevant discussion in this thread.
You can rename this thread using
/title <new title>
If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadencehow do you usually run scripts with foundry?
am I missing anything?
here's some more context:
transaction that deployed the ERC721 contract:
https://previewnet.flowdiver.io/tx/f0d929533682179c3b5e480b37b81d6a0aa92eb003e0cc5f06c396054583a2af?tab=evm-tx
transaction that minted an ERC721 token:
https://previewnet.flowdiver.io/tx/c23d6b0a35766470de794d42d3a225a2b92d371ea7614fb9240461028108b725?tab=evm-tx
contract code:
Looking at the events, looks like the ERC721 contract address is
0xa87827e9c64c44b8BD8284Ae94F8ab49612E733A
and I believe you'll want to remove the return type from the signature
Try running again with
It returns a value of 0, so I'm not sure that mint txn went through as intend. How are you encoding the calldata for the mint call?I used this command to deploy the contract:
I think I'm using a wrong address after the contract deployment
In the txns you linked to earlier, the deployed contract address is emitted in the event as
A.b6763b4399a888c8.EVM.TransactionExecuted.contractAddress
which is 0xa87827e9c64c44b8BD8284Ae94F8ab49612E733A
as the ERC721 contract
You can also use the interim ethernal EVM block explorer to look up the deployment EVM txn - https://flow-foundation.tryethernal.com/transaction/0x2a77b458f67a5fd0ab203d20f71086149811bf0140a332ffb7d551e757125779 which has the same contract address listed