VaultTransferHandler
VaultTransferHandler
Addresses
Chain | Address |
---|---|
Arbitrum Sepolia | 0x0f1E7182946a6fcd7Df42BcE5dC450AEaD341D3C |
Base Sepolia | 0xB813Aad98740bE471bB1a0B524cD9198deF58d13 |
Base Mainnet | 0xE6Bf6a30D18E1D5710ed63d2F5e98A71e135A51e |
Functions
initialize
function initialize(struct StorageInstance app_) external
transfer
function transfer(address from, address to, uint256 value) external
Dev note
Moves a value
amount of tokens from from
to to
.
This internal function is equivalent to {transfer}, and can be used to e.g. implement automatic token fees, slashing mechanisms, etc.
Emits a {Transfer} event.
NOTE: This function is not virtual, {_update} should be overridden instead.
update
function update(address from, address to, uint256 value) external
beforeTokenTransfer
function beforeTokenTransfer(address from, address to, uint256) public
afterTokenTransfer
Prevent gamesmanship by applying cooldown periods after unexecuted requests. After an expired request, the next one is given a cooldown period. But it would be easy to work around that by transfering shares to a fresh account to make a request with no penalty
So,
- Prevent transfering tokens "reserved" by an ongoing request
- If next request will receive a penalty, revert until best-case penalty would have finished
function afterTokenTransfer(address from, address to, uint256 amount) public
deposit
Deposit amount
collateral to user
, calling ERC-2612 permit()
using the attached signature
and deadline. See EIP-4626.
function deposit(
uint256 amount,
address user,
uint256 deadline,
struct IVaultDomain.Signature signature,
Shares minShares
) public returns (
Shares shares
)
Parameters
Name | Type | Description |
---|---|---|
amount | uint256 | Collateral to deposit from msg.sender |
user | address | Address credited with the deposit |
deadline | uint256 | deadline for permit |
signature | struct IVaultDomain.Signature | permit entitling DomFiVault to amount collateral |
minShares | Shares | Slippage control. Ignored if zero. If nonzero, revert if a deposit yields less than minShares |
Return Values
Name | Type | Description |
---|---|---|
shares | Shares | dfUSDC amount sent to user in exchange for this collateral |