diff --git a/Modules/BounceBitERC1155Module.php b/Modules/BounceBitERC1155Module.php new file mode 100644 index 0000000..0e889b3 --- /dev/null +++ b/Modules/BounceBitERC1155Module.php @@ -0,0 +1,20 @@ +blockchain = 'bouncebit'; + $this->module = 'bouncebit-erc-1155'; + $this->is_main = false; + $this->first_block_date = '2024-04-08'; + $this->first_block_id = 1; + } +} diff --git a/Modules/BounceBitERC20Module.php b/Modules/BounceBitERC20Module.php new file mode 100644 index 0000000..46f4922 --- /dev/null +++ b/Modules/BounceBitERC20Module.php @@ -0,0 +1,24 @@ +blockchain = 'bouncebit'; + $this->module = 'bouncebit-erc-20'; + $this->is_main = false; + $this->first_block_date = '2024-04-08'; + $this->first_block_id = 1; + $this->tests = [ + ['block' => 150387, 'result' => 'a:2:{s:6:"events";a:2:{i:0;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:2372;s:4:"time";s:19:"2024-04-10 19:24:23";s:8:"sort_key";i:0;}i:1;a:8:{s:11:"transaction";N;s:7:"address";s:8:"treasury";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";s:1:"r";s:5:"block";i:2372;s:4:"time";s:19:"2024-04-10 19:24:23";s:8:"sort_key";i:1;}}s:10:"currencies";N;}'], + ['block' => 2369594, 'result' => 'a:2:{s:6:"events";a:4:{i:0;a:7:{s:11:"transaction";s:66:"0x5bec430459b9f2ad54f60dd691aa6f562aa7483e6ea4759cd5829282e953b296";s:8:"currency";s:42:"0x7f150c293c97172c75983bd8ac084c187107ea19";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:0;s:6:"effect";s:16:"-100000000000000";s:5:"block";i:2369594;s:4:"time";s:19:"2024-07-16 14:24:57";}i:1;a:7:{s:11:"transaction";s:66:"0x5bec430459b9f2ad54f60dd691aa6f562aa7483e6ea4759cd5829282e953b296";s:8:"currency";s:42:"0x7f150c293c97172c75983bd8ac084c187107ea19";s:7:"address";s:42:"0x8fbad0655df10e92cca0ecc48a902b170ac7b2b0";s:8:"sort_key";i:1;s:6:"effect";s:15:"100000000000000";s:5:"block";i:2369594;s:4:"time";s:19:"2024-07-16 14:24:57";}i:2;a:7:{s:11:"transaction";s:66:"0x5bec430459b9f2ad54f60dd691aa6f562aa7483e6ea4759cd5829282e953b296";s:8:"currency";s:42:"0xf5e11df1ebcf78b6b6d26e04ff19cd786a1e81dc";s:7:"address";s:42:"0x8fbad0655df10e92cca0ecc48a902b170ac7b2b0";s:8:"sort_key";i:2;s:6:"effect";s:16:"-100000000000000";s:5:"block";i:2369594;s:4:"time";s:19:"2024-07-16 14:24:57";}i:3;a:7:{s:11:"transaction";s:66:"0x5bec430459b9f2ad54f60dd691aa6f562aa7483e6ea4759cd5829282e953b296";s:8:"currency";s:42:"0xf5e11df1ebcf78b6b6d26e04ff19cd786a1e81dc";s:7:"address";s:42:"0x7f150c293c97172c75983bd8ac084c187107ea19";s:8:"sort_key";i:3;s:6:"effect";s:15:"100000000000000";s:5:"block";i:2369594;s:4:"time";s:19:"2024-07-16 14:24:57";}}s:10:"currencies";a:2:{i:0;a:4:{s:2:"id";s:42:"0x7f150c293c97172c75983bd8ac084c187107ea19";s:4:"name";s:18:"Liquid staked BBTC";s:6:"symbol";s:6:"stBBTC";s:8:"decimals";i:18;}i:1;a:4:{s:2:"id";s:42:"0xf5e11df1ebcf78b6b6d26e04ff19cd786a1e81dc";s:4:"name";s:13:"BounceBit BTC";s:6:"symbol";s:4:"BBTC";s:8:"decimals";i:18;}}}'], + ]; + } +} diff --git a/Modules/BounceBitERC721Module.php b/Modules/BounceBitERC721Module.php new file mode 100644 index 0000000..91ad962 --- /dev/null +++ b/Modules/BounceBitERC721Module.php @@ -0,0 +1,20 @@ +blockchain = 'bouncebit'; + $this->module = 'bouncebit-erc-721'; + $this->is_main = false; + $this->first_block_date = '2024-04-08'; + $this->first_block_id = 1; + } +} \ No newline at end of file diff --git a/Modules/BounceBitMainModule.php b/Modules/BounceBitMainModule.php new file mode 100644 index 0000000..742c928 --- /dev/null +++ b/Modules/BounceBitMainModule.php @@ -0,0 +1,38 @@ +blockchain = 'bouncebit'; + $this->module = 'bouncebit-main'; + $this->is_main = true; + $this->first_block_date = '2024-04-08'; + $this->first_block_id = 1; + $this->currency = 'bouncebit'; + $this->currency_details = ['name' => 'BounceBit', 'symbol' => 'BB', 'decimals' => 18, 'description' => null]; + + // EVMMainModule + $this->evm_implementation = EVMImplementation::geth; + $this->extra_features = [EVMSpecialFeatures::FeesToTreasury]; + $this->reward_function = function($block_id) + { + return '0'; + }; + + // Handles + $this->handles_implemented = false; + $this->tests = [ + ['block' => 1, 'result' => 'a:2:{s:6:"events";a:2:{i:0;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:1;s:4:"time";s:19:"2024-04-08 06:43:00";s:8:"sort_key";i:0;}i:1;a:8:{s:11:"transaction";N;s:7:"address";s:8:"treasury";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";s:1:"r";s:5:"block";i:1;s:4:"time";s:19:"2024-04-08 06:43:00";s:8:"sort_key";i:1;}}s:10:"currencies";N;}'], + ['block' => 2372, 'result' => 'a:2:{s:6:"events";a:2:{i:0;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:2372;s:4:"time";s:19:"2024-04-10 19:24:23";s:8:"sort_key";i:0;}i:1;a:8:{s:11:"transaction";N;s:7:"address";s:8:"treasury";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";s:1:"r";s:5:"block";i:2372;s:4:"time";s:19:"2024-04-10 19:24:23";s:8:"sort_key";i:1;}}s:10:"currencies";N;}'], + ['block' => 2372111, 'result' => 'a:2:{s:6:"events";a:8:{i:0;a:8:{s:11:"transaction";s:66:"0x5c9d15c0918dfd621b4e0e54a70d84c4d1ecacf36cde6190353defe861c24dde";s:7:"address";s:42:"0x503c2a26bf64294d7955c929127a29847f7db57a";s:6:"effect";s:16:"-246680000000000";s:6:"failed";s:1:"f";s:5:"extra";s:1:"b";s:5:"block";i:2372111;s:4:"time";s:19:"2024-07-16 16:56:29";s:8:"sort_key";i:0;}i:1;a:8:{s:11:"transaction";s:66:"0x5c9d15c0918dfd621b4e0e54a70d84c4d1ecacf36cde6190353defe861c24dde";s:7:"address";s:4:"0x00";s:6:"effect";s:15:"246680000000000";s:6:"failed";s:1:"f";s:5:"extra";s:1:"b";s:5:"block";i:2372111;s:4:"time";s:19:"2024-07-16 16:56:29";s:8:"sort_key";i:1;}i:2;a:8:{s:11:"transaction";s:66:"0x5c9d15c0918dfd621b4e0e54a70d84c4d1ecacf36cde6190353defe861c24dde";s:7:"address";s:42:"0x503c2a26bf64294d7955c929127a29847f7db57a";s:6:"effect";s:15:"-30835000000000";s:6:"failed";s:1:"f";s:5:"extra";s:1:"f";s:5:"block";i:2372111;s:4:"time";s:19:"2024-07-16 16:56:29";s:8:"sort_key";i:2;}i:3;a:8:{s:11:"transaction";s:66:"0x5c9d15c0918dfd621b4e0e54a70d84c4d1ecacf36cde6190353defe861c24dde";s:7:"address";s:8:"treasury";s:6:"effect";s:14:"30835000000000";s:6:"failed";s:1:"f";s:5:"extra";s:1:"f";s:5:"block";i:2372111;s:4:"time";s:19:"2024-07-16 16:56:29";s:8:"sort_key";i:3;}i:4;a:8:{s:11:"transaction";s:66:"0x5c9d15c0918dfd621b4e0e54a70d84c4d1ecacf36cde6190353defe861c24dde";s:7:"address";s:42:"0x503c2a26bf64294d7955c929127a29847f7db57a";s:6:"effect";s:2:"-0";s:6:"failed";s:1:"f";s:5:"extra";N;s:5:"block";i:2372111;s:4:"time";s:19:"2024-07-16 16:56:29";s:8:"sort_key";i:4;}i:5;a:8:{s:11:"transaction";s:66:"0x5c9d15c0918dfd621b4e0e54a70d84c4d1ecacf36cde6190353defe861c24dde";s:7:"address";s:42:"0xc226ff4526afee15d32665f3ef3b291ac1e0c731";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";N;s:5:"block";i:2372111;s:4:"time";s:19:"2024-07-16 16:56:29";s:8:"sort_key";i:5;}i:6;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:2372111;s:4:"time";s:19:"2024-07-16 16:56:29";s:8:"sort_key";i:6;}i:7;a:8:{s:11:"transaction";N;s:7:"address";s:8:"treasury";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";s:1:"r";s:5:"block";i:2372111;s:4:"time";s:19:"2024-07-16 16:56:29";s:8:"sort_key";i:7;}}s:10:"currencies";N;}'], + ]; + } +} diff --git a/Modules/BounceBitTraceModule.php b/Modules/BounceBitTraceModule.php new file mode 100644 index 0000000..320b080 --- /dev/null +++ b/Modules/BounceBitTraceModule.php @@ -0,0 +1,27 @@ +blockchain = 'bouncebit'; + $this->module = 'bouncebit-trace'; + $this->complements = 'bouncebit-main'; + $this->is_main = false; + $this->first_block_date = '2024-04-08'; + $this->first_block_id = 1; + + // EVMTraceModule + $this->evm_implementation = EVMImplementation::geth; + $this->tests = [ + ['block' =>2374738, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:7:{s:11:"transaction";s:66:"0x4254a319a69c866eb701c01086ae23355eaa6a0c2510516f2c6bf46f98e205c9";s:7:"address";s:42:"0x3be72fcc9eaba1283744909b7b8260a4bc8ec956";s:8:"sort_key";i:0;s:6:"effect";s:21:"-83893757661856936691";s:5:"extra";N;s:5:"block";i:2374738;s:4:"time";s:19:"2024-07-16 19:32:06";}i:1;a:7:{s:11:"transaction";s:66:"0x4254a319a69c866eb701c01086ae23355eaa6a0c2510516f2c6bf46f98e205c9";s:7:"address";s:42:"0xd2f2e0cb8aa04235c868acbc9ac9782af0d21595";s:8:"sort_key";i:1;s:6:"effect";s:20:"83893757661856936691";s:5:"extra";N;s:5:"block";i:2374738;s:4:"time";s:19:"2024-07-16 19:32:06";}}s:10:"currencies";N;}'], + ]; + } +} diff --git a/Modules/Common/EVMMainModule.php b/Modules/Common/EVMMainModule.php index 6bb75b2..0e360bb 100644 --- a/Modules/Common/EVMMainModule.php +++ b/Modules/Common/EVMMainModule.php @@ -238,6 +238,9 @@ final public function pre_process_block($block_id) // Data processing + if (in_array(EVMSpecialFeatures::FeesToTreasury, $this->extra_features)) + $miner = 'treasury'; + $this->block_time = date('Y-m-d H:i:s', to_int64_from_0xhex($block_time)); if (($ic = count($general_data)) !== count($receipt_data)) diff --git a/Modules/Common/EVMTraits.php b/Modules/Common/EVMTraits.php index 880732a..8dbde81 100644 --- a/Modules/Common/EVMTraits.php +++ b/Modules/Common/EVMTraits.php @@ -38,6 +38,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 FeesToTreasury; // when the fee is not directly added to the block author balance } trait EVMTraits