Skip to content

Deploying

Publishing your contract to the Signum blockchain so that real accounts can use it, first on Testnet to try it for free, then on Mainnet.

  • Deploying is a transaction. Your wallet signs a transaction that carries the compiled contract. Once it’s included in a block, the contract exists on the chain with its own account id.
  • A deployed contract can’t be changed or deleted. To fix a bug you deploy a new contract. Test thoroughly first, and always try it on Testnet.
  • It costs a fee. The fee depends on the size of the contract. The deploy page shows the minimum.
  • Your wallet signs, the Studio never sees your keys. The Studio prepares the transaction and the XT Wallet browser extension asks you to confirm it.

Click Connect Wallet at the bottom left of the sidebar and choose Connect to Testnet or Connect to Mainnet. XT Wallet must be set to a node of the same network; if it isn’t, the Studio says which network it expected. Once connected, the sidebar shows your account and balance.

Open the deploy page with Deploy in the workflow rail (or Deploy in the .asm editor). It compiles the contract and shows:

  1. Contract Summary: the code size and the minimum fee for deploying.
  2. Deploy by reference (see below): choose Full deploy for a new contract.
  3. Parameters, if the contract has any (see below).
  4. Deployment Settings:
    • Activation Amount (SIGNA): taken from #program activationAmount.
    • Transaction Fee (SIGNA): at least the minimum shown.
    • Deadline (minutes): how long the network may take to include the transaction, at most 1440.

Click Deploy Contract. The Studio goes through Preparing Transaction, Wallet Confirmation (confirm in XT Wallet), Broadcasting and Deployed. The success message shows the transaction id, a link to the explorer and Inspect, which opens the new contract in the inspector.

The contract goes live once its transaction is in a block, usually within a few minutes. The workflow rail’s Deploy step shows how many deployments of this code exist on the network and how many are yours.

Some contracts take values at deployment: an owner, a fee, the id of another contract. They are written into the contract’s data stack when it’s deployed, so the same code can be deployed many times with different settings.

To make a variable a deploy parameter, mark its slot as a parameter in the contract’s Label Map (param: true). The deploy page then shows a field for each one, in the format the Label Map gives it (a number, an address, a short text of up to 8 bytes, and so on), with a preview of the resulting data stack.

Once a contract’s code is on the chain, more instances of the same code can be deployed by reference: only the data is sent, so it’s much cheaper. The Studio looks for existing deployments of this exact code (connect XT Wallet so it can ask the node) and lists them as candidates. Choose By reference and pick the original. Activation amount and memory pages come from the original.

  • Up to 8 KiB, a contract is deployed through XT Wallet as described above.
  • Between 8 and 10 KiB, XT Wallet can’t sign it. The Studio then offers a Large Contract Deployment that signs with your account passphrase directly. The passphrase is used to sign the transaction, isn’t stored, and is cleared from memory afterwards.
  • Above 10 KiB (10240 bytes), a contract can’t be deployed at all. Make it smaller.

Mainnet uses real SIGNA. Before deploying there:

  • all tests pass and the linter shows no warnings;
  • you’ve run the contract through its scenarios in the simulator;
  • you’ve deployed it to Testnet and used it there the way real users will;
  • the activation amount covers the worst case (Writing code).