Skip to main content

IRegeneratorRules

IRegeneratorRules

Interface for the RegeneratorRules contract, which manages the data and state transitions for Regenerator users, especially regarding inspections.

getRegenerator

function getRegenerator(address account) external view returns (struct Regenerator)

Retrieves the full Regenerator struct for a given account.

Parameters

NameTypeDescription
accountaddressThe address of the regenerator.

Return Values

NameTypeDescription
[0]struct RegeneratorThe Regenerator struct containing the user's data.

afterAcceptInspection

function afterAcceptInspection(address regenerator) external

A hook to be called after an inspection has been accepted.

Parameters

NameTypeDescription
regeneratoraddressThe address of the regenerator associated with the inspection.

poolCurrentEra

function poolCurrentEra() external view returns (uint256)

Returns the current era of the related pool.

Return Values

NameTypeDescription
[0]uint256The current era number.

afterRequestInspection

function afterRequestInspection(address regenerator) external

A hook to be called after a regenerator requests an inspection.

Parameters

NameTypeDescription
regeneratoraddressThe address of the regenerator requesting the inspection.

afterRealizeInspection

function afterRealizeInspection(address regenerator, uint32 regenerationScore, uint64 inspectionId) external returns (uint256)

A hook to be called after an inspection is completed.

Parameters

NameTypeDescription
regeneratoraddressThe address of the regenerator that was inspected.
regenerationScoreuint32The score calculated from the inspection.
inspectionIduint64

nextEraIn

function nextEraIn() external view returns (uint256)

Calculates the time or blocks remaining until the next era begins.

Return Values

NameTypeDescription
[0]uint256The number of seconds or blocks until the next era.

decrementInspections

function decrementInspections(address regenerator) external

Decrements the valid inspections count for a regenerator.

Called when an inspection is invalidated.

Parameters

NameTypeDescription
regeneratoraddressThe address of the regenerator.

removePoolLevels

function removePoolLevels(address user) external

Removes specified levels from a user's pool configuration.

The use of 'return' in the calling contract suggests this function returns a status, likely a boolean indicating success.

Parameters

NameTypeDescription
useraddressThe address of the regenerator.

newCertificationRegenerators

function newCertificationRegenerators(uint256 era) external view returns (uint256)

Returns the number of new regenerators that achieved impact status in a specific era.

Parameters

NameTypeDescription
erauint256The era number to query.

Return Values

NameTypeDescription
[0]uint256uint256 The count of new impact regenerators for that era.

regenerationArea

function regenerationArea() external view returns (uint256)

Returns the total area under regeneration across all regenerators.

Return Values

NameTypeDescription
[0]uint256The total regeneration area, in square meters.

removeInspectionLevels

function removeInspectionLevels(address addr, uint256 amountToRemove) external

Returns the total area under regeneration across all regenerators.

Parameters

NameTypeDescription
addraddressThe address of the regenerator.
amountToRemoveuint256Levels/score to be removed.