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:
User deposits USDC: User calls
request_to_mint
function to deposit USDCMatrixdock server validation:
Validates that the
from
address's bound UID has passed KYC2Verifies USDC amount exceeds minimum threshold
Compares user-provided pre-price with system timestamp price
Validation outcome:
Failure: Matrixdock operator manually refunds USDC on-chain
Success: Proceeds to next step
Off-chain processing: USDC converted to USD, physical gold purchased and vaulted
Update mint budget: Operator calls
change_mint_budget
to ensure minted XAUm doesn't exceed stocked goldRequest mint: Operator calls
request_mint_to
Execute mint: After delay, operator calls
execute_mint_to
Mint completion: XAUm minted to Matrixdock's address, then transferred to user