1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- // SPDX-License-Identifier: MIT
- // This file was procedurally generated from scripts/generate/templates/CheckpointsMock.js.
- pragma solidity ^0.8.0;
- import "../utils/Checkpoints.sol";
- contract CheckpointsMock {
- using Checkpoints for Checkpoints.History;
- Checkpoints.History private _totalCheckpoints;
- function latest() public view returns (uint256) {
- return _totalCheckpoints.latest();
- }
- function push(uint256 value) public returns (uint256, uint256) {
- return _totalCheckpoints.push(value);
- }
- function getAtBlock(uint256 blockNumber) public view returns (uint256) {
- return _totalCheckpoints.getAtBlock(blockNumber);
- }
- function getAtRecentBlock(uint256 blockNumber) public view returns (uint256) {
- return _totalCheckpoints.getAtRecentBlock(blockNumber);
- }
- function length() public view returns (uint256) {
- return _totalCheckpoints._checkpoints.length;
- }
- }
- contract Checkpoints224Mock {
- using Checkpoints for Checkpoints.Trace224;
- Checkpoints.Trace224 private _totalCheckpoints;
- function latest() public view returns (uint224) {
- return _totalCheckpoints.latest();
- }
- function push(uint32 key, uint224 value) public returns (uint224, uint224) {
- return _totalCheckpoints.push(key, value);
- }
- function lowerLookup(uint32 key) public view returns (uint224) {
- return _totalCheckpoints.lowerLookup(key);
- }
- function upperLookup(uint32 key) public view returns (uint224) {
- return _totalCheckpoints.upperLookup(key);
- }
- function upperLookupRecent(uint32 key) public view returns (uint224) {
- return _totalCheckpoints.upperLookupRecent(key);
- }
- function length() public view returns (uint256) {
- return _totalCheckpoints._checkpoints.length;
- }
- }
- contract Checkpoints160Mock {
- using Checkpoints for Checkpoints.Trace160;
- Checkpoints.Trace160 private _totalCheckpoints;
- function latest() public view returns (uint160) {
- return _totalCheckpoints.latest();
- }
- function push(uint96 key, uint160 value) public returns (uint160, uint160) {
- return _totalCheckpoints.push(key, value);
- }
- function lowerLookup(uint96 key) public view returns (uint160) {
- return _totalCheckpoints.lowerLookup(key);
- }
- function upperLookup(uint96 key) public view returns (uint160) {
- return _totalCheckpoints.upperLookup(key);
- }
- function upperLookupRecent(uint96 key) public view returns (uint224) {
- return _totalCheckpoints.upperLookupRecent(key);
- }
- function length() public view returns (uint256) {
- return _totalCheckpoints._checkpoints.length;
- }
- }
|