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

Bug with parse admin address of jetton master #34

Open
0x0liver opened this issue May 25, 2024 · 1 comment
Open

Bug with parse admin address of jetton master #34

0x0liver opened this issue May 25, 2024 · 1 comment

Comments

@0x0liver
Copy link


Description:

I got an error when trying to get jetton data with this function:

    async getJettonData(provider: ContractProvider) {
        let res = await provider.get('get_jetton_data', []);
        let totalSupply = res.stack.readBigNumber();
        let mintable = res.stack.readBoolean();
        let adminAddress = res.stack.readAddress();
        let content = res.stack.readCell();
        let walletCode = res.stack.readCell();
        return {
            totalSupply,
            mintable,
            adminAddress,
            content,
            walletCode
        };
    }

The problem is that the proxy ton (EQCM3B12QK1e4yZSf8GtBRT0aLMNyEsBc_DhVfRRtOEffLez) does not have an admin address, so I encounter the error:

Error: Invalid address: 0

Steps to Reproduce:
Call the function with the jetton address EQCM3B12QK1e4yZSf8GtBRT0aLMNyEsBc_DhVfRRtOEffLez.

Solution:
Use let adminAddress = res.stack.readAddressOpt(); instead.

puzzle-rusher pushed a commit to puzzle-rusher/ton that referenced this issue Jun 27, 2024
feat: Block actions and OutList added
@Torakushi
Copy link

Torakushi commented Sep 10, 2024

Same here. I agree with the solution proposed here

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

2 participants