Skip to content

On-Chain Contract

The Trident contract on each chain exposes:

// Deposit tokens into Trident (requires prior ERC-20 approval)
function deposit(address token, uint256 amount) external;
// Execute a signed spend attestation
function tridentSpend(bytes calldata attestation, bytes calldata signature) external;
// Read-only
function isTokenSupported(address token) external view returns (bool);
function DOMAIN() external view returns (uint32);

The tridentSpend function validates the attestation (domain, expiry, caller, token support, replay protection), verifies the signer, then executes the mint-supply-borrow-transfer flow atomically:

  1. Verify attestation signature and signer authority
  2. Check domain, expiry, and replay protection
  3. If usdcMinted > 0: mint USDC via Circle Gateway
  4. Supply minted USDC to Aave V3 as collateral
  5. Borrow the requested token from Aave V3
  6. Transfer the borrowed token to the recipient
  7. If any step fails, the entire transaction reverts