Docs

Marketplace is now an upgradeable, dynamic contract.

Krishang Nadgauda

We're excited to introduce upgradeable, dynamic contracts to the thirdweb community!

We've just published the latest, upgradeable version of the MarketplaceV3 smart contract. The upgradeable contract's available to deploy from published version 2.0.0 and onwards.

The MarketplaceV3 contract is written in the EIP-7504 dynamic contracts pattern. This means you can perform upgrades i.e. add/remove/edit the functionality of your Marketplace contract after it has been deployed.

Upgrades can only be performed by EXTENSION_ROLE holders. Only an EXTENSION_ROLE role holder can grant or revoke this role from others. Once this role is revoked from all holders, the contract becomes non-upgradeable.

ExtensionManager API (SDK)

You can perform upgrades to your marketplace via the ExtensionManger API.

A dynamic contract is a central 'router' that routes function calls to 'extensions', which are feature-specific implementation smart contracts. And so, upgrading a dynamic contract means adding and removing extensions from its router.

const marketplace = await sdk.getContract("0x123...");
const allExtensions = await marketplace.extensions.getAll();
console.log(allExtensions) // By default: Direct Listings, English Auctions, Offers.
// Add new the functionality of a published smart contract to your marketplace.
const tx_addExtension = await marketplace.extensions.addPublished({
extensionName: "DutchAuctions"
publisherAddress: "0x456..."
});
// Delete unwanted functionality from your marketplace.
const tx_removeExtension - await marketplace.extensions.remove({
extensionName: "Offers"
});

We're building the easiest API for performing smart contract upgrades, and look forward to the thirdweb community's feedback.