-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Review code reuse pattern #4
Comments
Call site code and storage were separated out in b2ae784. Current code is organized as:
Work plan
Requesting help: @jeff-aion @jennijuju |
Reviewed with team and agreed that this is the approach to use. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Motivation
Most new contributors to Aion will start directly by copy-pasting the code here or from another real world example reference project. To help these people, this project should be of the highest quality possible and also make references to all relevant areas where somebody might want to learn more.
Issue
Previously this was written as a combined interface + reference implementation + mock + test mock, that's bad. Now it is spread out to multiple files.
Instead, the interface (AIP040) should be separate from the reference implementation (nf-token.java) and the mock (nf-token-test-mock.java).
This is handled beautifully in 0xcert's reference implementation of non-fungible tokens on EVM:
Reference:
https://github.com/0xcert/ethereum-erc721/tree/master/src/contracts/tokens
https://github.com/0xcert/ethereum-erc721/tree/master/src/tests/mocks
We should decide how to implement this code modularity in a Java-friendly way. Perhaps an interface with default function implementations will be preferred.
Other notes:
isOwnable
anderc721
andpassable
. We should find how to support this extremely common use case. And interfaces may support this.The text was updated successfully, but these errors were encountered: