Skip to content

ICycleFacet

ICycleFacet is the interface for the CycleFacet contract.

This contract is responsible for managing the cycle state of the project.

Updates the state of the cycle. This function is called by various facets to update the cycle state when certain actions are performed.

This function is payable to allow delegatecalls to it while the caller is receiving ether.

function updateCycleState(uint256 cycleId) external payable;

Parameters

NameTypeDescription
cycleIduint256The cycle ID.

Returns the remaining time (in seconds) for the cycle to end.

function cycleTimeRemaining(uint256 cycleId) external view returns (uint256 remainingTime);

Parameters

NameTypeDescription
cycleIduint256The cycle ID.

Returns

NameTypeDescription
remainingTimeuint256The time remaining (in seconds) for the cycle to end.

Returns the last time the cycle is applicable. This timestamp is a Math.min of the cycle finish time and the current block.timestamp.

function lastTimeCycleApplicable(uint256 cycleId)
external
view
returns (uint256 lastTimeApplicable);

Parameters

NameTypeDescription
cycleIduint256The cycle ID.

Returns

NameTypeDescription
lastTimeApplicableuint256The last time the cycle is applicable.

Starts a new cycle.

function startNewCycle(uint256 cycleDuration, bool issueCertificateIfNone) external;

Parameters

NameTypeDescription
cycleDurationuint256The duration of the cycle (in seconds).
issueCertificateIfNoneboolA flag to issue a certificate upon cycle start if none exists.

Extends the duration of the cycle.

The cycle duration cannot be less than 60 seconds.

The extension is only applicable if the manager owns 100% of the certificates.

Only the manager can call this function.

function extendCycleDuration(uint256 secondsToIncrease) external;

Parameters

NameTypeDescription
secondsToIncreaseuint256The number of seconds to increase the cycle duration by.