Skip to content

Initialization

constructor()
ERC721(DUTCH_AUCTION_COLLECTION_NAME, DUTCH_AUCTION_COLLECTION_SYMBOL)
{}
public entry fun initialize(creator: &signer) {
assert!(signer::address_of(creator) == @dutch_auction_address, error::permission_denied(ENOT_OWNER));
let description = string::utf8(DUTCH_AUCTION_COLLECTION_DESCRIPTION);
let name = string::utf8(DUTCH_AUCTION_COLLECTION_NAME);
let uri = string::utf8(DUTCH_AUCTION_COLLECTION_URI);
collection::create_unlimited_collection(
creator,
description,
name,
option::none(),
uri,
);
}

The initialize function creates the collection object that later token objects will belong to. The publisher calls it in a separate transaction after publishing the package; add a once-guard for production modules (see Modules on Aptos). Compared with Solidity, initialization is still a one-time setup step, but the output is an on-chain object structure rather than an inherited ERC-721 contract state machine.