Skip to content
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

Merged
merged 1 commit into from
Aug 24, 2020
Merged

Conversation

sras
Copy link
Contributor

@sras sras commented Aug 21, 2020

Description

Related issue(s)

Resolves #91

✅ Checklist for your Pull Request

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
    • I updated changelog unless I am sure my changes are
      not essential.

Stylistic guide (mandatory)

@sras sras marked this pull request as ready for review August 21, 2020 21:20
Copy link
Collaborator

@gromakovsky gromakovsky left a 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.

(pair (string %symbol)
(pair (string %name) (pair (nat %decimals) (map %extras string string))))))) ;
code { CDR ; NIL operation ; PAIR } }

Copy link
Collaborator

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.

Copy link
Contributor Author

@sras sras Aug 23, 2020

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 ?

Copy link
Collaborator

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.

@sras
Copy link
Contributor Author

sras commented Aug 23, 2020

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.

Yes. This appear to work.

@sras
Copy link
Contributor Author

sras commented Aug 24, 2020

I have removed the metadata.tz from repo and have changed the pipeline. I have not merged it since I am not sure about the changed made to the nix files, and think it would be better to merge after it is reviewed.

.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
Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

@gromakovsky
Copy link
Collaborator

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.
@sras sras force-pushed the sras/#91-move-metadata branch from 284aced to 6ce115f Compare August 24, 2020 08:50
@sras sras merged commit 90d73b5 into master Aug 24, 2020
@sras sras deleted the sras/#91-move-metadata branch August 24, 2020 09:26
@sras sras mentioned this pull request Sep 12, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move metadata into another contract
2 participants