Skip to content

v2 · Feature 5 — Changing Collection Authors - #5

Closed
robrigo wants to merge 2 commits into
mainfrom
feat/v2-5-collection-authors
Closed

v2 · Feature 5 — Changing Collection Authors#5
robrigo wants to merge 2 commits into
mainfrom
feat/v2-5-collection-authors

Conversation

@robrigo

@robrigo robrigo commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Enables collection author reassignment (authorswaps).


Mirrored into the canonical atomicassets org for the AtomicAssets v2 release + audit.
Original: wax-office-of-inspector-general/atomicassets-contract#6

⚠️ Hold — do not merge to master yet. Kept on a feature branch to avoid prod integration risk; pending the comprehensive v2 audit.

@robrigo
robrigo marked this pull request as ready for review June 2, 2026 20:49
@robrigo
robrigo requested a review from Copilot June 2, 2026 20:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an “author swap” flow to allow reassigning a collection’s author via an on-chain offer/accept/reject mechanism, with timing constraints intended to differ based on whether the swap was created using owner vs active authorization.

Changes:

  • Introduces createauswap, acceptauswap, and rejectauswap actions to manage collection author swap offers.
  • Adds a new authorswaps multi_index table to persist pending swap offers and an AUTHOR_SWAP_TIME_DELTA timing constant.
  • Implements time-gated acceptance and an expiry window for swaps.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
src/atomicassets.cpp Implements create/accept/reject action logic for author swap offers, including auth + time checks and collection author update.
include/atomicassets.hpp Declares new actions, adds the authorswaps table, and introduces AUTHOR_SWAP_TIME_DELTA.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/atomicassets.cpp
Comment on lines +349 to +350
check(authorswaps.find(collection_name.value) == authorswaps.end(),
"Can't swap author's while an authorswap is underway for this collection");
Comment thread src/atomicassets.cpp
Comment on lines +340 to +348
auto collection_itr = collections.require_find(collection_name.value,
"No collection with this name exists");

if (owner){
require_auth(permission_level{collection_itr->author, name("owner")});
} else {
require_auth(collection_itr->author);
}

Comment thread src/atomicassets.cpp
Comment on lines +381 to +385
uint32_t now = eosio::current_time_point().sec_since_epoch();

check (now > author_swaps_itr->acceptance_date,
("[ " + to_string(author_swaps_itr->acceptance_date - now) + " ] seconds remaining until this author swap can be accepted").c_str());

Comment thread src/atomicassets.cpp
Comment on lines +360 to +364
/**
* Accepts an author swap, with time constraints based on 'owner' or 'active' permissions used when creating the author swap
* With default parameters, author swaps created by 'active' permissions can only be accepted after 1 week has passed
* With default parameters, author swaps remain valid for up to 3 weeks
*/
Comment thread include/atomicassets.hpp


static constexpr double MAX_MARKET_FEE = 0.15;
static constexpr uint32_t AUTHOR_SWAP_TIME_DELTA = 60 * 60 * 24 * 7; // 1 week, valid for 1 week
@robrigo

robrigo commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #9, which is merged. This feature is on main: createauswap, acceptauswap and rejectauswap are declared in include/atomicassets.hpp and back the authorswaps table, shipped in v2.0.0-rc4 and rc5. rc5 additionally fixes the acceptance boundary so a swap is acceptable on its acceptance_date rather than a second later. The integration branch carried the feature under its own commits rather than these, so this PR could not close automatically. Branch kept for history.

@robrigo robrigo closed this Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants