Skip to content

Latest commit

 

History

History

gauntlet-cosmos-contracts

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Gauntlet Cosmos Contracts

Getting started

asdf install
yarn
yarn build
yarn gauntlet <command> --<flags>=<x> <arguments>

To bundle:

yarn
yarn bundle

This will generate executables for Linux and MacOS under ./bin.

./bin/gauntlet-cosmos-<macos/linux> <command>  --<flags>=<x> <arguments>

Commands

Every contract available has 3 actions available:

  • Deploy: Deploys the contract
  • Execute/Query: Executes/Queries a contract function. Execute will send a transaction. Query will inspect the contract
  • Help: Gives an description of the contract available functions

The command follows the same style:

<contract>:<action> --<param>=<value> <contract_address>

For our Access Controller contract, we could perform:

  • Deploy chainlink contract
./bin/gauntlet-cosmos-macos access_controller:deploy --network=bombay-testnet

This will give us the contract address (cosmos234)

  • To Execute/Query any function
./bin/gauntlet-cosmos-macos access_controller:add_access --address="cosmos123" cosmos234

Should add access for address cosmos123

./bin/gauntlet-cosmos-macos access_controller:has_access --address="cosmos123" cosmos234

Should return true has cosmos123 has already access

  • To show available methods:
./bin/gauntlet-cosmos-macos access_controller:help

It will show every method available in the contract, with their needed parameters and their types, if any

The following contracts have the previous actions available:

  • access_controller
  • flags
  • ocr2
  • deviation_flagging_validator

Multisig Commands

  • Create a cw4 group

This instantiates a group with 3 members, each having equal voting power, for a total of 1+1+1=3 votes: (passing admin address is optional)

yarn gauntlet cw4_group:deploy --members='[cosmos1pl4k5rj2jv6phm2vvhkttju7px6va2ja2v3haw,cosmos1tsxn3zzp09kvwpx03gzwquhc6nn794vvznuhzr,cosmos1s66cck3sxacdc2jfpdd4t4pk4yzc60pa72ssdr]' --admin=cosmos1pl4k5rj2jv6phm2vvhkttju7px6va2ja2v3haw  --network=bombay-testnet
  • Create a cw3 flex multisig wallet

This instantiates a multisig wallet, for the group above... with a max voting period of 28800s (8 hours) and an threshold of 100 percent of the vote:

yarn gauntlet cw3_flex_multisig:deploy --network=bombay-testnet --group=cosmos1wx0ahe6gpeyyh0wtq3cyc26f2wyk08kjtndxhf --time=28800 --threshold=3

You may also specify the threshold as an absolute number of votes, or even a quorum combined with a threshold percentage. ( See https://docs.cosmwasm.com/cw-plus/0.9.0/cw3/cw3-flex-spec for details )

Signing with Ledger Wallet

To sign transactions with Ledger cold storage, the command follows the same style but with the --withLedger flag:

<contract>:<action> --<param>=<value> <contract_address> --withLedger