Governance
Introduction
The Source One Market is governed and upgraded by SRC1 token-holders, using three distinct components; the SRC1 token, governance module (Governor Alpha), and Timelock. Together, these contracts allow the community to propose, vote, and implement changes through the administrative functions of an sToken or the unitroller. Proposals can include changes like adjusting an interest rate model, to adding support for a new asset.
sTokens are the primary means of interacting with the Source One Market; when a user mints, redeems, borrows, repays a borrow, liquidates a borrow, or transfers sTokens, she will do so using the sToken contract.
Source One (SRC1)
SRC1 is an BEP-20 token that allows the owner to delegate voting rights to any address, including their own address. Changes to the owner’s token balance automatically adjust the voting rights of the delegate.
Delegate
Delegate votes from the sender to the delegatee. Users can delegate to 1 address at a time, and the number of votes added to the delegatee’s vote count is equivalent to the balance of SRC1 in the user’s account. Votes are delegated from the current block and onward, until the sender delegates again, or transfers their SRC1.
SRC1
delegatee: The address in which the sender wishes to delegate their votes to.
msg.sender: The address of the SRC1 token holder that is attempting to delegate their votes.
RETURN: No return, reverts on error.
Solidity
Web3 1.2.6
Delegate By Signature
Delegate votes from the signatory to the delegatee. This method has the same purpose as Delegate but it instead enables offline signatures to participate in Source One governance vote delegation. For more details on how to create an offline signature, review EIP-712.
SRC1
delegatee: The address in which the sender wishes to delegate their votes to.
nonce: The contract state required to match the signature. This can be retrieved from the contract’s public nonces mapping.
expiry: The time at which to expire the signature. A block timestamp as seconds since the unix epoch (uint).
v: The recovery byte of the signature.
r: Half of the ECDSA signature pair.
s: Half of the ECDSA signature pair.
RETURN: No return, reverts on error.
Solidity
Web3 1.2.6
Get Current Votes
Gets the balance of votes for an account as of the current block.
SRC1
account: Address of the account in which to retrieve the number of votes.
RETURN: The number of votes (integer).
Solidity
Web3 1.2.6
Get Prior Votes
Gets the prior number of votes for an account at a specific block number. The block number passed must be a finalized block or the function will revert.
SRC1
account: Address of the account in which to retrieve the number of votes.
blockNumber: The block number at which to retrieve the prior number of votes.
RETURN: The number of prior votes.
Solidity
Web3 1.2.6
Governor Alpha
Governor Alpha is the governance module of the protocol; it allows addresses with more than 300,000 SRC1 to propose changes to the protocol. Addresses that held voting weight, at the start of the proposal, invoked through the getpriorvotes function, can submit their votes during a 3 day voting period. If a majority, and at least 600,000 votes are cast for the proposal, it is queued in the Timelock, and can be implemented after 2 days.
Quorum Votes
The required minimum number of votes in support of a proposal for it to succeed.
Governor Alpha
RETURN: The minimum number of votes required for a proposal to succeed.
Solidity
Web3 1.2.6
Proposal Threshold
The minimum number of votes required for an account to create a proposal.
Governor Alpha
RETURN: The minimum number of votes required for an account to create a proposal.
Solidity
Web3 1.2.6
Proposal Max Operations
The maximum number of actions that can be included in a proposal. Actions are functions calls that will be made when a proposal succeeds and executes.
Governor Alpha
RETURN: The maximum number of actions that can be included in a proposal.
Solidity
Web3 1.2.6
Voting Delay
The number of BSC blocks to wait before voting on a proposal may begin. This value is added to the current block number when a proposal is created.
Governor Alpha
RETURN: Number of blocks to wait before voting on a proposal may begin.
Solidity
Web3 1.2.6
Voting Period
The duration of voting on a proposal, in BSC blocks.
Governor Alpha
RETURN: The duration of voting on a proposal, in BSC blocks.
Solidity
Web3 1.2.6
Propose
Create a Proposal to change the protocol. E.g., A proposal can set a sToken's interest rate model or risk parameters on the Unitroller.
Proposals will be voted on by delegated voters. If there is sufficient support before the voting period ends, the proposal shall be automatically enacted. Enacted proposals are queued and executed in the Source One Timelock contract.
The sender must hold more SRC1 than the current proposal threshold (proposalThreshold()) as of the immediately previous block. If the threshold is 300,000 SRC1, the sender must have been delegated more than 1% of all SRC1 in order to create a proposal. The proposal can have up to 10 actions (based on proposalMaxOperations()).
The proposer cannot create another proposal if they currently have a pending or active proposal. It is not possible to queue two identical actions in the same block (due to a restriction in the Timelock), therefore actions in a single proposal must be unique, and unique proposals that share an identical action must be queued in different blocks.
Governor Alpha
targets: The ordered list of target addresses for calls to be made during proposal execution. This array must be the same length as all other array parameters in this function.
values: The ordered list of values (i.e. msg.value) to be passed to the calls made during proposal execution. This array must be the same length as all other array parameters in this function.
signatures: The ordered list of function signatures to be passed during execution. This array must be the same length as all other array parameters in this function.
calldatas: The ordered list of data to be passed to each individual function call during proposal execution. This array must be the same length as all other array parameters in this function.
description: A human readable description of the proposal and the changes it will enact.
RETURN: The ID of the newly created proposal.
Solidity
Web3 1.2.6
Queue
After a proposal has succeeded, any address can call the queue method to move the proposal into the Timelock queue. A proposal can only be queued if it has succeeded.
Governor Alpha
proposalId: ID of a proposal that has succeeded.
RETURN: No return, reverts on error.
Solidity
Web3 1.2.6
Execute
After the Timelock delay period, any account may invoke the execute method to apply the changes from the proposal to the target contracts. This will invoke each of the actions described in the proposal.
This function is payable so the Timelock contract can invoke payable functions that were selected in the proposal. E.g., A proposal can add reserves to a market like sBNB, set a sToken's interest rate model, or set risk parameters on the Unitroller.
Governor Alpha
proposalId: ID of a succeeded proposal to execute.
RETURN: No return, reverts on error.
Solidity
Web3 1.2.6
Cancel
Cancel a proposal that has not yet been executed. The Guardian is the only one who may execute this unless the proposer does not maintain the delegates required to create a proposal. If the proposer does not have more delegates than the proposal threshold, anyone can cancel the proposal.
Governor Alpha
proposalId: ID of a proposal that has succeeded.
RETURN: No return, reverts on error.
Solidity
Web3 1.2.6
Get Actions
Gets the actions of a selected proposal. Pass a proposal ID and get the targets, values, signatures and calldatas of that proposal.
Governor Alpha
Solidity
Web3 1.2.6
Get Receipt
Gets a proposal ballot receipt of the indicated voter.
Governor Alpha
proposalId: ID of the proposal in which to get a voter’s ballot receipt.
voter: Address of the account of a proposal voter.
RETURN: Reverts on error. If successful, returns a Receipt struct for the ballot of the voter address.
Solidity
Web3 1.2.6
State
Gets the proposal state for the specified proposal. The return value, ProposalState is an enumerated type defined in the Governor Alpha contract.
Governor Alpha
proposalId: ID of a proposal in which to get its state.
RETURN: Enumerated type ProposalState. The types are Pending, Active, Canceled, Defeated, Succeeded, Queued, Expired, and Executed.
Solidity
Web3 1.2.6
Cast Vote
Cast a vote on a proposal. The account's voting weight is determined by the number of votes the account had delegated to it at the time the proposal state became active.
Governor Alpha
proposalId: ID of a proposal in which to cast a vote.
support: A boolean of true for 'yes' or false for 'no' on the proposal vote.
RETURN: No return, reverts on error.
Solidity
Web3 1.2.6
Cast Vote By Signature
Cast a vote on a proposal. The account's voting weight is determined by the number of votes the account had delegated at the time that proposal state became active. This method has the same purpose as Cast Vote but it instead enables offline signatures to participate in Source One governance voting. For more details on how to create an offline signature, review EIP-712.
Governor Alpha
proposalId: ID of a proposal in which to cast a vote.
support: A boolean of true for 'yes' or false for 'no' on the proposal vote.
v: The recovery byte of the signature.
r: Half of the ECDSA signature pair.
s: Half of the ECDSA signature pair.
RETURN: No return, reverts on error.
Solidity
Web3 1.2.6
Timelock
Each sToken contract and the Unitroller contract allow the Timelock address to modify them. The Timelock contract can modify system parameters, logic, and contracts in a 'time-delayed, opt-out' upgrade pattern.
The Timelock has a hard-coded minimum delay of 2 days, which is the least amount of notice possible for a governance action. Each proposed action will be published at a minimum of 2 days in the future from the time of announcement. Major upgrades, such as changing the risk system, may have a 14 day delay.
The Timelock is controlled by the governance module; pending and completed governance actions can be monitored on the Timelock Dashboard.
Pause Guardian
The Unitroller contract designates a Pause Guardian address capable of disabling protocol functionality. Used only in the event of an unforeseen vulnerability, the Pause Guardian has one and only one ability: to disable a select set of functions: Mint, Borrow, Transfer, and Liquidate. The Pause Guardian cannot unpause an action, nor can it ever prevent users from calling Redeem, or Repay Borrow to close positions and exit the protocol.
SRC1 token-holders designate the Pause Guardian address, which is currently held by Source Protocol.
Last updated