Skip to main content

IGMTokenManager

The IGMTokenManager interface may be used by external parties to buy and sell Ondo Stocks using attestations. The general flow for each side is: Buying GM Tokens
  1. User gets a signed quote (off‑chain)
    • The attestation service prepares a Quote whose side is BUY, signs its EIP‑712 digest, and returns the quote and signature to the user
    • Price is expressed in USD with 18 decimals (e.g., $12.34 →12340000000000000000)
    • Quantity is the number of GM tokens the user wishes to receive
  2. User pre‑authorizes USDon or USDC/USDT
    • GMTokenManager must have a sufficient allowance of USDon, USDC (Ethereum) or USDT (BNB Chain) before the call
    • Allowance ≥ price × quantity
      🚧 Notes on USDon
      • USDon will be Ondo’s permissionless ERC20 stablecoin representing USD held in Ondo’s brokerage account (which buys equities/ETFs backing GM tokens). Users can convert stablecoins to USDon with zero slippage by specifying it as the deposit token below.
      • We accept USDC on Ethereum, and USDT on BNB Chain.
      • If you would like to convert stablecoins to USDon directly, outside of a GM token swap, reach out to us and we can provide instructions for our USDonConverter contract.
  3. User calls mintWithAttestation(quote, signature, depositToken, depositTokenAmount), which will atomically: Verify the quote
    • Re‑computes the EIP‑712 digest and verifies the signature against the attestation signer
    • Confirm that the caller is whitelisted and their stored userID matches the one received in the quote
    • Ensures the attestationId has not been used and that block.timestamp ≤ expiration
    • Confirms side == BUY
    • Ensure the value of the transaction is greater than minimumDepositUSD but does not exceed per-user and per-token rate limits
    Settle the tokens
    • If the depositToken specified is not USDon, first swap depositTokenAmount for USDon
    • Burns price × quantity of USDon (either after receiving from msg.sender or swapping)
    • Mints quantity of GM tokens to msg.sender
    • Refund USDon to the user if any is leftover
    Post‑process the quote
    • Marks attestationId as consumed to prevent replay
    Return the tokens received
    • receivedGmTokenAmount equals quantity
Selling GM Tokens
  1. User gets a signed quote (off‑chain)
    • Attestation service issues a Quote whose side is SELL, signs it, and returns quote and signature
    • Price still uses 18‑decimal USD format
    • Quantity is the GM amount the user will sell
  2. User pre‑authorizes GM tokens
    • GMTokenManager must have allowance ≥ quantity of the specific GM token (asset) described in the quote
  3. User calls redeemWithAttestation(quote, signature, receiveToken, minimumReceiveAmount), which will atomically: Verify the quote
    • Same as subscribe, but checks that side == SELL instead and that the transaction value is greater than minimumRedemptiUSDon
    Settle the tokens
    • Transfers quantity of GM tokens from user to manager and burns them
    • Mints out price × quantity of USDon to the GMTokenManager
    • If the caller specifies a non-USDon token as the receiveToken, it will swap all the USDon received for the receiveToken (note: the call will revert if the swap doesn’t result in >= minimumReceiveAmount being received)
    • All tokens received are transferred to the caller
    Post‑process the quote
    • Marks attestationId as used
    Return the tokens received
    • receivedUSDonAmount equals price × quantity

Functions

mintWithAttestation

Called by users to mint GM tokens with a quote attestation using either USDon, USDC on Ethereum, or USDT on Binance Smart Chain. If the deposit token is not USDon and the depositTokenAmount is not enough to swap for USDon
worth quantity * price as specified in the quote, the transaction will fail as the mintUSDonValue is passed in to the minimum RWA received field in subscribe.
Parameters Returns

redeemWithAttestation

Called by users to redeem GM tokens for USDon.
Parameters Returns

Structs

Quote

Quote struct that is signed by the attestation signer
Properties

Enums

QuoteSide

Enum for the side of the quote

Contract addresses

Contract addresses are available at the following page: GM smart contract addresses.