Supervisor Functions

The Eco Protocol contains state change functions that are called to advance the protocol phases forward at specific times. These functions are called "Supervisor Functions". For example, the code below allows the generation to be incremented when exactly 14 days have passed since the start of the last generation.

TimedPolicies.sol
function incrementGeneration() external {
    uint256 time = getTime();
    require(
        time >= nextGenerationWindowOpen,
        "Cannot update the generation counter so soon"
    );

    nextGenerationWindowOpen = time + MIN_GENERATION_DURATION;
    generation++;

    [...]

    emit PolicyDecisionStart(address(_proposals));
    emit NewGeneration(generation);
}

Ethereum does not have a "cron job" function to call functions at regular intervals. Therefore, functions like incrementGeneration() have to be called by an external caller on a regular cadence to ensure the proper functioning of the currency. In service of the protocol, the Eco Association is hosting an automated program that calls these critical state transition functions on a proper cadence, but any other actor is welcome to do the same for redundancy — there is no privileged access.

Last updated