tact-lang / tact

Tact compiler main repository
https://tact-lang.org
MIT License
371 stars 103 forks source link

The version 1.4.1 cannot deploy contracts properly. #674

Closed lanlingxiawu closed 1 month ago

lanlingxiawu commented 1 month ago

The version 1.4.1 cannot deploy contracts properly. tact.config.json { "name": "ExampleJettonMaster", "path": "./src/contracts/jetton_example.tact", "output": "./src/output", "mode": "fullWithDecompilation", "options":{ } },

deploy ts code:

let packed_msg2 = beginCell()
.store(
    storeJettonMint({
        $$type: "JettonMint",
        origin: deployer_wallet_contract.address,
        receiver: deployer_wallet_contract.address,
        amount: supply,
        custom_payload: beginCell().endCell(),
        forward_ton_amount: 0n,
        forward_payload: beginCell().endCell().asSlice(),
    })
)
.endCell();

await deployer_wallet_contract.sendTransfer({
    seqno,
    secretKey,
    messages: [
        internal({
            to: jettonMaster,
            value: deployAmount,
            init: {
                code: init.code,
                data: init.data,
            },
            body: packed_msg2,
        }),
    ],
});

It runs properly in versions below 1.4.0.

anton-trunov commented 1 month ago

Thank you for reporting.

lanlingxiawu commented 1 month ago

Thank you for reporting.

  • Could you please clarify what "versions below 1.4.0" means? Does it include 1.4.0 or not?
  • What exact error message do you see?
  • Please link a repository with a reproducible example, so we could try running something like npx blueprint deploy to see the issue.

Could you please clarify what "versions below 1.4.0" means? Does it include 1.4.0 or not?

I used the following code to deploy the contract. It could be deployed successfully in versions below 1.4.0. In version 1.4.0, adding the "mode": "fullWithDecompilation" property allows it to deploy successfully. However, in version 1.4.1, it fails to deploy.

https://github.com/howardpen9/jetton-implementation-in-tact

anton-trunov commented 1 month ago

@lanlingxiawu We just released a dev version of Tact (next tag on NPM) that is supposed to fix this issue. Could you please try it and check it does indeed resolve your issue? https://www.npmjs.com/package/@tact-lang/compiler/v/1.4.1-dev.20240813

Here are some instructions on how to use the next version of Tact: https://github.com/tact-lang/tact/wiki/Using-unreleased-versions-of-tools-early#dev-versions-of-tact-with-blueprint

anton-trunov commented 1 month ago

actually, it's easier to install that Tact version like so:

yarn add @tact-lang/compiler@1.4.1-dev.20240813
lanlingxiawu commented 1 month ago

Thank you, using the development version did indeed allow the contract to be successfully deployed.

anton-trunov commented 1 month ago

Perfect! Thank you so much for trying it out and closing the issue, really appreciate it

anton-trunov commented 1 month ago

@lanlingxiawu Btw, we just release Tact v1.4.2 with that fix and even more.