@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.
404 lines (201 loc) • 5.5 kB
Markdown
# FlashStrategySushiSwap
## Methods
### burnFToken
```solidity
function burnFToken(uint256 _amount, uint256 _minimumReturned, address _yieldTo) external nonpayable returns (uint256)
```
This is the function the user will be calling when performing a FlashBurn.
*It is responsible for burning the fToken supplied by the user and returning yield to the user.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _amount | uint256 | undefined |
| _minimumReturned | uint256 | undefined |
| _yieldTo | address | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### depositPrincipal
```solidity
function depositPrincipal(uint256 _amount) external nonpayable returns (uint256)
```
This function will be called whenever a user stakes via the Flash Protocol.
*The Strategy owner can choose to implement a fee but the resulting "locked" principal the user should expect after the stake has ended must be returned.*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _amount | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### fToken
```solidity
function fToken() external view returns (address)
```
address of fERC20 for this strategy
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
### factory
```solidity
function factory() external view returns (address)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
### flashProtocol
```solidity
function flashProtocol() external view returns (address)
```
address of FlashProtocol
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
### flpToken
```solidity
function flpToken() external view returns (address)
```
address of FarmingLPToken
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
### getMaxStakeDuration
```solidity
function getMaxStakeDuration() external pure returns (uint256)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | undefined |
### getPrincipalAddress
```solidity
function getPrincipalAddress() external view returns (address)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | address of LP Token |
### getPrincipalBalance
```solidity
function getPrincipalBalance() external view returns (uint256)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | amount of principal tokens that are currently deposited |
### getYieldBalance
```solidity
function getYieldBalance() external view returns (uint256)
```
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | amount of yield tokens that can be rewarded in SUSHI |
### initialize
```solidity
function initialize(address _flashProtocol, address _flpToken) external nonpayable
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _flashProtocol | address | undefined |
| _flpToken | address | undefined |
### quoteBurnFToken
```solidity
function quoteBurnFToken(uint256 _amount) external view returns (uint256)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _amount | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | how many aLP rewards should be returned if _amount fERC20 tokens are burned |
### quoteMintFToken
```solidity
function quoteMintFToken(uint256 _amount, uint256 _duration) external pure returns (uint256 amountFToken)
```
*called by flashProtocol*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _amount | uint256 | undefined |
| _duration | uint256 | undefined |
#### Returns
| Name | Type | Description |
|---|---|---|
| amountFToken | uint256 | how many fTokens should be minted for a given _amount and _duration (in seconds) |
### setFTokenAddress
```solidity
function setFTokenAddress(address _fTokenAddress) external nonpayable
```
*called by flashProtocol*
#### Parameters
| Name | Type | Description |
|---|---|---|
| _fTokenAddress | address | undefined |
### sushi
```solidity
function sushi() external view returns (address)
```
address of SUSHI token
#### Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
### withdrawPrincipal
```solidity
function withdrawPrincipal(uint256 _amount) external nonpayable
```
This function should withdraw principal from the underlying strategy.
#### Parameters
| Name | Type | Description |
|---|---|---|
| _amount | uint256 | undefined |
## Events
### BurnedFToken
```solidity
event BurnedFToken(address indexed _address, uint256 _tokenAmount, uint256 _yieldReturned)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| _address `indexed` | address | undefined |
| _tokenAmount | uint256 | undefined |
| _yieldReturned | uint256 | undefined |
### Initialized
```solidity
event Initialized(uint8 version)
```
#### Parameters
| Name | Type | Description |
|---|---|---|
| version | uint8 | undefined |
## Errors
### AmountTooLow
```solidity
error AmountTooLow()
```
### Forbidden
```solidity
error Forbidden()
```
### InsufficientTotalSupply
```solidity
error InsufficientTotalSupply()
```
### InsufficientYield
```solidity
error InsufficientYield()
```
### InvalidVault
```solidity
error InvalidVault()
```