⌛Epoch Manager
The Epoch Manager is a contract which sole purpose is to generate epochs on MANTRA, acting like a clock for the other contracts.
An Epoch
is a period of time that is defined by the duration
parameter on EpochConfig
, and they are used by other contracts to take timely actions. For example, the Farm Manager uses epochs to calculate the farm rewards for its users.
How it works
The epoch configuration is set up when the contract is instantiated. The epoch configuration defines the duration of an epoch and when the genesis epoch is going to take place, i.e. the first epoch.
Then, when querying the contract, the epochs in the system are derived based on the genesis epoch and duration values.
Instantiate
Instantiates an instance of the epoch manager contract
owner
String
The owner of the contract
epoch_config
EpochConfig
The configuration for the epochs
ExecuteMsg
UpdateConfig
Updates the contract configuration. This can only be triggered by the contract owner.
epoch_config
Option<EpochConfig>
The new epoch configuration
UpdateOwnership(::cw_ownable::Action)
Implements cw_ownable
. Updates the contract's ownership. ::cw_ownable::Action
can be TransferOwnership
, AcceptOwnership
and RenounceOwnership
.
Note: This is a cw_ownable
message.
Propose to transfer the contract's ownership to another account, optionally with an expiry time. Can only be called by the contract's current owner. Any existing pending ownership transfer is overwritten.
new_owner
String
The new owner proposed,
expiry
Option<Expiration>
Optional expiration time parameter.
QueryMsg
Config
Returns the configuration of the contract.
CurrentEpoch
Returns the current epoch based on the current timestamp.
Epoch
Returns the epoch with the given ID.
id
u64
The id of the epoch to be queried.
Ownership
Returns the ownership of the contract.
Note: This is a cw_ownable
query.
MigrateMsg
Message to migrate the contract to a new code ID.
Last updated