-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update metadata views and test on testnet
- Loading branch information
1 parent
4ae6f83
commit f148c4b
Showing
6 changed files
with
120 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
import "FungibleToken" | ||
import "FiatToken" | ||
|
||
transaction() { | ||
|
||
prepare(signer: AuthAccount) { | ||
|
||
// Return early if the account already stores a FiatToken Vault | ||
if signer.borrow<&FiatToken.Vault>(from: FiatToken.VaultStoragePath) != nil { | ||
return | ||
} | ||
|
||
// Create a new ExampleToken Vault and put it in storage | ||
signer.save( | ||
<-FiatToken.createEmptyVault(), | ||
to: FiatToken.VaultStoragePath | ||
) | ||
|
||
// Create a public capability to the Vault that only exposes | ||
// the deposit function through the Receiver interface | ||
signer.link<&FiatToken.Vault{FungibleToken.Receiver}>( | ||
FiatToken.VaultReceiverPubPath, | ||
target: FiatToken.VaultStoragePath | ||
) | ||
|
||
// Create a public capability to the Vault that only exposes | ||
// the UUID() function through the VaultUUID interface | ||
signer.link<&FiatToken.Vault{FiatToken.ResourceId}>( | ||
FiatToken.VaultUUIDPubPath, | ||
target: FiatToken.VaultStoragePath | ||
) | ||
|
||
// Create a public capability to the Vault that only exposes | ||
// the balance field through the Balance interface | ||
signer.link<&FiatToken.Vault{FungibleToken.Balance}>( | ||
FiatToken.VaultBalancePubPath, | ||
target: FiatToken.VaultStoragePath | ||
) | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters