TransactionSEALED
~▪&▫□▓◇@░╲○*#%?░░■?!○░╱$░□~█●□▪#!●█^$▪!◆■*◇╳@@*^#**░●●▪?╲?█◆!%&╲
Transaction ID
Transaction Summary
TransactionScript Arguments
0amountUFix64
0.00000001
Cadence Script
1import EVM from 0xe467b9dd11fa00df
2import FungibleToken from 0xf233dcee88fe0abe
3import FlowToken from 0x1654653399040a61
4
5transaction(amount: UFix64) {
6 let auth: auth(Storage) &Account
7
8 prepare(signer: auth(Storage) &Account) {
9 self.auth = signer
10 }
11
12 execute {
13 // If the COA is already created & saved, there's nothing to do, just return.
14 if let coa = self.auth.storage.borrow<&EVM.CadenceOwnedAccount>(from: /storage/evm) {
15 return
16 }
17
18 let vaultRef = self.auth.storage.borrow<auth(FungibleToken.Withdraw) &FlowToken.Vault>(
19 from: /storage/flowTokenVault
20 ) ?? panic("Could not borrow reference to the owner's Vault!")
21 let vault <- vaultRef.withdraw(amount: amount) as! @FlowToken.Vault
22
23 let account <- EVM.createCadenceOwnedAccount()
24 account.deposit(from: <-vault)
25
26 self.auth.storage.save<@EVM.CadenceOwnedAccount>(
27 <-account,
28 to: /storage/evm
29 )
30 }
31}