Assetera Docs
Smart contracts

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

PropertyWhat 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-gatedEvery 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:

RolePurpose
DEFAULT_ADMIN_ROLEGovernance: upgrades, pause/unpause, compliance toggles, fee-collector allowlist, and the emergency cancelOrderForUser / cancelOfferForUser exits. Held by a Safe multisig in production.
KYC_OPERATOR_ROLEThe operator key whose EIP-712 signature authorizes each KYC-gated action.
FEE_OPERATOR_ROLEThe 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):

NetworkChain IDProxy address
Polygon Amoy (testnet)800020x8B75B0c5Dc41Fca81c87Af0cbBA9Cf764aFE8616

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

On this page