Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
UMA Governor
copy icon
UMA
• version 1.0.0
Governance
Voting
Audited

UMA Governor

Audited

Takes proposals for certain governance actions and allows UMA token holders to vote on them.

*Visit desktop site to download or deploy

Version

1.0.0

Creator

UMA

Last Publish

11/5/2022
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
propose() :
This function is used to propose a new transaction to the system. It takes an array of transactions as an argument and stores them in the proposals array. It then constructs an identifier for the proposal and adds it to the supported identifiers whitelist. Finally, it requests a price from the oracle and removes the identifier from the whitelist. The function emits a NewProposal event with the proposal ID and transactions. (autogenerated documentation)
executeProposal(uint256,uint256) :
This function executes a proposal with a given ID and transaction index. It first retrieves the price of the proposal from the oracle, then checks that the previous transaction has been executed, that the current transaction has not been executed yet, that the price is not 0, and that the amount of ETH sent is equal to the transaction value. It then deletes the transaction from the proposal, executes the call, and emits an event. (autogenerated documentation)
numProposals() :
This function returns the number of proposals stored in the proposals array. It works by looping through the array and counting the number of elements in it. (autogenerated documentation)
getProposal(uint256) :
This function is used to retrieve a proposal from the proposals mapping. It takes an id as an argument and returns a Proposal memory object. The function is marked as external and view, meaning that it can be called from outside the contract and does not modify the state of the contract. (autogenerated documentation)
_executeCall(address,uint256) :
This function is used to execute a call to another contract. It takes in an address to call, the value to send, and the data to be sent as parameters. It then uses assembly code to add the data size to the data, and then calls the other contract with the gas, address, value, data, data size, and two 0s as parameters. It returns a boolean value indicating whether the call was successful or not. (autogenerated documentation)
_getOracle() :
This function is a private view function that returns an OracleInterface. It does this by using the finder contract to get the address of the Oracle contract, and then returning an OracleInterface instance that is initialized with the address of the Oracle contract. (autogenerated documentation)
_getIdentifierWhitelist() :
This function is a private view function that returns an instance of the IdentifierWhitelistInterface contract. It does this by using the finder contract to get the address of the IdentifierWhitelistInterface contract and then returning an instance of that contract. (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i uma-governor
copy icon

Last Publish

11/5/2022

Version

1.0.0

Creator

UMA

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.