Skip to content

OutlierVentures/simple-secret-contract

Repository files navigation

A very simple Secret Contract

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

Transactional functions

add_squared: Add the square of a number to a running total

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: Reset the running total

Reset the running total to an arbitrary number.

Example call:

secretcli tx compute execute $CONTRACT '{"reset": {"total": 0}}' --from a --keyring-backend test

Queryable fields

get_total

Get the current running total.

secretcli query compute contract-state smart $CONTRACT '{"get_total": {}}'

About

A simple Secret Contract to be deployed on the Secret Network, built as part of the Secret Games incentivised testnet.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published