-
Notifications
You must be signed in to change notification settings - Fork 11.3k
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
Implement the move module for cross-chain airdrop #623
Conversation
I received the following compiler error
UPDATE: resolved in https://mysten-labs.slack.com/archives/C02DRAL32GN/p1646256086677789 |
7279caf
to
bc50f45
Compare
c40db39
to
3bb6d4a
Compare
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.
Very nice!
A few nits.
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.
Hard requirement: TxContext must be last arg for entry functions.
Format is: [ObjectArgs.... Pure/Primitive Args... TxContext]
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.
Another request:
Sorry for holding up the PR.
I think if a module has entry functions it is important that we test exercising the functions from systems outside of Move (CLI tests, Client unit tests, Authority unit tests, etc) for the following reasons:
- It shows others how to use the contract without understanding Move details
- It proves that the contract entry functions are conformant
- It helps us exercise our linter (and in future pre-execution logic)
For examples see https://github.com/MystenLabs/fastnft/blob/main/sui/src/unit_tests/cli_tests.rs#L557
https://github.com/MystenLabs/fastnft/blob/main/sui_core/src/unit_tests/client_tests.rs#L855
let fields = &token["contents"]["fields"]; | ||
assert_eq!(fields["source_token_id"]["fields"]["id"], SOURCE_TOKEN_ID); | ||
|
||
// TODO: verify the other string fields once SuiJSON has better support for rendering |
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 think you can still compare ASCII bytes right?
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 have a hard time figuring out how to convert serde_json::Value to bytes, let me know if you know how to do it
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.
Looks good!
Only a some renaming nits that may cause ambiguity, and one test case that could be more complete, but overall looks good, thanks for updating the tests!
This PR implements the Move component as mentioned in the NFT Mirroring design doc . The goal of this PR is not to write a rigorous and production ready contract with all the features in ERC-721 standard, but just to have a minimal version to unblock the MVP before GDC.
The major TODOs are(in separate PRs)
token_id
inu256
(see discussion in [RFC] Add Starcoin-framework as a dependency #616)(eth_contract_address, eth_token_id)
is O(M+N) where M is the number of mirrored ETH contracts and N is the max number of claimed token ids for a given eth contract address). Implementing the sparse set will reduce the time complexity to O(1) but will take more efforts.