@ohgeez/fsushi
Version:
fSUSHI is a protocol built on top of [FlashStake](http://flashstake.io/) and [SushiSwap](https://sushi.com) that enables stakers to get instant, upfront yield without waiting for it to accrue.
900 lines (448 loc) • 10.8 kB
Markdown
# IVotingEscrow
## Methods
### balanceOf
```solidity
function balanceOf(address addr, uint256 _t) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| addr | address | undefined |
| _t | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### balanceOf
```solidity
function balanceOf(address addr) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| addr | address | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### balanceOfAt
```solidity
function balanceOfAt(address addr, uint256 _block) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| addr | address | undefined |
| _block | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### checkpoint
```solidity
function checkpoint() external nonpayable
```
### createLock
```solidity
function createLock(uint256 _value, uint256 _duration) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _value | uint256 | undefined |
| _duration | uint256 | undefined |
### createLockFor
```solidity
function createLockFor(address _addr, uint256 _value, uint256 _discount, uint256 _duration) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _addr | address | undefined |
| _value | uint256 | undefined |
| _discount | uint256 | undefined |
| _duration | uint256 | undefined |
### decimals
```solidity
function decimals() external view returns (uint8)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint8 | undefined |
### delegateAt
```solidity
function delegateAt(address account, uint256 index) external view returns (address)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |
| index | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
### delegateLength
```solidity
function delegateLength(address addr) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| addr | address | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### depositFor
```solidity
function depositFor(address _addr, uint256 _value) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _addr | address | undefined |
| _value | uint256 | undefined |
### epoch
```solidity
function epoch() external view returns (uint256)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### getCheckpointTime
```solidity
function getCheckpointTime(address _addr, uint256 _idx) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _addr | address | undefined |
| _idx | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### getLastUserSlope
```solidity
function getLastUserSlope(address addr) external view returns (int128)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| addr | address | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | int128 | undefined |
### increaseAmount
```solidity
function increaseAmount(uint256 _value) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _value | uint256 | undefined |
### increaseAmountFor
```solidity
function increaseAmountFor(address _addr, uint256 _value, uint256 _discount) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _addr | address | undefined |
| _value | uint256 | undefined |
| _discount | uint256 | undefined |
### increaseUnlockTime
```solidity
function increaseUnlockTime(uint256 _duration) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _duration | uint256 | undefined |
### interval
```solidity
function interval() external view returns (uint256)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### isDelegate
```solidity
function isDelegate(address account) external view returns (bool)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | undefined |
### locked
```solidity
function locked(address account) external view returns (int128 amount, int128 discount, uint256 start, uint256 end)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| amount | int128 | undefined |
| discount | int128 | undefined |
| start | uint256 | undefined |
| end | uint256 | undefined |
### maxDuration
```solidity
function maxDuration() external view returns (uint256)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### name
```solidity
function name() external view returns (string)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined |
### pointHistory
```solidity
function pointHistory(uint256 epoch) external view returns (int128 bias, int128 slope, uint256 ts, uint256 blk)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| bias | int128 | undefined |
| slope | int128 | undefined |
| ts | uint256 | undefined |
| blk | uint256 | undefined |
### setDelegate
```solidity
function setDelegate(address account, bool _isDelegate) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |
| _isDelegate | bool | undefined |
### slopeChanges
```solidity
function slopeChanges(uint256 epoch) external view returns (int128)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| epoch | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | int128 | undefined |
### supply
```solidity
function supply() external view returns (uint256)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### symbol
```solidity
function symbol() external view returns (string)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | string | undefined |
### token
```solidity
function token() external view returns (address)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
### totalSupply
```solidity
function totalSupply() external view returns (uint256)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### totalSupply
```solidity
function totalSupply(uint256 t) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| t | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### totalSupplyAt
```solidity
function totalSupplyAt(uint256 _block) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _block | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### unlockTime
```solidity
function unlockTime(address _addr) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _addr | address | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### userPointEpoch
```solidity
function userPointEpoch(address account) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### userPointHistory
```solidity
function userPointHistory(address account, uint256 epoch) external view returns (int128 bias, int128 slope, uint256 ts, uint256 blk)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |
| epoch | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| bias | int128 | undefined |
| slope | int128 | undefined |
| ts | uint256 | undefined |
| blk | uint256 | undefined |
### withdraw
```solidity
function withdraw() external nonpayable
```
## Events
### Deposit
```solidity
event Deposit(address indexed provider, uint256 value, uint256 discount, uint256 indexed unlockTime, int128 indexed _type, uint256 ts)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| provider `indexed` | address | undefined |
| value | uint256 | undefined |
| discount | uint256 | undefined |
| unlockTime `indexed` | uint256 | undefined |
| _type `indexed` | int128 | undefined |
| ts | uint256 | undefined |
### SetDelegate
```solidity
event SetDelegate(address indexed account, bool isDelegate)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| account `indexed` | address | undefined |
| isDelegate | bool | undefined |
### Supply
```solidity
event Supply(uint256 prevSupply, uint256 supply)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| prevSupply | uint256 | undefined |
| supply | uint256 | undefined |
### Withdraw
```solidity
event Withdraw(address indexed provider, uint256 value, uint256 discount, uint256 ts)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| provider `indexed` | address | undefined |
| value | uint256 | undefined |
| discount | uint256 | undefined |
| ts | uint256 | undefined |
## Errors
### DiscountTooHigh
```solidity
error DiscountTooHigh()
```
### Discounted
```solidity
error Discounted()
```
### Existent
```solidity
error Existent()
```
### Expired
```solidity
error Expired()
```
### Forbidden
```solidity
error Forbidden()
```
### InvalidAmount
```solidity
error InvalidAmount()
```
### InvalidPath
```solidity
error InvalidPath()
```
### NonExistent
```solidity
error NonExistent()
```
### NotExpired
```solidity
error NotExpired()
```
### NotPastBlock
```solidity
error NotPastBlock()
```
### OutOfRange
```solidity
error OutOfRange()
```
### TooEarly
```solidity
error TooEarly()
```
### TooLate
```solidity
error TooLate()
```