feat(contracts): implement governance token system - #109
Open
Malik6828 wants to merge 1 commit into
Open
Conversation
- contracts/GOV_Token.sol: ERC-20 BOXMKT token
- 100M max supply cap
- Admin + authorised minter roles
- Linear vesting schedules with escrow (create / release / revoke)
- Weekly emission mints with configurable cooldown
- Full ERC-20: transfer, transferFrom, approve, increase/decreaseAllowance, burn
- contracts/Timelock.sol: 2-day timelock executor
- MIN_DELAY = 2 days, MAX_DELAY = 30 days, GRACE_PERIOD = 14 days
- queue() / execute() / cancel() with CEI pattern in execute()
- Separate proposer and executor roles (set to Voting contract)
- hashTransaction() view helper for off-chain tooling
- contracts/Voting.sol: veToken governance
- Lock BOXMKT 1–4 years; voting power = amount × lockYears (1×–4×)
- extendLock() increases power without unlock penalty
- Proposals: 5-day voting period, 4% quorum (QUORUM_BPS = 400)
- Proposal threshold: 1 000 BOXMKT locked
- Passes → auto-queued in Timelock via finalise()
- execute() forwards call through Timelock after 2-day delay
- Immutable on-chain voteHistory array for full audit trail
- cancel() works for both Active and Queued proposals
Closes GruftNet#80
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #80 — Build Governance Token System
contracts/GOV_Token.sol — BOXMKT ERC-20 Token
transfer,transferFrom,approve,increaseAllowance,decreaseAllowance,burncreateVesting()/releaseVested()/revokeVesting()emitTokens()with cooldown enforcementcontracts/Timelock.sol — 2-day Timelock Executor
MIN_DELAY = 2 days,GRACE_PERIOD = 14 daysqueue()/execute()/cancel()— CEI pattern: state set toExecutedbefore external callproposerandexecutorroles (set to Voting contract on deploy)isReady()andhashTransaction()view helpers for off-chain toolingcontracts/Voting.sol — veToken Governance
lock()/extendLock()/unlock()— tokens held in escrow until expiryfinalise()→ queues passing proposals in Timelock automaticallyexecute()→ forwards call through Timelock after 2-day delayvoteHistory[]array;getVoteHistory(from, to)for paginationcancel()works for both Active and Queued proposals (also cancels in Timelock)closes Build Governance Token System #80