Skip to content

Commit

Permalink
sync Router
Browse files Browse the repository at this point in the history
  • Loading branch information
austinkline committed Aug 28, 2024
1 parent be81034 commit 90ba66f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions contracts/fungible-token-router/FungibleTokenRouter.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,12 @@ access(all) contract FungibleTokenRouter {
vaultDataOpt = md as! FungibleTokenMetadataViews.FTVaultData
}

let vaultData = vaultDataOpt ?? panic("vault data could not be retrieved")
let vaultData = vaultDataOpt ?? panic("vault data could not be retrieved for type ".concat(tokenType.identifier))
let receiver = getAccount(destination).capabilities.get<&{FungibleToken.Receiver}>(vaultData.receiverPath)
assert(receiver.check(), message: "no receiver found at path: ".concat(vaultData.receiverPath.toString()))

emit TokensRouted(tokenType: tokenType.identifier, amount: from.balance, to: destination)
receiver.borrow()!.deposit(from: <-from)

panic("Could not find FungibleTokenMetadataViews.FTVaultData on depositing tokens")
}

access(all) view fun getSupportedVaultTypes(): {Type: Bool} {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@flowtyio/flow-contracts",
"version": "0.1.0-beta.30",
"version": "0.1.0-beta.31",
"main": "index.json",
"description": "An NPM package for common flow contracts",
"author": "flowtyio",
Expand Down

0 comments on commit 90ba66f

Please sign in to comment.