-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(world-modules): add ERC721 module #1844
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
04dbad8
wip
alvrs 1ee8da8
wip2
alvrs 63cb919
add todos
alvrs 63ad4ea
wip 3
alvrs f6389c2
almost there
alvrs 10c2aaf
fix ERC721 module
alvrs 611d722
wip: add erc721 test
alvrs 56261e5
wip port solady erc721 test
alvrs 40a040e
draft refactor tests
alvrs 00bc362
make it compile
alvrs 1764936
vm assumptions
alvrs 7a83c63
emit event on puppet
alvrs 82c2ecc
fix expect revert encoding
alvrs 5f966b3
fix bug in _update
alvrs 32adab0
fix assumption in testSafeTransferFromToEOA
alvrs c1cb9c7
fix more assumptions'
alvrs b06b27f
fix expected error
alvrs 601af88
fix test
alvrs 8d97dd4
assume eoa in eoa tests
alvrs d9d2c01
only allow token owner to burn (as per spec)
alvrs b01a5c4
add test for installing twice
alvrs 56fd216
remove unused imports
alvrs 3e852bb
remove more unused imports
alvrs 40b0210
Create gorgeous-swans-hide.md
alvrs f20ad7d
use toTopic
alvrs d963bb4
Update .changeset/gorgeous-swans-hide.md
alvrs 65a8802
prettier
alvrs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
"@latticexyz/world-modules": minor | ||
--- | ||
|
||
Added 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: "" }));``` | ||
```` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel strongly but wondering if these changes get moved to the ERC20 PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I generally agree, but in this case i'd prefer to not do the refactor for time reasons. We could merge the erc721 PR into the erc20 PR instead of merging both into main individually