Constants
balance
Number of tez held by the contract.
It is indeed possible to send tez to a contract, either with a buitlin tansfer command (tezos-client, wallets, ...) or when calling an entrypoint.
Note however that it is not possible to transfer the balance of a contract unless it is explicitely made possible by entrypoints.
If a contract is receiving tez, it is recommended to add the following collect
entrypoint:
entry collect(collector : address) {
called by owner
effect {
transfer balance to collector
}
}
Type
Michelson
caller
Address calling the contract. It may be an account or another smart contract.
Type
Michelson
Related
level
now
min_block_time
self_address
self_chain_id
Chain unique identifier.
It is typically used in signed permits data to be verified on chain, in order to avoid replay attacks from testnet to mainnet (so that a permit from testnet cannot be used on mainnet).
The table below shows the chain id of the main networks:
"NetXdQprcVkpaWU"
"NetXnHfVqm9iesp"
The chain id is provided by the tezos node at:
<node url>/chains/main/chain_id
Type
Michelson
source
Address of the account at the origin of the call to the entrypoint. If Alice calls contract A, which calls contract B, then source in contract B is Alice (and caller in contract B is contract A).
Type
Michelson
Related
state
transition
entrypoints, not assignment instructions.The Michelson representation is a nat
storage variable named _state
.Related