Collectibles V2 pack engine function reference
Every readable and writable function in AuroraCollectiblesPackEngineV2, with permissions, supply accounting and opening recovery.
In questa pagina
Choose the correct version and address
This reference covers AuroraCollectiblesPackEngineV2, 2.0.0-collectibles-beta.1. V3 is the current factory build in Aurora; available networks depend on enabled deployments. Existing V2 collections remain V2 and V1 has no sealed packs. A website update does not upgrade an existing contract.
Read packEngine() on the collection and use that engine address for these actions. The engine reads collection.owner() for owner permissions. Never send clone actions to an implementation address.
Reads need no wallet transaction. Writes require gas and the permission shown below. Prices and quantities are integers; times on chain are Unix seconds, with zero meaning no opening start or deadline. Use Aurora transaction preparation for proofs and signed fee authorization.
What is permanent
- Collection and engine implementations, factory, provider, identities, lifetime caps and pool definitions cannot be replaced. A token belongs to one on-chain pool, but can appear in several organizational sets.
- Closing a phase or collection minting is permanent. Issued pack contents stay reserved and can still be delivered; configured opening windows still apply to new requests. Ownership renunciation is disabled.
- Pack slot pools, duplicate policy and transferability are fixed. Boxes contain card slots, not nested boosters. Consuming a wrapper does not restore its lifetime issuance capacity.
- V2 token metadata and opening deadlines are fixed. There is no setTokenURI, metadata freeze, opening-start setter or combined allocation/delivery method in V2.
Supply, randomness and recovery
Lifetime minted + pooled + retired contents cannot exceed the token cap or configured collection cap. Wrapper supply is separate. Issuing a pack reserves its pool contents and provider capacity; only allocation identifies exact token IDs.
Openings progress through Requested, Seeded, Allocated and Opened. A request cannot be cancelled or rerolled. Allocation follows engine-wide request order; an earlier missing seed delays later allocation. Anyone may allocate the next seeded request, but only its original opener can choose the delivery recipient.
V2 allocate and deliver are separate transactions. Failed delivery preserves the allocated result for retry with a compatible recipient, while later requests can continue allocating.
Opening gas and provider requirements depend on the configured adapter. The user-paid OpenVRF path submits the fixed proof in the collector wallet; the Chainlink adapter depends on its configured subscription. The final card-flip ceremony shows already confirmed contents and sends no extra transaction.
Readable functions
allowlistLeafRead only · allowlist helper
Computes the double-hashed leaf binding chain, engine, phase, payer, allowance and individual price. Proofs and wallet limits apply to the paying wallet, including gifts.
- Funzione e argomenti
allowlistLeaf(bytes32 phaseId, address wallet, uint256 allowance, uint256 price)- Resi / pagamento
- bytes32
availableForSaleRead only · inventory bound
Returns remaining backed pack issuance capacity, or direct-item saleAvailable for content IDs. Does not apply phase timing, phase/wallet caps, allowlist proof or provider availability; use quote for purchase validation.
- Funzione e argomenti
availableForSale(uint256 id)- Resi / pagamento
- uint256 available
collectionRead only · collection binding
The paired ERC-1155 collection address. Its owner controls this engine; its balances hold both cards and sealed packs.
- Funzione e argomenti
collection()- Resi / pagamento
- address
factoryRead only · deployment binding
The immutable factory that created this implementation and initialized its clones.
- Funzione e argomenti
factory()- Resi / pagamento
- address
getOpeningRead only · recoverable opening
Returns opener, pack ID, request nonce, fixed seed, state and selected IDs. States: 0 None, 1 Requested, 2 Seeded, 3 Allocated, 4 Opened. Repeated IDs represent duplicate copies.
- Funzione e argomenti
getOpening(bytes32 requestId)- Resi / pagamento
- (address opener, uint256 packId, uint256 nonce, uint256 seed, uint8 state, uint256[] tokenIds)
getPackRead only · pack definition
Returns cap, lifetime issued, opening deadline, transferability, duplicate policy, existence and slot pools. V3 openingStartsAt is a separate getter.
- Funzione e argomenti
getPack(uint256 id)- Resi / pagamento
- (uint256 maxSupply, uint256 issued, uint64 openingDeadline, bool transferable, bool duplicatesAllowed, bool exists, uint256[] slotPools)
getPhaseRead only · sale configuration
Returns sale configuration, cumulative minted units, configuration version, existence and permanent closure. Its packId field can identify a sealed pack or a directly sold collectible.
- Funzione e argomenti
getPhase(bytes32 phaseId)- Resi / pagamento
- ((uint256 packId, uint64 startsAt, uint64 endsAt, uint256 unitPrice, uint256 supplyCap, uint256 walletCap, bytes32 allowlistRoot, address payoutRecipient, bool paused) config, uint256 minted, uint256 version, bool exists, bool closed)
getPoolRead only · pool inventory
Returns the draw model, remaining contents, committed contents, token entries and existence flag. Remaining weights describe the next draw, not a whole-pack probability.
- Funzione e argomenti
getPool(uint256 id)- Resi / pagamento
- uint8 model, uint256 remaining, uint256 committed, (uint256 tokenId, uint128 remaining, uint64 weight)[] entries, bool exists
mintFeeAuthorityRead only · immutable
Returns the immutable factory that validates public-mint fee authorizations. It does not have owner or withdrawal powers.
- Funzione e argomenti
mintFeeAuthority()- Resi / pagamento
- address
mintNonceRead only · replay protection
Payer-specific successful purchase nonce. A request must use its current value; another payer purchasing does not change it.
- Funzione e argomenti
mintNonce(address)- Resi / pagamento
- uint256
mintedByWalletRead only · payer allowance usage
Cumulative units bought by a paying wallet in a phase, including gifts sent to other recipients.
- Funzione e argomenti
mintedByWallet(bytes32, address)- Resi / pagamento
- uint256
nextAllocationNonceRead only · FIFO queue
The next sequence number eligible for allocation. An earlier request without a seed blocks later allocation.
- Funzione e argomenti
nextAllocationNonce()- Resi / pagamento
- uint256
nextOpeningNonceRead only · FIFO queue
The next request sequence number. Requests are ordered globally within this engine, across pack types.
- Funzione e argomenti
nextOpeningNonce()- Resi / pagamento
- uint256
openingAtRead only · opening lookup
Looks up a request ID by its engine sequence number.
- Funzione e argomenti
openingAt(uint256)- Resi / pagamento
- bytes32
quoteRead only · current-state estimate
Validates a proposed mint against current phase, version, supply, payer nonce and wallet rules and returns artwork unit and total prices. Another payer minting does not change this payer’s nonce. Does not include the platform fee or gas, reserve inventory, validate fee authorization, or guarantee a receiving contract accepts payment.
- Funzione e argomenti
quote((bytes32 phaseId, uint256 quantity, uint256 expectedVersion, uint256 nonce, uint256 maxUnitPrice, address recipient, uint256 allowance, uint256 allowlistPrice) request, address payer, bytes32[] proof)- Resi / pagamento
- uint256 price, uint256 totalPrice
randomnessProviderRead only · immutable provider
The immutable provider adapter used by this engine or factory. Changing Aurora configuration cannot replace it for existing engines.
- Funzione e argomenti
randomnessProvider()- Resi / pagamento
- address
tokenPoolRead only · pool membership
The permanent pool ID assigned to a content token. Releasing inventory does not clear this assignment; organizational sets are separate.
- Funzione e argomenti
tokenPool(uint256)- Resi / pagamento
- uint256
Writable functions
allocateAnyone · next seeded request only
Allocates the next Seeded request in FIFO order from remaining pool inventory, records exact contents and advances the allocation queue. Cannot choose a seed or recipient. Useful if an opener receiver rejects delivery.
- Funzione e argomenti
allocate(bytes32 requestId)- Resi / pagamento
- No return value
buyPackBuyer · payable, valid quote/proof/fee authorization required
Purchases 1–20 sealed packs or directly sold items, as selected by the phase. Exact native payment equals sale price plus signed platform fee. The recipient receives tokens; payer allowance and nonce are consumed. Failed payout or receiver callbacks revert the purchase.
- Funzione e argomenti
buyPack((bytes32 phaseId, uint256 quantity, uint256 expectedVersion, uint256 nonce, uint256 maxUnitPrice, address recipient, uint256 allowance, uint256 allowlistPrice) request, bytes32[] proof, uint256 fee, bytes authorization)- Resi / pagamento
- No return value · PAYABLE
closePhaseCollection owner · ONE WAY
Permanently closes one sale and increments its version. Does not cancel issued packs or close the entire collection.
- Funzione e argomenti
closePhase(bytes32 phaseId)- Resi / pagamento
- No return value
configurePackCollection owner · ONCE per pack ID
Creates a sealed wrapper with 1–20 pool slots, positive lifetime issuance cap, transferability and optional Unix-seconds opening deadline. Duplicate-free packs require distinct pools. Boxes use card slots, not nested packs.
- Funzione e argomenti
configurePack(uint256 packId, string tokenURI, uint256 maxSupply, bool transferable, uint64 openingDeadline, bool duplicatesAllowed, uint256[] slotPools)- Resi / pagamento
- No return value
configurePhaseCollection owner · repeatable before phase closure
Creates or edits a sale for a configured pack or direct item. Cannot change the token ID of an existing phase or reopen a closed phase. Requires a nonzero direct payout recipient; version increments invalidate old quotes.
- Funzione e argomenti
configurePhase(bytes32 phaseId, (uint256 packId, uint64 startsAt, uint64 endsAt, uint256 unitPrice, uint256 supplyCap, uint256 walletCap, bytes32 allowlistRoot, address payoutRecipient, bool paused) config)- Resi / pagamento
- No return value
configurePoolCollection owner · ONCE per pool ID
Creates an immutable pool with 1–128 entries. Model 0 draws among remaining copies; model 1 uses fixed positive weights for nonempty entries. Quantities fit uint128; weighted values fit uint64. Each token ID may belong to only one on-chain pool.
- Funzione e argomenti
configurePool(uint256 poolId, uint8 model, uint256[] tokenIds, uint256[] quantities, uint256[] weights)- Resi / pagamento
- No return value
deliverOriginal opener only
Delivers an Allocated opening to the original opener chosen nonzero recipient. Burns the wrapper only on successful delivery. Retry with the same contents or a compatible recipient after receiver failure.
- Funzione e argomenti
deliver(bytes32 requestId, address recipient)- Resi / pagamento
- No return value
fulfillRandomnessFixed randomness provider only
Saves the provider result only for a Requested opening. Zero is a valid seed. Does not allocate inventory or invoke token receivers.
- Funzione e argomenti
fulfillRandomness(bytes32 requestId, uint256 seed)- Resi / pagamento
- No return value
initializeFactory only · ONCE
Binds the clone to its collection or engine during factory deployment. A second initialization or direct implementation initialization is rejected.
- Funzione e argomenti
initialize(address collection_)- Resi / pagamento
- No return value
issuePackCollection owner · engine issuance
Issues 1–20 backed packs to a recipient, reserves pool contents and provider capacity, and mints sealed wrappers. Pack caps and expiry apply; no sale payment is collected.
- Funzione e argomenti
issuePack(uint256 packId, uint256 quantity, address recipient)- Resi / pagamento
- No return value
releasePoolCollection owner · retirement is irreversible
Releases only uncommitted surplus while no opening awaits allocation. retire=true permanently removes capacity; false makes it available for direct minting. Pool membership and commitments remain protected.
- Funzione e argomenti
releasePool(uint256 poolId, uint256 entryIndex, uint256 quantity, bool retire)- Resi / pagamento
- No return value
requestOpenPack holder · payable, one pack per request
Locks one held pack, records a permanent request in FIFO order and requests randomness from the fixed provider. Send the provider-required fee. Opening start/deadline rules apply. There is no cancel or reroll.
- Funzione e argomenti
requestOpen(uint256 packId)- Resi / pagamento
- bytes32 requestId · PAYABLE
Sale requests and gift recipients
PhaseConfig.packId may name either a sealed pack or a direct collectible. Prices exclude the signed platform fee and gas. A zero phase or wallet cap means no limit at that level; actual inventory and lifetime caps still apply. A nonzero payoutRecipient receives the sale price immediately.
MintRequest binds phaseId, quantity, expectedVersion, payer nonce, maxUnitPrice, recipient, allowance and allowlistPrice. Gifts send tokens to recipient while the payer signs, pays and consumes its own phase allowance. buyPack also serves direct-item phases.
A quote does not reserve stock or authorize payment. Phase edits, expiry, inventory consumption, provider availability and receiver acceptance can still prevent a purchase. Metadata URIs are references, not proof that externally hosted content will remain unchanged.