From 0881dfd096abfecfe7a63b05fb88821e0f0bd498 Mon Sep 17 00:00:00 2001 From: alvarius Date: Mon, 30 Oct 2023 21:51:44 +0100 Subject: [PATCH] Create gorgeous-swans-hide.md --- .changeset/gorgeous-swans-hide.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .changeset/gorgeous-swans-hide.md diff --git a/.changeset/gorgeous-swans-hide.md b/.changeset/gorgeous-swans-hide.md new file mode 100644 index 0000000000..4835c5dd7d --- /dev/null +++ b/.changeset/gorgeous-swans-hide.md @@ -0,0 +1,20 @@ +--- +"@latticexyz/world-modules": minor +--- + +Adds the `ERC721Module` to `@latticexyz/world-modules`. +This module allows the registration of `ERC721` tokens in an existing World. + +Important note: this module has not been audited yet, so any production use is discouraged for now. + +```solidity +import { PuppetModule } from "@latticexyz/world-modules/src/modules/puppet/PuppetModule.sol"; +import { ERC721MetadataData } from "@latticexyz/world-modules/src/modules/erc721-puppet/tables/ERC721Metadata.sol"; +import { IERC721Mintable } from "@latticexyz/world-modules/src/modules/erc721-puppet/IERC721Mintable.sol"; +import { registerERC721 } from "@latticexyz/world-modules/src/modules/erc721-puppet/registerERC721.sol"; + +// The ERC721 module requires the Puppet module to be installed first +world.installModule(new PuppetModule(), new bytes(0)); + +// After the Puppet module is installed, new ERC721 tokens can be registered +IERC721Mintable token = registerERC721(world, "myERC721", ERC721MetadataData({ name: "Token", symbol: "TKN", baseURI: "" }));```