ConfigStore
nonReentrant()
modifier
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 make it call a
private
function that does the actual work.
nonReentrantView()
modifier
Designed to prevent a view-only method from being re-entered during a call to a nonReentrant()
state-changing method.
constructor(struct ConfigStoreInterface.ConfigSettings _initialConfig, address _timerAddress)
public
Construct the Config Store. An initial configuration is provided and set on construction.
Parameters:
-
_initialConfig
: Configuration settings to initializecurrentConfig
with. -
_timerAddress
: Address of testable Timer contract.
updateAndGetCurrentConfig() → struct ConfigStoreInterface.ConfigSettings
external
Returns current config or pending config if pending liveness has expired.
proposeNewConfig(struct ConfigStoreInterface.ConfigSettings newConfig)
external
Propose new configuration settings. New settings go into effect after a liveness period passes.
Callable only by owner. Calling this while there is already a pending proposal will overwrite the pending proposal.
Parameters:
-
newConfig
: Configuration settings to publish aftercurrentConfig.timelockLiveness
passes from now.
publishPendingConfig()
external
Publish any pending configuration settings if there is a pending proposal that has passed liveness.
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.
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.