diff --git a/.env.example b/.env.example index d7379cb..7544df5 100644 --- a/.env.example +++ b/.env.example @@ -875,6 +875,61 @@ MODULE_xrp-ledger-nft_NODES[]=http://login:password@127.0.0.2:1234/ MODULE_xrp-ledger-nft_REQUESTER_TIMEOUT=60 MODULE_xrp-ledger-nft_REQUESTER_THREADS=12 +#################### +# Main Rollux Module +#################### + +MODULES[]=rollux-main +MODULE_rollux-main_CLASS=RolluxMainModule +MODULE_rollux-main_NODES[]=http://login:password@127.0.0.1:1234/ +MODULE_rollux-main_NODES[]=http://login:password@127.0.0.2:1234/ +MODULE_rollux-main_REQUESTER_TIMEOUT=60 +MODULE_rollux-main_REQUESTER_THREADS=12 + +###################### +## Trace Rollux Module +###################### + +MODULES[]=rollux-trace +MODULE_rollux-trace_CLASS=RolluxTraceModule +MODULE_rollux-trace_NODES[]=http://login:password@127.0.0.1:1234/ +MODULE_rollux-trace_NODES[]=http://login:password@127.0.0.2:1234/ +MODULE_rollux-trace_REQUESTER_TIMEOUT=60 +MODULE_rollux-trace_REQUESTER_THREADS=12 + +###################### +## ERC20 Rollux Module +###################### + +MODULES[]=rollux-erc-20 +MODULE_rollux-erc-20_CLASS=RolluxERC20Module +MODULE_rollux-erc-20_NODES[]=http://login:password@127.0.0.1:1234/ +MODULE_rollux-erc-20_NODES[]=http://login:password@127.0.0.2:1234/ +MODULE_rollux-erc-20_REQUESTER_TIMEOUT=60 +MODULE_rollux-erc-20_REQUESTER_THREADS=12 + +####################### +## ERC721 Rollux Module +####################### + +MODULES[]=rollux-erc-721 +MODULE_rollux-erc-721_CLASS=RolluxERC721Module +MODULE_rollux-erc-721_NODES[]=http://login:password@127.0.0.1:1234/ +MODULE_rollux-erc-721_NODES[]=http://login:password@127.0.0.2:1234/ +MODULE_rollux-erc-721_REQUESTER_TIMEOUT=60 +MODULE_rollux-erc-721_REQUESTER_THREADS=12 + +######################### +## ERC-1155 Rollux Module +######################### + +MODULES[]=rollux-erc-1155 +MODULE_rollux-erc-1155_CLASS=RolluxERC1155Module +MODULE_rollux-erc-1155_NODES[]=http://login:password@127.0.0.1:1234/ +MODULE_rollux-erc-1155_NODES[]=http://login:password@127.0.0.2:1234/ +MODULE_rollux-erc-1155_REQUESTER_TIMEOUT=60 +MODULE_rollux-erc-1155_REQUESTER_THREADS=12 + ##################### ## Ton Minimal Module ##################### diff --git a/Modules/Common/EVMMainModule.php b/Modules/Common/EVMMainModule.php index 6bb75b2..e956298 100644 --- a/Modules/Common/EVMMainModule.php +++ b/Modules/Common/EVMMainModule.php @@ -34,6 +34,7 @@ abstract class EVMMainModule extends CoreModule EVMSpecialTransactions::ContractCreation->value => 'Contract creation', EVMSpecialTransactions::ContractDestruction->value => 'Contract destruction', EVMSpecialTransactions::Withdrawal->value => 'Withdrawal', + EVMSpecialTransactions::L1Fee->value => 'L1 fee' ]; public ?bool $should_return_events = true; @@ -49,7 +50,8 @@ abstract class EVMMainModule extends CoreModule public array $extra_features = []; public ?string $staking_contract = null; public ?Closure $reward_function = null; - + public ?string $l1_fee_vault = null; + public ?string $base_fee_recipient = null; // final public function pre_initialize() @@ -80,6 +82,12 @@ final public function post_post_initialize() $this->block_entity_name = 'batch'; // We process batches instead of blocks $this->mempool_entity_name = 'queue'; // Unfinalized batches are processed as "mempool" } + + if(is_null($this->l1_fee_vault) && in_array(EVMSpecialFeatures::OPStack, $this->extra_features)) + throw new DeveloperError("For each OP stack chains should be set L1 fee vault address"); + + if(is_null($this->base_fee_recipient) && in_array(EVMSpecialFeatures::OPStack, $this->extra_features)) + throw new DeveloperError("For each OP stack chains should be set base fee recipient address"); } final public function pre_process_block($block_id) @@ -272,6 +280,8 @@ final public function pre_process_block($block_id) $transaction_data[($general_data[$i]['hash'])]['blobGasPrice'] = $receipt_data[$i]['blobGasPrice'] ?? null; $transaction_data[($general_data[$i]['hash'])]['blobGasUsed'] = $receipt_data[$i]['blobGasUsed'] ?? null; } + if(in_array(EVMSpecialFeatures::OPStack, $this->extra_features)) + $transaction_data[($general_data[$i]['hash'])]['l1Fee'] = $receipt_data[$i]['l1Fee'] ?? null; } } else // Mempool processing @@ -399,6 +409,7 @@ final public function pre_process_block($block_id) $this_gas_used = to_int256_from_0xhex($transaction['gasUsed']); $this_burned = (!is_null($base_fee_per_gas)) ? bcmul($base_fee_per_gas, $this_gas_used) : '0'; $this_to_miner = bcsub(bcmul(to_int256_from_0xhex($transaction['effectiveGasPrice']), $this_gas_used), $this_burned); + $this_l1_fee = ((isset($transaction['l1Fee']) && !is_null($transaction['l1Fee'])) ? to_int256_from_0xhex($transaction['l1Fee']) : '0'); if (in_array(EVMSpecialFeatures::EffectiveGasPriceCanBeZero, $this->extra_features)) if ($transaction['effectiveGasPrice'] === '0x0') @@ -434,6 +445,29 @@ final public function pre_process_block($block_id) $this_to_miner = '0'; } + if (in_array(EVMSpecialFeatures::OPStack, $this->extra_features) && $this_l1_fee !== '0') + { + $events[] = [ + 'transaction' => $transaction_hash, + 'address' => $transaction['from'], + 'sort_in_block' => $ijk, + 'sort_in_transaction' => -2, + 'effect' => '-' . $this_l1_fee, + 'failed' => false, + 'extra' => EVMSpecialTransactions::L1Fee->value, + ]; + + $events[] = [ + 'transaction' => $transaction_hash, + 'address' => $this->l1_fee_vault, + 'sort_in_block' => $ijk, + 'sort_in_transaction' => -1, + 'effect' => $this_l1_fee, + 'failed' => false, + 'extra' => EVMSpecialTransactions::L1Fee->value, + ]; + } + // Burning if ($this_burned !== '0') { @@ -449,7 +483,7 @@ final public function pre_process_block($block_id) $events[] = [ 'transaction' => $transaction_hash, - 'address' => '0x00', + 'address' => in_array(EVMSpecialFeatures::OPStack, $this->extra_features) ? $this->base_fee_recipient : '0x00', 'sort_in_block' => $ijk, 'sort_in_transaction' => 1, 'effect' => $this_burned, diff --git a/Modules/Common/EVMTraits.php b/Modules/Common/EVMTraits.php index 880732a..5f6ec41 100644 --- a/Modules/Common/EVMTraits.php +++ b/Modules/Common/EVMTraits.php @@ -16,6 +16,7 @@ enum EVMSpecialTransactions: string { case Burning = 'b'; case FeeToMiner = 'f'; + case L1Fee = 'l1f'; case BlockReward = 'r'; case UncleInclusionReward = 'i'; case UncleReward = 'u'; @@ -38,6 +39,7 @@ enum EVMSpecialFeatures case rskEVM; // Rootstock has different traces and deferred validators rewards (in N+4000 block). case TraceBlockSupport; // Support for `trace_block` in RPC API case EIP4844; // Support of blob transaction + case OPStack; // support of optimistic rollups } trait EVMTraits diff --git a/Modules/RolluxERC1155Module.php b/Modules/RolluxERC1155Module.php new file mode 100644 index 0000000..241884e --- /dev/null +++ b/Modules/RolluxERC1155Module.php @@ -0,0 +1,24 @@ +blockchain = 'rollux'; + $this->module = 'rollux-erc-1155'; + $this->is_main = false; + $this->first_block_date = '2023-06-21'; + $this->first_block_id = 0; + + $this->tests = [ + ['block' => 14850046, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:8:{s:11:"transaction";s:66:"0x051fb896c240aa190ddca3d7e88c1467435e876c6d193cbd9beb2346f86a6267";s:8:"currency";s:42:"0xca765f0ffda51b942d5f105f57b7110dc69214a0";s:7:"address";s:42:"0x84bcb98505cdd43ae1ffc86e3a0e803ffbdb803a";s:8:"sort_key";i:0;s:6:"effect";s:2:"-3";s:5:"extra";s:1:"1";s:5:"block";i:14850046;s:4:"time";s:19:"2024-05-30 10:35:33";}i:1;a:8:{s:11:"transaction";s:66:"0x051fb896c240aa190ddca3d7e88c1467435e876c6d193cbd9beb2346f86a6267";s:8:"currency";s:42:"0xca765f0ffda51b942d5f105f57b7110dc69214a0";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:1;s:6:"effect";s:1:"3";s:5:"extra";s:1:"1";s:5:"block";i:14850046;s:4:"time";s:19:"2024-05-30 10:35:33";}}s:10:"currencies";a:1:{i:0;a:3:{s:2:"id";s:42:"0xca765f0ffda51b942d5f105f57b7110dc69214a0";s:4:"name";s:19:"Rollux Arcade Token";s:6:"symbol";s:6:"ARCADE";}}}'], + ]; + } +} diff --git a/Modules/RolluxERC20Module.php b/Modules/RolluxERC20Module.php new file mode 100644 index 0000000..3cadf4b --- /dev/null +++ b/Modules/RolluxERC20Module.php @@ -0,0 +1,24 @@ +blockchain = 'rollux'; + $this->module = 'rollux-erc-20'; + $this->is_main = false; + $this->first_block_date = '2023-06-21'; + $this->first_block_id = 0; + + $this->tests = [ + ['block' => 16686745, 'result' => 'a:2:{s:6:"events";a:26:{i:0;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0xab07b0c933dacb9d776af7dfaa814a4e3bea8d9a";s:8:"sort_key";i:0;s:6:"effect";s:7:"-180192";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:1;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:1;s:6:"effect";s:6:"180192";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:2;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0xab07b0c933dacb9d776af7dfaa814a4e3bea8d9a";s:8:"sort_key";i:2;s:6:"effect";s:21:"-14339620384511699566";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:3;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:3;s:6:"effect";s:20:"14339620384511699566";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:4;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:4;s:6:"effect";s:6:"-36038";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:5;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0x7e9035e18fdc308b82f3bd03a923d384bc296bfa";s:8:"sort_key";i:5;s:6:"effect";s:5:"36038";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:6;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:6;s:6:"effect";s:20:"-2867924076902339913";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:7;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0x7e9035e18fdc308b82f3bd03a923d384bc296bfa";s:8:"sort_key";i:7;s:6:"effect";s:19:"2867924076902339913";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:8;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0xab07b0c933dacb9d776af7dfaa814a4e3bea8d9a";s:8:"sort_key";i:8;s:6:"effect";s:8:"-5425634";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:9;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:9;s:6:"effect";s:7:"5425634";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:10;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0xab07b0c933dacb9d776af7dfaa814a4e3bea8d9a";s:8:"sort_key";i:10;s:6:"effect";s:22:"-431770145020104429890";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:11;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:11;s:6:"effect";s:21:"431770145020104429890";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:12;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:12;s:6:"effect";s:8:"-1085126";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:13;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0x7e9035e18fdc308b82f3bd03a923d384bc296bfa";s:8:"sort_key";i:13;s:6:"effect";s:7:"1085126";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:14;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:14;s:6:"effect";s:21:"-86354029004020885978";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:15;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0x7e9035e18fdc308b82f3bd03a923d384bc296bfa";s:8:"sort_key";i:15;s:6:"effect";s:20:"86354029004020885978";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:16;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0xe52fe994c84a1c32f4d43bda6121fedabde9f3f7";s:8:"sort_key";i:16;s:6:"effect";s:5:"-9029";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:17;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:17;s:6:"effect";s:4:"9029";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:18;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0xe52fe994c84a1c32f4d43bda6121fedabde9f3f7";s:8:"sort_key";i:18;s:6:"effect";s:20:"-5116180989887260184";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:19;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:19;s:6:"effect";s:19:"5116180989887260184";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:20;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:20;s:6:"effect";s:8:"-4493691";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:21;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:7:"address";s:42:"0xab07b0c933dacb9d776af7dfaa814a4e3bea8d9a";s:8:"sort_key";i:21;s:6:"effect";s:7:"4493691";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:22;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:8:"sort_key";i:22;s:6:"effect";s:22:"-306547047339742042061";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:23;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:7:"address";s:42:"0xab07b0c933dacb9d776af7dfaa814a4e3bea8d9a";s:8:"sort_key";i:23;s:6:"effect";s:21:"306547047339742042061";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:24;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:24;s:6:"effect";s:20:"-9953709226342834923";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}i:25;a:7:{s:11:"transaction";s:66:"0x377831e603911757665d50cdd461021f9b9c0916ec7b15163110814b2edca197";s:8:"currency";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:7:"address";s:42:"0xe52fe994c84a1c32f4d43bda6121fedabde9f3f7";s:8:"sort_key";i:25;s:6:"effect";s:19:"9953709226342834923";s:5:"block";i:16686745;s:4:"time";s:19:"2024-07-11 22:58:51";}}s:10:"currencies";a:3:{i:0;a:4:{s:2:"id";s:42:"0x28c9c7fb3fe3104d2116af26cc8ef7905547349c";s:4:"name";s:6:"Tether";s:6:"symbol";s:4:"USDT";s:8:"decimals";i:6;}i:1;a:4:{s:2:"id";s:42:"0x48023b16c3e81aa7f6effbdeb35bb83f4f31a8fd";s:4:"name";s:7:"Pegasys";s:6:"symbol";s:4:"PSYS";s:8:"decimals";i:18;}i:2;a:4:{s:2:"id";s:42:"0x8421c6102ee8a147facc01977df3b159f7921d54";s:4:"name";s:11:"xUSDT-PSYS3";s:6:"symbol";s:11:"xUSDT-PSYS3";s:8:"decimals";i:18;}}}'], + ]; + } +} diff --git a/Modules/RolluxERC721Module.php b/Modules/RolluxERC721Module.php new file mode 100644 index 0000000..ff3172c --- /dev/null +++ b/Modules/RolluxERC721Module.php @@ -0,0 +1,24 @@ +blockchain = 'rollux'; + $this->module = 'rollux-erc-721'; + $this->is_main = false; + $this->first_block_date = '2023-06-21'; + $this->first_block_id = 0; + + $this->tests = [ + ['block' => 9949101, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:8:{s:11:"transaction";s:66:"0x4dde8ecfe4f88403569806ce257f3c919f30027f067f70221732d43b2fa5460c";s:8:"currency";s:42:"0x7c18839f857cb5e40e7c163cfab46e4f0dee210b";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:0;s:6:"effect";s:2:"-1";s:5:"extra";s:4:"3000";s:5:"block";i:9949101;s:4:"time";s:19:"2024-02-06 23:50:43";}i:1;a:8:{s:11:"transaction";s:66:"0x4dde8ecfe4f88403569806ce257f3c919f30027f067f70221732d43b2fa5460c";s:8:"currency";s:42:"0x7c18839f857cb5e40e7c163cfab46e4f0dee210b";s:7:"address";s:42:"0x5c3ba710db3710f2970bac40e98941c0ec8baac6";s:8:"sort_key";i:1;s:6:"effect";s:1:"1";s:5:"extra";s:4:"3000";s:5:"block";i:9949101;s:4:"time";s:19:"2024-02-06 23:50:43";}}s:10:"currencies";a:1:{i:0;a:3:{s:2:"id";s:42:"0x7c18839f857cb5e40e7c163cfab46e4f0dee210b";s:4:"name";s:8:"MudAiSBT";s:6:"symbol";s:5:"MASBT";}}}'], + ]; + } +} diff --git a/Modules/RolluxMainModule.php b/Modules/RolluxMainModule.php new file mode 100644 index 0000000..fb9b607 --- /dev/null +++ b/Modules/RolluxMainModule.php @@ -0,0 +1,38 @@ +blockchain = 'rollux'; + $this->module = 'rollux-main'; + $this->is_main = true; + $this->first_block_date = '2023-06-21'; + $this->first_block_id = 0; + $this->currency = 'syscoin'; + $this->currency_details = ['name' => 'Syscoin', 'symbol' => 'SYS', 'decimals' => 18, 'description' => null]; + $this->mempool_implemented = false; // Unlike other EVMMainModule heirs, Rollux doesn't implement mempool + + // EVMMainModule + $this->evm_implementation = EVMImplementation::geth; + $this->extra_features = [EVMSpecialFeatures::HasSystemTransactions, EVMSpecialFeatures::EffectiveGasPriceCanBeZero, EVMSpecialFeatures::OPStack]; // Rollux is a fork of Optimism, so it has the same special txs + $this->reward_function = function($block_id) + { + return '0'; + }; + + $this->l1_fee_vault = '0x420000000000000000000000000000000000001A'; + $this->base_fee_recipient = '0x4200000000000000000000000000000000000019'; + + $this->tests = [ + ['block' => 16725100, 'result' => 'a:2:{s:6:"events";a:12:{i:0;a:8:{s:11:"transaction";s:66:"0x38c04d90612a9aeb78366e5decf3189d01d0fe4bf5dda68dc677ad6f76c6e700";s:7:"address";s:42:"0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001";s:6:"effect";s:2:"-0";s:6:"failed";s:1:"f";s:5:"extra";N;s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:0;}i:1;a:8:{s:11:"transaction";s:66:"0x38c04d90612a9aeb78366e5decf3189d01d0fe4bf5dda68dc677ad6f76c6e700";s:7:"address";s:42:"0x4200000000000000000000000000000000000015";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";N;s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:1;}i:2;a:8:{s:11:"transaction";s:66:"0xe6d1a85b81005383bb0db6119c0a35d83e2935ccb3c2979cd0fe63194b08de30";s:7:"address";s:42:"0x1241f44bfa102ab7386c784959bae3d0fb923734";s:6:"effect";s:8:"-1845267";s:6:"failed";s:1:"f";s:5:"extra";s:3:"l1f";s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:2;}i:3;a:8:{s:11:"transaction";s:66:"0xe6d1a85b81005383bb0db6119c0a35d83e2935ccb3c2979cd0fe63194b08de30";s:7:"address";s:42:"0x420000000000000000000000000000000000001A";s:6:"effect";s:7:"1845267";s:6:"failed";s:1:"f";s:5:"extra";s:3:"l1f";s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:3;}i:4;a:8:{s:11:"transaction";s:66:"0xe6d1a85b81005383bb0db6119c0a35d83e2935ccb3c2979cd0fe63194b08de30";s:7:"address";s:42:"0x1241f44bfa102ab7386c784959bae3d0fb923734";s:6:"effect";s:9:"-74983750";s:6:"failed";s:1:"f";s:5:"extra";s:1:"b";s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:4;}i:5;a:8:{s:11:"transaction";s:66:"0xe6d1a85b81005383bb0db6119c0a35d83e2935ccb3c2979cd0fe63194b08de30";s:7:"address";s:42:"0x4200000000000000000000000000000000000019";s:6:"effect";s:8:"74983750";s:6:"failed";s:1:"f";s:5:"extra";s:1:"b";s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:5;}i:6;a:8:{s:11:"transaction";s:66:"0xe6d1a85b81005383bb0db6119c0a35d83e2935ccb3c2979cd0fe63194b08de30";s:7:"address";s:42:"0x1241f44bfa102ab7386c784959bae3d0fb923734";s:6:"effect";s:16:"-149967500000000";s:6:"failed";s:1:"f";s:5:"extra";s:1:"f";s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:6;}i:7;a:8:{s:11:"transaction";s:66:"0xe6d1a85b81005383bb0db6119c0a35d83e2935ccb3c2979cd0fe63194b08de30";s:7:"address";s:42:"0x4200000000000000000000000000000000000011";s:6:"effect";s:15:"149967500000000";s:6:"failed";s:1:"f";s:5:"extra";s:1:"f";s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:7;}i:8;a:8:{s:11:"transaction";s:66:"0xe6d1a85b81005383bb0db6119c0a35d83e2935ccb3c2979cd0fe63194b08de30";s:7:"address";s:42:"0x1241f44bfa102ab7386c784959bae3d0fb923734";s:6:"effect";s:2:"-0";s:6:"failed";s:1:"f";s:5:"extra";N;s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:8;}i:9;a:8:{s:11:"transaction";s:66:"0xe6d1a85b81005383bb0db6119c0a35d83e2935ccb3c2979cd0fe63194b08de30";s:7:"address";s:42:"0xc1539b7084a9f793cbeada7382443dcdbc4d9add";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";N;s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:9;}i:10;a:8:{s:11:"transaction";N;s:7:"address";s:4:"0x00";s:6:"effect";s:2:"-0";s:6:"failed";s:1:"f";s:5:"extra";s:1:"r";s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:10;}i:11;a:8:{s:11:"transaction";N;s:7:"address";s:42:"0x4200000000000000000000000000000000000011";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";s:1:"r";s:5:"block";i:16725100;s:4:"time";s:19:"2024-07-12 20:17:21";s:8:"sort_key";i:11;}}s:10:"currencies";N;}'], + ]; + } +} diff --git a/Modules/RolluxTraceModule.php b/Modules/RolluxTraceModule.php new file mode 100644 index 0000000..203a4b4 --- /dev/null +++ b/Modules/RolluxTraceModule.php @@ -0,0 +1,27 @@ +blockchain = 'rollux'; + $this->module = 'rollux-trace'; + $this->complements = 'rollux-main'; + $this->is_main = false; + $this->first_block_date = '2023-06-21'; + $this->first_block_id = 0; + + // EVMTraceModule + $this->evm_implementation = EVMImplementation::geth; + $this->tests = [ + ['block' => 16682478, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:7:{s:11:"transaction";s:66:"0x362532acd8e234ab0544ecf5cfcebdf475f877a3a656c3e009b90a31d09129d7";s:7:"address";s:42:"0x35ee5876db071b527dc62fd3ee3c32e4304d8c23";s:8:"sort_key";i:0;s:6:"effect";s:17:"-1000000000000000";s:5:"extra";N;s:5:"block";i:16682478;s:4:"time";s:19:"2024-07-11 20:36:37";}i:1;a:7:{s:11:"transaction";s:66:"0x362532acd8e234ab0544ecf5cfcebdf475f877a3a656c3e009b90a31d09129d7";s:7:"address";s:42:"0xa7e69de356b587ce22157234490612e5b20f29d3";s:8:"sort_key";i:1;s:6:"effect";s:16:"1000000000000000";s:5:"extra";N;s:5:"block";i:16682478;s:4:"time";s:19:"2024-07-11 20:36:37";}}s:10:"currencies";N;}'] + ]; + } +}