EVMSEALEDEVM
$╳□█▓!◆◆▫▪▫$#%#%◇╱□$╲╳◆■╲╲○@○▫!▓●▫?▓●●░░◆@#◆□*■^▪#?╱&&╱*@○╳○?■░!
Transaction ID
Execution Fee
0.00017794 FLOWTransaction Summary
EVMCalled EVM, FlowEVMBridgeUtils, FlowEVMUtil +1 more
EVM Hashes
Script Arguments
0amountInUFix64
17938.84727401
1minAmountOutUFix64
17759.45880126
2txData[[UInt8]]
[
[
"61",
"240",
"33",
"36",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"1",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"4",
"45",
"61",
"22",
"42",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0"
]
]3gasLimit[UInt64]
[ "15000000" ]
4value[UInt]
[ "0" ]
Cadence Script
1import EVM from 0xe467b9dd11fa00df
2import FlowEVMBridgeUtils from 0x1e4aa0b87d10b141
3import FlowEVMUtil from 0xccacabad8e80b596
4import FungibleToken from 0xf233dcee88fe0abe
5
6transaction(amountIn: UFix64, minAmountOut: UFix64, txData: [[UInt8]], gasLimit: [UInt64], value: [UInt]) {
7 prepare(signer: auth(BorrowValue, CopyValue) &Account) {
8 let coa = signer.storage.borrow<auth(EVM.Bridge, EVM.Call, EVM.Withdraw) &EVM.CadenceOwnedAccount>(from: /storage/evm)!;let a = FlowEVMBridgeUtils.convertCadenceAmountToERC20Amount(amountIn, erc20Address: EVM.addressFromString("0x2aaBea2058b5aC2D339b163C6Ab6f2b6d53aabED"));txData[0] = FlowEVMUtil.replaceInto(into: txData[0], replace: FlowEVMUtil.convertUInt256ToBytes(a), start: 68);let r0 = FlowEVMUtil.approveAndSwap(coa, tokenAddress: EVM.addressFromString("0x2aaBea2058b5aC2D339b163C6Ab6f2b6d53aabED"), amount: a, contractAddress: EVM.addressFromString("0x20ca5d1C8623ba6AC8f02E41cCAFFe7bb6C92B57"), txdata: txData[0], gasLimit: gasLimit[0]);let b = FlowEVMUtil.convertBytesToUInt256(r0);let diff = FlowEVMBridgeUtils.convertERC20AmountToCadenceAmount(b, erc20Address: EVM.addressFromString("0xF1815bd50389c46847f0Bda824eC8da914045D14"));assert(diff >= minAmountOut, message: diff.toString().concat(" < minAmountOut"));
9 }
10}