Skip to content

Commit

Permalink
Fix EVM transactions (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling authored Feb 26, 2024
1 parent 58f97ef commit 04cc488
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion cadence/transactions/evm/mint_and_fund_evm_address.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ transaction(to: EVM.EVMAddress, amount: UFix64, gasLimit: UInt64) {
let mintedVault <- minter.mintTokens(amount: amount)
destroy minter

let balance = EVM.Balance(attoflow: 0)
balance.setFLOW(flow: amount)

self.coa.deposit(from: <-mintedVault)
self.coa.call(
to: to,
data: [],
gasLimit: gasLimit,
value: EVM.Balance(flow: amount),
value: balance,
)
}
}
5 changes: 4 additions & 1 deletion lib/flow/fund.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,15 @@ transaction(to: EVM.EVMAddress, amount: UFix64, gasLimit: UInt64) {
let mintedVault <- minter.mintTokens(amount: amount)
destroy minter
let balance = EVM.Balance(attoflow: 0)
balance.setFLOW(flow: amount)
self.coa.deposit(from: <-mintedVault)
self.coa.call(
to: to,
data: [],
gasLimit: gasLimit,
value: EVM.Balance(flow: amount),
value: balance,
)
}
}
Expand Down

0 comments on commit 04cc488

Please sign in to comment.