Skip to main content

Building a contract

Selecting a compilation block

To build a smart contract, the user needs to select a contract compilation block.

The animation below shows how to do it.

Specifying the storage type

The animation below sets the contract storage to be of type string.

Specifying the initial storage

The initial storage is optional. It is unnecessary when the user only wants to compile the smart contract.

The initial storage value will be propagated to the deployment page if the user wants to deploy the contract directly from VisualTez.

Specifying an entrypoint

The animation below shows how to define an entry point that expects a string as an input argument and replaces the current value in the contract storage.

Specifying an on-chain view

The example below shows how to define an on-chain view that expects an argument of type unit and returns the current contract storage if the calling contract has permission.