Skip to main content

Proposer

Proposer#

Functions#

constructor(contract IERC20 _token, uint256 _bond, contract Governor _governor, contract Finder _finder, address _timer) (public)

Construct the Proposer contract.

Parameters:#

  • _token: the ERC20 token that the bond is paid in.
  • _bond: the bond amount.
  • _governor: the governor contract that this contract makes proposals to.
  • _finder: the finder contract used to look up addresses.
  • _timer: the timer contract to control the output of getCurrentTime(). Set to 0x0 if in production.
propose(struct Governor.Transaction[] transactions) โ†’ uint256 id (external)

Propose a new set of governance transactions for vote.

Pulls bond from the caller.

Parameters:#

  • transactions: list of transactions for the governor to execute.
resolveProposal(uint256 id) (external)

Resolves a proposal by checking the status of the request in the Voting contract.

For the resolution to work correctly, this contract must be a registered contract in the DVM.

Parameters:#

  • id: proposal id.
setBond(uint256 _bond) (public)

Admin method to set the bond amount.

Admin is intended to be the governance system, itself.

Parameters:#

  • _bond: the new bond.
_preEntranceCheck() (internal)
_preEntranceSet() (internal)
_postEntranceReset() (internal)
setCurrentTime(uint256 time) (external)

Sets the current time.

Will revert if not running in test mode.

Parameters:#

  • time: timestamp to set current Testable time to.
getCurrentTime() โ†’ uint256 (public)

Gets the current time. Will return the last time set in setCurrentTime if running in test mode. Otherwise, it will return the block timestamp.

owner() โ†’ address (public)

Returns the address of the current owner.

renounceOwnership() (public)

Leaves the contract without owner. It will not be possible to call onlyOwner functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.

transferOwnership(address newOwner) (public)

Transfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.

_transferOwnership(address newOwner) (internal)

Transfers ownership of the contract to a new account (newOwner). Internal function without access restriction.

_msgSender() โ†’ address (internal)
_msgData() โ†’ bytes (internal)

Events#

BondSet(uint256 bond)
ProposalResolved(uint256 id, bool success)
OwnershipTransferred(address previousOwner, address newOwner)

Modifiers#

nonReentrant()

Prevents a contract from calling itself, directly or indirectly. Calling a nonReentrant function from another nonReentrant function is not supported. It is possible to prevent this from happening by making the nonReentrant function external, and making it call a private function that does the actual state modification.

nonReentrantView()

Designed to prevent a view-only method from being re-entered during a call to a nonReentrant() state-changing method.

onlyIfTest()

Reverts if not running in test mode.

onlyOwner()

Throws if called by any account other than the owner.