StakedLbgt
State Variables
LBGT
address public constant LBGT = Constants.LBGT;
exitFee
Returns the current exit fee rate in basis points (1/10000)
This fee is applied when users redeem or withdraw staked LBGT
uint16 public exitFee;
Functions
initialize
function initialize(address _owner) public initializer;
setExitFee
Sets the exit fee for the staking contract
This function can only be called by accounts with ROLE_ADMIN permission
function setExitFee(uint16 _exitFee) public onlyRole(ROLE_ADMIN);
Parameters
Name | Type | Description |
---|---|---|
_exitFee | uint16 | The new exit fee to be set, expressed in basis points (1/10000th). Must not exceed BASIS_POINT_SCALE (10000) |
pause
Pause the vault.
Only the curator can pause the vault.
function pause() public onlyRole(ROLE_CURATOR);
unpause
Unpause the vault.
Only the admin can unpause the vault.
function unpause() public onlyRole(ROLE_ADMIN);
deposit
Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens.
- MUST emit the Deposit event.
- MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the deposit execution, and are accounted for during deposit.
- MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not approving enough underlying tokens to the Vault contract, etc). NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.*
function deposit(
uint256 assets,
address receiver
)
public
override(IERC4626, ERC4626Upgradeable)
whenNotPaused
returns (uint256);
mint
Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens.
- MUST emit the Deposit event.
- MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint execution, and are accounted for during mint.
- MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not approving enough underlying tokens to the Vault contract, etc). NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token.*
function mint(
uint256 shares,
address receiver
)
public
override(IERC4626, ERC4626Upgradeable)
whenNotPaused
returns (uint256);
withdraw
Burns shares from owner and sends exactly assets of underlying tokens to receiver.
- MUST emit the Withdraw event.
- MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the withdraw execution, and are accounted for during withdraw.
- MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner not having enough shares, etc). Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. Those methods should be performed separately.*
function withdraw(
uint256 assets,
address receiver,
address owner
)
public
override(IERC4626, ERC4626Upgradeable)
whenNotPaused
returns (uint256);
redeem
Burns exactly shares from owner and sends assets of underlying tokens to receiver.
- MUST emit the Withdraw event.
- MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the redeem execution, and are accounted for during redeem.
- MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner not having enough shares, etc). NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. Those methods should be performed separately.*
function redeem(
uint256 shares,
address receiver,
address owner
)
public
override(IERC4626, ERC4626Upgradeable)
whenNotPaused
returns (uint256);
previewDeposit
Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given current on-chain conditions.
- MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called in the same transaction.
- MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the deposit would be accepted, regardless if the user has enough tokens approved, etc.
- MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
- MUST NOT revert. NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by depositing.*
function previewDeposit(uint256 assets) public view virtual override(IERC4626, ERC4626Upgradeable) returns (uint256);
previewMint
Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given current on-chain conditions.
- MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the same transaction.
- MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint would be accepted, regardless if the user has enough tokens approved, etc.
- MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees.
- MUST NOT revert. NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by minting.*
function previewMint(uint256 shares) public view virtual override(IERC4626, ERC4626Upgradeable) returns (uint256);
previewWithdraw
Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, given current on-chain conditions.
- MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if called in the same transaction.
- MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though the withdrawal would be accepted, regardless if the user has enough shares, etc.
- MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
- MUST NOT revert. NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by depositing.*
function previewWithdraw(uint256 assets) public view virtual override(IERC4626, ERC4626Upgradeable) returns (uint256);
previewRedeem
Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, given current on-chain conditions.
- MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the same transaction.
- MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the redemption would be accepted, regardless if the user has enough shares, etc.
- MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees.
- MUST NOT revert. NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in share price or some other type of condition, meaning the depositor will lose assets by redeeming.*
function previewRedeem(uint256 shares) public view virtual override(IERC4626, ERC4626Upgradeable) returns (uint256);