Integration Guide
Minting USD+
To mint USD+, a deposit or mint can be performed on the USD+ Minter Contract as seen below:
/// @notice calculate USD+ amount to mint for payment
/// @param paymentToken payment token
/// @param paymentTokenAmount amount of payment token
function previewDeposit(IERC20 paymentToken, uint256 paymentTokenAmount)
external
view
returns (uint256 usdPlusAmount);
/// @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);/// @notice calculate the payment token amount to spend to mint USD+
/// @param paymentToken payment token
/// @param usdPlusAmount amount of USD+ to mint
function previewMint(IERC20 paymentToken, uint256 usdPlusAmount)
external view
returns (uint256 paymentTokenAmount);
/// @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+, a requestRedeem or requestWithdrawcan be performed on the USD+ Redeem Contract as seen below:
/// @notice calculate payment token amount received for burning USD+
/// @param paymentToken payment token
/// @param usdplusAmount amount of USD+ to burn
function previewRedeem(IERC20 paymentToken, uint256 usdplusAmount)
external
view
returns (uint256 paymentTokenAmount);
/// @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);/// @notice calculate payment token amount received for burning USD+
/// @param paymentToken payment token
/// @param paymentTokenAmount amount of payment token
function previewWithdraw(IERC20 paymentToken, uint256 paymentTokenAmount)
external
view
returns (uint256 usdplusAmount);
/// @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);Either of the two methods above will create a redemption request that may take 0-3 days depending on the size of the redemption made.
Updated 8 days ago