Spectra4626Wrapper
The Spectra4626Wrapper
contract implements a wrapper to facilitate compliance of an interest-bearing vault with the ERC-4626 standard, making it compatible for deploying a Spectra Principal Token.
ERC-4626
This contract is compatible with the ERC-4626 standard and implements its interface. However, depending on the functionalities supported by the wrapped vault, some functions may revert by default (e.g. redeem() / withdraw()).
Methods
wrap
Deposits vault shares into the wrapper.
Input Parameter | Type | Description |
---|---|---|
| uint256 | The amount of vault shares to deposit |
| address | The address to receive the wrapper shares |
Return Parameter | Type | Description |
---|---|---|
| uint256 | The amount of minted wrapper shares |
wrap
Deposits vault shares into the wrapper, with support for slippage protection.
Input Parameter | Type | Description |
---|---|---|
| uint256 | The amount of vault shares to deposit |
| address | The address to receive the wrapper shares |
| uint256 | The minimum allowed wrapper shares from this deposit |
Return Parameter | Type | Description |
---|---|---|
| uint256 | The amount of minted wrapper shares |
unwrap
Withdraws vault shares from the wrapper.
msg.sender
must approve the relevant allowance of the vault token before calling this method.
Input Parameter | Type | Description |
---|---|---|
| uint256 | The amount of wrapper shares to redeem |
| address | The address to receive the vault shares |
| address | The address of the owner of the wrapper shares |
Return Parameter | Type | Description |
---|---|---|
| uint256 | The amount of withdrawn vault shares |
unwrap
Withdraws vault shares from the wrapper, with support for slippage protection.
Input Parameter | Type | Description |
---|---|---|
| uint256 | The amount of wrapper shares to redeem |
| address | The address to receive the vault shares |
| address | The address of the owner of the wrapper shares |
| uint256 | The minimum vault shares that should be returned |
Return Parameter | Type | Description |
---|---|---|
| uint256 | The amount of withdrawn vault shares |
View Methods
previewWrap
Calculates the amount of minted wrapper shares for a given amount of deposited vault shares.
previewUnwrap
Calculates the amount of withdrawn vault shares for a given amount of redeemed wrapper shares.
vault
Returns the address of the wrapped vault.
totalVaultShares
Returns the vault balance of the wrapper.
Last updated