Search
Duplicate
Try Notion
🏜️
Change a module param
To play with the governance module we are going to create new proposal to deactivate the EVMHook.
Create the proposal
Let’s make sure that the EVMHook is enabled:
~/evmosd q erc20 params # params: # enable_erc20: true # enable_evm_hook: true
Bash
We need to create a proposal.json file to submit the proposal:
{ "title": "Change EVMHook", "description": "Try the governance module changing a module param", "changes": [ { "subspace": "erc20", "key": "EnableEVMHook", "value": false } ] }
JSON
Submit the proposal
We need to send the proposal.json to the blockchain. The submit proposal command will just create the proposal, and we are going to make the deposit in a later step.
~/evmosd tx gov submit-proposal param-change proposal.json --from=validator --keyring-backend file --fees=20aevmos -b block --gas=auto --chain-id=evmos_9999-1
Bash
Let’s make sure that the proposal was created:
~/evmosd q gov proposals
Bash
Our newly created proposal should be there and its status should be: DEPOSIT PENDING
pagination: next_key: null total: "0" proposals: - content: '@type': /cosmos.params.v1beta1.ParameterChangeProposal changes: - key: EnableEVMHook subspace: erc20 value: "false" description: Try the governance module changing a module param title: Change EVMHook deposit_end_time: "2022-11-08T14:48:43.248538Z" final_tally_result: abstain: "0" "no": "0" no_with_veto: "0" "yes": "0" proposal_id: "1" status: PROPOSAL_STATUS_DEPOSIT_PERIOD submit_time: "2022-11-06T14:48:43.248538Z" total_deposit: [] voting_end_time: "0001-01-01T00:00:00Z" voting_start_time: "0001-01-01T00:00:00Z"
Bash
Deposit the coins to the proposal
Now that we know that our proposal was created correctly we can make the deposit.
NOTE: the value 1 is the proposal_id that we got from the previous step.
~/evmosd tx gov deposit 1 20000000aevmos --from=validator --keyring-backend file --fees=20aevmos -b block --chain-id=evmos_9999-1
Bash
The proposal status should be VOTING PERIOD :
~/evmosd q gov proposals pagination: next_key: null total: "0" proposals: - content: '@type': /cosmos.params.v1beta1.ParameterChangeProposal changes: - key: EnableEVMHook subspace: erc20 value: "false" description: Try the governance module changing a module param title: Change EVMHook deposit_end_time: "2022-11-08T14:48:43.248538Z" final_tally_result: abstain: "0" "no": "0" no_with_veto: "0" "yes": "0" proposal_id: "1" status: PROPOSAL_STATUS_VOTING_PERIOD submit_time: "2022-11-06T14:48:43.248538Z" total_deposit: - amount: "20000000" denom: aevmos voting_end_time: "2022-11-08T14:53:20.485424Z" voting_start_time: "2022-11-06T14:53:20.485424Z"
Bash
Vote
Now that the proposal is in voting period we are able to send our votes.
NOTE: as validators when we vote on a proposal we are going to be voting representing all the users that delegated coins to us. Any of our delegators can vote using its own wallet in case they want their part of the stake to vote using another option.
~/evmosd tx gov vote "1" "yes" --from validator --keyring-backend file --fees=20aevmos -b=block --chain-id=evmos_9999-1
Bash
Get voting status
If we query the status of the proposal we are going to see that the tally is all zeros, because the gov proposal endpoint only displays the final tally, so it will only be populated after the voting period ends.
~/evmosd q gov proposal 1 content: '@type': /cosmos.params.v1beta1.ParameterChangeProposal changes: - key: EnableEVMHook subspace: erc20 value: "false" description: Try the governance module changing a module param title: Change EVMHook deposit_end_time: "2022-11-08T14:48:43.248538Z" final_tally_result: abstain: "0" "no": "0" no_with_veto: "0" "yes": "0" proposal_id: "1" status: PROPOSAL_STATUS_VOTING_PERIOD submit_time: "2022-11-06T14:48:43.248538Z" total_deposit: - amount: "20000000" denom: aevmos voting_end_time: "2022-11-08T14:53:20.485424Z" voting_start_time: "2022-11-06T14:53:20.485424Z"
Bash
But we can get an estimation on how the voting is going using the gov tally command:
~/evmosd q gov tally 1 # abstain: "0" # "no": "0" # no_with_veto: "0" # "yes": "1000000000000000000000"
Bash
This won’t be 100% precise, because the wallets can unstake coins so their vote is going to be lower, or they can stake more coins and the vote is going to be bigger.
That’s why the gov proposal endpoint doesn’t display the tally until the voting period ends and the module recalculates all the votes using blockchain state at the moment that the voting period ends.
Make sure that the EVMHook is disabled
After the proposal ends its voting period, we can query the erc20 module to check the new status.
~/evmosd q erc20 params # params: # enable_erc20: true # enable_evm_hook: false
Bash