EVMSEALEDEVM
□!╱╲█#█*●●░◆●██▫#?^○#%■╲■$?○◆╳□^░%●?█▪█░█▒%*~◇%▪?○▓~╲○▪▫●◇#$░~╳╱
Transaction ID
Execution Fee
0.00214 FLOWTransaction Summary
EVMCalled EVM
EVM Hashes
Contracts
Script Arguments
0hexEncodedTxs[String]
[ "02f902358202eb218503bbf075808503bbf075828304977794604f45ce1b8ce702597e00ff586f370ff1738a6b80b901c4f30d9b08000000000000000000000000b1e079854268985431935ce53aa54c8e1722fa0d000000000000000000000000662a4a899820021c6835b048bd85ddbbe736fc730000000000000000000000000000000000000000000000000000000000000f2c00000000000000000000000000000000000000000000000000000000699387a900000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000041fd9540772adf1a99b84d5057ab2e2cf2fc3fca69fabee32e4580c890cff915ba1b9d16157b3dd391d9d943aecef95016e9c510ec1f9428db7ed603f98921a8d81b00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004131985de86ee69f0a77fe6c06e37bb7782f484891fd3d1a2e8f8b6efa342d0a424d837141fe6a6d9d1b3f75e41518225ddc03e82c129588551c718833b34e03aa1b00000000000000000000000000000000000000000000000000000000000000c080a01cef277f0397c311f5ef06c55cc42f4a076408c6f87c226d0c8eae80e515bb3aa03dcc6f45d8f0faabcf94d972d4e9af8caef961751bccb01c9c67473e963500e5" ]
Cadence Script
1import EVM from 0xe467b9dd11fa00df
2
3transaction(hexEncodedTxs: [String], coinbase: String) {
4 execute {
5 let txs: [[UInt8]] = []
6 for tx in hexEncodedTxs {
7 txs.append(tx.decodeHex())
8 }
9
10 // If there's only one tx, use `EVM.run`.
11 // If there are more, then use `EVM.batchRun`
12 if txs.length == 1 {
13 let txResult = EVM.run(
14 tx: txs[0],
15 coinbase: EVM.addressFromString(coinbase)
16 )
17 assert(
18 txResult.status == EVM.Status.failed || txResult.status == EVM.Status.successful,
19 message: "evm_error=\(txResult.errorMessage);evm_error_code=\(txResult.errorCode)"
20 )
21 return
22 }
23
24 let txResults = EVM.batchRun(
25 txs: txs,
26 coinbase: EVM.addressFromString(coinbase)
27 )
28
29 // If at least one of the EVM transactions in the batch is either
30 // failed or successful, in other words not invalid, we let the
31 // Cadence transaction succeed.
32 for txResult in txResults {
33 if txResult.status == EVM.Status.failed || txResult.status == EVM.Status.successful {
34 return
35 }
36 }
37
38 // Otherwise, all EVM transactions are invalid txs and can't be
39 // executed (such as nonce too low).
40 // In this case, we fail the Cadence transaction with the error
41 // message from the first EVM transaction.
42 for txResult in txResults {
43 assert(
44 txResult.status == EVM.Status.failed || txResult.status == EVM.Status.successful,
45 message: "evm_error=\(txResult.errorMessage);evm_error_code=\(txResult.errorCode)"
46 )
47 }
48 }
49}