Add contract-specific README
This commit is contained in:
parent
f9f7a81cb0
commit
5855077d30
1 changed files with 2 additions and 62 deletions
|
@ -24,65 +24,5 @@ CosmWasm smart contracts used in the Bisenzone MVP.
|
|||
export CONTRACT="wasm13we0myxwzlpx8l5ark8elw5gj5d59dl6cjkzmt80c5q5cv5rt54qhmta7s"
|
||||
```
|
||||
|
||||
* Upload a cycle of obligations -
|
||||
|
||||
```
|
||||
export EXECUTE='{
|
||||
"upload_obligation": {
|
||||
"creditor": "wasm19u72czh0w4jraan8esalv48nrwemh8kgax69yw",
|
||||
"amount": "100",
|
||||
"memo": "alice -> bob"
|
||||
}
|
||||
}'
|
||||
wasmd tx wasm execute "$CONTRACT" "$EXECUTE" --from alice --chain-id testing -y
|
||||
|
||||
export EXECUTE='{
|
||||
"upload_obligation": {
|
||||
"creditor": "wasm12r9t5wmre89rwakr0e5nyhfmaf4kdleyltsm9f",
|
||||
"amount": "80",
|
||||
"memo": "bob -> charlie"
|
||||
}
|
||||
}'
|
||||
wasmd tx wasm execute "$CONTRACT" "$EXECUTE" --from bob --chain-id testing -y
|
||||
|
||||
export EXECUTE='{
|
||||
"upload_obligation": {
|
||||
"creditor": "wasm19xlctyn7ha6pqg7pk9lnk8y60rk8646dm86qgv",
|
||||
"amount": "70",
|
||||
"memo": "charlie -> alice"
|
||||
}
|
||||
}'
|
||||
wasmd tx wasm execute "$CONTRACT" "$EXECUTE" --from charlie --chain-id testing -y
|
||||
```
|
||||
|
||||
* Clear cycle -
|
||||
|
||||
```
|
||||
export EXECUTE='{
|
||||
"apply_cycle": {
|
||||
"path": ["wasm19xlctyn7ha6pqg7pk9lnk8y60rk8646dm86qgv", "wasm19u72czh0w4jraan8esalv48nrwemh8kgax69yw", "wasm12r9t5wmre89rwakr0e5nyhfmaf4kdleyltsm9f", "wasm19xlctyn7ha6pqg7pk9lnk8y60rk8646dm86qgv"],
|
||||
"amount": "70"
|
||||
}
|
||||
}'
|
||||
wasmd tx wasm execute "$CONTRACT" "$EXECUTE" --from alice --chain-id testing -y
|
||||
```
|
||||
|
||||
* Query obligations -
|
||||
|
||||
```
|
||||
* wasmd query wasm contract-state smart "$CONTRACT" '{
|
||||
"get_obligations": {
|
||||
"creditor": "wasm19u72czh0w4jraan8esalv48nrwemh8kgax69yw"
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
* Check balance of the solver (to confirm increase in karma) -
|
||||
|
||||
```
|
||||
wasmd query wasm contract-state smart "$CONTRACT" '{
|
||||
"balance": {
|
||||
"address": "wasm19xlctyn7ha6pqg7pk9lnk8y60rk8646dm86qgv"
|
||||
}
|
||||
}'
|
||||
```
|
||||
For further instructions, refer to the contract specific READMEs
|
||||
(e.g. [cofi-karma-game README.md](contracts/cofi-karma-game/README.md))
|
Loading…
Reference in a new issue