Minting OKRW via Governance
An end-to-end tutorial on how to authorize a new minter address and mint OKRW tokens using the command line.
What You Will Learn
- ✓How to query the `x/okrw` module parameters.
- ✓How to create and submit a governance proposal to set the minter address.
- ✓How to vote on a governance proposal.
- ✓How to use the newly authorized address to mint OKRW tokens.
Prerequisites
- A running Maroo local testnet or access to a public testnet.
- An account with enough `aokrw` to submit a governance proposal deposit (e.g., a validator account).
Tools Needed
marood (Maroo node CLI)
The
x/okrw module ensures that only a single, authorized address can mint new OKRW. By default, this address is not set. This tutorial will walk you through the complete, governance-driven process of setting the minter address and then using it to mint new tokens. 1
1. Check Initial Parameters
First, let's verify the initial state of the
x/okrw module. The minter_address should be empty. terminal bash
marood query okrw params
# Expected Output:
# params:
# minter_address: ""
# mint_denom: aokrw 2
2. Create a Minter Account
We need a dedicated account to be the minter. Let's create a new key for this purpose.
terminal bash
marood keys add okrw-minter
# This will output the address, which you should save for the next step.
# e.g., maroo1zaq9j8k4g8q8w8... (save this address) 3
3. Craft the Governance Proposal
Now, we'll create a JSON file that defines our proposal. The proposal's message will be a
MsgUpdateParams transaction for the x/okrw module. Remember to replace maroo1... with the address you just created. terminal bash
MINTER_ADDRESS=$(marood keys show okrw-minter -a)
GOV_MODULE_ADDRESS="maroo10d07y265gmmuvt4z0w9aw880jnsr700j8k2m34"
cat <<EOF > proposal.json
{
"title": "Set OKRW Minter Address",
"summary": "Authorize the address $MINTER_ADDRESS to mint OKRW tokens.",
"messages": [
{
"@type": "/maroo.okrw.v1.MsgUpdateParams",
"authority": "$GOV_MODULE_ADDRESS",
"params": {
"minter_address": "$MINTER_ADDRESS",
"mint_denom": "aokrw"
}
}
],
"deposit": "10000000aokrw"
}
EOF Note: The `authority` is the address of the `x/gov` module. You can find this with `marood debug addr gov`.
4
4. Submit and Vote on the Proposal
Submit the proposal using an account that has funds for the deposit. Then, vote 'yes' on it. On a local testnet, the voting period is very short.
terminal bash
# Use a validator or other funded account to submit
marood tx gov submit-proposal proposal.json --from validator1 --chain-id maroo-local-1 -y --gas auto --gas-adjustment 1.5
# Get the proposal ID (it will likely be 1)
PROPOSAL_ID=1
# Vote on the proposal
marood tx gov vote $PROPOSAL_ID yes --from validator1 --chain-id maroo-local-1 -y 5
5. Verify the Parameter Change
After the voting period ends and the proposal passes, query the params again. The
minter_address should now be set to your new account's address. terminal bash
# Wait for the voting period to pass (e.g., ~15 seconds on a localnet)
marood query okrw params
# Expected Output:
# params:
# minter_address: maroo1zaq9j8k4g8q8w8...
# mint_denom: aokrw 6
6. Mint New OKRW Tokens
With the minter address set, you can now mint tokens. First, you'll need to send some funds to your new minter account to pay for gas fees. Then, execute the mint command.
terminal bash
# Send gas funds to the minter account
MINTER_ADDRESS=$(marood keys show okrw-minter -a)
marood tx bank send validator1 $MINTER_ADDRESS 1000000aokrw --from validator1 --chain-id maroo-local-1 -y
# Create a recipient account
marood keys add recipient1
RECIPIENT_ADDRESS=$(marood keys show recipient1 -a)
# Mint 500 OKRW from the authorized minter account (500 OKRW = 500 * 10^18 aokrw)
marood tx okrw mint $RECIPIENT_ADDRESS 500000000000000000000aokrw --from okrw-minter --chain-id maroo-local-1 -y
# Verify the recipient's balance
marood query bank balances $RECIPIENT_ADDRESS Conclusion
Congratulations! You have successfully used the on-chain governance system to authorize a minter and create new OKRW tokens. This process demonstrates the core security model of the
x/okrw module, ensuring that control over the token supply remains decentralized and transparent.