█□?◆@%◇~░▪▒◇□@╳%◇$▪◆◆○◇○&@◆▒●▒▪■◆▒!▫%╳%░●$◇?╲◆■◆╳●□?█~▫^◆%%%■◆╲$
Transaction ID
Execution Fee
0.00003399 FLOWExecution Error
assertion failed: tx failed. status: failed [306]: execution reverted
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 endVault = signer.storage.borrow<&{FungibleToken.Vault}>(from: /storage/flowTokenVault)!;let a = FlowEVMBridgeUtils.convertCadenceAmountToERC20Amount(amountIn, erc20Address: EVM.addressFromString("0x2aaBea2058b5aC2D339b163C6Ab6f2b6d53aabED"));txData[0] = FlowEVMUtil.replaceInto(into: txData[0], replace: FlowEVMUtil.convertUInt256ToBytes(a), start: 4);let r0 = FlowEVMUtil.approveAndSwap(coa, tokenAddress: EVM.addressFromString("0x2aaBea2058b5aC2D339b163C6Ab6f2b6d53aabED"), amount: a, contractAddress: EVM.addressFromString("0xf45AFe28fd5519d5f8C1d4787a4D5f724C0eFa4d"), txdata: txData[0], gasLimit: gasLimit[0]);let b = FlowEVMUtil.convertBytesToUInt256(r0.slice(from: r0.length - 32, upTo: r0.length))
9 let c <- FlowEVMUtil.bridgeFlowToCadence(coa, amount: b);assert(c.balance >= minAmountOut, message: c.balance.toString().concat(" < minAmountOut"));endVault.deposit(from: <- c);
10 }
11}Raw Error
[Error Code: 1101] error caused by: 1 error occurred: * transaction execute failed: [Error Code: 1101] cadence runtime error: Execution failed: --> c95387231d313cdee8a7cbea20e1448923dd30a1aaeeee7c8f1b2954a04ce8f1:8:494 | 8 | let coa = signer.storage.borrow<auth(EVM.Bridge, EVM.Call, EVM.Withdraw) &EVM.CadenceOwnedAccount>(from: /storage/evm)!;let endVault = signer.storage.borrow<&{FungibleToken.Vault}>(from: /storage/flowTokenVault)!;let a = FlowEVMBridgeUtils.convertCadenceAmountToERC20Amount(amountIn, erc20Address: EVM.addressFromString("0x2aaBea2058b5aC2D339b163C6Ab6f2b6d53aabED"));txData[0] = FlowEVMUtil.replaceInto(into: txData[0], replace: FlowEVMUtil.convertUInt256ToBytes(a), start: 4);let r0 = FlowEV... | ^^^^^^ --> ccacabad8e80b596.FlowEVMUtil:13:15 error: assertion failed: tx failed. status: failed [306]: execution reverted --> ccacabad8e80b596.FlowEVMUtil:19:8 Was this error unhelpful? Consider suggesting an improvement here: https://github.com/onflow/cadence/issues.
Transaction Summary
Contract CallCalled EVM, FlowEVMBridgeUtils, FlowEVMUtil +1 more
Script Arguments
[
[
"24",
"203",
"175",
"229",
"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",
"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",
"160",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"2",
"184",
"124",
"150",
"107",
"192",
"11",
"194",
"196",
"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",
"105",
"17",
"133",
"133",
"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",
"2",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"42",
"171",
"234",
"32",
"88",
"181",
"172",
"45",
"51",
"155",
"22",
"60",
"106",
"182",
"242",
"182",
"213",
"58",
"171",
"237",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"211",
"191",
"83",
"218",
"193",
"6",
"160",
"41",
"11",
"4",
"131",
"236",
"188",
"137",
"212",
"15",
"204",
"150",
"31",
"62"
]
][ "15000000" ]
[ "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 endVault = signer.storage.borrow<&{FungibleToken.Vault}>(from: /storage/flowTokenVault)!;let a = FlowEVMBridgeUtils.convertCadenceAmountToERC20Amount(amountIn, erc20Address: EVM.addressFromString("0x2aaBea2058b5aC2D339b163C6Ab6f2b6d53aabED"));txData[0] = FlowEVMUtil.replaceInto(into: txData[0], replace: FlowEVMUtil.convertUInt256ToBytes(a), start: 4);let r0 = FlowEVMUtil.approveAndSwap(coa, tokenAddress: EVM.addressFromString("0x2aaBea2058b5aC2D339b163C6Ab6f2b6d53aabED"), amount: a, contractAddress: EVM.addressFromString("0xf45AFe28fd5519d5f8C1d4787a4D5f724C0eFa4d"), txdata: txData[0], gasLimit: gasLimit[0]);let b = FlowEVMUtil.convertBytesToUInt256(r0.slice(from: r0.length - 32, upTo: r0.length))
9 let c <- FlowEVMUtil.bridgeFlowToCadence(coa, amount: b);assert(c.balance >= minAmountOut, message: c.balance.toString().concat(" < minAmountOut"));endVault.deposit(from: <- c);
10 }
11}