Evaluate Expression
1
{
2
"type": "evaluate",
3
"expression": {
4
"code": "return 2 + 2 == 4;"
5
}
6
}
Copied!
The Evaluate Expression lets you run arbitrary JavaScript code. This expression will match if the provided JavaScript code returns true.
In the JavaScript code that you provide, you'll have two "magic" variables available to you:
  • tx: This variable holds informations regarding the transaction itself
  • logs: This variable holds an array containing information about all of the emitted logs during the execution of the transaction
Below you can see an example of the tx and logs variables, as well as where your provided code will get extrapolated.
1
var tx = {"hash":"0x7f350a3ccea4418f3532c6e07179b2d8a03262316ef4aa4159a15d39f182b796","block_hash":"0xbf32b1954f43ab07a9a97bd72701e33c384d8da95cc3d85eb07d655ef54029a9","block_number":11184616,"from":"0xf43a28ceea7080ef2d9972e92f7d52af203763c4","gas":291925,"gas_price":47100000000,"cumulative_gas_used":5902118,"gas_used":235856,"input":"0x38ed1739000000000000000000000000000000000000000000000002bb70c4f827b000000000000000000000000000000000000000000000000000000000000016b3f51d00000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000f43a28ceea7080ef2d9972e92f7d52af203763c4000000000000000000000000000000000000000000000000000000005fa167730000000000000000000000000000000000000000000000000000000000000004000000000000000000000000913d8adf7ce6986a8cbfee5a54725d9eea4f07290000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7","nonce":4051,"to":"0x7a250d5630b4cf539739df2c5dacb4c659f2488d","index":105,"value":"0x","status":true,"addresses":["0xf43a28ceea7080ef2d9972e92f7d52af203763c4","0x7a250d5630b4cf539739df2c5dacb4c659f2488d","0xe3efd3465f354375484ba648408bd3b5f8278ece","0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5","0x3041cbd36888becc7bbcbc0045e3b1f144466f5f","0x913d8adf7ce6986a8cbfee5a54725d9eea4f0729","0x6b175474e89094c44da98b954eedeac495271d0f","0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48","0xb7277a6e95992041568d9391d09d0122023778a2","0xdac17f958d2ee523a2206206994597c13d831ec7"],"contract_ids":["eth:1:0xf43a28ceea7080ef2d9972e92f7d52af203763c4","eth:1:0x7a250d5630b4cf539739df2c5dacb4c659f2488d","eth:1:0xe3efd3465f354375484ba648408bd3b5f8278ece","eth:1:0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5","eth:1:0x3041cbd36888becc7bbcbc0045e3b1f144466f5f","eth:1:0x913d8adf7ce6986a8cbfee5a54725d9eea4f0729","eth:1:0x6b175474e89094c44da98b954eedeac495271d0f","eth:1:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48","eth:1:0xb7277a6e95992041568d9391d09d0122023778a2","eth:1:0xdac17f958d2ee523a2206206994597c13d831ec7"],"network_id":"1","function_selector":"0x38ed1739","timestamp":"2020-11-03T15:02:06+01:00","method":"","decoded_input":null,"logs":[{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0x913d8adf7ce6986a8cbfee5a54725d9eea4f0729","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000f43a28ceea7080ef2d9972e92f7d52af203763c4","0x000000000000000000000000e3efd3465f354375484ba648408bd3b5f8278ece"],"data":"0x000000000000000000000000000000000000000000000002bb70c4f827b00000"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0x913d8adf7ce6986a8cbfee5a54725d9eea4f0729","topics":["0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925","0x000000000000000000000000f43a28ceea7080ef2d9972e92f7d52af203763c4","0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d"],"data":"0xfffffffffffffffffffffffffffffffffffffffffffffea1f6c4abcb9cc0c054"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0x6b175474e89094c44da98b954eedeac495271d0f","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000e3efd3465f354375484ba648408bd3b5f8278ece","0x000000000000000000000000ae461ca67b15dc8dc81ce7615e0320da1a9ab8d5"],"data":"0x000000000000000000000000000000000000000000000014c73b94bf1f32edfd"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xe3efd3465f354375484ba648408bd3b5f8278ece","topics":["0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1"],"data":"0x00000000000000000000000000000000000000000000253d818269ba218ecb6b0000000000000000000000000000000000000000000004e48eeb00e09e059786"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xe3efd3465f354375484ba648408bd3b5f8278ece","topics":["0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822","0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d","0x000000000000000000000000ae461ca67b15dc8dc81ce7615e0320da1a9ab8d5"],"data":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002bb70c4f827b00000000000000000000000000000000000000000000000000014c73b94bf1f32edfd0000000000000000000000000000000000000000000000000000000000000000"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000ae461ca67b15dc8dc81ce7615e0320da1a9ab8d5","0x0000000000000000000000003041cbd36888becc7bbcbc0045e3b1f144466f5f"],"data":"0x0000000000000000000000000000000000000000000000000000000016fa9fb2"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5","topics":["0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1"],"data":"0x00000000000000000000000000000000000000000002ea0f2c64d4f4909f81a60000000000000000000000000000000000000000000000000000033b78af9dae"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5","topics":["0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822","0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d","0x0000000000000000000000003041cbd36888becc7bbcbc0045e3b1f144466f5f"],"data":"0x000000000000000000000000000000000000000000000014c73b94bf1f32edfd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016fa9fb2"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xdac17f958d2ee523a2206206994597c13d831ec7","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000003041cbd36888becc7bbcbc0045e3b1f144466f5f","0x000000000000000000000000f43a28ceea7080ef2d9972e92f7d52af203763c4"],"data":"0x0000000000000000000000000000000000000000000000000000000016ee13ba"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0x3041cbd36888becc7bbcbc0045e3b1f144466f5f","topics":["0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1"],"data":"0x0000000000000000000000000000000000000000000000000000065352d8660700000000000000000000000000000000000000000000000000000654a467439f"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0x3041cbd36888becc7bbcbc0045e3b1f144466f5f","topics":["0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822","0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d","0x000000000000000000000000f43a28ceea7080ef2d9972e92f7d52af203763c4"],"data":"0x0000000000000000000000000000000000000000000000000000000016fa9fb2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016ee13ba"}}]};
2
var logs = [{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0x913d8adf7ce6986a8cbfee5a54725d9eea4f0729","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000f43a28ceea7080ef2d9972e92f7d52af203763c4","0x000000000000000000000000e3efd3465f354375484ba648408bd3b5f8278ece"],"data":"0x000000000000000000000000000000000000000000000002bb70c4f827b00000"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0x913d8adf7ce6986a8cbfee5a54725d9eea4f0729","topics":["0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925","0x000000000000000000000000f43a28ceea7080ef2d9972e92f7d52af203763c4","0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d"],"data":"0xfffffffffffffffffffffffffffffffffffffffffffffea1f6c4abcb9cc0c054"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0x6b175474e89094c44da98b954eedeac495271d0f","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000e3efd3465f354375484ba648408bd3b5f8278ece","0x000000000000000000000000ae461ca67b15dc8dc81ce7615e0320da1a9ab8d5"],"data":"0x000000000000000000000000000000000000000000000014c73b94bf1f32edfd"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xe3efd3465f354375484ba648408bd3b5f8278ece","topics":["0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1"],"data":"0x00000000000000000000000000000000000000000000253d818269ba218ecb6b0000000000000000000000000000000000000000000004e48eeb00e09e059786"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xe3efd3465f354375484ba648408bd3b5f8278ece","topics":["0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822","0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d","0x000000000000000000000000ae461ca67b15dc8dc81ce7615e0320da1a9ab8d5"],"data":"0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002bb70c4f827b00000000000000000000000000000000000000000000000000014c73b94bf1f32edfd0000000000000000000000000000000000000000000000000000000000000000"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x000000000000000000000000ae461ca67b15dc8dc81ce7615e0320da1a9ab8d5","0x0000000000000000000000003041cbd36888becc7bbcbc0045e3b1f144466f5f"],"data":"0x0000000000000000000000000000000000000000000000000000000016fa9fb2"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5","topics":["0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1"],"data":"0x00000000000000000000000000000000000000000002ea0f2c64d4f4909f81a60000000000000000000000000000000000000000000000000000033b78af9dae"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xae461ca67b15dc8dc81ce7615e0320da1a9ab8d5","topics":["0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822","0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d","0x0000000000000000000000003041cbd36888becc7bbcbc0045e3b1f144466f5f"],"data":"0x000000000000000000000000000000000000000000000014c73b94bf1f32edfd000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016fa9fb2"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0xdac17f958d2ee523a2206206994597c13d831ec7","topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000003041cbd36888becc7bbcbc0045e3b1f144466f5f","0x000000000000000000000000f43a28ceea7080ef2d9972e92f7d52af203763c4"],"data":"0x0000000000000000000000000000000000000000000000000000000016ee13ba"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0x3041cbd36888becc7bbcbc0045e3b1f144466f5f","topics":["0x1c411e9a96e071241c2f21f7726b17ae89e3cab4c78be50e062b03a9fffbbad1"],"data":"0x0000000000000000000000000000000000000000000000000000065352d8660700000000000000000000000000000000000000000000000000000654a467439f"}},{"name":"","anonymous":false,"inputs":null,"raw":{"address":"0x3041cbd36888becc7bbcbc0045e3b1f144466f5f","topics":["0xd78ad95fa46c994b6551d0da85fc275fe613ce37657fb8d5e3d130840159d822","0x0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d","0x000000000000000000000000f43a28ceea7080ef2d9972e92f7d52af203763c4"],"data":"0x0000000000000000000000000000000000000000000000000000000016fa9fb2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000016ee13ba"}}];
3
var stateDiff = [{"soltype":{"name":"allowance","type":"mapping (address => mapping (address => uint256))","storage_location":"storage","components":null,"offset":0,"index":"0x0000000000000000000000000000000000000000000000000000000000000003","indexed":false},"original":{"0x5c281d4e9ef3d5ba96e2387cab50374d7429a5b8":{"0x21f165fcf2a49bb1c5c983fc242a7e54b979cd0d":"0"}},"dirty":{"0x5c281d4e9ef3d5ba96e2387cab50374d7429a5b8":{"0x21f165fcf2a49bb1c5c983fc242a7e54b979cd0d":"115792089237316195423570985008687907853269984665640564039457584007913129639935"}},"raw":[{"address":"0x6b175474e89094c44da98b954eedeac495271d0f","key":"0x7ddc77e015f8e1848e61c6b601de9427a933634450ddbc1b4652acd94a2e765f","original":"0x0000000000000000000000000000000000000000000000000000000000000000","dirty":"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"}]}];
4
โ€‹
5
// your code will get interpolated here
Copied!
Network, filesystem and OS level actions are disabled in the execution environment of the provided code snippet.
At least one contract from your project needs to be participating in the transaction (this is true for all expressions).
Last modified 7d ago
Copy link