feat(autocrat): on-chain governance with safety rails#36
Open
hellno wants to merge 4 commits intoJejuNetwork:mainfrom
Open
feat(autocrat): on-chain governance with safety rails#36hellno wants to merge 4 commits intoJejuNetwork:mainfrom
hellno wants to merge 4 commits intoJejuNetwork:mainfrom
Conversation
- Add executeProposal() - permissionless, anyone can call after grace period - Add canExecuteProposal() and timeUntilExecutable() view functions - Add executionWindow (7 days default) for proposal expiration - Proposals without targetContract mark COMPLETED without external call - Follow GovernanceTimelock pattern with proper guards Validated: submitted proposal, approved, advanced time, executed from different address - confirmed permissionless execution works. Reviewed by codex: goal achieved, security model sound.
1. Auth provider enum: passkey was inserted at position 1, shifting all
other providers and corrupting on-chain attestation mappings. Moved
passkey to position 9 (append) to preserve backward compatibility.
2. parseEther removal: the route handler was correctly converting
frontend ETH strings ('0.01') to wei via parseEther(). Removing it
caused BigInt('0.01') to throw at runtime. Restored parseEther.
3. autocrat contract category: code changed lookups from 'governance'
to 'autocrat' but testnet/mainnet contracts.json lacked this
category. Added autocrat category to both networks.
- Terminal state protection: block transitions out of COMPLETED/REJECTED/VETOED/DUPLICATE/SPAM - Director status guard: require DIRECTOR_QUEUE or AUTOCRAT_FINAL for director approval - Spam protection: gate submitProposal with onlyAutocrat modifier - ProposalService: read address from config instead of hardcoded, support testnet/mainnet chains - Add boardGovernance field to contracts.json for all networks
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.
Summary
Changes
Contract (
BoardGovernance.sol+IBoardGovernance.sol)submitProposalgated withonlyAutocratto block spamAPI (
proposal-service.ts)boardGovernanceaddress fromcontracts.json(fail-fast on missing)getChain()supports chain IDs 31337, 420690, 420691Config (
contracts.json)boardGovernanceto autocrat category for all 3 networksTests (
BoardGovernance.t.sol)Test plan
forge buildcompilesforge test --match-contract BoardGovernanceTest— 15/15 passupdateProposalStatuson COMPLETED → revertsInvalidStatusTransitionsubmitProposalfrom random address → revertsNotAuthorized