Contracts
The contract
type represents a smart contract.
There is no way to create a literal value of this type; you must create a contract
type by passing the address of the account to a predefined function.
Beware of failures if the address is invalid.
The call Tezos.implicit_account(kh)
casts the public key hash kh
of an implicit account to a contract
type that represents that user account.
Contract types that represent implicit accounts always have the type contract<unit>
because they accept no parameter.
The call Tezos.get_contract(address)
casts the address of a smart contract (originated account) to a contract
type that represents that contract.
The type is parameterized based on the parameter that the contract accepts.
For example, if the contract accepts an integer, the type is contract<int>
.