// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import {IERC721} from "@openzeppelin/contracts/interfaces/IERC721.sol"; import {IERC721Receiver} from "@openzeppelin/contracts/interfaces/IERC721Receiver.sol"; import {IRegistry} from "./IRegistry.sol"; interface INFTLocker is IERC721 { function registry() external view returns (IRegistry); function balanceOfNFT(uint256) external view returns (uint256); function isStaked(uint256) external view returns (bool); function epoch() external view returns (uint256); function userPointEpoch(uint256) external view returns (uint256); function userPointHistory(uint256, uint256) external view returns (Point memory); function pointHistory(uint256) external view returns (Point memory); function totalSupplyWithoutDecay() external view returns (uint256); function isApprovedOrOwner(address, uint256) external view returns (bool); function totalSupply() external view returns (uint256); function totalSupplyAt(uint256 _block) external view returns (uint256); function merge(uint256 _from, uint256 _to) external; function blockNumber() external view returns (uint256); function checkpoint() external; function depositFor(uint256 _tokenId, uint256 _value) external; function createLockFor( uint256 _value, uint256 _lockDuration, address _to, bool _stakeNFT ) external returns (uint256); function migrateTokenFor( uint256 _value, uint256 _lockDuration, address _to ) external returns (uint256); function createLock( uint256 _value, uint256 _lockDuration, bool _stakeNFT ) external returns (uint256); enum DepositType { DEPOSIT_FOR_TYPE, CREATE_LOCK_TYPE, INCREASE_LOCK_AMOUNT, INCREASE_UNLOCK_TIME, MERGE_TYPE } struct Point { int128 bias; int128 slope; // # -dweight / dt uint256 ts; uint256 blk; // block } /* We cannot really do block numbers per se b/c slope is per time, not per block * and per block could be fairly bad b/c Ethereum changes blocktimes. * What we can do is to extrapolate ***At functions */ struct LockedBalance { int128 amount; uint256 end; uint256 start; } event Deposit( address indexed provider, uint256 tokenId, uint256 value, uint256 indexed locktime, DepositType deposit_type, uint256 ts ); event Withdraw( address indexed provider, uint256 tokenId, uint256 value, uint256 ts ); event Supply(uint256 prevSupply, uint256 supply); }