-
Notifications
You must be signed in to change notification settings - Fork 49
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
Adds metadata views to FlowToken
and removes init parameter
#370
Conversation
FlowToken
and removes init parameter
contracts/FlowToken.cdc
Outdated
case Type<FungibleTokenMetadataViews.FTDisplay>(): | ||
let media = MetadataViews.Media( | ||
file: MetadataViews.HTTPFile( | ||
url: "https://assets.website-files.com/5f6294c0c7a8cdd643b1c820/5f6294c0c7a8cda55cb1c936_Flow_Wordmark.svg" |
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.
Do we know where this is hosted? It'd be great to get this pinned in IPFS or some other Web3 native solution.
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.
Not sure actually. yeah IPFS would be great. I'd like to get this merged first though and then we can start looking into it in the future
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.
We might just store it on chain in xml format since it is small
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.
Anybody have any ideas about which metadata view would be the best to use for storing an entire XML file? This one would only be about 2KB so we can probably just store it all on chain, but I don't know which one to use or if we have to create a new view for it
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.
@joshuahannan HTTPFile
with data
URI ? https://en.wikipedia.org/wiki/Data_URI_scheme
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.
So I would just save the entire XML file as a String
in the URI field?
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.
So long as you encode the start with the right preface that should work, I think. Only returning the string won't tell platforms how to interpret the data being returned
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.
it will be:
data:image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JjbGUgY2xhc3M9ImNscy0yIiBjeD0iNTAiIGN5PSI1MCIgcj0iNTAiLz48cmVjdCBjbGFzcz0iY2xzLTMiIHg9IjU3LjgyIiB5PSI0Mi4xOCIgd2lkdGg9IjE0LjEyIiBoZWlnaHQ9IjE0LjEyIi8+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNNDMuNzEsNjEuNTlhNS4zLDUuMywwLDEsMS01LjMtNS4zaDUuM1Y0Mi4xOGgtNS4zQTE5LjQxLDE5LjQxLDAsMSwwLDU3LjgyLDYxLjU5di01LjNINDMuNzFaIi8+PHBhdGggY2xhc3M9ImNscy0zIiBkPSJNNjMuMTIsMzUuMTJINzlWMjFINjMuMTJBMTkuNDMsMTkuNDMsMCwwLDAsNDMuNzEsNDAuNDF2MS43N0g1Ny44MlY0MC40MUE1LjMsNS4zLDAsMCwxLDYzLjEyLDM1LjEyWiIvPjxwb2x5Z29uIGNsYXNzPSJjbHMtNCIgcG9pbnRzPSI0My43MSA1Ni4yOSA1Ny44MiA1Ni4yOSA1Ny44MiA1Ni4yOSA1Ny44MiA0Mi4xOCA1Ny44MiA0Mi4xOCA0My43MSA0Mi4xOCA0My43MSA1Ni4yOSIvPjwvZz48L2c+PC9zdmc+
c96adfd
to
5336244
Compare
Tests are passing, but I'm having a hard time getting CI to pass because there are diffs in |
4536: Update bootstrapping to include nft and metadata views r=janezpodhostnik a=joshuahannan In onflow/flow-core-contracts#370, we're adding metadata views to the `FlowToken` smart contract. For this, the contract needs to implement all the metadata views contracts. This PR updates the bootstrapping logic to deploy `NonFungibleToken`, `MetadataViews`, `ViewResolver`, and `FungibleTokenMetadataViews` and provide those import addresses to the `FlowToken` smart contract deployment. Co-authored-by: Josh Hannan <hannanjoshua19@gmail.com> Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> Co-authored-by: Janez Podhostnik <67895329+janezpodhostnik@users.noreply.github.com>
4536: Update bootstrapping to include nft and metadata views r=janezpodhostnik a=joshuahannan In onflow/flow-core-contracts#370, we're adding metadata views to the `FlowToken` smart contract. For this, the contract needs to implement all the metadata views contracts. This PR updates the bootstrapping logic to deploy `NonFungibleToken`, `MetadataViews`, `ViewResolver`, and `FungibleTokenMetadataViews` and provide those import addresses to the `FlowToken` smart contract deployment. Co-authored-by: Josh Hannan <hannanjoshua19@gmail.com> Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> Co-authored-by: Janez Podhostnik <67895329+janezpodhostnik@users.noreply.github.com>
4536: Update bootstrapping to include nft and metadata views r=janezpodhostnik a=joshuahannan In onflow/flow-core-contracts#370, we're adding metadata views to the `FlowToken` smart contract. For this, the contract needs to implement all the metadata views contracts. This PR updates the bootstrapping logic to deploy `NonFungibleToken`, `MetadataViews`, `ViewResolver`, and `FungibleTokenMetadataViews` and provide those import addresses to the `FlowToken` smart contract deployment. Co-authored-by: Josh Hannan <hannanjoshua19@gmail.com> Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> Co-authored-by: Janez Podhostnik <67895329+janezpodhostnik@users.noreply.github.com>
4536: Update bootstrapping to include nft and metadata views r=janezpodhostnik a=joshuahannan In onflow/flow-core-contracts#370, we're adding metadata views to the `FlowToken` smart contract. For this, the contract needs to implement all the metadata views contracts. This PR updates the bootstrapping logic to deploy `NonFungibleToken`, `MetadataViews`, `ViewResolver`, and `FungibleTokenMetadataViews` and provide those import addresses to the `FlowToken` smart contract deployment. Co-authored-by: Josh Hannan <hannanjoshua19@gmail.com> Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> Co-authored-by: Janez Podhostnik <67895329+janezpodhostnik@users.noreply.github.com>
4536: Update bootstrapping to include nft and metadata views r=janezpodhostnik a=joshuahannan In onflow/flow-core-contracts#370, we're adding metadata views to the `FlowToken` smart contract. For this, the contract needs to implement all the metadata views contracts. This PR updates the bootstrapping logic to deploy `NonFungibleToken`, `MetadataViews`, `ViewResolver`, and `FungibleTokenMetadataViews` and provide those import addresses to the `FlowToken` smart contract deployment. Co-authored-by: Josh Hannan <hannanjoshua19@gmail.com> Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> Co-authored-by: Janez Podhostnik <67895329+janezpodhostnik@users.noreply.github.com>
4536: Update bootstrapping to include nft and metadata views r=janezpodhostnik a=joshuahannan In onflow/flow-core-contracts#370, we're adding metadata views to the `FlowToken` smart contract. For this, the contract needs to implement all the metadata views contracts. This PR updates the bootstrapping logic to deploy `NonFungibleToken`, `MetadataViews`, `ViewResolver`, and `FungibleTokenMetadataViews` and provide those import addresses to the `FlowToken` smart contract deployment. Co-authored-by: Josh Hannan <hannanjoshua19@gmail.com> Co-authored-by: Janez Podhostnik <janez.podhostnik@gmail.com> Co-authored-by: Janez Podhostnik <67895329+janezpodhostnik@users.noreply.github.com>
Adds standard fungible token metadata views to the
FlowToken
smart contractAlso removes the init parameter from the contract so that it is easier for users to deploy it to the playground