Skip to content

Commit

Permalink
make balance check enforce that it is a FlowToken Vault
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuahannan committed Sep 26, 2024
1 parent 028f5a6 commit 9490d27
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contracts/FlowServiceAccount.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ access(all) contract FlowServiceAccount {
/// Returns 0 if the account has no default balance
access(all) view fun defaultTokenBalance(_ acct: &Account): UFix64 {
var balance = 0.0
if let balanceRef = acct.capabilities.borrow<&{FungibleToken.Balance}>(/public/flowTokenBalance) {
if let balanceRef = acct.capabilities.borrow<&FlowToken.Vault>(/public/flowTokenBalance) {
balance = balanceRef.balance
}

Expand Down
6 changes: 3 additions & 3 deletions lib/go/contracts/internal/assets/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9490d27

Please sign in to comment.