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 attestationfunction tridentSpend(bytes calldata attestation, bytes calldata signature) external;
// Read-onlyfunction isTokenSupported(address token) external view returns (bool);function DOMAIN() external view returns (uint32);tridentSpend Flow
Section titled “tridentSpend Flow”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:
- Verify attestation signature and signer authority
- Check domain, expiry, and replay protection
- If
usdcMinted > 0: mint USDC via Circle Gateway - Supply minted USDC to Aave V3 as collateral
- Borrow the requested token from Aave V3
- Transfer the borrowed token to the recipient
- If any step fails, the entire transaction reverts