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

Build core FungibleTokenSwitchboard features #66

Closed
alilloig opened this issue May 19, 2022 · 0 comments · Fixed by #71
Closed

Build core FungibleTokenSwitchboard features #66

alilloig opened this issue May 19, 2022 · 0 comments · Fixed by #71
Assignees
Labels
Feature Feedback P-High SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board

Comments

@alilloig
Copy link
Member

Issue To Be Solved

Build the core features specified in the epic. Also build the tests for the features

Suggest A Solution

  • We will write a new contract “FungibleTokenSwitchboard” that will feature a resource “Switchboard” conforming to {FungibleToken.Receiver} but instead of storing a vault balance, it will store a record of these capabilities: Capability<&AnyResource{FungibleToken.Receiver}>.

  • The deposit function enforced by the {FungibleToken.Receiver} will then check the type of the @FungibleToken.Vault received as an argument and route it to the proper Capability<&AnyResource{FungibleToken.Receiver}>. If there is no capability matching the deposited FT, the transaction will fail.

  • The owner of the Switchboard resource will be able to call the function addVaultCapability(switch: Capability<&{FungibleToken.Receiver}> in order to store a new one of these capabilities.

  • The Switchboard resource also should expose a getVaultCapabilities(): [Capability<&{FungibleToken.Receiver}>] in order to allow buyers to know if the token they are willing to use for the payment is supported by the seller / payment receiver.

@alilloig alilloig added Feedback Feature P-High SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board labels May 19, 2022
@alilloig alilloig self-assigned this May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Feedback P-High SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant