Reference › Contract reference
This page is generated automatically from /developers/contracts.json — it covers only the public interface integrators need.
Full source code (including the Owner's admin functions) is verified on the explorer; admin permissions are summarized in
Trust model. Revert codes: Limits & error codes.
Compiler: Solidity 0.8.28, optimizer 200 runs (482120-side contracts). Bridge routers: @hyperlane-xyz/core 12.1.0.
USDw
Address 0x3b5BD179CA6Aab4DAF0f842829776843ABe6e727 · chain 482120 · 18 decimals
USDw — functions
function name() view returns (string)
function symbol() view returns (string)
function decimals() view returns (uint8)
function totalSupply() view returns (uint256)
function balanceOf(address) view returns (uint256)
function allowance(address,address) view returns (uint256)
function approve(address spender, uint256 amount) returns (bool)
function transfer(address to, uint256 amount) returns (bool)
USDw — events
event Transfer(address indexed from, address indexed to, uint256 value)
OracleAMM
Address 0xd953d53414a81eb6AC5a4edE73d13992181aF51E · chain 482120
BTCw <-> USDw at the oracle price +/- spreadBps (30 = 0.3%). maxTradeBtcw per order; stops when the oracle is older than maxAgeSec.
OracleAMM — functions
function quoteSellBtcw(uint256 btcwIn) view returns (uint256 usdOut)
function quoteBuyBtcw(uint256 usdIn) view returns (uint256 btcwOut)
function sellBtcw(uint256 minUsdOut) payable returns (uint256 usdOut)
function buyBtcw(uint256 usdIn, uint256 minBtcwOut) returns (uint256 btcwOut)
function midPrice() view returns (uint256 priceWad, uint256 updatedAt)
function spreadBps() view returns (uint256)
function maxTradeBtcw() view returns (uint256)
function btcwReserve() view returns (uint256)
function usdReserve() view returns (uint256)
function paused() view returns (bool)
OracleAMM — events
event Swap(address indexed trader, bool btcwIn, uint256 amountIn, uint256 amountOut, uint256 priceWad)
OracleTokenAMM_ETHw
Address 0xFd6d78A3b60175D37146793396A2FA7864039D54 · chain 482120
ETHw <-> USDw at the PriceHub price of ETHw +/- spreadBps (30 = 0.3%). maxTradeToken 300 ETHw per order; stops when the price is older than maxAgeSec (300). buyToken/sellToken can pay another recipient. Bridge destination for ETHw (deposit USDC/USD₮0 -> USDw -> ETHw).
OracleTokenAMM_ETHw — functions
function quoteBuyToken(uint256 usdIn) view returns (uint256 tokenOut)
function quoteSellToken(uint256 tokenIn) view returns (uint256 usdOut)
function buyToken(uint256 usdIn, uint256 minTokenOut, address to) returns (uint256 tokenOut)
function sellToken(uint256 tokenIn, uint256 minUsdOut, address to) returns (uint256 usdOut)
function midPrice() view returns (uint256 priceWad, uint256 updatedAt)
function token() view returns (address)
function usd() view returns (address)
function hub() view returns (address)
function tokenReserve() view returns (uint256)
function usdReserve() view returns (uint256)
function spreadBps() view returns (uint256)
function maxAgeSec() view returns (uint256)
function maxTradeToken() view returns (uint256)
function paused() view returns (bool)
OracleTokenAMM_ETHw — events
event Swap(address indexed trader, address indexed to, bool tokenIn, uint256 amountIn, uint256 amountOut, uint256 priceWad)
OracleTokenAMM_ETHw — errors
error ContractPaused()
error ZeroAmount()
error ZeroAddress()
error StalePrice(uint256 updatedAt)
error InvalidOraclePrice()
error ExceedsMaxTrade(uint256 cap, uint256 amount)
error InsufficientLiquidity(uint256 available, uint256 required)
error SlippageExceeded(uint256 amountOut, uint256 minAmountOut)
SwapRouter
Address 0x397E607eA05eF7909f84540077F3a716778031E4 · chain 482120
Ownerless router: chains up to MAX_HOPS (4) hops across venue 0 ClpPools, venue 1 OracleAMM (BTCw <-> USDw), venue 2 token AMMs (ETHw kho) in one transaction. BTCw in: send msg.value = amountIn; token in: approve the router (it only pulls from msg.sender). quote() does not check caps, reserves or pause.
SwapRouter — functions
function swap(address tokenIn, uint256 amountIn, (uint8 venue, address tokenOut)[] hops, uint256 minOut, address to, uint256 deadline) payable returns (uint256 amountOut)
function quote(address tokenIn, uint256 amountIn, (uint8 venue, address tokenOut)[] hops) view returns (uint256 amountOut)
function tokenAmmCount() view returns (uint256)
function tokenAmmAt(uint256 index) view returns (address amm, address token)
function clp() view returns (address)
function oracleAmm() view returns (address)
function usdw() view returns (address)
function NATIVE() view returns (address)
function MAX_HOPS() view returns (uint256)
SwapRouter — events
event Routed(address indexed sender, address indexed tokenIn, address indexed tokenOut, uint256 amountIn, uint256 amountOut, address to, uint256 hops)
SwapRouter — errors
error Expired(uint256 deadline)
error InvalidRecipient()
error InvalidPath()
error UnknownVenue(uint8 venue)
error UnsupportedHop(uint8 venue, address tokenIn, address tokenOut)
error ValueMismatch(uint256 sent, uint256 expected)
error SlippageExceeded(uint256 amountOut, uint256 minAmountOut)
error ZeroAmount()
error ZeroAddress()
error UnexpectedSender()
error NativeTransferFailed()
ClpPools
Address 0x557aDc3d900c471F3907cdDA3a9F5377d6F9E7e0 · chain 482120
201 continuous-liquidity pools (USDw, 100 crypto trackers, 100 US stock trackers), every pool paired with native BTCw (THORChain-style CLP). Fee floor minFeeBps (5).
ClpPools — functions
function swapBtcwForAsset(address token, uint256 minOut, address to) payable returns (uint256)
function swapAssetForBtcw(address token, uint256 amountIn, uint256 minOut, address to) returns (uint256)
function swapAssetForAsset(address tokenIn, address tokenOut, uint256 amountIn, uint256 minOut, address to) returns (uint256)
function quoteBtcwForAsset(address token, uint256 btcwIn) view returns (uint256 out, uint256 fee)
function quoteAssetForBtcw(address token, uint256 amountIn) view returns (uint256 out, uint256 fee)
function priceInBtcw(address token) view returns (uint256)
function poolCount() view returns (uint256)
function poolTokenAt(uint256 index) view returns (address)
function pools(address token) view returns (uint256 btcwDepth, uint256 assetDepth, uint256 totalUnits, bool exists, bool enabled)
function minFeeBps() view returns (uint256)
function paused() view returns (bool)
ClpPools — events
event Swap(address indexed trader, address indexed token, bool btcwIn, uint256 amountIn, uint256 amountOut, uint256 fee, address to)
BtcwPriceFeed
Address 0x6E0687A5D5a5b98CC5fb05c4d8d742fBD75ba96c · chain 482120 · 8 decimals
BTC/USD, Chainlink AggregatorV3Interface. Internal oracle (median of external sources).
BtcwPriceFeed — functions
function latestRoundData() view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
function latestAnswer() view returns (int256)
function decimals() view returns (uint8)
PriceHub
Address 0xE87FDdCC0b668564a20B23F3bE1EE108C805ecb4 · chain 482120 · 18 decimals
USD reference price of the 200 tracker tokens: 100 crypto, 100 US stocks (internal oracle).
PriceHub — functions
function latestRoundData(address asset) view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)
function prices(address[] assets) view returns (int256[] answers, uint256[] updatedAts)
function decimals() view returns (uint8)
Bridge router (GuardedCollateralRouter)
USDC: Arbitrum 0x10B5757aC9a40E3467846e35749ae30b00ef0182 ⇄ 482120 0x10EDFF80C17A39940a4dc724b9c24fE9D2E8Fd9b
USD₮0: Arbitrum 0x984fDC24D1A2Be538C7290487d0fc212635D98A5 ⇄ 482120 0xD6d8452FdCC26B155BEc4fc878635c05CaC95FB1
Arbitrum USDC / USD₮0 (6 decimals) are locked in the Arbitrum router; the 482120 router releases USDw (18 decimals) from its reserve, and back. Amount leaving an end is bounded by what is locked there. On 482120 amounts must be a multiple of granularity (1e12). No interchain gas payment: call transferRemote with msg.value = 0. Recipient is bytes32, address LEFT-padded with zeros. Delivery usually 10-30 s. Read allowlistEnabled(): when true only allowlisted wallets can send.
Bridge router (GuardedCollateralRouter) — functions
function transferRemote(uint32 destination, bytes32 recipient, uint256 amount) payable returns (bytes32 messageId)
function wrappedToken() view returns (address)
function granularity() view returns (uint256)
function allowlistEnabled() view returns (bool)
function isAllowed(address) view returns (bool)
function paused() view returns (bool)
function routers(uint32 domain) view returns (bytes32)
function mailbox() view returns (address)
Bridge router (GuardedCollateralRouter) — events
event SentTransferRemote(uint32 indexed destination, bytes32 indexed recipient, uint256 amountOrId)
event ReceivedTransferRemote(uint32 indexed origin, bytes32 indexed recipient, uint256 amountOrId)
Bridge router (GuardedCollateralRouter) — errors
error NotAllowed(address account)
error Paused()
error BadGranularity(uint256 amount, uint256 granularity)