Skip to main content

Parthenon

Git Source

Inherits: Policy

Parthenon, OlympusDAO's on-chain governance system.

The Parthenon policy is also the Kernel's Executor.

Constants​

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;

State Variables​

getProposalMetadata​

Return a proposal metadata object for a given proposal id.

mapping(uint256 => ProposalMetadata) public getProposalMetadata;

INSTR​

INSTRv1 public INSTR;

VOTES​

VOTESv1 public VOTES;

Functions​

constructor​

constructor(Kernel kernel_) Policy(kernel_);

Parameters

NameTypeDescription
kernel_Kernel

configureDependencies​

Define module dependencies for this policy.

function configureDependencies() external override returns (Keycode[] memory dependencies);

Returns

NameTypeDescription
dependenciesKeycode[]- Keycode array of module dependencies.

requestPermissions​

Function called by kernel to set module function permissions.

function requestPermissions() external view override returns (Permissions[] memory requests);

Returns

NameTypeDescription
requestsPermissions[]- Array of keycodes and function selectors for requested permissions.

_max​

function _max(uint256 a, uint256 b) public pure returns (uint256);

Parameters

NameTypeDescription
auint256
buint256

Returns

NameTypeDescription
<none>uint256

submitProposal​

function submitProposal(
Instruction[] calldata instructions_,
string calldata title_,
string calldata proposalURI_
) external;

Parameters

NameTypeDescription
instructions_Instruction[]
title_string
proposalURI_string

activateProposal​

function activateProposal(uint256 proposalId_) external;

Parameters

NameTypeDescription
proposalId_uint256

vote​

function vote(uint256 proposalId_, bool approve_) external;

Parameters

NameTypeDescription
proposalId_uint256
approve_bool

executeProposal​

function executeProposal(uint256 proposalId_) external;

Parameters

NameTypeDescription
proposalId_uint256

reclaimCollateral​

function reclaimCollateral(uint256 proposalId_) external;

Parameters

NameTypeDescription
proposalId_uint256

Events​

ProposalSubmitted​

event ProposalSubmitted(uint256 proposalId, string title, string proposalURI);

Parameters

NameTypeDescription
proposalIduint256
titlestring
proposalURIstring

ProposalActivated​

event ProposalActivated(uint256 proposalId, uint256 timestamp);

Parameters

NameTypeDescription
proposalIduint256
timestampuint256

VotesCast​

event VotesCast(uint256 proposalId, address voter, bool approve, uint256 userVotes);

Parameters

NameTypeDescription
proposalIduint256
voteraddress
approvebool
userVotesuint256

ProposalExecuted​

event ProposalExecuted(uint256 proposalId);

Parameters

NameTypeDescription
proposalIduint256

CollateralReclaimed​

event CollateralReclaimed(uint256 proposalId, uint256 tokensReclaimed_);

Parameters

NameTypeDescription
proposalIduint256
tokensReclaimed_uint256

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;
}

Properties

NameTypeDescription
submitteraddress
submissionTimestampuint256
collateralAmtuint256
activationTimestampuint256
totalRegisteredVotesuint256
yesVotesuint256
noVotesuint256
isExecutedbool
isCollateralReturnedbool
votesCastByUsermapping(address => uint256)