HistoricalBalance

Inherits: ERC20Votes, IHistoricalBalance

Adds support for tracking historical balance on ERC20Votes (not just historical voting power) and adds support for contributing and retrieving incentives pro-rata of historical balanceOf.

Uses a timestamp-based clock for checkpoints as opposed to the default OZ implementation that is blocknumber based.

State Variables

_balanceOfCheckpoints

mapping(address account => Checkpoints.Trace208) private _balanceOfCheckpoints;

Functions

getPastBalanceOf

This function retrieves the historical balance of an account at a specific point in time.

function getPastBalanceOf(address account, uint256 timepoint) public view returns (uint256 balance);

Parameters

Returns

_update

function _update(address from, address to, uint256 amount) internal virtual override;

clock

function clock() public view override returns (uint48);

CLOCK_MODE

Machine-readable description of the clock as specified in ERC-6372.

function CLOCK_MODE() public pure override returns (string memory);

__push

function __push(Checkpoints.Trace208 storage store, function(uint208, uint208) view returns (uint208) op, uint208 delta)
    private
    returns (uint208, uint208);

__add

function __add(uint208 a, uint208 b) private pure returns (uint208);

__subtract

function __subtract(uint208 a, uint208 b) private pure returns (uint208);

Last updated