Parthenon
Inherits: Policy
Parthenon, OlympusDAO's on-chain governance system.
The Parthenon policy is also the Kernel's Executor.
State Variables
getProposalMetadata
Return a proposal metadata object for a given proposal id.
mapping(uint256 => ProposalMetadata) public getProposalMetadata;
COLLATERAL_REQUIREMENT
The amount of VOTES a proposer needs to post in collateral in order to submit a proposal
This number is expressed as a percentage of total supply in basis points: 500 = 5% of the supply
uint256 public constant COLLATERAL_REQUIREMENT = 500;
COLLATERAL_MINIMUM
The minimum amount of VOTES the proposer must post in collateral to submit
uint256 public constant COLLATERAL_MINIMUM = 10e18;
WARMUP_PERIOD
Amount of time a wallet must wait after depositing before they can vote.
uint256 public constant WARMUP_PERIOD = 1 minutes;
ACTIVATION_TIMELOCK
Amount of time a submitted proposal must exist before triggering activation.
uint256 public constant ACTIVATION_TIMELOCK = 1 minutes;
ACTIVATION_DEADLINE
Amount of time a submitted proposal can exist before activation can no longer be triggered.
uint256 public constant ACTIVATION_DEADLINE = 3 minutes;
EXECUTION_THRESHOLD
Net votes required to execute a proposal on chain as a percentage of total registered votes.
uint256 public constant EXECUTION_THRESHOLD = 33;
VOTING_PERIOD
The period of time a proposal has for voting
uint256 public constant VOTING_PERIOD = 3 minutes;
EXECUTION_TIMELOCK
Required time for a proposal before it can be activated.
This amount should be greater than 0 to prevent flash loan attacks.
uint256 public constant EXECUTION_TIMELOCK = VOTING_PERIOD + 1 minutes;
EXECUTION_DEADLINE
Amount of time after the proposal is activated (NOT AFTER PASSED) when it can be activated (otherwise proposal will go stale).
This is inclusive of the voting period (so the deadline is really ~4 days, assuming a 3 day voting window).
uint256 public constant EXECUTION_DEADLINE = VOTING_PERIOD + 1 weeks;
COLLATERAL_DURATION
Amount of time a non-executed proposal must wait for the proposal to go through.
This is inclusive of the voting period (so the deadline is really ~4 days, assuming a 3 day voting window).
uint256 public constant COLLATERAL_DURATION = 16 weeks;
INSTR
INSTRv1 public INSTR;
VOTES
VOTESv1 public VOTES;
Functions
constructor
constructor(Kernel kernel_) Policy(kernel_);
configureDependencies
function configureDependencies() external override returns (Keycode[] memory dependencies);
requestPermissions
function requestPermissions() external view override returns (Permissions[] memory requests);
_max
function _max(uint256 a, uint256 b) public pure returns (uint256);
submitProposal
function submitProposal(Instruction[] calldata instructions_, string calldata title_, string calldata proposalURI_)
external;
activateProposal
function activateProposal(uint256 proposalId_) external;
vote
function vote(uint256 proposalId_, bool approve_) external;
executeProposal
function executeProposal(uint256 proposalId_) external;
reclaimCollateral
function reclaimCollateral(uint256 proposalId_) external;
Events
ProposalSubmitted
event ProposalSubmitted(uint256 proposalId, string title, string proposalURI);
ProposalActivated
event ProposalActivated(uint256 proposalId, uint256 timestamp);
VotesCast
event VotesCast(uint256 proposalId, address voter, bool approve, uint256 userVotes);
ProposalExecuted
event ProposalExecuted(uint256 proposalId);
CollateralReclaimed
event CollateralReclaimed(uint256 proposalId, uint256 tokensReclaimed_);
Errors
NotAuthorized
error NotAuthorized();
UnableToActivate
error UnableToActivate();
ProposalAlreadyActivated
error ProposalAlreadyActivated();
WarmupNotCompleted
error WarmupNotCompleted();
UserAlreadyVoted
error UserAlreadyVoted();
UserHasNoVotes
error UserHasNoVotes();
ProposalIsNotActive
error ProposalIsNotActive();
DepositedAfterActivation
error DepositedAfterActivation();
PastVotingPeriod
error PastVotingPeriod();
ExecutorNotSubmitter
error ExecutorNotSubmitter();
NotEnoughVotesToExecute
error NotEnoughVotesToExecute();
ProposalAlreadyExecuted
error ProposalAlreadyExecuted();
ExecutionTimelockStillActive
error ExecutionTimelockStillActive();
ExecutionWindowExpired
error ExecutionWindowExpired();
UnmetCollateralDuration
error UnmetCollateralDuration();
CollateralAlreadyReturned
error CollateralAlreadyReturned();
Structs
ProposalMetadata
struct ProposalMetadata {
address submitter;
uint256 submissionTimestamp;
uint256 collateralAmt;
uint256 activationTimestamp;
uint256 totalRegisteredVotes;
uint256 yesVotes;
uint256 noVotes;
bool isExecuted;
bool isCollateralReturned;
mapping(address => uint256) votesCastByUser;
}