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