Mint or Deposit newUSD

Description

Users can obtain newUSD tokens by depositing AUSD into the vault. The vault operates at a 1:1 conversion rate between AUSD and newUSD.

Flow of Funds

  • User approves the newUSD contract to spend their AUSD
  • User calls deposit() or mint()
    • deposit(assets, receiver) - Specify exact AUSD amount to deposit. The vault calculates and mints the corresponding newUSD.
    • mint(newUsd, receiver) - Specify exact newUSD you want to receive. The vault calculates and charges the corresponding AUSD amount
  • Remaining AUSD is transferred to vault
  • Equivalent amount of newUSD is minted to user

Examples

Functions

1// Deposit exact amount of AUSD, receive newUSD
2function deposit(uint256 assets, address receiver) returns (uint256 newUsd);
3
4// Mint exact amount of newUSD, pay required AUSD
5function mint(uint256 newUsd, address receiver) returns (uint256 assets);
6
7// Check maximum AUSD you can deposit
8function maxDeposit(address owner) returns (uint256);
9
10// Calculate newUSD received for AUSD amount
11function previewDeposit(uint256 assets) returns (uint256);