tact-lang / tact

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

Different FunC code after compilation #336

Closed jokly closed 2 weeks ago

jokly commented 1 month ago

Description

Example project Contract structure: NFTItem -> NFTCollection

Problem

After compilation files with FunC code of NFTItem are different:

Diff:

_ get_abi_ipfs() method_id {

    return "ipfs://QmYMHufVnBdJM9je3XUNKK8WGUHKHRgDkVg6ygjiTMu3hP";

}
anton-trunov commented 2 weeks ago

The hash is calculated based on the ABI, by adding traits (as explained in the repo's readme) you change your contract's ABI, so the hash changes. This is expected behavior.

jokly commented 2 weeks ago

Hello! Thank you for your reply.

Based on your answer, if contract NFTCollection use contract NFTItem I need to use build folder of NFTCollection contract for both in wrappers:

Is it right? I think it's not clear behavior Can you explain why does FunC code of NFTItem depends on NFTCollection code and its traits?