In this exercise, the entry point may only be called by the
admin address; it also requires:
- that the argument value
vbe between 10 (included) and 20 (strictly)
- be even
If not even, it must fail with this following message :
Expected even value:
It is also possible to establish execution conditions with a
Execution conditions have identifiers (here
r2) used for fail message when no
otherwise is established, and to name the property in contract formal verification.
One of the key requirements of a smart contract's entry point is to establish execution conditions:
- Who can call the contract?
- Under which logical conditions?
Archetype provides dedicated syntax to make execution conditions very explicit and non ambiguous.
The following Completium CLI command deploys the contract on the Tezos network:
Call entry point
The following command calls the unique entry point with the argument
14 using the
If the contract call fails with an
InvalidCaller error, it is because your tezos test address does not match the
admin address specified in the contract code, which proves that the execution condition works as intended. To successfully call the contract, modify the
admin address in the code to match your own wallet address, which is listed when you run
completium-cli show account. You need to redeploy the contract when making any changes to the code.
The following command generates the URL to view the contract in Better call Dev:
Open '3-rat_transfer.arl' and click on "Next: Rationals & transfers" below.