You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
590 B
24 lines
590 B
3 years ago
|
// SPDX-License-Identifier: MIT
|
||
|
|
||
|
pragma solidity ^0.8.0;
|
||
|
|
||
|
import "../utils/Checkpoints.sol";
|
||
|
|
||
|
contract CheckpointsImpl {
|
||
|
using Checkpoints for Checkpoints.History;
|
||
|
|
||
|
Checkpoints.History private _totalCheckpoints;
|
||
|
|
||
|
function latest() public view returns (uint256) {
|
||
|
return _totalCheckpoints.latest();
|
||
|
}
|
||
|
|
||
|
function getAtBlock(uint256 blockNumber) public view returns (uint256) {
|
||
|
return _totalCheckpoints.getAtBlock(blockNumber);
|
||
|
}
|
||
|
|
||
|
function push(uint256 value) public returns (uint256, uint256) {
|
||
|
return _totalCheckpoints.push(value);
|
||
|
}
|
||
|
}
|