Skip to content

CleanupBlockNumberManager#

Source | Inherits from Governed, AddressUpdatable

Token history cleanup manager.

Maintains the list of cleanable tokens for which history cleanup can be collectively executed.

Events#

CleanupBlockNumberSet#

Defined in CleanupBlockNumberManager (Docs, Source).

event CleanupBlockNumberSet(
    contract IICleanable theContract,
    uint256 blockNumber,
    bool success
)

Emitted when an attempt has been made to set the cleanup block number.

Parameters Type Description
theContract contract IICleanable The token contract address.
blockNumber uint256 The block number being set.
success bool Whether it succeeded or not.

GovernanceCallTimelocked#

Defined in GovernedBase (Docs, Source).

event GovernanceCallTimelocked(
    bytes4 selector,
    uint256 allowedAfterTimestamp,
    bytes encodedCall
)

Emitted when a new governance call has been recorded and is now waiting for the time lock to expire.

GovernanceInitialised#

Defined in GovernedBase (Docs, Source).

event GovernanceInitialised(
    address initialGovernance
)

Emitted when the governance address is initialized. This address will be used until production mode is entered (see GovernedProductionModeEntered). At that point the governance address is taken from GovernanceSettings.

GovernedProductionModeEntered#

Defined in GovernedBase (Docs, Source).

event GovernedProductionModeEntered(
    address governanceSettings
)

Emitted when governance is enabled and the governance address cannot be changed anymore (only through a network fork).

RegistrationUpdated#

Defined in CleanupBlockNumberManager (Docs, Source).

event RegistrationUpdated(
    contract IICleanable theContract,
    bool add
)

Emitted when a new token has been registered to have its history managed by us, or an old one unregistered.

Parameters Type Description
theContract contract IICleanable The token contract address.
add bool true is the token has been registered, false if unregistered.

TimelockedGovernanceCallCanceled#

Defined in GovernedBase (Docs, Source).

event TimelockedGovernanceCallCanceled(
    bytes4 selector,
    uint256 timestamp
)

Emitted when a timelocked governance call is canceled before execution.

TimelockedGovernanceCallExecuted#

Defined in GovernedBase (Docs, Source).

event TimelockedGovernanceCallExecuted(
    bytes4 selector,
    uint256 timestamp
)

Emitted when a timelocked governance call is executed.

Functions#

cancelGovernanceCall#

Defined in GovernedBase (Docs, Source).

function cancelGovernanceCall(
    bytes4 _selector
) external;

Cancel a timelocked governance call before it has been executed.

Only governance can call this method.

Parameters Type Description
_selector bytes4 The method selector.

constructor#

Defined in CleanupBlockNumberManager (Docs, Source).

constructor(
    address _governance,
    address _addressUpdater,
    string _triggerContractName
) public;

Build a new instance.

Parameters Type Description
_governance address Contract address that can make governance calls. See Governed.
_addressUpdater address Contract address that can update redeployable addresses. See AdressUpdatable.
_triggerContractName string Contract name that can trigger history cleanups.

executeGovernanceCall#

Defined in GovernedBase (Docs, Source).

function executeGovernanceCall(
    bytes4 _selector
) external;

Execute the timelocked governance calls once the timelock period expires.

Only executor can call this method.

Parameters Type Description
_selector bytes4 The method selector (only one timelocked call per method is stored).

getAddressUpdater#

Defined in AddressUpdatable (Docs, Source).

function getAddressUpdater(
) public view returns (
    address _addressUpdater);

Returns the configured address updater.

Returns Type Description
_addressUpdater address The AddresUpdater contract that can update our contract address list, as a response to a governance call.

governance#

Defined in GovernedBase (Docs, Source).

function governance(
) public view returns (
    address);

Returns the current effective governance address.

registerToken#

Defined in CleanupBlockNumberManager (Docs, Source).

function registerToken(
    contract IICleanable _cleanableToken
) external;

Register a token contract whose history cleanup index is to be managed. The registered contracts must allow calling setCleanupBlockNumber.

Parameters Type Description
_cleanableToken contract IICleanable The address of the contract to be managed.

setCleanUpBlockNumber#

Defined in CleanupBlockNumberManager (Docs, Source).

function setCleanUpBlockNumber(
    uint256 _blockNumber
) external;

Sets clean up block number on managed cleanable tokens.

Parameters Type Description
_blockNumber uint256 cleanup block number

switchToProductionMode#

Defined in GovernedBase (Docs, Source).

function switchToProductionMode(
) external;

Enter the production mode after all the initial governance settings have been set. This enables timelocks and the governance can be obtained afterward by calling governanceSettings.getGovernanceAddress(). Emits GovernedProductionModeEntered.

unregisterToken#

Defined in CleanupBlockNumberManager (Docs, Source).

function unregisterToken(
    contract IICleanable _cleanableToken
) external;

Unregister a token contract from history cleanup index management.

Parameters Type Description
_cleanableToken contract IICleanable The address of the contract to unregister.

updateContractAddresses#

Defined in AddressUpdatable (Docs, Source).

function updateContractAddresses(
    bytes32[] _contractNameHashes,
    address[] _contractAddresses
) external;

External method called from AddressUpdater only.

Modifiers#

onlyAddressUpdater#

Defined in AddressUpdatable (Docs, Source).

modifier onlyAddressUpdater()

Only the AdressUpdater contract can call this method. Its address is set at construction time but it can also update itself.

onlyGovernance#

Defined in GovernedBase (Docs, Source).

modifier onlyGovernance()

onlyImmediateGovernance#

Defined in GovernedBase (Docs, Source).

modifier onlyImmediateGovernance()

onlyTrigger#

Defined in CleanupBlockNumberManager (Docs, Source).

modifier onlyTrigger()

Only the trigger contract can call this method. This contract is set at construction time and updated through AddressUpdatable.

Variables#

governanceSettings#

Defined in GovernedBase (Docs, Source).

    contract IGovernanceSettings governanceSettings

Governance Settings.

productionMode#

Defined in GovernedBase (Docs, Source).

    bool productionMode

When true, governance is enabled and cannot be disabled. See switchToProductionMode.

registeredTokens#

Defined in CleanupBlockNumberManager (Docs, Source).

    contract IICleanable[] registeredTokens

Current list of token contracts being managed.

timelockedCalls#

Defined in GovernedBase (Docs, Source).

    mapping(bytes4 => struct GovernedBase.TimelockedCall) timelockedCalls

List of pending timelocked governance calls.

triggerContract#

Defined in CleanupBlockNumberManager (Docs, Source).

    address triggerContract

Address of the contract that can trigger a cleanup.

triggerContractName#

Defined in CleanupBlockNumberManager (Docs, Source).

    string triggerContractName

Name of the contract that can trigger a cleanup. Needed to update the trigger contract address through the AddressUpdater.


Last update: 2024-03-01