USR

Minting USR Tokens

  1. Request Minting:

    • Method: requestMint(address _depositTokenAddress, uint256 _amount, uint256 _minMintAmount)

    • Parameters:

      • _depositTokenAddress: The address of the token you want to exchange for USR. Supported tokens: USDC and USDT.

      • _amount: The amount of the depositing token.

      • _minMintAmount: The minimum amount of USR tokens you want to receive. If this amount is higher than the executable amount, the request will not be handled and will remain in the CREATED status.

  2. Mint Event:

    • After the backend (BE) receives the mint request, it processes the mint through the completeMint method.

    • This method emits a MintRequestCompleted event, indicating that the minting of USR tokens is done.

    • USR is minted using oracle price of USDC or USDT tokens against USD (Pyth).

    • The minting process takes approximately 1 minute (typically 1 - 5 blocks).

  3. Canceling a Mint Request:

    • Method: cancelMint(uint256 id)

    • A mint request can be canceled if it is not in the COMPLETED state.

    • The current state of the request can be queried using the mintRequests(uint256 id) method.

Burning USR Tokens

  1. Request Burning:

    • Method: requestBurn(uint256 _issueTokenAmount, address _withdrawalTokenAddress, uint256 _minWithdrawalAmount)

    • Parameters:

      • _issueTokenAmount: The amount of USR tokens to burn.

      • _withdrawalTokenAddress: The address of the token you want to receive after burning. Supported tokens: USDC and USDT.

      • _minWithdrawalAmount: The minimum amount of tokens you want to receive. If this amount is higher than the executable amount, the request will not be handled and will remain in the CREATED status.

  2. Burn Event:

    • Upon receiving the burn request, the backend processes the burn through the completeBurn method.

    • Value of tokens distributed at completion of the burn request is based on Pyth oracle price.

    • This method emits a BurnRequestCompleted event, indicating that the burning of USR tokens is done.

    • The process of burning USR tokens takes up to 24 hours.

  3. Canceling a Burn Request:

    • Method: cancelBurn(uint256 id)

    • A burn request can be canceled if it is not in the COMPLETED state.

    • The current state of the request can be queried using the burnRequests(uint256 id) method.

Last updated