Minting and Burning
Minting USD+
To mint USD+, deposit an accepted stablecoin payment token (USDC) into the UsdPlusMinter
contract using one of the methods below. USD+ is always treated as equal to 1 USD. Currently USDC is accepted at 1-to-1 exchange rate for USD+.
There are two methods available for minting USD+. USD+ is minted immediately within these calls.
In addition, there are preview methods for each of these two calls for estimating the resulting value before attempting.
Deposit
deposit
specifies the amount of payment token to deposit in exchange for USD+.
/// @notice mint USD+ for payment
/// @param paymentToken payment token
/// @param paymentTokenAmount amount of payment token to spend
/// @param receiver recipient
/// @return usdPlusAmount amount of USD+ minted
function deposit(IERC20 paymentToken, uint256 paymentTokenAmount, address receiver)
external
returns (uint256 usdPlusAmount);
Mint
mint
specifies the amount of USD+ to mint and will pull the needed amount of payment token.
/// @notice mint USD+ for payment
/// @param paymentToken payment token
/// @param usdPlusAmount amount of USD+ to mint
/// @param receiver recipient
/// @return paymentTokenAmount amount of payment token spent
function mint(IERC20 paymentToken, uint256 usdPlusAmount, address receiver)
external
returns (uint256 paymentTokenAmount);
Redeeming USD+
To redeem USD+ for an approved payment token, submit a redemption request to the UsdPlusRedeemer
contract. When the request is created, USD+ will be pulled from your account and escrowed on the UsdPlusRedeemer
contract until the request is filled or cancelled. USD+ is always treated as equal to 1 USD. Currently USDC is accepted at 1-to-1 exchange rate for USD+.
Your request may take from 0 to 3 days to complete depending on the size and available liquidity. When the request is submitted, the exchange rate is locked. When the request is filled, it will use the amounts created at request time.
There are two methods available for redeeming USD+. They return a ticket number that can be used to check the status of the request.
In addition, there are preview methods for each of these two calls for estimating the resulting value before attempting.
Request Redeem
requestRedeem
specifies the amount of USD+ to burn for payment token.
/// @notice create a request to burn USD+ for payment
/// @param paymentToken payment token
/// @param usdplusAmount amount of USD+ to burn
/// @param receiver recipient
/// @param owner USD+ owner
/// @return ticket request ticket number
/// @dev exchange rate fixed at time of request creation
function requestRedeem(IERC20 paymentToken, uint256 usdplusAmount, address receiver, address owner)
external
returns (uint256 ticket);
Request Withdraw
requestWithdraw
specifies the amount of payment token to receive and will pull and burn the needed amount of USD+.
/// @notice create a request to burn USD+ for payment
/// @param paymentToken payment token
/// @param paymentTokenAmount amount of payment token
/// @param receiver recipient
/// @param owner USD+ owner
/// @return ticket request ticket number
/// @dev exchange rate fixed at time of request creation
function requestWithdraw(IERC20 paymentToken, uint256 paymentTokenAmount, address receiver, address owner)
external
returns (uint256 ticket);
Redemption Request Info
Redemption requests are stored as Request
structs with the following information.
struct Request {
address owner;
address receiver;
IERC20 paymentToken;
uint256 paymentTokenAmount;
uint256 usdplusAmount;
}
This information can be queried at any time for a specific ticket number.
/// @notice get request info
/// @param ticket request ticket number
function requests(uint256 ticket) external view returns (Request memory);
Updated 2 months ago