EVMSEALEDEVM
~#^■▫○■~▫╳*&■▫@▪●○●◆╱╱◇~█*◆$▓█░!▓$#*○▓%#█?%▒?╱%$□□▪!╲░╲╳▪■!◇?○╲□
Transaction ID
Execution Fee
0.00274 FLOWTransaction Summary
EVMCalled EVM
EVM Hashes
Contracts
Script Arguments
0hexEncodedTxs[String]
[ "f9012f830dfec685047b208d0083035f30943c2269811836af69497e5f486a85d7316753cf6280b8c43161b7f600000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000006d0000000000000000000000000000000000000000000000096fe1ae13fd9a7395000000000000000000000000000000000000000000000000000000c3e83df4c500000000000000000000000000000000000000000000000000000000000000108205faa06d8ea9449056c3103c94cd494d9ef0137dd015726eee05bc4b0f74072235e6f0a0209c178871909008d042270be052563cf2d496bfa9370e15196c8d4340c7f280", "f9012f830dfec785047b208d0083035f30943c2269811836af69497e5f486a85d7316753cf6280b8c43161b7f600000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000018b0000000000000000000000000000000000000000000000003e1f9924b4c1dc190000000000000000000000000000000000000000000000000000000047868c0800000000000000000000000000000000000000000000000000000000000000108205f9a0fb9370d489b1482a381051e14df7f4dbc84ec77ad9551734fa845fa36ece67aaa04b68ff0646e609420dd84f52c38183afd123d68f96ab95e93ae38a83e39507c0", "f9012f830dfec885047b208d0083035f30943c2269811836af69497e5f486a85d7316753cf6280b8c43161b7f6000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000155000000000000000000000000000000000000000000000000000000007282c1ef00000000000000000000000000000000000000000000000000000028bed0160000000000000000000000000000000000000000000000000000000000000000108205faa0b8fe67cc20c8b2bdea0ec6599edcad5f0e7267345a2a4b188944852531b911e5a064a78660f1e31371ffd4d2c472ba0084d0be3d945529504ae49ff5f61432fdd1" ]
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}