-
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
[#91] Move metadata to external contract #96
Conversation
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. Did you test that both origination scenarios work in client? 1. Manually deployed metadata contract passed from CLI. 2. No contract is passed, it's automatically originated.
If everything works, feel free to squash commits and merge.
haskell/test/resources/metadata.tz
Outdated
(pair (string %symbol) | ||
(pair (string %name) (pair (nat %decimals) (map %extras string string))))))) ; | ||
code { CDR ; NIL operation ; PAIR } } | ||
|
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.
Oh, do we want to have two versions of this contract? Isn't it confusing? E. g. you update metadata.ligo
, but it doesn't affect stablecoin-client
in any way.
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.
@gromakovsky What do you think about adding a comment to the metadata.ligo
file that says, you have to run make build-ligo
command and copy the generated metadata.tz
to the test/resources/metadata.tz
location before doing the actual build ?
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.
@sras I'm ok with that, but then I think we also need a CI check that ligo compile-contract metadata.ligo
is the same as test/resources/metadata.tz
. And we need to check that ligo compile-contract metadata.ligo
works anyway. I believe it should be straightforward to add this check.
Yes. This appear to work. |
I have removed the |
.reuse/dep5
Outdated
@@ -1,9 +1,9 @@ | |||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ | |||
|
|||
Files: .github/* nix/sources.json | |||
Files: .github/* nix/sources.json haskell/test/resources/metadata.tz |
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.
This file should be reverted, I guess.
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.
Reverted
LGTM |
Problem: As per new changes to the FA2 spec, we don't have to store the token metadata in the contract storage. It can be moved to an external contract's storage, and the main contract only need to store the address of the external contract. Solution: Implement a simple contract, with token metadata structure in storage as defined in ligo. Change deploy process to optionally deploy this contract on main contract deploy. Change the client command to read the metadata to do additional indirection and fetch the metadata from the registry contract.
284aced
to
6ce115f
Compare
Description
Related issue(s)
Resolves #91
✅ Checklist for your Pull Request
Related changes (conditional)
Tests
silently reappearing again.
Documentation
not essential.
Stylistic guide (mandatory)