Skip to content

Support importing standard contracts #753

@sisyphusSmiling

Description

@sisyphusSmiling

Description

Currently, I need to copy+paste all contracts into my playground project which can make building even a simple contract on top of common standard contracts tedious and bloat a single file contract dapp into a 4+ contract suite. This can lead to issue when trying to build on FlowToken, which seems to be a protected contract in the playground namespace.

Suggested solution

It would be very helpful to have access to at least standard contracts via aliases, especially if those contracts are already running in the supporting emulator. Contracts that would be helpful to include are:

  • FungibleToken
  • FlowToken
  • NonFungibleToken
  • ViewResolver
  • MetadataViews
  • FungibleTokenMetadataViews
  • ExampleNFT

All of these contracts, with the exception of FungibleTokenMetadataViews are deployed when running flow emulator --contracts.

This would allow for rapid prototyping and promote composability and best practices while doing so. If implemented, it would also be helpful to inform users of the ability to import these contracts, how to do so (alias or import syntax - #751), and link to more info on each. Doing so would not only educate users about the feature, but would also serve as another pointer to commonly used and requested contracts.

Alternatives

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions