OptimisticGovernorTest
OptimisticGovernorTest
#
#
Functionsconstructor(address _finder, address _owner, address _collateral, uint256 _bond, string _rules, bytes32 _identifier, uint64 _liveness, address _timerAddress) (public)
getCurrentTime() โ uint256 (public)
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.
setUp(bytes initializeParams) (public)
setCollateralAndBond(contract IERC20 _collateral, uint256 _bondAmount) (public)
Sets the collateral and bond amount for proposals.
#
Parameters:- _collateral: token that will be used for all bonds for the contract.
- _bondAmount: amount of the bond token that will need to be paid for future proposals.
setRules(string _rules) (public)
Sets the rules that will be used to evaluate future proposals.
#
Parameters:- _rules: string that outlines or references the location where the rules can be found.
setLiveness(uint64 _liveness) (public)
Sets the liveness for future proposals. This is the amount of delay before a proposal is approved by default.
#
Parameters:- _liveness: liveness to set in seconds.
setIdentifier(bytes32 _identifier) (public)
Sets the identifier for future proposals.
Changing this after a proposal is made but before it is executed will make it unexecutable.
#
Parameters:- _identifier: identifier to set.
sync() (external)
This pulls in the most up-to-date Optimistic Oracle.
If a new OptimisticOracle is added and this is run between a proposal's introduction and execution, the proposal will become unexecutable.
proposeTransactions(struct OptimisticGovernor.Transaction[] _transactions, bytes _explanation) (external)
Makes a new proposal for transactions to be executed with an "explanation" argument.
Proposer must grant the contract collateral allowance equal or greater than the totalBond.
#
Parameters:- _transactions: the transactions being proposed.
- _explanation: Auxillary information that can be referenced to validate the proposal.
executeProposal(struct OptimisticGovernor.Transaction[] _transactions) (external)
Executes an approved proposal.
#
Parameters:- _transactions: the transactions being executed. These must exactly match those that were proposed.
deleteProposal(bytes32 _proposalHash) (external)
Method to allow the owner to delete a particular proposal.
#
Parameters:- _proposalHash: the hash of the proposal being deleted.
deleteRejectedProposal(bytes32 _proposalHash) (external)
Method to allow anyone to delete a proposal that was rejected.
#
Parameters:- _proposalHash: the hash of the proposal being deleted.
deleteDisputedProposal(bytes32 _proposalHash) (external)
Method to allow anyone to delete a proposal that was disputed.
#
Parameters:- _proposalHash: the hash of the proposal being deleted.
_getCollateralWhitelist() โ contract AddressWhitelistInterface (internal)
_getIdentifierWhitelist() โ contract IdentifierWhitelistInterface (internal)
_getStore() โ contract StoreInterface (internal)
_sync() (internal)
_preEntranceCheck() (internal)
_preEntranceSet() (internal)
_postEntranceReset() (internal)
_startReentrantGuardDisabled() (internal)
_endReentrantGuardDisabled() (internal)
setAvatar(address _avatar) (public)
Can only be called by the current owner.
Sets the avatar to a new avatar (newAvatar
).
setTarget(address _target) (public)
Can only be called by the current owner.
Sets the target to a new target (newTarget
).
exec(address to, uint256 value, bytes data, enum Enum.Operation operation) โ bool success (internal)
Can only be called by this contract.
Passes a transaction to be executed by the avatar.
#
Parameters:- to: Destination address of module transaction.
- value: Ether value of module transaction.
- data: Data payload of module transaction.
- operation: Operation type of module transaction: 0 == call, 1 == delegate call.
execAndReturnData(address to, uint256 value, bytes data, enum Enum.Operation operation) โ bool success, bytes returnData (internal)
Can only be called by this contract.
Passes a transaction to be executed by the target and returns data.
#
Parameters:- to: Destination address of module transaction.
- value: Ether value of module transaction.
- data: Data payload of module transaction.
- operation: Operation type of module transaction: 0 == call, 1 == delegate call.
setGuard(address _guard) (external)
Set a guard that checks transactions before execution
#
Parameters:- _guard: The address of the guard to be used or the 0 address to disable the guard
getGuard() โ address _guard (external)
__Ownable_init() (internal)
Initializes the contract setting the deployer as the initial owner.
__Ownable_init_unchained() (internal)
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.
__Context_init() (internal)
__Context_init_unchained() (internal)
_msgSender() โ address (internal)
_msgData() โ bytes (internal)
#
EventsOptimisticGovernorDeployed(address owner, address avatar, address target)
TransactionsProposed(address proposer, uint256 proposalTime, struct OptimisticGovernor.Proposal proposal, bytes32 proposalHash, bytes explanation, uint256 challengeWindowEnds)
TransactionExecuted(bytes32 proposalHash, uint256 transactionIndex)
ProposalDeleted(bytes32 proposalHash, address sender, bytes32 status)
SetBond(contract IERC20 collateral, uint256 bondAmount)
SetCollateral(contract IERC20 collateral)
SetRules(string rules)
SetLiveness(uint64 liveness)
SetIdentifier(bytes32 identifier)
AvatarSet(address previousAvatar, address newAvatar)
Emitted each time the avatar is set.
TargetSet(address previousTarget, address newTarget)
Emitted each time the Target is set.
ChangedGuard(address guard)
OwnershipTransferred(address previousOwner, address newOwner)
#
ModifiersonlyIfTest()
Reverts if not running in test mode.
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.
onlyOwner()
Throws if called by any account other than the owner.
initializer()
Modifier to protect an initializer function from being invoked twice.
onlyInitializing()
Modifier to protect an initialization function so that it can only be invoked by functions with the {initializer} modifier, directly or indirectly.