Assessment reports>XAUm>Discussion>Off-chain validation

Off-chain validation

Users can mint XAUm by calling the request_to_mint function. Several parameters require validation, including transferred_token and for_token matching, preprice, slippage, and timestamp values. However, the minter module does not perform these checks and only stores the transferred token and emits a MintRequest event.

public entry fun request_to_mint<T>(
    state: &State,
    transferred_token: &mut Coin<T>,
    for_token: address,
    amount: u64,
    preprice: u64,
    slippage: u64,
    timestamp: u64,
    clock: &Clock,
    ctx: &mut TxContext,
) {

This issue has been acknowledged by MatrixDock, and they have provided the following response:

Parameter validation is performed off-chain.

The XAUm minting process follows these steps:

  1. User deposits USDC: User calls request_to_mint function to deposit USDC

  2. Matrixdock server validation:

    • Validates that the from address's bound UID has passed KYC2

    • Verifies USDC amount exceeds minimum threshold

    • Compares user-provided pre-price with system timestamp price

  3. Validation outcome:

    • Failure: Matrixdock operator manually refunds USDC on-chain

    • Success: Proceeds to next step

  4. Off-chain processing: USDC converted to USD, physical gold purchased and vaulted

  5. Update mint budget: Operator calls change_mint_budget to ensure minted XAUm doesn't exceed stocked gold

  6. Request mint: Operator calls request_mint_to

  7. Execute mint: After delay, operator calls execute_mint_to

  8. Mint completion: XAUm minted to Matrixdock's address, then transferred to user

Zellic © 2025Back to top ↑