github.com/koko1123/flow-go-1@v0.29.6/fvm/blueprints/scripts/fundAccountTemplate.cdc (about)

     1  import FungibleToken from 0xFUNGIBLETOKENADDRESS
     2  import FlowToken from 0xFLOWTOKENADDRESS
     3  
     4  transaction(amount: UFix64, recipient: Address) {
     5  	let sentVault: @FungibleToken.Vault
     6  	prepare(signer: AuthAccount) {
     7  	let vaultRef = signer.borrow<&FlowToken.Vault>(from: /storage/flowTokenVault)
     8  		?? panic("failed to borrow reference to sender vault")
     9  	self.sentVault <- vaultRef.withdraw(amount: amount)
    10  	}
    11  	execute {
    12  	let receiverRef =  getAccount(recipient)
    13  		.getCapability(/public/flowTokenReceiver)
    14  		.borrow<&{FungibleToken.Receiver}>()
    15  		?? panic("failed to borrow reference to recipient vault")
    16  	receiverRef.deposit(from: <-self.sentVault)
    17  	}
    18  }