Delta.sol

Delta.sol extends ERC4626 with overrides listed below.

Public Methods

totalAssets

function totalAssets() public view returns (uint256)

Returns the total amount of thUSD held in the vault.

getUnvestedAmount

function getUnvestedAmount() public view returns (uint256)

Returns the current amount of unvested rewards.

getUserEscrow

function getUserEscrow(address user) public view returns (uint256, uint256)

Returns the escrowed amount and end time for a user.

Name
Type
Description

user

address

User to query escrow for

beginEscrowAssets

function beginEscrowAssets(uint256 assets, address receiver, address owner) external

Initiates escrow based on asset amount.

Name
Type
Description

assets

uint256

thUSD amount to escrow

receiver

address

Who will receive thUSD after escrow

owner

address

Owner of the assets

beginEscrowShares

function beginEscrowShares(uint256 shares, address receiver, address owner) external

Initiates escrow based on DELTA share amount.

Name
Type
Description

shares

uint256

Share amount to escrow

receiver

address

Who will receive thUSD after escrow

owner

address

Owner of the shares

endEscrow

function endEscrow(address receiver) external

Completes the escrow and sends thUSD to the receiver. This method reverts if the escrow duration has not elapsed.

Name
Type
Description

receiver

address

Recipient of thUSD

withdraw

function withdraw(uint256 assets, address receiver, address owner) public returns (uint256)

Overrides ERC4626 withdrawal with escrow logic.

Name
Type
Description

assets

uint256

thUSD amount to withdraw

receiver

address

Who will receive thUSD (via escrow)

owner

address

Owner of the DELTA shares

redeem

function redeem(uint256 shares, address receiver, address owner) public returns (uint256)

Overrides ERC4626 redeem with escrow logic.

Name
Type
Description

shares

uint256

DELTA shares to redeem

receiver

address

Who will receive thUSD (via escrow)

owner

address

Owner of the shares

Permissioned Methods

These methods can only be called by users with the REWARDED_ROLE.

sendRewards

function sendRewards(uint256 amount) external

Adds new rewards to the vault for vesting.

Name
Type
Description

amount

uint256

thUSD amount to vest

Admin Methods

setEscrowDuration

function setEscrowDuration(uint256 duration) external

Sets the global escrow duration.

Name
Type
Description

duration

uint256

Escrow time in seconds

setRewardsVestingDuration

function setRewardsVestingDuration(uint256 duration) external

Sets the duration for reward vesting.

Name
Type
Description

duration

uint256

Vesting time in seconds

Last updated