Smart Contract is failing while transferring from one account to another account using the sign key and address.
Looks like you are trying to interact with a CIS2 token. This error means that you are trying to transfer an amount of a token you do not own.
Does that make sense?
how to make custom error code? can code be string?
Did you look at the developer documentation? Return custom errors — Concordium documentation
Hi @abizjak Thanks for your update, I have checked the issue that I am getting it is considered an insufficient balance, But I have this much amount of 1200 (Public balance total) in my concordium browser wallet screenshot attached which is on Testnet.
Could you please let me know if it will not be considered as my account balance or if I may need to add something at the time of transfer?
That is your CCD balance on the account. The error is about the balance of the token you want to transfer. I don’t know what the balance of that is.
If you can share more details about what contract you want to interact with, I can investigate further.
Thanks for your kind suggestion, As we are working on the Local Node Testnet It seems that we do not have the CCD tokens to transfer but in my chrome wallet it is showing me that I have 1500 CCD (Public wallet balance) around, But when I am trying to transfer the 1CCD (Public wallet balance), We are getting an error below.
''Update contract failed: Rejected by contract logic with reason -42000002"
So Is there any difference between the CCD showing in the chrome wallet and the actual one we should have?
The error is about the token you are trying to transfer, not about the CCD.
What shows up in the wallet is the CCD balance, not your CIS2 token balance.
Are you trying to use the wCCD contract? Before you can transfer wCCD you have to wrap them.
and followed the steps from this link, In this link, there is a transfer function that I’m using and getting the above error as I mentioned earlier.
- This is a test-net account I’m using so How can we get the CIS2 token for the testnet account?
- How can we use 1500 CCD (Public Wallet Balance) for transfer?
Can you please confirm that your account owns this token? Or is it successfully minted by your account?
it wasn’t minted that is why I’m getting this error. now I minted it works