@latticexyz/world-modules 2.0.12-type-resolutions-effc7ab1 → 2.0.12-type-resolutions-ad8cc987
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cache/solidity-files-cache.json +1 -1
- package/package.json +9 -8
- package/src/index.sol +25 -0
- package/src/interfaces/IBaseWorld.sol +16 -0
- package/src/interfaces/IERC20System.sol +33 -0
- package/src/interfaces/IERC721System.sol +43 -0
- package/src/interfaces/IPuppetFactorySystem.sol +15 -0
- package/src/interfaces/IUniqueEntitySystem.sol +13 -0
- package/src/interfaces/IUnstable_CallWithSignatureSystem.sol +20 -0
- package/src/modules/callwithsignature/ECDSA.sol +174 -0
- package/src/modules/callwithsignature/IERC1271.sol +17 -0
- package/src/modules/callwithsignature/IUnstable_CallWithSignatureErrors.sol +9 -0
- package/src/modules/callwithsignature/SignatureChecker.sol +50 -0
- package/src/modules/callwithsignature/Unstable_CallWithSignatureModule.sol +48 -0
- package/src/modules/callwithsignature/Unstable_CallWithSignatureSystem.sol +36 -0
- package/src/modules/callwithsignature/constants.sol +10 -0
- package/src/modules/callwithsignature/getSignedMessageHash.sol +54 -0
- package/src/modules/callwithsignature/tables/CallWithSignatureNonces.sol +199 -0
- package/src/modules/callwithsignature/validateCallWithSignature.sol +31 -0
- package/src/modules/erc20-puppet/ERC20Module.sol +88 -0
- package/src/modules/erc20-puppet/ERC20System.sol +286 -0
- package/src/modules/erc20-puppet/IERC20.sol +94 -0
- package/src/modules/erc20-puppet/IERC20Errors.sol +49 -0
- package/src/modules/erc20-puppet/IERC20Events.sol +18 -0
- package/src/modules/erc20-puppet/IERC20Mintable.sol +25 -0
- package/src/modules/erc20-puppet/constants.sol +20 -0
- package/src/modules/erc20-puppet/registerERC20.sol +35 -0
- package/src/modules/erc20-puppet/tables/Allowances.sol +208 -0
- package/src/modules/erc20-puppet/tables/ERC20Metadata.sol +604 -0
- package/src/modules/erc20-puppet/tables/ERC20Registry.sol +199 -0
- package/src/modules/erc20-puppet/tables/TotalSupply.sol +184 -0
- package/src/modules/erc20-puppet/utils.sol +30 -0
- package/src/modules/erc721-puppet/ERC721Module.sol +95 -0
- package/src/modules/erc721-puppet/ERC721System.sol +531 -0
- package/src/modules/erc721-puppet/IERC721.sol +120 -0
- package/src/modules/erc721-puppet/IERC721Errors.sol +61 -0
- package/src/modules/erc721-puppet/IERC721Events.sol +23 -0
- package/src/modules/erc721-puppet/IERC721Metadata.sol +27 -0
- package/src/modules/erc721-puppet/IERC721Mintable.sol +53 -0
- package/src/modules/erc721-puppet/IERC721Receiver.sol +28 -0
- package/src/modules/erc721-puppet/constants.sol +23 -0
- package/src/modules/erc721-puppet/libraries/LibString.sol +77 -0
- package/src/modules/erc721-puppet/registerERC721.sol +37 -0
- package/src/modules/erc721-puppet/tables/ERC721Metadata.sol +703 -0
- package/src/modules/erc721-puppet/tables/ERC721Registry.sol +199 -0
- package/src/modules/erc721-puppet/tables/OperatorApproval.sol +220 -0
- package/src/modules/erc721-puppet/tables/Owners.sol +196 -0
- package/src/modules/erc721-puppet/tables/TokenApproval.sol +196 -0
- package/src/modules/erc721-puppet/tables/TokenURI.sol +450 -0
- package/src/modules/erc721-puppet/utils.sol +38 -0
- package/src/modules/keysintable/KeysInTableHook.sol +141 -0
- package/src/modules/keysintable/KeysInTableModule.sol +110 -0
- package/src/modules/keysintable/constants.sol +7 -0
- package/src/modules/keysintable/getKeysInTable.sol +81 -0
- package/src/modules/keysintable/hasKey.sol +28 -0
- package/src/modules/keysintable/query.sol +200 -0
- package/src/modules/keysintable/tables/KeysInTable.sol +1638 -0
- package/src/modules/keysintable/tables/UsedKeysIndex.sol +414 -0
- package/src/modules/keyswithvalue/KeysWithValueHook.sol +158 -0
- package/src/modules/keyswithvalue/KeysWithValueModule.sol +103 -0
- package/src/modules/keyswithvalue/constants.sol +7 -0
- package/src/modules/keyswithvalue/getKeysWithValue.sol +58 -0
- package/src/modules/keyswithvalue/getTargetTableId.sol +32 -0
- package/src/modules/keyswithvalue/tables/KeysWithValue.sol +668 -0
- package/src/modules/puppet/Puppet.sol +80 -0
- package/src/modules/puppet/PuppetDelegationControl.sol +17 -0
- package/src/modules/puppet/PuppetFactorySystem.sol +25 -0
- package/src/modules/puppet/PuppetMaster.sol +19 -0
- package/src/modules/puppet/PuppetModule.sol +64 -0
- package/src/modules/puppet/constants.sol +23 -0
- package/src/modules/puppet/createPuppet.sol +24 -0
- package/src/modules/puppet/tables/PuppetRegistry.sol +199 -0
- package/src/modules/puppet/utils.sol +10 -0
- package/src/modules/std-delegations/CallboundDelegationControl.sol +64 -0
- package/src/modules/std-delegations/StandardDelegationsModule.sol +55 -0
- package/src/modules/std-delegations/SystemboundDelegationControl.sol +54 -0
- package/src/modules/std-delegations/TimeboundDelegationControl.sol +27 -0
- package/src/modules/std-delegations/constants.sol +21 -0
- package/src/modules/std-delegations/tables/CallboundDelegations.sol +287 -0
- package/src/modules/std-delegations/tables/SystemboundDelegations.sol +256 -0
- package/src/modules/std-delegations/tables/TimeboundDelegations.sol +211 -0
- package/src/modules/tokens/tables/Balances.sol +196 -0
- package/src/modules/uniqueentity/UniqueEntityModule.sol +73 -0
- package/src/modules/uniqueentity/UniqueEntitySystem.sol +18 -0
- package/src/modules/uniqueentity/constants.sol +13 -0
- package/src/modules/uniqueentity/getUniqueEntity.sol +26 -0
- package/src/modules/uniqueentity/tables/UniqueEntity.sol +238 -0
- package/src/modules/utils/ArrayLib.sol +55 -0
- package/src/utils/AccessControlLib.sol +55 -0
- package/src/utils/SystemSwitch.sol +80 -0
@@ -0,0 +1,61 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
|
3
|
+
pragma solidity >=0.8.24;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @dev Standard ERC721 Errors
|
7
|
+
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
|
8
|
+
*/
|
9
|
+
interface IERC721Errors {
|
10
|
+
/**
|
11
|
+
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
|
12
|
+
* Used in balance queries.
|
13
|
+
* @param owner Address of the current owner of a token.
|
14
|
+
*/
|
15
|
+
error ERC721InvalidOwner(address owner);
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @dev Indicates a `tokenId` whose `owner` is the zero address.
|
19
|
+
* @param tokenId Identifier number of a token.
|
20
|
+
*/
|
21
|
+
error ERC721NonexistentToken(uint256 tokenId);
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
|
25
|
+
* @param sender Address whose tokens are being transferred.
|
26
|
+
* @param tokenId Identifier number of a token.
|
27
|
+
* @param owner Address of the current owner of a token.
|
28
|
+
*/
|
29
|
+
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
|
30
|
+
|
31
|
+
/**
|
32
|
+
* @dev Indicates a failure with the token `sender`. Used in transfers.
|
33
|
+
* @param sender Address whose tokens are being transferred.
|
34
|
+
*/
|
35
|
+
error ERC721InvalidSender(address sender);
|
36
|
+
|
37
|
+
/**
|
38
|
+
* @dev Indicates a failure with the token `receiver`. Used in transfers.
|
39
|
+
* @param receiver Address to which tokens are being transferred.
|
40
|
+
*/
|
41
|
+
error ERC721InvalidReceiver(address receiver);
|
42
|
+
|
43
|
+
/**
|
44
|
+
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
|
45
|
+
* @param operator Address that may be allowed to operate on tokens without being their owner.
|
46
|
+
* @param tokenId Identifier number of a token.
|
47
|
+
*/
|
48
|
+
error ERC721InsufficientApproval(address operator, uint256 tokenId);
|
49
|
+
|
50
|
+
/**
|
51
|
+
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
|
52
|
+
* @param approver Address initiating an approval operation.
|
53
|
+
*/
|
54
|
+
error ERC721InvalidApprover(address approver);
|
55
|
+
|
56
|
+
/**
|
57
|
+
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
|
58
|
+
* @param operator Address that may be allowed to operate on tokens without being their owner.
|
59
|
+
*/
|
60
|
+
error ERC721InvalidOperator(address operator);
|
61
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721.sol)
|
3
|
+
pragma solidity >=0.8.24;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @dev Events emitted by an ERC721 compliant contract.
|
7
|
+
*/
|
8
|
+
interface IERC721Events {
|
9
|
+
/**
|
10
|
+
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
|
11
|
+
*/
|
12
|
+
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
|
13
|
+
|
14
|
+
/**
|
15
|
+
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
|
16
|
+
*/
|
17
|
+
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
|
18
|
+
|
19
|
+
/**
|
20
|
+
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
|
21
|
+
*/
|
22
|
+
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
|
23
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/extensions/IERC721Metadata.sol)
|
3
|
+
pragma solidity >=0.8.24;
|
4
|
+
|
5
|
+
import { IERC721 } from "./IERC721.sol";
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @title ERC-721 Non-Fungible Token Standard, optional metadata extension
|
9
|
+
* @author MUD (https://mud.dev) by Lattice (https://lattice.xyz)
|
10
|
+
* @dev See https://eips.ethereum.org/EIPS/eip-721
|
11
|
+
*/
|
12
|
+
interface IERC721Metadata is IERC721 {
|
13
|
+
/**
|
14
|
+
* @dev Returns the token collection name.
|
15
|
+
*/
|
16
|
+
function name() external view returns (string memory);
|
17
|
+
|
18
|
+
/**
|
19
|
+
* @dev Returns the token collection symbol.
|
20
|
+
*/
|
21
|
+
function symbol() external view returns (string memory);
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.
|
25
|
+
*/
|
26
|
+
function tokenURI(uint256 tokenId) external view returns (string memory);
|
27
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
|
3
|
+
pragma solidity >=0.8.24;
|
4
|
+
|
5
|
+
import { IERC721 } from "./IERC721.sol";
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @dev Extending the ERC721 standard with permissioned mint and burn functions.
|
9
|
+
*/
|
10
|
+
interface IERC721Mintable is IERC721 {
|
11
|
+
/**
|
12
|
+
* @dev Mints `tokenId` and transfers it to `to`.
|
13
|
+
*
|
14
|
+
* Requirements:
|
15
|
+
*
|
16
|
+
* - `tokenId` must not exist.
|
17
|
+
* - `to` cannot be the zero address.
|
18
|
+
*
|
19
|
+
* Emits a {Transfer} event.
|
20
|
+
*/
|
21
|
+
function mint(address to, uint256 tokenId) external;
|
22
|
+
|
23
|
+
/**
|
24
|
+
* @dev Mints `tokenId`, transfers it to `to` and checks for `to` acceptance.
|
25
|
+
*
|
26
|
+
* Requirements:
|
27
|
+
*
|
28
|
+
* - caller must own the namespace
|
29
|
+
* - `tokenId` must not exist.
|
30
|
+
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
|
31
|
+
*
|
32
|
+
* Emits a {Transfer} event.
|
33
|
+
*/
|
34
|
+
function safeMint(address to, uint256 tokenId) external;
|
35
|
+
|
36
|
+
/**
|
37
|
+
* @dev Same as {xref-ERC721-safeMint-address-uint256-}[`safeMint`], with an additional `data` parameter which is
|
38
|
+
* forwarded in {IERC721Receiver-onERC721Received} to contract recipients.
|
39
|
+
*/
|
40
|
+
function safeMint(address to, uint256 tokenId, bytes memory data) external;
|
41
|
+
|
42
|
+
/**
|
43
|
+
* @dev Destroys `tokenId`.
|
44
|
+
* The approval is cleared when the token is burned.
|
45
|
+
*
|
46
|
+
* Requirements:
|
47
|
+
*
|
48
|
+
* - `tokenId` must exist.
|
49
|
+
*
|
50
|
+
* Emits a {Transfer} event.
|
51
|
+
*/
|
52
|
+
function burn(uint256 tokenId) external;
|
53
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC721/IERC721Receiver.sol)
|
3
|
+
pragma solidity >=0.8.24;
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @title ERC721 token receiver interface
|
7
|
+
* @author MUD (https://mud.dev) by Lattice (https://lattice.xyz)
|
8
|
+
* @dev Interface for any contract that wants to support safeTransfers
|
9
|
+
* from ERC721 asset contracts.
|
10
|
+
*/
|
11
|
+
interface IERC721Receiver {
|
12
|
+
/**
|
13
|
+
* @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}
|
14
|
+
* by `operator` from `from`, this function is called.
|
15
|
+
*
|
16
|
+
* It must return its Solidity selector to confirm the token transfer.
|
17
|
+
* If any other value is returned or the interface is not implemented by the recipient, the transfer will be
|
18
|
+
* reverted.
|
19
|
+
*
|
20
|
+
* The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.
|
21
|
+
*/
|
22
|
+
function onERC721Received(
|
23
|
+
address operator,
|
24
|
+
address from,
|
25
|
+
uint256 tokenId,
|
26
|
+
bytes calldata data
|
27
|
+
) external returns (bytes4);
|
28
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
pragma solidity >=0.8.24;
|
3
|
+
import { ResourceId } from "@latticexyz/store/src/ResourceId.sol";
|
4
|
+
import { RESOURCE_TABLE } from "@latticexyz/store/src/storeResourceTypes.sol";
|
5
|
+
import { RESOURCE_SYSTEM, RESOURCE_NAMESPACE } from "@latticexyz/world/src/worldResourceTypes.sol";
|
6
|
+
|
7
|
+
bytes14 constant MODULE_NAMESPACE = "erc721-puppet";
|
8
|
+
ResourceId constant MODULE_NAMESPACE_ID = ResourceId.wrap(
|
9
|
+
bytes32(abi.encodePacked(RESOURCE_NAMESPACE, MODULE_NAMESPACE))
|
10
|
+
);
|
11
|
+
|
12
|
+
bytes16 constant TOKEN_URI_NAME = "TokenURI";
|
13
|
+
bytes16 constant BALANCES_NAME = "Balances";
|
14
|
+
bytes16 constant METADATA_NAME = "Metadata";
|
15
|
+
bytes16 constant OPERATOR_APPROVAL_NAME = "OperatorApproval";
|
16
|
+
bytes16 constant TOKEN_APPROVAL_NAME = "TokenApproval";
|
17
|
+
bytes16 constant OWNERS_NAME = "Owners";
|
18
|
+
|
19
|
+
bytes16 constant ERC721_SYSTEM_NAME = "ERC721System";
|
20
|
+
|
21
|
+
ResourceId constant ERC721_REGISTRY_TABLE_ID = ResourceId.wrap(
|
22
|
+
bytes32(abi.encodePacked(RESOURCE_TABLE, MODULE_NAMESPACE, bytes16("ERC721Registry")))
|
23
|
+
);
|
@@ -0,0 +1,77 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
pragma solidity >=0.8.0;
|
3
|
+
|
4
|
+
/// @notice Efficient library for creating string representations of integers.
|
5
|
+
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/LibString.sol)
|
6
|
+
/// @author Modified from Solady (https://github.com/Vectorized/solady/blob/main/src/utils/LibString.sol)
|
7
|
+
library LibString {
|
8
|
+
function toString(int256 value) internal pure returns (string memory str) {
|
9
|
+
if (value >= 0) return toString(uint256(value));
|
10
|
+
|
11
|
+
unchecked {
|
12
|
+
str = toString(uint256(-value));
|
13
|
+
|
14
|
+
/// @solidity memory-safe-assembly
|
15
|
+
assembly {
|
16
|
+
// Note: This is only safe because we over-allocate memory
|
17
|
+
// and write the string from right to left in toString(uint256),
|
18
|
+
// and thus can be sure that sub(str, 1) is an unused memory location.
|
19
|
+
|
20
|
+
let length := mload(str) // Load the string length.
|
21
|
+
// Put the - character at the start of the string contents.
|
22
|
+
mstore(str, 45) // 45 is the ASCII code for the - character.
|
23
|
+
str := sub(str, 1) // Move back the string pointer by a byte.
|
24
|
+
mstore(str, add(length, 1)) // Update the string length.
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
function toString(uint256 value) internal pure returns (string memory str) {
|
30
|
+
/// @solidity memory-safe-assembly
|
31
|
+
assembly {
|
32
|
+
// The maximum value of a uint256 contains 78 digits (1 byte per digit), but we allocate 160 bytes
|
33
|
+
// to keep the free memory pointer word aligned. We'll need 1 word for the length, 1 word for the
|
34
|
+
// trailing zeros padding, and 3 other words for a max of 78 digits. In total: 5 * 32 = 160 bytes.
|
35
|
+
let newFreeMemoryPointer := add(mload(0x40), 160)
|
36
|
+
|
37
|
+
// Update the free memory pointer to avoid overriding our string.
|
38
|
+
mstore(0x40, newFreeMemoryPointer)
|
39
|
+
|
40
|
+
// Assign str to the end of the zone of newly allocated memory.
|
41
|
+
str := sub(newFreeMemoryPointer, 32)
|
42
|
+
|
43
|
+
// Clean the last word of memory it may not be overwritten.
|
44
|
+
mstore(str, 0)
|
45
|
+
|
46
|
+
// Cache the end of the memory to calculate the length later.
|
47
|
+
let end := str
|
48
|
+
|
49
|
+
// We write the string from rightmost digit to leftmost digit.
|
50
|
+
// The following is essentially a do-while loop that also handles the zero case.
|
51
|
+
// prettier-ignore
|
52
|
+
for { let temp := value } 1 {} {
|
53
|
+
// Move the pointer 1 byte to the left.
|
54
|
+
str := sub(str, 1)
|
55
|
+
|
56
|
+
// Write the character to the pointer.
|
57
|
+
// The ASCII index of the '0' character is 48.
|
58
|
+
mstore8(str, add(48, mod(temp, 10)))
|
59
|
+
|
60
|
+
// Keep dividing temp until zero.
|
61
|
+
temp := div(temp, 10)
|
62
|
+
|
63
|
+
// prettier-ignore
|
64
|
+
if iszero(temp) { break }
|
65
|
+
}
|
66
|
+
|
67
|
+
// Compute and cache the final total length of the string.
|
68
|
+
let length := sub(end, str)
|
69
|
+
|
70
|
+
// Move the pointer 32 bytes leftwards to make room for the length.
|
71
|
+
str := sub(str, 32)
|
72
|
+
|
73
|
+
// Store the string's length at the start of memory allocated for our string.
|
74
|
+
mstore(str, length)
|
75
|
+
}
|
76
|
+
}
|
77
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
2
|
+
pragma solidity >=0.8.24;
|
3
|
+
|
4
|
+
import { IBaseWorld } from "@latticexyz/world/src/codegen/interfaces/IBaseWorld.sol";
|
5
|
+
import { NamespaceOwner } from "@latticexyz/world/src/codegen/tables/NamespaceOwner.sol";
|
6
|
+
import { WorldResourceIdLib } from "@latticexyz/world/src/WorldResourceId.sol";
|
7
|
+
|
8
|
+
import { SystemSwitch } from "../../utils/SystemSwitch.sol";
|
9
|
+
|
10
|
+
import { ERC721Module } from "./ERC721Module.sol";
|
11
|
+
import { MODULE_NAMESPACE_ID, ERC721_REGISTRY_TABLE_ID } from "./constants.sol";
|
12
|
+
import { IERC721Mintable } from "./IERC721Mintable.sol";
|
13
|
+
|
14
|
+
import { ERC721MetadataData } from "./tables/ERC721Metadata.sol";
|
15
|
+
import { ERC721Registry } from "./tables/ERC721Registry.sol";
|
16
|
+
|
17
|
+
/**
|
18
|
+
* @notice Register a new ERC721 token with the given metadata in a given namespace
|
19
|
+
* @dev This function must be called within a Store context (i.e. using StoreSwitch.setStoreAddress())
|
20
|
+
*/
|
21
|
+
function registerERC721(
|
22
|
+
IBaseWorld world,
|
23
|
+
bytes14 namespace,
|
24
|
+
ERC721MetadataData memory metadata
|
25
|
+
) returns (IERC721Mintable token) {
|
26
|
+
// Get the ERC721 module
|
27
|
+
ERC721Module erc721Module = ERC721Module(NamespaceOwner.get(MODULE_NAMESPACE_ID));
|
28
|
+
if (address(erc721Module) == address(0)) {
|
29
|
+
erc721Module = new ERC721Module();
|
30
|
+
}
|
31
|
+
|
32
|
+
// Install the ERC721 module with the provided args
|
33
|
+
world.installModule(erc721Module, abi.encode(namespace, metadata));
|
34
|
+
|
35
|
+
// Return the newly created ERC721 token
|
36
|
+
token = IERC721Mintable(ERC721Registry.get(ERC721_REGISTRY_TABLE_ID, WorldResourceIdLib.encodeNamespace(namespace)));
|
37
|
+
}
|