Extensions
Last updated
Was this helpful?
Last updated
Was this helpful?
Any contract written in solidity on the Ethereum network can be registered as an extension to a base Creator Contract. The extension will only be recognized by your Creator Contract for the purpose of overriding various functions by implementing specific interfaces.
To override Token URI functionality implement interface . This is applicable to both ERC721 and ERC1155 contracts:
If you intend on using this functionality DO NOT pass in URI or baseURI values when you call mintExtension functions on the Creator Core contracts. Doing so will cause the Creator Core contracts to ignore the overridden tokenURI logic.
To receive an onBurn callback (pre-burn hook) whenever a token the extension created is burned implement either the or interface. Whenever a token created by the extension is burned using the Creator Core's burn function, this hook will fire.
ERC721
ERC1155
If your extension has implemented the Transfer Callback interface, it will automatically be enabled once the extension is installed. You can disable the callback by having the extension call setApproveTransferExtenstion(false). See the suggested implementation below the CreatorExtensionApproveTransfer interfaces.
ERC721
ERC1155
Suggested implementation for extensions with a transfer callback
Once deployed on the Ethereum network, extensions can be added or removed using the registerExtension
and unregisterExtension
functions. An extension can also be blacklisted via the blacklistExtension
function, preventing future registrations of the address and destroying all references to metadata associate with tokens created by the extension.
To receive a transfer callback (pre-transfer hook) whenever a token the extension created is transferred implement either the or interface. Whenever a token created by the extension is transferred using the Creator Core's transfer function this hook will fire.
To override Token URI functionality implement interface . This is applicable to both ERC721 and ERC1155 contracts:
For detailed extensions functions information see .