AsseteraExchange
The on-chain exchange contract behind Assetera trading: a UUPS-upgradeable, gasless, compliance-gated order and offer book.
AsseteraExchange is the Solidity smart contract that settles trading on Assetera. It holds an order book and a targeted-offer (negotiation) book, escrows the tokens users trade, and gates every state change behind an off-chain compliance attestation. It is the on-chain record of what was traded, by whom, and under which terms.
This section documents the contract for integrators: the two lifecycles, the event catalog you index against, and the EIP-712 attestation model that authorizes each action.
What it is
| Property | What it means for you |
|---|---|
| UUPS-upgradeable (ERC-1967) | Logic lives in an implementation behind a single proxy. Always index and interact with the proxy address. Confirm the live implementation via the eip1967.proxy.implementation storage slot. |
| Gasless (ERC-2771 meta-tx) | Users pay no gas and hold no native tokens. Calls are relayed through a trusted Forwarder; the contract resolves the real actor with _msgSender(). Read identity from the address in each event (maker, taker, account, by, proposedBy), never from tx.from. See Events. |
| Compliance-gated | Every state-changing call carries a single-use, deadline-bound EIP-712 KYC attestation signed off-chain. Fee terms travel in a separate fee attestation. See Attestations. |
Roles
The contract uses OpenZeppelin AccessControl. The roles an integrator should know about:
| Role | Purpose |
|---|---|
DEFAULT_ADMIN_ROLE | Governance: upgrades, pause/unpause, compliance toggles, fee-collector allowlist, and the emergency cancelOrderForUser / cancelOfferForUser exits. Held by a Safe multisig in production. |
KYC_OPERATOR_ROLE | The operator key whose EIP-712 signature authorizes each KYC-gated action. |
FEE_OPERATOR_ROLE | The operator key whose EIP-712 signature sets the fee terms snapshotted onto an order or offer. |
Roadmap: FEE_OPERATOR_ROLE and the decoupled fee attestation are not yet shipped; fees are
moving out of the KYC attestation into a separately-signed fee attestation. The current testnet
contract (v3.1.0) still carries fee fields inside the KYC attestation. See
Attestations for both the current and target model.
Where it runs
The current testnet deployment is on Polygon Amoy (chain ID 80002):
| Network | Chain ID | Proxy address |
|---|---|---|
| Polygon Amoy (testnet) | 80002 | 0x8B75B0c5Dc41Fca81c87Af0cbBA9Cf764aFE8616 |
The ABI and deployed addresses are published with each deployment; resolve them from the published artifacts rather than hardcoding a function set.
This is a testnet address. Production will be a fresh deploy (a brand-new proxy governed
by a Safe multisig), not an in-place upgrade of the testnet proxy. Storage layout, structs, and the
action enum are being redesigned for the production baseline (targeting version() 4.0.0), so
the production ABI and typehashes will differ. Re-point every off-chain consumer at the new
address when it lands.
Where to go next
Order lifecycle
place → fill → settle, plus cancel and expiry, and what each step escrows.
Offer lifecycle
The regulator-mandated targeted offer / counter-offer negotiation flow.
Events
The event catalog you index against, with the meta-tx actor model.
Attestations
The EIP-712 KYC and fee attestation model that authorizes each action.
Real-time (SSE)
The planned real-time subscription service. Integrators subscribe over Server-Sent Events (SSE) to live updates such as order and trade updates and notifications. Planned.
Order lifecycle
The AsseteraExchange order state machine (place, fill, settle, cancel and expire), and what each step escrows and attests.