-
Notifications
You must be signed in to change notification settings - Fork 13
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
[#131] TZIP 12 Updates implementing storage views and storage field changes. #151
Conversation
6424024
to
93a41df
Compare
-- possible to originate the contract. | ||
-- | ||
-- TODO: once we move the metadata to its own contract, we can | ||
-- add this info back to the metadata. |
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.
Hm, can we add it back already?
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.
Added it back.
f8043ed
to
093e8f4
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.
As Ivan predicted this has quite a bit of conflict with #115 and an MR to morley-ledgers
to move some of these changes there seems to be in order.
8171f26
to
54ac0f4
Compare
fe4d8b6
to
3cb14ac
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.
LGTM, only a couple nitpick comments and additionally a couple of things in commit messages:
-
registery
typo in 948b84d -
in 3cb14ac it says:
This includes. Some of the major changes are.
seems a bit redundant, it should probably be:
Some of the major changes include:
I'll approve already, feel free to merge with these few little changes
275e74e
to
5c2b1a2
Compare
Problem: The token metadata registry entrypoint has been removed from TZIP-12. We have the option to keep the token metadata as annotated bigmap in storage, but we have decided to implement it as an offchain storage view. So we have to remove the metadata registry entrypoint as well as the corresponding field from the storage. Solution: Token metadata registry storage field is removed. The entrypoint is removed as well. The tests that check for token metadata registry field in storage is removed as well.
Problem: We have to add storage views as required by TZIP-12. Solution: Implement the storage views and include them in TZIP-16 metadata. Origination procedures during tests have been changed to remove the token metadata registry contract origination. In addition to this, the procedure to implement the stablecoin-client commands like `getBalance` and `getTokenMetadata` has been changed to follow the metadata URI (currently only tezos-storage scheme is supported), and fetch and execute the views on the storage. This is not currently working because of inability to fetch whole storage. The `morley-metadata` dependency has also been bumped to use the new DSL for buidling metadata. Both the main contract metadata and FA1.2 variant has been updated to use it. Apart from this, some testing infra (`checkView` function) has been moved to `Test.Common` module from the tests for permits that checks the behavior of views. And it has been used in tests for the new storage views.
problem: Earlier we called the contract metadata as TZIP16-metadata to contrast with the token metadata. But now the token metadata has been moved to tzip-16 metadata. So we only have one metadata, and we can call it just "metadata". solution: Remove the old metadata contract, and rename the tzip16-metadata.ligo file as simply 'metadata.ligo'. Make the corresponding change in code, and build configurations.
problem: The morley-metadata repo has got some changes to the metadata record, and is incompatible with the current code. solution: Update the morly-metadata dependency and use the new infra to construct the metadata.
The get-token-metadata stablecoin client call was broken due to the view being run on a `StorageView` instead of `Storage`. But it has been fixed by using a modified version of `StorageView` with empty bigmaps so that it is changed to a `Storage` with with the `GetTokenMetadata` view is interpreted.
Adds back some FA1.2 metadata that was previously disable due to storage constraints. We can add it back since we are storing metadata in external contract.
Problem: We have made some changes in this PR to the contract's interface, so we should update it in changelog. Solution: Update the changelog.
Problem: As part of this PR, we have made some new changes to the morley-metadata dependencies. So we should update their versions and also should use the new infra from them. Solution: Bump the dependencies, and use the infra from them. Some of the major changes include: * Add custom instances for FA2 param. We have change morley-ledgers FA2 parameter not to be bundled with it's generic instance. This is so that we can customize the instance to match with FA2 parameter of this contract. * Port 'checkView' to morley-metadata and use it here This function, since it appeared to be a useful one generally, was moved to morley-metadata repo. * Move tezosStorageSchema to morley-metadata This was just being duplicated here. So we now use this symbol imported from morley-metadata.
5c2b1a2
to
2500dce
Compare
Description
Removes token-metadata-registry entrypoint and storage fields from contract. Add storage views as requried by tzip-12 and move token metadata to TZIP-16 storage view. Update tests and update stablecoin-client to read token-metadata from the TIP-16 metadata.
Related issue(s)
Resolves #131
✅ Checklist for your Pull Request
Related changes (conditional)
Tests
silently reappearing again.
Documentation
not essential.
Stylistic guide (mandatory)