CheckpointsImpl.sol 590 B

1234567891011121314151617181920212223
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../utils/Checkpoints.sol";
  4. contract CheckpointsImpl {
  5. using Checkpoints for Checkpoints.History;
  6. Checkpoints.History private _totalCheckpoints;
  7. function latest() public view returns (uint256) {
  8. return _totalCheckpoints.latest();
  9. }
  10. function getAtBlock(uint256 blockNumber) public view returns (uint256) {
  11. return _totalCheckpoints.getAtBlock(blockNumber);
  12. }
  13. function push(uint256 value) public returns (uint256, uint256) {
  14. return _totalCheckpoints.push(value);
  15. }
  16. }