Language
Guides
Masterchain

Masterchain

⚠️

Masterchain support must be enabled explicitly in the project configuration. Without enabling it all masterchain addresses will be treated as invalid.

Most of the contract developers don't need a masterchain. Masterchain is needed only for participating in elections or storing libraries. If you don't need to participate in elections or store libraries, you don't need a masterchain.

How contract is protected from masterchain

Most of the contracts written in func enforce all incoming addresses to be basechain ones. This is done to prevent masterchain addresses from being used in the contract. Tact does this by default.

What is prohibited to do without masterchain support enabled:

  • Deploy contract to masterchain. The init function would throw a Masterchain support is not enabled for this contract error for every message.
  • Receive messages from masterchain accounts.
  • Receive structs that have masterchain addresses in them.
  • Send messages to masterchain accounts.
  • Use masterchain addresses in arguments of get methods.

Enable masterchain support

To enable masterchain support, please enable it in the project configuration file:

{
    "options": {
        "masterchain": true
    }
}