AtomicAssets v2.0.0-rc4
Pre-releaseThe AtomicAssets v2 contract, release candidate 4. Built from feat/v2-integration with CDT 4.1.1. This describes the whole v2 feature set and supersedes rc1 through rc3.
v2 is a non-breaking, in-place upgrade of the v1 contract. Every existing table keeps its layout and every existing action keeps its signature, so v1 clients and indexers keep working. New capabilities live in new actions and new tables. Upgrading is a setcode (plus setabi on accounts still running v1); existing on-chain state is preserved and no migration action is needed.
Changes since rc3: custodial rentals descoped
Renting and dual ownership (Feature 300) has been removed from the v2 release train so the rest of v2 can ship without it (#27). The implementation is preserved on the archive/v2-custodial-rentals branch; whether and how rentals return has not been decided. The removal takes out:
- Actions:
move,logmove - Table:
holders
The ABI diff against rc3 is exactly these three entries. No other code changed, so everything below stands as reviewed and hardened in the earlier candidates.
Deployment order matters for chains that ran rc1 through rc3: any rows in holders must be cleared (each holder moves the assets back, or the owners burn them) before deploying rc4, because after the upgrade no action can erase them and the RAM they occupy is stranded. Both FACINGS testnets were verified empty before their rc4 deploys. Chains coming from v1 are unaffected.
What v2 adds
Mutable templates (Features 3 and 6). createtempl2 creates a template with mutable data and settempldata updates it (logsetdatatl logs the change). Mutable data lives in the new templates2 table alongside the original immutable templates row. Feature 6 covers the non-transferable / non-burnable rules for templates.
Delete unused templates (Feature 2). deltemplate removes a template that has no issued assets and cleans up its templates2 entry.
Reduce max supply (Feature 1). redtemplmax lowers a template's max_supply, never below the already-issued supply.
Schema media types (Feature 4). setschematyp records per-field media-type metadata for a schema in the new schematypes table.
Collection author succession (Feature 5). A two-step author handover: createauswap proposes a new author, and acceptauswap / rejectauswap complete or cancel it. Pending swaps live in the new authorswaps table; the collection's author changes only on acceptance.
Backed-asset deprecation (Feature 7). Deprecation handling on the deposit, withdraw, and back-asset path.
Contract-wide CPU optimizations (Feature 8). The hot collection-authorization checks (check_has_collection_auth, notify_collection_accounts) read only the bytes they need from the collection row via a low-level partial read, instead of loading the whole row (which can carry several KB of serialized data) into cache on every schema, template, and asset action.
Self-service RAM utilities. setrampayer and setlastpayer reassign an asset's RAM payer, with a logrampayer notification.
New actions
createtempl2, settempldata, logsetdatatl, deltemplate, redtemplmax, setschematyp, createauswap, acceptauswap, rejectauswap, setrampayer, setlastpayer, logrampayer. Existing v1 actions are unchanged. The final surface is 47 actions and 11 tables.
New tables
templates2, schematypes, authorswaps. Existing tables (assets, templates, schemas, collections, config, offers, balances, tokenconfigs) are unchanged.
Fixes carried from rc3
partial_read_collectionauth-path over-read (#12). The Feature 8 partial read deserializednotify_accountseven on the authorized-only path, overflowing its 330-byte buffer once a collection had more than ~38 combined authorized and notify accounts. That threwdatastream attempted to read past the endand brickedcreateschema,createtempl,setschematyp,settempldata, andextendschemafor that collection. The auth path now returns afterauthorized_accounts. Reproduced on jungle4 and covered by a VeRT regression test.createcol24-account cap (#23).addcolauthandaddnotifyacccap each account list at 24, butcreatecolwrote both lists with no size check, which could seed a collection past the read budget in one transaction.createcolnow enforces the same cap.
Build and verification
Built with cdt-cpp 4.1.1. The published ABI is the legacy-compat patched build: vector<uint8_t> fields render as uint8[] and pair fields keep their first/second key/value spellings, so integrations that read the ABI do not break. The VeRT suite is green (40 suites, 324 tests; the two rental suites were removed with the feature).
rc4 is deployed and verified on both FACINGS testnets: the on-chain code hash on the WAX testnet and jungle4 equals the atomicassets.wasm sha256 below, and get_abi on both chains confirms move, logmove, and holders are gone.
Artifacts
| asset | sha256 |
|---|---|
atomicassets.wasm |
86d59e12113442cfb89e84adae89471b6895d66b5c27db77e5cd420dce446316 |
atomicassets.abi |
b6389fdde10a16f2d94b12bb10a67b676f6449b1293b57cc0b18256652cfef68 |
Verify against the attached SHA256SUMS.
Deploying
Pinned by sha256 in the FACINGS monorepo chain-config and deployed via the contracts-deploy workflow using the atomicassets@deploy permission, which is linked to eosio::setcode and eosio::setabi. On an account still running v1 the deploy sends both setcode and setabi; on an account already on a v2 ABI, setabi is skipped as a no-op. Remember the holders cleanup ordering above when coming from an earlier v2 candidate. Pre-release, for testnet.
Credits
AtomicAssets is an open NFT standard created by Pink Network, with stewardship passing from Pink Network to Spielworks and then to FACINGS. The bulk of the v2 contract was authored by t-break (@on-a-t-break). The interface-header fix is from Aaron Cox (@aaroncox, Greymass). Full attribution is in AUTHORS.md.