Contract interface & permissions
All entry points are on the ConfidentialSwap proxy (public surface =
IConfidentialSwap). Lifecycle calls revert while the protocol is paused.
Take the current address and ABI from Addresses; don't
hard-code an address that may have been redeployed.
Roles
DEFAULT_ADMIN_ROLE: curates pairs and fees, manages the market-maker and pauser sets, sets the analytics interval, unpauses, and authorizes upgrades.MARKET_MAKER_ROLE: may quote and settle. Granted/revoked by the admin; every change redeploys the decryption context.PAUSER_ROLE: may pause trading (the admin unpauses).- Compliance address: granted decryption rights over intent / quote / settlement data for oversight (an address, not a callable role).
Functions
| Function | Who can call | When |
|---|---|---|
createIntent(InputIntent, inputProof) | anyone | not paused |
quoteIntent(intentId, eAmountOutQuoted, inputProof) | MARKET_MAKER_ROLE | block ≤ quotingEndsAtBlock |
resolveQuoting(intentId) | anyone | block > quotingEndsAtBlock, once |
settleIntent(intentId) | MARKET_MAKER_ROLE (winner only) | block ≤ settlementEndsAtBlock |
reclaimExpiredIntent(intentId) | anyone | once the intent is unfilled |
getIntent(intentId) / numberOfIntents() | view | anytime |
computePairId / isActivePair / getPair | view | anytime |
addPair / activatePair / deactivatePair / setPairFee / setFeeRecipient / collectProtocolFees | DEFAULT_ADMIN_ROLE | anytime |
pause() | PAUSER_ROLE | anytime |
unpause() / setRevealInterval(seconds) | DEFAULT_ADMIN_ROLE | anytime |
revealAnalytics(asset) | anyone | once per interval |
upgradeToAndCall(impl, data) | DEFAULT_ADMIN_ROLE | anytime |
Errors
Worth handling: ConfidentialSwap__ExpiredIntent (quoted late),
ConfidentialSwap__QuotingNotEnded (resolved/settled early),
ConfidentialSwap__NoQuoteSubmitted, ConfidentialSwap__IntentAlreadyResolved,
ConfidentialSwap__SettlementPeriodExpired,
ConfidentialSwap__ConfidentialBalanceNotInitialized,
ERC7984UnauthorizedSpender.