/
IVe.sol
57 lines (38 loc) · 1.39 KB
/
IVe.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface IVe {
enum DepositType {
DEPOSIT_FOR_TYPE,
CREATE_LOCK_TYPE,
INCREASE_LOCK_AMOUNT,
INCREASE_UNLOCK_TIME,
MERGE_TYPE
}
struct Point {
int128 bias;
int128 slope; // # -dweight / dt
uint ts;
uint 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;
uint end;
}
function token() external view returns (address);
function balanceOfNFT(uint) external view returns (uint);
function isApprovedOrOwner(address, uint) external view returns (bool);
function createLockFor(uint, uint, address) external returns (uint);
function userPointEpoch(uint tokenId) external view returns (uint);
function epoch() external view returns (uint);
function userPointHistory(uint tokenId, uint loc) external view returns (Point memory);
function pointHistory(uint loc) external view returns (Point memory);
function checkpoint() external;
function depositFor(uint tokenId, uint value) external;
function attachToken(uint tokenId) external;
function detachToken(uint tokenId) external;
function voting(uint tokenId) external;
function abstain(uint tokenId) external;
}