aip | title | author | discussions-to | Status | last-call-end-date (*optional) | type | created |
---|---|---|---|---|---|---|---|
2 |
Multiple Token Changes |
areshand |
Accepted |
Standard (framework) |
12/7/2022 |
This proposal contains the following changes:
- token CollectionData mutation functions: provide set functions to mutate the TokenData fields based on the token mutability setting.
- token TokenData metadata mutation functions: provide set functions to mutate the CollectionData fields based on collection mutability setting.
- A bug fix for collection supply underflow: fix a bug that cause underflow error when burning unlimited collection’s TokenData.
- Fix the order of events: when minting token, the deposit events enter queue before the mint events. This changes corrects the order to make the token deposit event after the mint event.
- Make a public entry for transfer with opt-in: provide an entry function to allow transfer token directly when users opt-in direct transfer.
- Ensure royalty numerator is smaller than denominator: we observe about 0.004% token having a royalty > 100%. This change introduces an assertion to ensure royalty is always smaller or equal to 100%.
Change 1, 2: the motivation is to support CollectionData and TokenData mutation based on the mutability config so that creators can update the fields based on their own application logic to support new product features
Change 3,4: the motivation is fix existing issues to make the token contract works correctly
Change 5: this motivation is to allow the dapp to directly call the function without deploying their own contracts or scripts
Change 6: this is to prevent potential malicious token that could lead to charging a higher fee than the token price.
Change 1, 2 are fulling existing token standard specification without introducing new functionalities
Change 3, 4, 5 and 6 are small fix and straightforward changes.
The PRs of the changes above are listed below:
Change 1, 2: aptos-labs/aptos-core#5382 aptos-labs/aptos-core#5265 aptos-labs/aptos-core#5017
Change 3: aptos-labs/aptos-core#5096
Change 4: aptos-labs/aptos-core#5499
Change 5: aptos-labs/aptos-core#4930
Change 6: aptos-labs/aptos-core#5444
Change 1, 2 are internally reviewed and undergo auditing to fully vet the risks
Change 3, 4 and 6 are to reduce the identified risks and drawbacks
Change 5 is to improve usability. This change doesn’t introduce new functionality
Reference implementation changes will be deployed in devnet on 11/14 (PST) for ease of testing and providing feedback/discussion. This AIP will be open for public comments until 11/17. After discussion, reference implementation changes will be deployed in testnet on 11/17 for testing.