Skip to content

Instantly share code, notes, and snippets.

@austinkline
Last active January 27, 2023 21:00
Show Gist options
  • Save austinkline/fb1dd0c4704c1327cd3376a7333573cf to your computer and use it in GitHub Desktop.
Save austinkline/fb1dd0c4704c1327cd3376a7333573cf to your computer and use it in GitHub Desktop.
Add royalties to Cuvée Collective
case Type<MetadataViews.Royalties>():
// note: Royalties are not aware of the token being used with, so the path is not useful right now
// eventually the FungibleTokenSwitchboard might be an option
// https://github.com/onflow/flow-ft/blob/master/contracts/FungibleTokenSwitchboard.cdc
let cut = MetadataViews.Royalty(
receiver: Collector.account.getCapability<&{FungibleToken.Receiver}>(/public/somePath),
cut: 0.05 // 5% royaty,
description: "Some description here"
)
var royalties: [MetadataViews.Royalty] = [cut]
return MetadataViews.Royalties(royalties)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment