Crates.io | hmip20 |
lib.rs | hmip20 |
version | 0.1.1 |
source | src |
created_at | 2023-01-20 03:49:19.351225 |
updated_at | 2023-02-27 07:03:12.633595 |
description | Hermit incentive contract |
homepage | |
repository | |
max_upload_size | |
id | 763118 |
size | 382,538 |
hmip20 smart contract for hermit network.
git clone https://github.com/HermitMatrixNetwork/hmip20.git
apt update && apt install -y binaryen clang
cd himp20
cargo test
make compile-optimized
this commone will output a file contract.wasm.gz
.
ghmd tx compute store contract.wasm.gz --from a --gas 1000000 --gas-prices 0.25ughm
use ghmd q compute list-code
, find the number of upload contract
ghmd tx compute instantiate <code-id> \
'{"name":"<your_token_name>","symbol":"<your_token_symbol>","admin":"<optional_admin_address_defaults_to_the_from_address>","decimals":<number_of_decimals>,"initial_balances":[{"address":"<address1>","amount":"<amount_for_address1>"}],"prng_seed":"<base64_encoded_string>","config":{"public_total_supply":<true_or_false>,"enable_deposit":<true_or_false>,"enable_redeem":<true_or_false>,"enable_mint":<true_or_false>,"enable_burn":<true_or_false>}}' \
--label <token_label> \
--from <account>
"config":{
"public_total_supply":<true_or_false>,
"enable_deposit":<true_or_false>,
"enable_redeem":<true_or_false>,
"enable_mint":<true_or_false>,
"enable_burn":<true_or_false>
}
ghmd tx compute execute <contract_address> '{"deposit":{}}' --amount 1000000ughm --from <account>
ghmd tx compute execute <contract-address> '{"redeem": {"amount": "<amount_in_smallest_denom_of_token>"}}' --from <account>
'{"transfer":{"amount":"<string>","recipient":"<address_string>"}}'
'{"send":{"amount": <string>, "recipient": <string>}}'
'{"batch_transfer":{"actions":[{"amount": <string>, "recipient": <string>}]}}'
'{"batch_send":{"actions":[{"amount":<string>, "recipient":<string>}]}}'
'{"burn":{"amount": <string>}}'
'{"register_receive": {"code_hash": <string>}}'
'{"create_viewing_key":{"entropy": <string>}'
ghmd tx compute execute <contract-address> '{"set_viewing_key": {"key": "<your_key>"}}' --from <account>
'{"increase_allowance":{"spender": <string>, "amount": <striong>}'
'{"decrease_allowance":{"spender": <string>,"amount":<string>}}'
'{"transfer_from":{"amount":<string>, "owner":<string>, "recipient":<string>}}'
'{"send_from":{"amount":<string>, "owner":<string>, "recipient":<string>}'
'{"batch_transfer_from":{"actions":[{"amount":<string>, "owner":<string>, "recipient":<string>}]}'
'{"batch_send_from":{"actions":[{"amount":<string>, "owner":<string>, "recipient":<string>}]}'
'{"burn_from":{"amount":"<string>"", "owner":"<string>"}'
'{"batch_burn_from":{"actions":[{"amount":"<string>"", "owner":"<string>"}]}'
'{"mint":{"amount":"<string>","recipient":"<string>"}}'
'{"batch_mint":{"actions":[{"amount":"<string>","recipient":"<string>"}]}}'
'{"change_admin":{"address":"<str>"}}'
'{"set_contract_status":{"level":"<string>"}}'
// normal_run
// stop_all_but_redeems
// stop_all
'{"add_minters":{"minters":["str1","str2"]}}'
'{"remove_minters":{"minters":["str1","str2"]}}'
'{"set_minters":{"minters":["str1","str2"]}}'
'{"revoke_permit":{"permit_name":"<string>"}}'
'{"token_info":{}}'
ghmd q compute query <contract-address> '{"token_config": {}}'
'{"contract_status":{}}'
ghmd q compute query <contract-address> '{"exchange_rate": {}}'
'{"minters":{}}'
// todo
'{"with_permit":{"permit":{},"query":""}}'
'{"balance":{"address":"<str>","key":"str"}}'
'{"transfer_history":{"address":"<str>","key":"<str>","page_size":<int>}}'
'{"transaction_history":{"address":"<str>","key":"<str>","page_size":<int>}'
'{"allowance":{"key":"<string>","owner":"<string>","spender":"<string>"}}'