This project is a script to create, manage, and execute governance proposals for creating a Rewards Vault on Berachain.
-
Clone the repository and install dependencies:
npm install
-
Create a
.envfile in the project root with the following content:RPC=https://bepolia.rpc.berachain.com/ PRIVATE_KEY=your_private_key_here FACTORY_ADDRESS=0x2B6e40f65D82A0cB98795bC7587a71bfa49fBB2B LP_TOKEN_ADDRESS=your_lp_token_address_from_bepolia GOVERNANCE_ADDRESS=0xE3EDa03401Cf32010a9A9967DaBAEe47ed0E1a0b BERACHEF_ADDRESS=0xfb81E39E3970076ab2693fA5C45A07Cc724C93c2 BGT_ADDRESS=0xbDa130737BDd9618301681329bF2e46A016ff9Ad -
Replace
your_private_key_herewith your actual private key. -
Replace
your_lp_token_address_from_bepoliawith your LP token address from Bepolia.
Run:
node governance.js --create-vaultThis will create or retrieve your Rewards Vault.
Run:
node governance.js --create-proposalThis creates a new governance proposal to whitelist your Rewards Vault.
After running this command, update your .env file with the new PROPOSAL_ID:
PROPOSAL_ID=your_new_proposal_id
Use this command to check the current state of your proposal:
node governance.js --check-stateThe proposal goes through the following stages:
- Pending: 3 hours
- Active (Voting): 3 hours
- Queued: 3 hours
- Ready for Execution
Once the proposal is in the Active state, cast your vote:
node governance.js --voteAfter the queuing period, execute the proposal:
node governance.js --executeIf needed, you can cancel a proposal in the Pending state:
node governance.js --cancel- The entire process from proposal creation to execution takes approximately 9 hours.
- Remember to update your
.envfile with thePROPOSAL_IDafter creating a new proposal. - Use the
--check-statecommand frequently to monitor your proposal's progress. - Ensure you have sufficient BGT tokens and voting power before creating a proposal(1000 to create a proposal, 2B to get a vote through).
For any issues or questions, please refer to the Governance tutorial or the Berachain team on discord.