Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell underflow when smart contract receive JettonTransferNotification #20

Open
JohnnnyWang opened this issue Aug 29, 2024 · 0 comments
Open

Comments

@JohnnnyWang
Copy link

JohnnnyWang commented Aug 29, 2024

Here is the transfer logic of the client. We hope to notify the smart contract when the transfer is completed, carrying a bigint as necessary data:

 const jetton = sdk.openJetton(Address.parse('xxxxxxxxxxxxxxxxxxxxxxxxxx')); 
 const playerWallet = await jetton.getWallet(provider.sender().address!);
 await playerWallet.send(provider.sender(), classicGameAddress, toNano(50), {
        notify: {
            amount: toNano(0.06),
            payload: beginCell().storeUint(1n, 64).endCell() // store Uint here
        },
        value: toNano(0.14)
});

here is code of smart contract (tact), we try to load

 let roomId = notify.forward_payload.loadUint(64);

Finally, the smart contract reports an error on this line:
Exit code
9 · Cell underflow

ps: We find when using Jetton Transfer, forward_payload is sum_type: TextComment
instead of Cell

Is there something I did wrong?
Thanks for help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant