UNPKG

@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.

498 lines (250 loc) 6.55 kB
# FSushiBar FSushiBar is an extension of ERC4626 with the addition of vesting period for locks ## Methods ### asset ```solidity function asset() external view returns (address) ``` #### Returns | Name | Type | Description | |---|---|---| | _0 | address | undefined | ### balanceOf ```solidity function balanceOf(address) external view returns (uint256) ``` #### Parameters | Name | Type | Description | |---|---|---| | _0 | address | undefined | #### Returns | Name | Type | Description | |---|---|---| | _0 | uint256 | undefined | ### checkpoint ```solidity function checkpoint() external nonpayable ``` *if this function doesn't get called for 512 weeks (around 9.8 years) this contract breaks* ### checkpointedTotalAssets ```solidity function checkpointedTotalAssets() external nonpayable returns (uint256) ``` #### Returns | Name | Type | Description | |---|---|---| | _0 | uint256 | undefined | ### checkpointedTotalAssetsDuring ```solidity function checkpointedTotalAssetsDuring(uint256 week) external nonpayable returns (uint256) ``` #### Parameters | Name | Type | Description | |---|---|---| | week | uint256 | undefined | #### Returns | Name | Type | Description | |---|---|---| | _0 | uint256 | undefined | ### decimals ```solidity function decimals() external view returns (uint8) ``` #### Returns | Name | Type | Description | |---|---|---| | _0 | uint8 | undefined | ### deposit ```solidity function deposit(uint256 assets, uint256 _weeks, address beneficiary) external nonpayable returns (uint256) ``` #### Parameters | Name | Type | Description | |---|---|---| | assets | uint256 | undefined | | _weeks | uint256 | undefined | | beneficiary | address | undefined | #### Returns | Name | Type | Description | |---|---|---| | _0 | uint256 | undefined | ### depositSigned ```solidity function depositSigned(uint256 assets, uint256 _weeks, address beneficiary, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable returns (uint256) ``` #### Parameters | Name | Type | Description | |---|---|---| | assets | uint256 | undefined | | _weeks | uint256 | undefined | | beneficiary | address | undefined | | deadline | uint256 | undefined | | v | uint8 | undefined | | r | bytes32 | undefined | | s | bytes32 | undefined | #### Returns | Name | Type | Description | |---|---|---| | _0 | uint256 | undefined | ### lastCheckpoint ```solidity function lastCheckpoint() external view returns (uint256) ``` totalAssetsDuring is guaranteed to be correct before this week #### Returns | Name | Type | Description | |---|---|---| | _0 | uint256 | undefined | ### name ```solidity function name() external view returns (string) ``` #### Returns | Name | Type | Description | |---|---|---| | _0 | string | undefined | ### previewDeposit ```solidity function previewDeposit(uint256 assets, uint256 _weeks) external view returns (uint256 shares) ``` #### Parameters | Name | Type | Description | |---|---|---| | assets | uint256 | undefined | | _weeks | uint256 | undefined | #### Returns | Name | Type | Description | |---|---|---| | shares | uint256 | undefined | ### previewWithdraw ```solidity function previewWithdraw(address owner) external view returns (uint256 shares, uint256 assets, uint256 yield) ``` #### Parameters | Name | Type | Description | |---|---|---| | owner | address | undefined | #### Returns | Name | Type | Description | |---|---|---| | shares | uint256 | undefined | | assets | uint256 | undefined | | yield | uint256 | undefined | ### startWeek ```solidity function startWeek() 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 | ### totalAssets ```solidity function totalAssets() external view returns (uint256) ``` #### Returns | Name | Type | Description | |---|---|---| | _0 | uint256 | undefined | ### totalAssetsDuring ```solidity function totalAssetsDuring(uint256) external view returns (uint256) ``` *this is guaranteed to be correct up until the last week* #### Parameters | Name | Type | Description | |---|---|---| | _0 | uint256 | undefined | #### Returns | Name | Type | Description | |---|---|---| | _0 | uint256 | minimum number of staked total assets during the whole week | ### totalSupply ```solidity function totalSupply() external view returns (uint256) ``` #### Returns | Name | Type | Description | |---|---|---| | _0 | uint256 | undefined | ### withdraw ```solidity function withdraw(address beneficiary) external nonpayable returns (uint256 shares, uint256 assets, uint256 yield) ``` #### Parameters | Name | Type | Description | |---|---|---| | beneficiary | address | undefined | #### Returns | Name | Type | Description | |---|---|---| | shares | uint256 | undefined | | assets | uint256 | undefined | | yield | uint256 | undefined | ## Events ### Deposit ```solidity event Deposit(address indexed sender, address indexed beneficiary, uint256 shares, uint256 assets) ``` #### Parameters | Name | Type | Description | |---|---|---| | sender `indexed` | address | undefined | | beneficiary `indexed` | address | undefined | | shares | uint256 | undefined | | assets | uint256 | undefined | ### Transfer ```solidity event Transfer(address indexed from, address indexed to, uint256 value) ``` #### Parameters | Name | Type | Description | |---|---|---| | from `indexed` | address | undefined | | to `indexed` | address | undefined | | value | uint256 | undefined | ### Withdraw ```solidity event Withdraw(address indexed owner, address indexed beneficiary, uint256 shares, uint256 assets, uint256 yield) ``` #### Parameters | Name | Type | Description | |---|---|---| | owner `indexed` | address | undefined | | beneficiary `indexed` | address | undefined | | shares | uint256 | undefined | | assets | uint256 | undefined | | yield | uint256 | undefined | ## Errors ### Bankrupt ```solidity error Bankrupt() ``` ### InvalidAccount ```solidity error InvalidAccount() ``` ### InvalidDuration ```solidity error InvalidDuration() ``` ### NotEnoughBalance ```solidity error NotEnoughBalance() ``` ### QueueEmpty ```solidity error QueueEmpty() ``` ### WithdrawalDenied ```solidity error WithdrawalDenied() ```