Add ERC721Votes for NFT-based governance (#2944)

Co-authored-by: Francisco Giordano <frangio.1@gmail.com>
Co-authored-by: Hadrien Croubois <hadrien@openzeppelin.com>
This commit is contained in:
JulissaDantes
2021-12-10 17:58:45 -04:00
committed by GitHub
parent 9a7e4a0112
commit b42b05311b
31 changed files with 1346 additions and 36 deletions

View File

@ -0,0 +1,23 @@
// 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);
}
}