TokenTransfers
Require full ERC-20 delivery without charging extra to the sender; token-reported success is insufficient.
Functions
snapshot
function snapshot(address token, address from, address to) internal view returns (Balances memory balances);Parameters
| Name | Type | Description |
|---|---|---|
| token | address | |
| from | address | |
| to | address |
Returns
| Name | Type | Description |
|---|---|---|
| balances | Balances |
verify
function verify(address token, address from, address to, uint256 amount, Balances memory before) internal view;Parameters
| Name | Type | Description |
|---|---|---|
| token | address | |
| from | address | |
| to | address | |
| amount | uint256 | |
| before | Balances |
transferFrom
function transferFrom(address token, address from, address to, uint256 amount) internal;Parameters
| Name | Type | Description |
|---|---|---|
| token | address | |
| from | address | |
| to | address | |
| amount | uint256 |
verifyDebit
PoolManager verifies deposit credit at settlement. Preserve CurrencyNotSettled for short deposits.
function verifyDebit(address token, address from, uint256 amount, uint256 before) internal view;Parameters
| Name | Type | Description |
|---|---|---|
| token | address | |
| from | address | |
| amount | uint256 | |
| before | uint256 |
transfer
function transfer(address token, address to, uint256 amount) internal;Parameters
| Name | Type | Description |
|---|---|---|
| token | address | |
| to | address | |
| amount | uint256 |
bubbleUnsupported
A liquidity miss may leave an order resting; an unsupported token must fail the caller explicitly.
function bubbleUnsupported(bytes memory reason) internal pure;Parameters
| Name | Type | Description |
|---|---|---|
| reason | bytes |
take
function take(IPoolManager manager, Currency currency, address to, uint256 amount) internal;Parameters
| Name | Type | Description |
|---|---|---|
| manager | IPoolManager | |
| currency | Currency | |
| to | address | |
| amount | uint256 |
Errors
TokenNotSupported
error TokenNotSupported(address token);Parameters
| Name | Type | Description |
|---|---|---|
| token | address |
Structs
Balances
struct Balances {
uint256 from;
uint256 to;
}Properties
| Name | Type | Description |
|---|---|---|
| from | uint256 | |
| to | uint256 |