Skip to content

CheckPointable#

Check-Pointable ERC20 Behavior.

ERC20 behavior that adds balance check-point features.

Events#

CreatedTotalSupplyCache#

Defined in CheckPointable (Docs, Source).

event CreatedTotalSupplyCache(
    uint256 _blockNumber
)

Emitted when a total supply cache entry is created. Allows history cleaners to track total supply cache cleanup opportunities off-chain.

Functions#

balanceHistoryCleanup#

Defined in CheckPointable (Docs, Source).

function balanceHistoryCleanup(
    address _owner,
    uint256 _count
) external returns (
    uint256);

Delete balance checkpoints that expired (i.e. are before cleanupBlockNumber). Method can only be called from the cleanerContract (which may be a proxy to external cleaners).

Parameters Type Description
_owner address balance owner account address
_count uint256 maximum number of checkpoints to delete
Returns Type Description
[0] uint256 the number of checkpoints deleted

totalSupplyCacheCleanup#

Defined in CheckPointable (Docs, Source).

function totalSupplyCacheCleanup(
    uint256 _blockNumber
) external returns (
    uint256);

Delete total supply cache entry that expired (i.e. is before cleanupBlockNumber). Method can only be called from the cleanerContract (which may be a proxy to external cleaners).

Parameters Type Description
_blockNumber uint256 the block number for which total supply value was cached
Returns Type Description
[0] uint256 the number of cache entries deleted (always 0 or 1)

totalSupplyHistoryCleanup#

Defined in CheckPointable (Docs, Source).

function totalSupplyHistoryCleanup(
    uint256 _count
) external returns (
    uint256);

Delete total supply checkpoints that expired (i.e. are before cleanupBlockNumber). Method can only be called from the cleanerContract (which may be a proxy to external cleaners).

Parameters Type Description
_count uint256 maximum number of checkpoints to delete
Returns Type Description
[0] uint256 the number of checkpoints deleted

Modifiers#

notBeforeCleanupBlock#

Defined in CheckPointable (Docs, Source).

modifier notBeforeCleanupBlock(    uint256 _blockNumber)

This method cannot be called for _blockNumber lower than the current cleanup block number.

onlyCleaner#

Defined in CheckPointable (Docs, Source).

modifier onlyCleaner()

Only the cleanerContract can call this method.

Variables#

cleanerContract#

Defined in CheckPointable (Docs, Source).

    address cleanerContract

Address of the contract that is allowed to call methods for history cleaning.


Last update: 2024-03-01