Governance Contract

Maven Finance's Governance Contract: Empowering Your Decision-Making

Serving as the backbone of Maven Finance's decentralized governance system, the Governance contract manages and regulates the democratic decision-making processes.

The Governance contract manages proposal submissions, voting procedures, and the implementation of approved decisions.

Through its meticulous administration of the governance process, the contract upholds Maven Finance's commitment to decentralization, transparency, and community engagement, underpinning the platform's vision of a truly decentralized financial ecosystem.

Governance Cycle Entrypoints

updateSatelliteSnapshot

function updateSatelliteSnapshot(list(updateSatelliteSingleSnapshotType singleSnapshot) satelliteSnapshotList)

Updates the snapshot record for a given list of satellites for the current governance cycle

Can be called only by admin or whitelisted addresses, specified by Maven Governance

Param Name
Type
Description

satelliteSnapshotList

list(updateSatelliteSingleSnapshotType singleSnapshot)

A list of satellites and their snapshot params

singleSnapshot

updateSatelliteSingleSnapshotType: (address satelliteAddress, nat totalStakedMvnBalance, nat totalDelegatedAmount, bool ready, nat delegationRatio, nat accumulatedRewardsPerShare)

The main details of the satellite for which the snapshot will be created

satelliteAddress

address

The satellite address that the snapshot will be created for

totalStakedMvnBalance

nat

The total staked MVN balance of the satellite

totalDelegatedAmount

nat

The total delegated amount of the satellite

ready

bool

Ready status of a satellite. Initialised to False when a satellite is first registered, so that it will not participate in the governance round it was created in.

delegationRatio

nat

The ratio to determine a satellite's maximum total voting power if overdelegated

accumulatedRewardsPerShare

nat

The accumulated rewards per share of the satellite from the satellite rewards ledger on the delegation contract

startNextRound

function startNextRound(bool executePastProposal)

Starts the next round of a governance cycle which could be a new proposal round in a new governance cycle, a new voting round, or a new timelock round depending on the current governance cycle state.

Can only be called when the current round has ended

Param Name
Type
Description

executePastProposal

bool

If executePastProposal is True and the current governance round is moving from the Timelock Round to a new Proposal Round, then the governance contract will execute the immediate preceding proposal that has just successfully completed

the Timelock round

propose

function propose(string title, string description, string invoice, string sourceCode, option(updateProposalDataType proposalDataList) proposalData, option(updatePaymentDataType paymentDataList) paymentData)

Creates a new governance proposal.

Can be called only by an active Satellite during the Proposal Round

Param Name
Type
Description

title

string

The title of the governance proposal

description

string

The description of the governance proposal

invoice

string

A url link to the invoice for the costs of work done by the satellite

sourceCode

string

A url link to a code repository for work done by the satellite

proposalData

option(updateProposalDataType proposalDataList)

An optional list of proposal data to be executed if the proposal is successful

proposalDataList

updateProposalDataType: list(updateProposalDataVariantType proposalDataVariant)

A list of proposal data variants

proposalDataVariant

updateProposalDataVariantType: | updateProposalDataSetType AddOrSetProposalData | nat RemoveProposalData

Proposal data variants for setting new proposal data, or removal of previous proposal data

addOrSetProposalData

updateProposalDataSetType: (string proposalDataTitle, bytes encodedCode, option(string) codeDescription, option(nat) proposalDataIndex)

Proposal data to be set

proposalDataTitle

string

The title of the proposal data

encodedCode

bytes

The Michelson bytes of the proposal data that will be executed if the proposal is successful

codeDescription

option(string)

An optional description of the proposal data

proposalDataIndex

option(nat)

An optional value to set the index of the proposal data

removeProposalData

nat

Index of proposal data to be removed

paymentData

option(updatePaymentDataType paymentDataList)

An optional list of payment data to be executed if the proposal is successful

paymentDataList

updatePaymentDataType: list(updatePaymentDataVariantType paymentDataVariant)

A list of payment data variants

paymentDataVariant

updatePaymentDataVariantType: | updatePaymentDataSetType AddOrSetPaymentData | nat RemovePaymentData

Proposal data variants for setting new payment data, or removal of previous payment data

addOrSetPaymentData

updatePaymentDataSetType: (string paymentDataTitle, transferDestinationType transaction, option(nat) paymentDataIndex)

Payment data to be set

paymentDataTitle

string

The title of the payment data

transaction

transferDestinationType: (address to_, nat tokenAmount, tokenType token)

Specifies the recipient, token amount, and type of token of the payment transfer if the proposal is successful

to_

address

Recipient of the payment transaction

tokenAmount

nat

The amount of tokens to be transferred in the payment transaction

token

tokenType: | unit Mav | (address tokenContractAddress) MRC-10 | (address tokenContractAddress, nat tokenId) MRC-20

The token type of the token to be transferred, corresponding to either Mav, MRC-10, or MRC-20

paymentDataIndex

option(nat)

An optional value to set the index of the payment data

removePaymentData

nat

Index of payment data to be removed

updateProposalData

function updateProposalData(nat proposalId, option(updateProposalDataType proposalDataList) proposalData, option(updatePaymentDataType paymentDataList) paymentData)

Updates the proposal or payment data for a given proposal

Can be called only by an active Satellite during the Proposal Round, and before the proposal has been locked

Param Name
Type
Description

proposalId

nat

The Id of the proposal which will be updated

proposalData

option(updateProposalDataType proposalDataList)

An optional list of proposal data to be executed if the proposal is successful

proposalDataList

updateProposalDataType: list(updateProposalDataVariantType proposalDataVariant)

A list of proposal data variants

proposalDataVariant

updateProposalDataVariantType: | updateProposalDataSetType AddOrSetProposalData | nat RemoveProposalData

Proposal data variants for setting new proposal data, or removal of previous proposal data

addOrSetProposalData

updateProposalDataSetType: (string proposalDataTitle, bytes encodedCode, option(string) codeDescription, option(nat) proposalDataIndex)

Proposal data to be set

proposalDataTitle

string

The title of the proposal data

encodedCode

bytes

The Michelson bytes of the proposal data that will be executed if the proposal is successful

codeDescription

option(string)

An optional description of the proposal data

proposalDataIndex

option(nat)

An optional value to set the index of the proposal data

removeProposalData

nat

Index of proposal data to be removed

paymentData

option(updatePaymentDataType paymentDataList)

An optional list of payment data to be executed if the proposal is successful

paymentDataList

updatePaymentDataType: list(updatePaymentDataVariantType paymentDataVariant)

A list of payment data variants

paymentDataVariant

updatePaymentDataVariantType: | updatePaymentDataSetType AddOrSetPaymentData | nat RemovePaymentData

Proposal data variants for setting new payment data, or removal of previous payment data

addOrSetPaymentData

updatePaymentDataSetType: (string paymentDataTitle, transferDestinationType transaction, option(nat) paymentDataIndex)

Payment data to be set

paymentDataTitle

string

The title of the payment data

transaction

transferDestinationType: (address to_, nat tokenAmount, tokenType token)

Specifies the recipient, token amount, and type of token of the payment transfer if the proposal is successful

to_

address

Recipient of the payment transaction

tokenAmount

nat

The amount of tokens to be transferred in the payment transaction

token

tokenType: | unit Mav | (address tokenContractAddress) Fa12 | (address tokenContractAddress, nat tokenId) Fa2

The token type of the token to be transferred, corresponding to either Mav, MRC-10, or MRC-20

paymentDataIndex

option(nat)

An optional value to set the index of the payment data

removePaymentData

nat

Index of payment data to be removed

lockProposal

function lockProposal(nat proposalId)

An irreversible action to lock a specific proposal during the proposal round, thereafter no updates or changes can be made to it.

Can be called only by the Satellite proposer during the Proposal Round

Param Name
Type
Description

proposalId

nat

The proposal Id that the satellite chooses to lock during the proposal round

proposalRoundVote

function proposalRoundVote(nat proposalId)

Vote for a specific proposal during the proposal round. Proposal round voting can only be done on locked proposals.

Can be called only by an active Satellite during the Proposal Round

Param Name
Type
Description

proposalId

nat

The proposal Id that the satellite chooses to vote for during the proposal round

votingRoundVote

function votingRoundVote(voteType vote, unit empty)

Vote for a specific proposal during the voting round.

Only the highest voted proposal during the proposal round gets to move on to the voting round (it is also required for this proposal to have votes exceeding the minimum proposal round votes required which is a given percentage of the total staked MVN supply - initially set at 10% and configurable through governance)

Can be called only by an active Satellite during the Voting Round

Param Name
Type
Description

vote

voteType: | unit Yay | unit Nay | unit Pass

The variant vote choices that a satellite may choose when voting for the proposal during the voting round

Empty

unit

A null param used to prettify interactions with this entrypoint on blockchain explorers such as better-call-dev

executeProposal

function executeProposal(nat proposalId)

Executes a proposal if it is executable. Proposal has to be a valid proposal that has successfully gone through the Voting and Timelock rounds.

There are additional verification checks that the proposal has not already been executed, has not been dropped, has at least one proposal data to be executed, and that the proposal execution has not started yet (in the event of large proposal data that has to be processed manually and individually)

Param Name
Type
Description

proposalId

nat

The proposal to be executed

processProposalSingleData

function processProposalSingleData(nat proposalId)

Processes the execution of a proposal individually by the proposal data index. Proposal has to be a valid proposal that has successfully gone through the Voting and Timelock rounds.

There are additional verification checks that the proposal has not already been executed, has not been dropped, and has at least one proposal data to be executed.

Param Name
Type
Description

proposalId

nat

The proposal to be processed

processProposalPayment

function processProposalPayment(nat proposalId)

Processes the execution of a proposal payment individually by payment data index. Proposal has to be a valid proposal that has successfully gone through the Voting and Timelock rounds.

There are additional verification checks that the proposal has been executed, payments have not been processed yet, proposal has not been dropped, and the proposal contains at least one payment data to be executed.

Can be called only by the Satellite that is the Proposal Creator

Param Name
Type
Description

proposalId

nat

The proposal to be processed

distributeProposalRewards

function distributeProposalRewards(address satelliteAddress, set(nat proposalId) proposalIdSet

Distributes the governance rewards that a satellite is entitled to based on its voting activity. A satellite may receive governance rewards from voting on proposals during the Voting Round, regardless of what its vote choice was.

Param Name
Type
Description

address

satelliteAddress

The satellite address to receive governance rewards

proposalIdSet

set(nat proposalId)

Set of proposal ids to claim for rewards

proposalId

nat

Single proposal Id

dropProposal

function dropProposal(nat proposalId)

Drops a specified proposal based on its id. A proposal may be dropped at any point in time during its Governance Cycle.

If the proposal happens to be the sole proposal during the Voting Round and Timelock round when it is dropped, a new Governance cycle will be restarted.

Param Name
Type
Description

proposalId

nat

The proposal to be dropped

Housekeeping Entrypoints

setAdmin

function setAdmin(address newAdminAddress)

Sets a new admin address for the contract

Can be called only by the admin (i.e. the governance proxy contract)

Param Name
Type
Description

newAdminAddress

address

The address of the new admin

setGovernanceProxy

function setGovernanceProxy(address newGovernanceProxyAddress)

Sets a new governance proxy contract address

Can be called only by the admin (i.e. the governance proxy contract)

Param Name
Type
Description

newGovernanceProxyAddress

address

The address of the new governance proxy contract

updateMetadata

function updateMetadata(string key, bytes hash)

Replace the hash of the contract metadata based on the provided key

Can be called only by the admin (i.e. the governance proxy contract)

Param Name
Type
Description

key

string

The key in the metadata bigmap to be updated

hash

bytes

The hash of the metadata key

updateConfig

function updateConfig(nat newConfigValue, governanceConfigActionType governanceConfigAction)

Updates the config variables on the Governance Contract

Can be called only by the admin (i.e. the governance proxy contract)

Param Name
Type
Description

newConfigValue

nat

The new value of the config parameter

governanceConfigAction

governanceConfigActionType: | unit ConfigSuccessReward | unit ConfigCycleVotersReward | unit ConfigMinProposalRoundVotePct | unit ConfigMinQuorumPercentage | unit ConfigMinYayVotePercentage | unit ConfigProposeFeeMumav | unit ConfigMaxProposalsPerSatellite | unit ConfigBlocksPerProposalRound | unit ConfigBlocksPerVotingRound | unit ConfigBlocksPerTimelockRound | unit ConfigDataTitleMaxLength | unit ConfigProposalTitleMaxLength | unit ConfigProposalDescMaxLength | unit ConfigProposalInvoiceMaxLength | unit ConfigProposalCodeMaxLength

The variant config variable to be updated

updateWhitelistContracts

function updateWhitelistContracts(address whitelistContractAddress, updateType update)

Add, update or remove a whitelist contract in the whitelistContracts map in the storage

Can be called only by the admin (i.e. the governance proxy contract)

Param Name
Type
Description

whitelistContractAddress

address

The contract address to be updated in the whitelist contracts bigmap

updateType

updateType: | unit Update | unit Remove

Specifies whether the whitelistContractAddress should be updated or removed from the whitelist contracts bigmap

updateGeneralContracts

function updateGeneralContracts(string generalContractName, address generalContractAddress, updateType update)

Add, update or remove a general contract in the generalContracts map in the storage

Can be called only by the admin (i.e. the governance proxy contract)

Param Name
Type
Description

generalContractName

string

The identifier key to be set in the general contracts bigmap which will be the general contract name in camelcase

generalContractAddress

address

The contract address to be updated in the general contracts bigmap

updateType

updateType: | unit Update | unit Remove

Specifies whether the generalContractAddress should be updated or removed from the general contracts bigmap

updateWhitelistDevelopers

function updateWhitelistDevelopers(address whitelistedDeveloperAddress)

Adds a whitelisted developer address in the whitelistDevelopers set in the storage. Removes a whitelisted developer address from the whitelistDevelopers set if it already exists

Can be called only by the admin (i.e. the governance proxy contract)

Param Name
Type
Description

whitelistedDeveloperAddress

address

The whitelisted developer address to be updated

mistakenTransfer

function mistakenTransfer(transferActionType transferList)

Transfers any mav or token that may have mistakenly been sent to this contract

Can be called only by the admin or the governance satellite contract

Param Name
Type
Description

transferList

transferActionType:

list(address to_, nat tokenAmount, token tokenType)

A list of transfers of tokens to recipients

to_

address

The recipient of the mistaken transfer

tokenAmount

nat

The amount of tokens to be transferred

token

tokenType: | unit Mav | (address tokenContractAddress) Fa12 | (address tokenContractAddress, nat tokenId) Fa2

The token type of the token to be transferred, corresponding to either Mav, MRC-10, or MRC-20

setContractAdmin

function setContractAdmin(address targetContractAddress, address newContractAdmin)

Sets a new admin address on the target contract address.

Can be called only by the admin (i.e. the governance proxy contract)

Param Name
Type
Description

targetContractAddress

address

The target contract address on which the admin address will be updated

newContractAdmin

address

The address of the new admin

setContractGovernance

function setContractGovernance(address targetContractAddress, address newContractGovernance)

Sets a new governance address on the target contract address.

Can be called only by the admin (i.e. the governance proxy contract)

Param Name
Type
Description

targetContractAddress

address

The target contract address on which the governance contract address will be updated

newContractGovernance

address

The address of the new governance contract

setLambda

function setLambda(string lambdaName, bytes func_bytes)

Sets a lambda in the contract with the given bytes and name

Can be called only by the admin (i.e. the governance proxy contract)

Param Name
Type
Description

lambdaName

string

The name of the lambda to be set

func_bytes

bytes

The data of the lambda in Michelson bytes format

BreakGlass Entrypoints

breakGlass

function breakGlass()

Breaks the glass on the Governance Contract. This will set the admin of the Governance Contract to the Break Glass contract.

Can be called only by the Emergency Governance Contract

propagateBreakGlass

function propagateBreakGlass(set(address contractAddress) breakGlassContractsSet)

Propagates the break glass event to the rest of the Maven contracts within the ecosystem. This will pause all entrypoints of the contract addresses within the set and also set their admin to the Break Glass Contract.

Can be called only by the admin when glass has been broken (n.b. the admin will be the Break Glass contract during an emergency)

Param Name
Type
Description

breakGlassContractsSet

set(address contractAddress)

The set of contract addresses to propagate break glass to

contractAddress

address

The contract address on which break glass will be propagated

View Methods

getAdmin

function getAdmin()

Returns the contract admin

getGovernanceProxyAddress

function getGovernanceProxyAddress()

Returns the contract governance proxy address

getConfig

function getConfig()

Returns the contract configuration parameters

getWhitelistContractOpt

function getWhitelistContractOpt(address contractAddress)

Returns unit if contract address is whitelisted, else returns none

getGeneralContractOpt

function getGeneralContractOpt(string contractName)

Returns the contract address if the contract name is found, else returns none

getWhitelistDevelopers

function getWhitelistDevelopers()

Returns the whitelisted developers on the governance contract

getProposalOpt

function getProposalOpt(nat proposalId)

Returns the proposal record if the proposal id is found, else returns none

getProposalVoterOpt

function getProposalVoterOpt(nat proposalId * address satelliteAddress)

Returns the vote type (Yay, Nay, or Pass) if the proposal voter is found, else returns none

getProposalRewardOpt

function getProposalRewardOpt(nat proposalId * address satelliteAddress)

Returns unit if rewards are found for the given proposal id and satellite, else returns none

getSnapshotOpt

function getSnapshotOpt(nat cycleId * address satelliteAddress)

Returns a satellite snapshot for the given governance cycle id and satellite address, else returns none

getStakedMvnSnapshotOpt

function getStakedMvnSnapshotOpt(nat cycleId)

Returns a staked MVN total supply snapshot for the given governance cycle id, else returns none

getCurrentCycleInfo

function getCurrentCycleInfo()

Returns the current governance cycle information, such as the round start and end level

getCycleProposals

function getCycleProposals()

Returns all governance proposals in the current governance cycle

getCycleProposerOpt

function getCycleProposerOpt(nat cycleId * address satelliteAddress)

Returns all governance proposals by a satellite in a given governance cycle, else returns none

getRoundVoteOpt

function getRoundVoteOpt(nat cycleId * address satelliteAddress)

Returns the last vote of a given satellite and governance cycle, else returns none

getNextProposalId

function getNextProposalId()

Returns the next governance proposal id

getCycleCounter

function getCycleCounter()

Returns the current governance cycle counter

getCycleHighestVotedProposalId

function getNextProposalId()

Returns the highest voted proposal id of the current governance cycle

getTimelockProposalId

function getTimelockId()

Returns the Timelock proposal id (Timelock proposal id is reset to 0 when Voting Round is reached)

getLambdaOpt

function getLambdaOpt(string lambdaName)

Returns a lambda in the contract for the given lambda name, else returns none

Last updated