This is a very simple Secret Contract which can be deployed on the Secret Network, created as part of the Secret Games incentivised testnet phase 1. It was built using the Secret Contracts Starter Pack. For the basics on how to build, test, deploy and interact with secret contracts, please start there.
The example calls below assume the default situation on the local containerised development environment:
- a key named
a
- keyring-backend
test
Add the square of a the passed number to a running total.
Example call:
secretcli tx compute execute $CONTRACT '{"add_squared": {"amount": 5}}' --from a --keyring-backend test
Reset the running total to an arbitrary number.
Example call:
secretcli tx compute execute $CONTRACT '{"reset": {"total": 0}}' --from a --keyring-backend test
Get the current running total.
secretcli query compute contract-state smart $CONTRACT '{"get_total": {}}'