IERC20Wrapper
Title: IERC20Wrapper
Author: Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/ERC20Wrapper.sol)
Interface for the ERC-20 wrapper extension: deposit an underlying ERC-20 to mint matching wrapped tokens 1:1, and burn wrapped tokens to withdraw the underlying.
Functions
underlying
The address of the underlying ERC-20 token being wrapped.
function underlying() external view returns (address);Returns
| Name | Type | Description |
|---|---|---|
| <none> | address |
depositFor
Deposit value underlying tokens from the caller and mint the same number of wrapped tokens to
account.
function depositFor(address account, uint256 value) external returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| account | address | |
| value | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
withdrawTo
Burn value wrapped tokens from the caller and send the same number of underlying tokens to
account.
function withdrawTo(address account, uint256 value) external returns (bool);Parameters
| Name | Type | Description |
|---|---|---|
| account | address | |
| value | uint256 |
Returns
| Name | Type | Description |
|---|---|---|
| <none> | bool |
Errors
ERC20InvalidUnderlying
The underlying token couldn't be wrapped (e.g. it is the wrapper itself).
error ERC20InvalidUnderlying(address token);Parameters
| Name | Type | Description |
|---|---|---|
| token | address |
SafeERC20FailedOperation
A safe ERC-20 transfer of the underlying token failed.
error SafeERC20FailedOperation(address token);Parameters
| Name | Type | Description |
|---|---|---|
| token | address |