hmip20 smart contract for hermit network.
bash
git clone https://github.com/HermitMatrixNetwork/hmip20.git
bash
apt update && apt install -y binaryen clang
```bash cd himp20 cargo test
make compile-optimized
``
this commone will output a file
contract.wasm.gz`.
bash
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
bash
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>
json
"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>
}
bash
ghmd tx compute execute <contract_address> '{"deposit":{}}' --amount 1000000ughm --from <account>
bash
ghmd tx compute execute <contract-address> '{"redeem": {"amount": "<amount_in_smallest_denom_of_token>"}}' --from <account>
bash
'{"transfer":{"amount":"<string>","recipient":"<address_string>"}}'
bash
'{"send":{"amount": <string>, "recipient": <string>}}'
bash
'{"batch_transfer":{"actions":[{"amount": <string>, "recipient": <string>}]}}'
bash
'{"batch_send":{"actions":[{"amount":<string>, "recipient":<string>}]}}'
bash
'{"burn":{"amount": <string>}}'
bash
'{"register_receive": {"code_hash": <string>}}'
bash
'{"create_viewing_key":{"entropy": <string>}'
bash
ghmd tx compute execute <contract-address> '{"set_viewing_key": {"key": "<your_key>"}}' --from <account>
bash
'{"increase_allowance":{"spender": <string>, "amount": <striong>}'
bash
'{"decrease_allowance":{"spender": <string>,"amount":<string>}}'
bash
'{"transfer_from":{"amount":<string>, "owner":<string>, "recipient":<string>}}'
bash
'{"send_from":{"amount":<string>, "owner":<string>, "recipient":<string>}'
bash
'{"batch_transfer_from":{"actions":[{"amount":<string>, "owner":<string>, "recipient":<string>}]}'
bash
'{"batch_send_from":{"actions":[{"amount":<string>, "owner":<string>, "recipient":<string>}]}'
bash
'{"burn_from":{"amount":"<string>"", "owner":"<string>"}'
bash
'{"batch_burn_from":{"actions":[{"amount":"<string>"", "owner":"<string>"}]}'
bash
'{"mint":{"amount":"<string>","recipient":"<string>"}}'
bash
'{"batch_mint":{"actions":[{"amount":"<string>","recipient":"<string>"}]}}'
bash
'{"change_admin":{"address":"<str>"}}'
bash
'{"set_contract_status":{"level":"<string>"}}'
// normal_run
// stop_all_but_redeems
// stop_all
bash
'{"add_minters":{"minters":["str1","str2"]}}'
bash
'{"remove_minters":{"minters":["str1","str2"]}}'
bash
'{"set_minters":{"minters":["str1","str2"]}}'
bash
'{"revoke_permit":{"permit_name":"<string>"}}'
bash
'{"token_info":{}}'
bash
ghmd q compute query <contract-address> '{"token_config": {}}'
bash
'{"contract_status":{}}'
bash
ghmd q compute query <contract-address> '{"exchange_rate": {}}'
bash
'{"minters":{}}'
bash
// todo
'{"with_permit":{"permit":{},"query":""}}'
bash
'{"balance":{"address":"<str>","key":"str"}}'
bash
'{"transfer_history":{"address":"<str>","key":"<str>","page_size":<int>}}'
bash
'{"transaction_history":{"address":"<str>","key":"<str>","page_size":<int>}'
bash
'{"allowance":{"key":"<string>","owner":"<string>","spender":"<string>"}}'