%~&░▒@▪$?◆╲~▓░◇█▫?▫@^#%■▓^□●◇╳#╲%%&■░$╲◆█○~^●$&░&▒◇╲?■▓#^◇□$█╱#█
Transaction ID
Execution Fee
0.0049 FLOWExecution Error
assertion failed: tx failed. status: failed [306]: execution reverted
10
11transaction(amount: UFix64, txData: [[UInt8]], gasLimit: [UInt64], value: [UInt]) {
12 prepare(signer: auth(BorrowValue, CopyValue, SaveValue, IssueStorageCapabilityController) &Account) {
13 let coa = signer.storage.borrow<auth(EVM.Bridge, EVM.Withdraw, EVM.Call) &EVM.CadenceOwnedAccount>(from: /storage/evm)!;let inVault = signer.storage.borrow<auth(FungibleToken.Withdraw) &FlowToken.Vault>(from: /storage/flowTokenVault)!;let startBalance = inVault.balance;let a <- inVault.withdraw(amount: amount);let b = FlowEVMBridgeUtils.convertCadenceAmountToERC20Amount(a.balance, erc20Address: FlowEVMBridgeConfig.getEVMAddressAssociated(with: Type<@FlowToken.Vault>())!);coa.deposit(from: <-(a as! @FlowToken.Vault))
14 let r0 = FlowEVMUtil.runCall(coa, contractAddress: EVM.addressFromString("0xeEDC6Ff75e1b10B903D9013c358e446a73d35341"), txdata: txData[0], gasLimit: gasLimit[0], value: EVM.Balance(attoflow: UInt(b)));let c = FlowEVMUtil.convertBytesToUInt256(r0.slice(from: r0.length - 32, upTo: r0.length))
15 txData[1] = FlowEVMUtil.replaceInto(into: txData[1], replace: FlowEVMUtil.convertUInt256ToBytes(c), start: 68);let r1 = FlowEVMUtil.approveAndSwap(coa, tokenAddress: EVM.addressFromString("0xF1815bd50389c46847f0Bda824eC8da914045D14"), amount: c, contractAddress: EVM.addressFromString("0x0e9712Ad7dbC3c0AC25765f57E8805C3fd3cF717"), txdata: txData[1], gasLimit: gasLimit[1]);let d = FlowEVMUtil.convertBytesToUInt256(r1)
16 let e <- FlowEVMUtil.bridgeTokenToCadence(coa, capCopy: signer.storage.copy<Capability<auth(FungibleToken.Withdraw) &{FungibleToken.Provider}>>(from: FlowEVMBridgeConfig.providerCapabilityStoragePath)!, vaultType: Type<@EVMVMBridgedToken_99af3eea856556646c98c8b9b2548fe815240750.Vault>(), amount: d)
17 let f <- getAccount(0xe468e4c5081b5501).capabilities.borrow<&{SwapInterfaces.PairPublic}>(SwapConfig.PairPublicPath)!.swap(vaultIn: <- e, exactAmountOut: nil);;inVault.deposit(from: <- f);assert(inVault.balance >= startBalance, message: inVault.balance.toString().concat(" < ").concat(startBalance.toString()));
18 }
19}Raw Error
[Error Code: 1101] error caused by: 1 error occurred: * transaction execute failed: [Error Code: 1101] cadence runtime error: Execution failed: --> c0768457c8a407e49239688ccc46fb88fc185873aa44bfd31b2d28e68a7b9273:15:122 | 15 | txData[1] = FlowEVMUtil.replaceInto(into: txData[1], replace: FlowEVMUtil.convertUInt256ToBytes(c), start: 68);let r1 = FlowEVMUtil.approveAndSwap(coa, tokenAddress: EVM.addressFromString("0xF1815bd50389c46847f0Bda824eC8da914045D14"), amount: c, contractAddress: EVM.addressFromString("0x0e9712Ad7dbC3c0AC25765f57E8805C3fd3cF717"), txdata: txData[1], gasLimit: gasLimit[1]);let d = FlowEVMUtil.convertBytesToUInt256(r1) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --> 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
FT TransferCalled EVM, EVMVMBridgedToken_99af3eea856556646c98c8b9b2548fe815240750, FlowEVMBridgeConfig +6 more
Script Arguments
[
[
"4",
"228",
"90",
"175",
"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",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"241",
"129",
"91",
"213",
"3",
"137",
"196",
"104",
"71",
"240",
"189",
"168",
"36",
"236",
"141",
"169",
"20",
"4",
"93",
"20",
"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",
"11",
"184",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"2",
"221",
"220",
"6",
"70",
"16",
"90",
"63",
"212",
"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",
"163",
"222",
"78",
"214",
"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"
],
[
"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",
"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",
"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",
"21",
"29",
"96",
"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"
]
][ "15000000", "15000000" ]
[ "27492553820000000000", "0" ]
Cadence Script
1import EVM from 0xe467b9dd11fa00df
2import EVMVMBridgedToken_99af3eea856556646c98c8b9b2548fe815240750 from 0x1e4aa0b87d10b141
3import FlowEVMBridgeConfig from 0x1e4aa0b87d10b141
4import FlowEVMBridgeUtils from 0x1e4aa0b87d10b141
5import FlowEVMUtil from 0xccacabad8e80b596
6import FlowToken from 0x1654653399040a61
7import FungibleToken from 0xf233dcee88fe0abe
8import SwapConfig from 0xb78ef7afa52ff906
9import SwapInterfaces from 0xb78ef7afa52ff906
10
11transaction(amount: UFix64, txData: [[UInt8]], gasLimit: [UInt64], value: [UInt]) {
12 prepare(signer: auth(BorrowValue, CopyValue, SaveValue, IssueStorageCapabilityController) &Account) {
13 let coa = signer.storage.borrow<auth(EVM.Bridge, EVM.Withdraw, EVM.Call) &EVM.CadenceOwnedAccount>(from: /storage/evm)!;let inVault = signer.storage.borrow<auth(FungibleToken.Withdraw) &FlowToken.Vault>(from: /storage/flowTokenVault)!;let startBalance = inVault.balance;let a <- inVault.withdraw(amount: amount);let b = FlowEVMBridgeUtils.convertCadenceAmountToERC20Amount(a.balance, erc20Address: FlowEVMBridgeConfig.getEVMAddressAssociated(with: Type<@FlowToken.Vault>())!);coa.deposit(from: <-(a as! @FlowToken.Vault))
14 let r0 = FlowEVMUtil.runCall(coa, contractAddress: EVM.addressFromString("0xeEDC6Ff75e1b10B903D9013c358e446a73d35341"), txdata: txData[0], gasLimit: gasLimit[0], value: EVM.Balance(attoflow: UInt(b)));let c = FlowEVMUtil.convertBytesToUInt256(r0.slice(from: r0.length - 32, upTo: r0.length))
15 txData[1] = FlowEVMUtil.replaceInto(into: txData[1], replace: FlowEVMUtil.convertUInt256ToBytes(c), start: 68);let r1 = FlowEVMUtil.approveAndSwap(coa, tokenAddress: EVM.addressFromString("0xF1815bd50389c46847f0Bda824eC8da914045D14"), amount: c, contractAddress: EVM.addressFromString("0x0e9712Ad7dbC3c0AC25765f57E8805C3fd3cF717"), txdata: txData[1], gasLimit: gasLimit[1]);let d = FlowEVMUtil.convertBytesToUInt256(r1)
16 let e <- FlowEVMUtil.bridgeTokenToCadence(coa, capCopy: signer.storage.copy<Capability<auth(FungibleToken.Withdraw) &{FungibleToken.Provider}>>(from: FlowEVMBridgeConfig.providerCapabilityStoragePath)!, vaultType: Type<@EVMVMBridgedToken_99af3eea856556646c98c8b9b2548fe815240750.Vault>(), amount: d)
17 let f <- getAccount(0xe468e4c5081b5501).capabilities.borrow<&{SwapInterfaces.PairPublic}>(SwapConfig.PairPublicPath)!.swap(vaultIn: <- e, exactAmountOut: nil);;inVault.deposit(from: <- f);assert(inVault.balance >= startBalance, message: inVault.balance.toString().concat(" < ").concat(startBalance.toString()));
18 }
19}