Skip to main content

OptimisticGovernorTest

OptimisticGovernorTest#

Functions#

constructor(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)
priceProposed(bytes32 _identifier, uint32 _timestamp, bytes _ancillaryData, struct SkinnyOptimisticOracleInterface.Request _request) (external)
setBond(uint256 _bond) (public)
setCollateral(contract IERC20 _collateral) (public)
setRules(string _rules) (public)
setLiveness(uint64 _liveness) (public)
setIdentifier(bytes32 _identifier) (public)
sync() (public)
proposeTransactions(struct OptimisticGovernor.Transaction[] _transactions, bytes _explanation) (public)
executeProposal(uint256 _proposalId, struct OptimisticGovernor.Transaction[] _transactions, uint32 _originalTime, struct SkinnyOptimisticOracleInterface.Request _request) (public)
deleteProposal(uint256 _proposalId) (public)
deleteRejectedProposal(uint256 _proposalId, uint32 _originalTime, bytes _ancillaryData, struct SkinnyOptimisticOracleInterface.Request _request) (public)
_getCollateralWhitelist() โ†’ contract AddressWhitelistInterface (internal)
_getIdentifierWhitelist() โ†’ contract IdentifierWhitelistInterface (internal)
_getStore() โ†’ contract StoreInterface (internal)
_sync() (internal)
_preEntranceCheck() (internal)
_preEntranceSet() (internal)
_postEntranceReset() (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)

Events#

OptimisticGovernorDeployed(address owner, address avatar, address target)
TransactionsProposed(uint256 proposalId, address proposer, uint256 proposalTime, struct OptimisticGovernor.Proposal proposal, bytes explanation)
PriceProposed(bytes32 identifier, uint256 timestamp, bytes ancillaryData, struct SkinnyOptimisticOracleInterface.Request request)
TransactionExecuted(uint256 proposalId, uint256 transactionIndex)
ProposalDeleted(uint256 proposalId)
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)

Modifiers#

onlyIfTest()

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.