├── CODEOWNERS ├── .gitignore ├── CONTRIBUTING.md ├── CONTRIBUTORS.md ├── Modules ├── RootstockERC721Module.php ├── RootstockERC1155Module.php ├── RootstockERC20Module.php ├── TronInternalModule.php ├── BitcoinCashFCTModule.php ├── BitcoinCashNFCTModule.php ├── BOBERC721Module.php ├── BOBERC1155Module.php ├── BaseERC721Module.php ├── BOBERC20Module.php ├── BaseERC1155Module.php ├── LineaERC721Module.php ├── TronTRC721Module.php ├── opBNBBEP721Module.php ├── BaseERC20Module.php ├── LineaERC1155Module.php ├── TronTRC1155Module.php ├── opBNBBEP1155Module.php ├── BotanixERC721Module.php ├── FantomERC721Module.php ├── LineaERC20Module.php ├── TronTRC10Module.php ├── TronTRC20Module.php ├── opBNBBEP20Module.php ├── BotanixERC1155Module.php ├── FantomERC1155Module.php ├── OptimismERC721Module.php ├── zkSyncEraERC721Module.php ├── BotanixERC20Module.php ├── OptimismERC1155Module.php ├── zkSyncEraERC1155Module.php ├── FantomERC20Module.php ├── OptimismERC20Module.php ├── zkSyncEraERC20Module.php ├── ArbitrumOneERC721Module.php ├── ArbitrumOneERC1155Module.php ├── BNBBEP721Module.php ├── ArbitrumOneERC20Module.php ├── BNBBEP1155Module.php ├── PolygonERC721Module.php ├── BNBBEP20Module.php ├── EthereumERC1155Module.php ├── EthereumERC721Module.php ├── PolygonERC1155Module.php ├── PolygonERC20Module.php ├── EthereumERC20Module.php ├── CardanoNativeTokensModule.php ├── EthereumClassicERC721Module.php ├── EthereumClassicERC1155Module.php ├── EthereumClassicERC20Module.php ├── GnosisChainERC1155Module.php ├── GnosisChainERC721Module.php ├── BitcoinBRC20Module.php ├── GnosisChainERC20Module.php ├── BOBTraceModule.php ├── BaseTraceModule.php ├── LineaTraceModule.php ├── opBNBTraceModule.php ├── OptimismTraceModule.php ├── BotanixTraceModule.php ├── zkSyncEraTraceModule.php ├── EthereumTraceModule.php ├── TONNFJettonModule.php ├── BNBTraceModule.php ├── PolygonzkEVMERC721Module.php ├── TONJettonModule.php ├── PolygonzkEVMERC1155Module.php ├── PolygonzkEVMERC20Module.php ├── FantomTraceModule.php ├── EthereumClassicTraceModule.php ├── RootstockTraceModule.php ├── DogecoinMainModule.php ├── DashDIP2Module.php ├── AvalancheERC721Module.php ├── AvalancheERC1155Module.php ├── AvalancheERC20Module.php ├── LitecoinMimbleWimbleModule.php ├── TONMainModule.php ├── PolygonTraceModule.php ├── BitcoinOmniModule.php ├── AvalancheTraceModule.php ├── PeercoinMainModule.php ├── BeaconChainProposalsModule.php ├── GnosisChainTraceModule.php ├── DigiByteMainModule.php ├── BeaconChainAttestationsModule.php ├── DashMainModule.php ├── BotanixMainModule.php ├── LitecoinMainModule.php ├── BeaconChainWithdrawalsModule.php ├── BOBMainModule.php ├── FantomMainModule.php ├── PolygonzkEVMMainModule.php ├── LineaMainModule.php ├── PolygonMainModule.php ├── BitcoinCashMainModule.php ├── SolanaMainModule.php ├── ArbitrumOneTraceModule.php ├── BeaconChainDepositsModule.php ├── BeaconChainPenaltiesModule.php ├── ZcashMainModule.php ├── SolanaFTModule.php ├── SolanaNFTModule.php ├── GroestlcoinMainModule.php ├── opBNBMainModule.php ├── BlastERC721Module.php ├── BaseMainModule.php ├── EthereumClassicMainModule.php ├── PolygonzkEVMTraceModule.php ├── BNBMainModule.php ├── CardanoMainModule.php ├── RootstockMainModule.php ├── ArbitrumOneMainModule.php ├── HandshakeMainModule.php ├── RippleNFTModule.php ├── GnosisChainMainModule.php ├── AvalancheMainModule.php ├── TronMainModule.php ├── zkSyncEraMainModule.php ├── Common │ ├── TONTraits.php │ ├── BeaconChainLikeTraits.php │ ├── TVMInternalModule.php │ ├── MimbleWimbleModule.php │ ├── BeaconChainLikeWithdrawalsModule.php │ └── BeaconChainLikeProposalsModule.php ├── BlastERC20Module.php ├── BitcoinMainModule.php ├── EthereumMainModule.php ├── RippleFTModule.php ├── BlastERC1155Module.php ├── MoneroMainModule.php └── OptimismMainModule.php ├── LICENSE.md ├── Init.php └── Engine ├── Crypto ├── Base32.php └── Base58.php ├── ModuleInterface.php ├── Database.php ├── Exceptions.php └── Env.php /CODEOWNERS: -------------------------------------------------------------------------------- 1 | * nikzh@nikzh.com 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.env 2 | .idea 3 | .vscode 4 | .DS_Store 5 | /vendor/ 6 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | 3xpl Core contributing guide 2 | ============================ 3 | 4 | By contributing to this repository, you agree to license your work under the MIT license unless specified otherwise at the top of the file itself. 5 | 6 | Any work contributed where you are not the original author must contain its license header with the original author(s) and source. 7 | 8 | When contributing, please retain the copyright header in full and feel free to add yourself to the CONTRIBUTORS.md file. 9 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | 3xpl Core contributors 2 | ====================== 3 | 4 | * [Nikita Zhavoronkov](https://github.com/Har01d) 5 | - Core, UTXO modules, EVM modules 6 | * [Yulian Volianskyi](https://github.com/jzethar) 7 | - Beacon Chain modules 8 | * [alexqrid](https://github.com/alexqrid) 9 | - TVM modules 10 | - BRC-20 module 11 | - Solana Token module 12 | * [Oleg Makaussov](https://github.com/Lorgansar) 13 | - Cardano Tokens modules 14 | * [Kirill Kuzminykh](https://github.com/Oskal174) 15 | - Rootstock modules 16 | - Solana Token module 17 | -------------------------------------------------------------------------------- /Modules/RootstockERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'rootstock'; 15 | $this->module = 'rootstock-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2018-01-02'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Modules/RootstockERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'rootstock'; 15 | $this->module = 'rootstock-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2018-01-02'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Modules/RootstockERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'rootstock'; 15 | $this->module = 'rootstock-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2018-01-02'; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Modules/TronInternalModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'tron'; 15 | $this->module = 'tron-internal'; 16 | $this->complements = 'tron-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2018-06-25'; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BitcoinCashFCTModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bitcoin-cash'; 15 | $this->module = 'bitcoin-cash-fct'; 16 | $this->is_main = false; 17 | $this->first_block_id = 792_773; 18 | $this->first_block_date = '2023-05-15'; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BitcoinCashNFCTModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bitcoin-cash'; 15 | $this->module = 'bitcoin-cash-nfct'; 16 | $this->is_main = false; 17 | $this->first_block_id = 792_773; 18 | $this->first_block_date = '2023-05-15'; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BOBERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bob'; 15 | $this->module = 'bob-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2024-04-11'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BOBERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bob'; 15 | $this->module = 'bob-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2024-04-11'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BaseERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'base'; 15 | $this->module = 'base-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-06-15'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BOBERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bob'; 15 | $this->module = 'bob-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2024-04-11'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BaseERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'base'; 15 | $this->module = 'base-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-06-15'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/LineaERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'linea'; 15 | $this->module = 'linea-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-07-06'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/TronTRC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'tron'; 16 | $this->module = 'tron-trc-721'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2018-06-25'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/opBNBBEP721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'opbnb'; 15 | $this->module = 'opbnb-bep-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-08-11'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BaseERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'base'; 15 | $this->module = 'base-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-06-15'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/LineaERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'linea'; 15 | $this->module = 'linea-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-07-06'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/TronTRC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'tron'; 16 | $this->module = 'tron-trc-1155'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2018-06-25'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/opBNBBEP1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'opbnb'; 15 | $this->module = 'opbnb-bep-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-08-11'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BotanixERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'botanix'; 15 | $this->module = 'botanix-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-11-22'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/FantomERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'fantom'; 15 | $this->module = 'fantom-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2019-12-27'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/LineaERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'linea'; 15 | $this->module = 'linea-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-07-06'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/TronTRC10Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'tron'; 16 | $this->module = 'tron-trc-10'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2018-06-25'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/TronTRC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'tron'; 16 | $this->module = 'tron-trc-20'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2018-06-25'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/opBNBBEP20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'opbnb'; 15 | $this->module = 'opbnb-bep-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-08-11'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BotanixERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'botanix'; 15 | $this->module = 'botanix-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-11-22'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/FantomERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'fantom'; 15 | $this->module = 'fantom-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2019-12-27'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/OptimismERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'optimism'; 15 | $this->module = 'optimism-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2021-11-11'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/zkSyncEraERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'zksync-era'; 15 | $this->module = 'zksync-era-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-02-15'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BotanixERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'botanix'; 15 | $this->module = 'botanix-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-11-22'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/OptimismERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'optimism'; 15 | $this->module = 'optimism-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2021-11-11'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/zkSyncEraERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'zksync-era'; 15 | $this->module = 'zksync-era-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-02-15'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/FantomERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'fantom'; 15 | $this->module = 'fantom-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2019-12-27'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/OptimismERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'optimism'; 15 | $this->module = 'optimism-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2021-11-11'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/zkSyncEraERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'zksync-era'; 15 | $this->module = 'zksync-era-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-02-15'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/ArbitrumOneERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'arbitrum-one'; 15 | $this->module = 'arbitrum-one-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2021-05-28'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/ArbitrumOneERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'arbitrum-one'; 15 | $this->module = 'arbitrum-one-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2021-05-28'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BNBBEP721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bnb'; 16 | $this->module = 'bnb-bep-721'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-08-29'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/ArbitrumOneERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'arbitrum-one'; 15 | $this->module = 'arbitrum-one-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2021-05-28'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/BNBBEP1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bnb'; 16 | $this->module = 'bnb-bep-1155'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-08-29'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/PolygonERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'polygon'; 16 | $this->module = 'polygon-erc-721'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-05-30'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/BNBBEP20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bnb'; 16 | $this->module = 'bnb-bep-20'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-08-29'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/EthereumERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ethereum'; 16 | $this->module = 'ethereum-erc-1155'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2015-07-30'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/EthereumERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ethereum'; 16 | $this->module = 'ethereum-erc-721'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2015-07-30'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/PolygonERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'polygon'; 16 | $this->module = 'polygon-erc-1155'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-05-30'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/PolygonERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'polygon'; 16 | $this->module = 'polygon-erc-20'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-05-30'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/EthereumERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ethereum'; 16 | $this->module = 'ethereum-erc-20'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2015-07-30'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/CardanoNativeTokensModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'cardano'; 15 | $this->module = 'cardano-native-tokens'; 16 | $this->is_main = false; 17 | $this->first_block_id = 1; 18 | $this->first_block_date = '2017-09-23'; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/EthereumClassicERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ethereum-classic'; 15 | $this->module = 'ethereum-classic-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2015-07-30'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/EthereumClassicERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ethereum-classic'; 15 | $this->module = 'ethereum-classic-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2015-07-30'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/EthereumClassicERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ethereum-classic'; 15 | $this->module = 'ethereum-classic-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2015-07-30'; 18 | $this->first_block_id = 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Modules/GnosisChainERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'gnosis-chain'; 16 | $this->module = 'gnosis-chain-erc-1155'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2018-10-08'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/GnosisChainERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'gnosis-chain'; 16 | $this->module = 'gnosis-chain-erc-721'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2018-10-08'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/BitcoinBRC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bitcoin'; 16 | $this->module = 'bitcoin-brc-20'; 17 | $this->is_main = false; 18 | $this->first_block_id = 779_832; 19 | $this->first_block_date = '2023-03-08'; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/GnosisChainERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'gnosis-chain'; 16 | $this->module = 'gnosis-chain-erc-20'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2018-10-08'; 19 | $this->first_block_id = 0; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/BOBTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bob'; 15 | $this->module = 'bob-trace'; 16 | $this->complements = 'bob-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2024-04-11'; 19 | $this->first_block_id = 0; 20 | 21 | // EVMTraceModule 22 | $this->evm_implementation = EVMImplementation::geth; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BaseTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'base'; 15 | $this->module = 'base-trace'; 16 | $this->complements = 'base-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2023-06-15'; 19 | $this->first_block_id = 0; 20 | 21 | // EVMTraceModule 22 | $this->evm_implementation = EVMImplementation::geth; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/LineaTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'linea'; 15 | $this->module = 'linea-trace'; 16 | $this->complements = 'linea-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2023-07-06'; 19 | $this->first_block_id = 0; 20 | 21 | // EVMTraceModule 22 | $this->evm_implementation = EVMImplementation::geth; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/opBNBTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'opbnb'; 15 | $this->module = 'opbnb-trace'; 16 | $this->complements = 'opbnb-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2023-08-11'; 19 | $this->first_block_id = 0; 20 | 21 | // EVMTraceModule 22 | $this->evm_implementation = EVMImplementation::geth; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/OptimismTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'optimism'; 15 | $this->module = 'optimism-trace'; 16 | $this->complements = 'optimism-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2021-11-11'; 19 | $this->first_block_id = 0; 20 | 21 | // EVMTraceModule 22 | $this->evm_implementation = EVMImplementation::geth; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BotanixTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'botanix'; 15 | $this->module = 'botanix-trace'; 16 | $this->complements = 'botanix-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2023-11-22'; 19 | 20 | // EVMTraceModule 21 | $this->evm_implementation = EVMImplementation::geth; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Modules/zkSyncEraTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'zksync-era'; 15 | $this->module = 'zksync-era-trace'; 16 | $this->complements = 'zksync-era-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2023-02-15'; 19 | $this->first_block_id = 0; 20 | 21 | // EVMTraceModule 22 | $this->evm_implementation = EVMImplementation::geth; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/EthereumTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ethereum'; 15 | $this->module = 'ethereum-trace'; 16 | $this->complements = 'ethereum-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2015-07-30'; 19 | 20 | // EVMTraceModule 21 | $this->evm_implementation = EVMImplementation::Erigon; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Modules/TONNFJettonModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ton'; 16 | $this->module = 'ton-nft'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2019-11-15'; 19 | $this->first_block_id = 0; 20 | 21 | // TONLikeMainModule 22 | $this->workchain = '0'; // BaseChain 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BNBTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bnb'; 15 | $this->module = 'bnb-trace'; 16 | $this->complements = 'bnb-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-08-29'; 19 | $this->first_block_id = 0; 20 | 21 | // EVMTraceModule 22 | $this->evm_implementation = EVMImplementation::Erigon; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/PolygonzkEVMERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'polygon-zkevm'; 15 | $this->module = 'polygon-zkevm-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-03-24'; 18 | $this->first_block_id = 0; 19 | 20 | // EVMTraceModule 21 | $this->extra_features = [EVMSpecialFeatures::zkEVM]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Modules/TONJettonModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ton'; 16 | $this->module = 'ton-jetton'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2019-11-15'; 19 | $this->first_block_id = 0; 20 | 21 | // TONLikeMainModule 22 | $this->workchain = '0'; // BaseChain 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/PolygonzkEVMERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'polygon-zkevm'; 15 | $this->module = 'polygon-zkevm-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-03-24'; 18 | $this->first_block_id = 0; 19 | 20 | // EVMTraceModule 21 | $this->extra_features = [EVMSpecialFeatures::zkEVM]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Modules/PolygonzkEVMERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'polygon-zkevm'; 15 | $this->module = 'polygon-zkevm-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2023-03-24'; 18 | $this->first_block_id = 0; 19 | 20 | // EVMTraceModule 21 | $this->extra_features = [EVMSpecialFeatures::zkEVM]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Modules/FantomTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'fantom'; 15 | $this->module = 'fantom-trace'; 16 | $this->complements = 'fantom-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2019-12-27'; 19 | $this->first_block_id = 0; 20 | 21 | // EVMTraceModule 22 | $this->evm_implementation = EVMImplementation::geth; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/EthereumClassicTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ethereum-classic'; 15 | $this->module = 'ethereum-classic-trace'; 16 | $this->complements = 'ethereum-classic-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2015-07-30'; 19 | 20 | // EVMTraceModule 21 | $this->evm_implementation = EVMImplementation::geth; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Modules/RootstockTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'rootstock'; 15 | $this->module = 'rootstock-trace'; 16 | $this->complements = 'rootstock-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2018-01-02'; 19 | 20 | // EVMTraceModule 21 | $this->evm_implementation = EVMImplementation::geth; 22 | $this->extra_features = [EVMSpecialFeatures::TraceBlockSupport]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/DogecoinMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'dogecoin'; 13 | $this->module = 'dogecoin-main'; 14 | $this->is_main = true; 15 | $this->currency = 'dogecoin'; 16 | $this->currency_details = ['name' => 'Dogecoin', 'symbol' => 'DOGE', 'decimals' => 8, 'description' => null]; 17 | $this->first_block_date = '2013-12-06'; 18 | 19 | // UTXOMainModule 20 | $this->p2pk_prefix1 = ''; 21 | $this->p2pk_prefix2 = '1e'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Modules/DashDIP2Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'dash'; 16 | $this->module = 'dash-dip-2'; 17 | $this->is_main = false; 18 | $this->currency = 'dash'; 19 | $this->currency_details = ['name' => 'Dash', 'symbol' => 'DASH', 'decimals' => 8, 'description' => null]; 20 | $this->first_block_id = 1028160; 21 | $this->first_block_date = '2019-02-27'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Modules/AvalancheERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'avalanche'; 15 | $this->module = 'avalanche-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2015-07-30'; // That's for block #0, in reality it starts on 2020-09-23 with block #1... ¯\_(ツ)_/¯ 18 | $this->first_block_id = 0; 19 | $this->forking_implemented = false; // All blocks are instantly finalized 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/AvalancheERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'avalanche'; 15 | $this->module = 'avalanche-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2015-07-30'; // That's for block #0, in reality it starts on 2020-09-23 with block #1... ¯\_(ツ)_/¯ 18 | $this->first_block_id = 0; 19 | $this->forking_implemented = false; // All blocks are instantly finalized 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/AvalancheERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'avalanche'; 15 | $this->module = 'avalanche-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2015-07-30'; // That's for block #0, in reality it starts on 2020-09-23 with block #1... ¯\_(ツ)_/¯ 18 | $this->first_block_id = 0; 19 | $this->forking_implemented = false; // All blocks are instantly finalized 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Modules/LitecoinMimbleWimbleModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'litecoin'; 16 | $this->module = 'litecoin-mweb'; 17 | $this->is_main = false; 18 | $this->currency = 'litecoin'; 19 | $this->currency_details = ['name' => 'Litecoin', 'symbol' => 'LTC', 'decimals' => 8, 'description' => null]; 20 | $this->first_block_id = 2_265_984; 21 | $this->first_block_date = '2022-05-20'; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Modules/TONMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ton'; 15 | $this->module = 'ton-main'; 16 | $this->is_main = true; 17 | $this->currency = 'ton'; 18 | $this->currency_details = ['name' => 'TON', 'symbol' => '💎', 'decimals' => 9, 'description' => null]; 19 | $this->first_block_date = '2019-11-15'; 20 | $this->first_block_id = 0; 21 | 22 | // TONLikeMainModule 23 | $this->workchain = '0'; // BaseChain 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Modules/PolygonTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'polygon'; 16 | $this->module = 'polygon-trace'; 17 | $this->complements = 'polygon-main'; 18 | $this->is_main = false; 19 | $this->first_block_date = '2020-05-30'; 20 | $this->first_block_id = 0; 21 | 22 | // EVMTraceModule 23 | $this->evm_implementation = EVMImplementation::Erigon; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Modules/BitcoinOmniModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bitcoin'; 16 | $this->module = 'bitcoin-omni'; 17 | $this->is_main = false; 18 | $this->first_block_id = 252_316; 19 | $this->first_block_date = '2013-08-15'; 20 | 21 | // UTXOOmniModule 22 | $this->genesis_block = 252_316; // First real transactions are in block 252_317, so we use this one for genesis transactions 23 | $this->genesis_json = 'BitcoinOmni.json'; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Modules/AvalancheTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'avalanche'; 15 | $this->module = 'avalanche-trace'; 16 | $this->complements = 'avalanche-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2015-07-30'; // That's for block #0, in reality it starts on 2020-09-23 with block #1... ¯\_(ツ)_/¯ 19 | $this->first_block_id = 0; 20 | $this->forking_implemented = false; // All blocks are instantly finalized 21 | 22 | // EVMTraceModule 23 | $this->evm_implementation = EVMImplementation::geth; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Modules/PeercoinMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'peercoin'; 13 | $this->module = 'peercoin-main'; 14 | $this->is_main = true; 15 | $this->currency = 'peercoin'; 16 | $this->currency_details = ['name' => 'Peercoin', 'symbol' => 'PPC', 'decimals' => 6, 'description' => null]; 17 | $this->first_block_date = '2012-08-16'; 18 | 19 | // UTXOMainModule 20 | $this->extra_features = [UTXOSpecialFeatures::Not8Decimals, UTXOSpecialFeatures::OneAddressInScriptPubKey]; 21 | $this->p2pk_prefix1 = ''; 22 | $this->p2pk_prefix2 = '37'; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BeaconChainProposalsModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'beacon-chain'; 15 | $this->module = 'beacon-chain-proposals'; 16 | $this->complements = 'beacon-chain-deposits'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-12-01'; 19 | $this->first_block_id = 0; 20 | 21 | // BeaconChainLikeModule 22 | $this->chain_config = [ 23 | 'BELLATRIX_FORK_EPOCH' => 144896, 24 | 'SLOT_PER_EPOCH' => 32, 25 | 'DELAY' => 2, 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Modules/GnosisChainTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'gnosis-chain'; 16 | $this->module = 'gnosis-chain-trace'; 17 | $this->complements = 'gnosis-chain-main'; 18 | $this->is_main = false; 19 | $this->first_block_date = '2018-10-08'; 20 | $this->first_block_id = 0; 21 | 22 | // EVMTraceModule 23 | $this->evm_implementation = EVMImplementation::Erigon; // Change to geth if you're running Nethermind, but this would be slower 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Modules/DigiByteMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'digibyte'; 16 | $this->module = 'digibyte-main'; 17 | $this->is_main = true; 18 | $this->currency = 'digibyte'; 19 | $this->currency_details = ['name' => 'DigiByte', 'symbol' => 'DGB', 'decimals' => 8, 'description' => null]; 20 | $this->first_block_date = '2014-01-10'; 21 | 22 | // UTXOMainModule 23 | $this->p2pk_prefix1 = ''; 24 | $this->p2pk_prefix2 = '1e'; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Modules/BeaconChainAttestationsModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'beacon-chain'; 15 | $this->module = 'beacon-chain-attestations'; 16 | $this->complements = 'beacon-chain-deposits'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-12-01'; 19 | $this->first_block_id = 0; 20 | 21 | // BeaconChainLikeModule 22 | $this->chain_config = [ 23 | 'ALTAIR_FORK_EPOCH' => 74240, 24 | 'BELLATRIX_FORK_EPOCH' => 144896, 25 | 'SLOT_PER_EPOCH' => 32, 26 | 'DELAY' => 2, 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Modules/DashMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'dash'; 16 | $this->module = 'dash-main'; 17 | $this->is_main = true; 18 | $this->currency = 'dash'; 19 | $this->currency_details = ['name' => 'Dash', 'symbol' => 'DASH', 'decimals' => 8, 'description' => null]; 20 | $this->first_block_date = '2014-01-19'; 21 | $this->extra_features = [UTXOSpecialFeatures::OneAddressInScriptPubKey]; 22 | 23 | // UTXOMainModule 24 | $this->p2pk_prefix1 = ''; 25 | $this->p2pk_prefix2 = '4c'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Modules/BotanixMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'botanix'; 15 | $this->module = 'botanix-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2023-11-22'; 18 | $this->currency = 'botanix-bitcoin'; 19 | $this->currency_details = ['name' => 'Bitcoin', 'symbol' => 'BTC', 'decimals' => 18, 'description' => null]; 20 | 21 | // EVMMainModule 22 | $this->evm_implementation = EVMImplementation::geth; 23 | $this->extra_features = []; 24 | $this->reward_function = function($block_id) 25 | { 26 | return '0'; 27 | }; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Modules/LitecoinMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'litecoin'; 16 | $this->module = 'litecoin-main'; 17 | $this->is_main = true; 18 | $this->currency = 'litecoin'; // Static 19 | $this->currency_details = ['name' => 'Litecoin', 'symbol' => 'LTC', 'decimals' => 8, 'description' => null]; 20 | $this->first_block_date = '2011-10-07'; 21 | 22 | // UTXOMainModule 23 | $this->extra_features = [UTXOSpecialFeatures::HasMWEB]; 24 | $this->p2pk_prefix1 = ''; 25 | $this->p2pk_prefix2 = '30'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Modules/BeaconChainWithdrawalsModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'beacon-chain'; 15 | $this->module = 'beacon-chain-withdrawals'; 16 | $this->complements = 'beacon-chain-deposits'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-12-01'; 19 | $this->first_block_id = 0; 20 | $this->extra_indexed_hint_blockchain = 'ethereum'; 21 | 22 | // BeaconChainLikeModule 23 | $this->chain_config = [ 24 | 'BELLATRIX_FORK_EPOCH' => 144896, 25 | 'SLOT_PER_EPOCH' => 32, 26 | 'DELAY' => 2, 27 | 'CAPELLA_FORK_EPOCH' => 194048, 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Modules/BOBMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bob'; 15 | $this->module = 'bob-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2024-04-11'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'bob-bitcoin'; 20 | $this->currency_details = ['name' => 'Bitcoin', 'symbol' => 'BTC', 'decimals' => 18, 'description' => null]; 21 | 22 | // EVMMainModule 23 | $this->evm_implementation = EVMImplementation::geth; 24 | $this->extra_features = [EVMSpecialFeatures::EffectiveGasPriceCanBeZero]; 25 | $this->reward_function = function($block_id) 26 | { 27 | return '0'; 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Modules/FantomMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'fantom'; 15 | $this->module = 'fantom-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2019-12-27'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'fantom'; 20 | $this->currency_details = ['name' => 'Fantom', 'symbol' => 'FTM', 'decimals' => 18, 'description' => null]; 21 | 22 | // EVMMainModule 23 | $this->evm_implementation = EVMImplementation::geth; 24 | $this->extra_features = [EVMSpecialFeatures::SpecialSenderPaysNoFee]; 25 | $this->reward_function = function($block_id) 26 | { 27 | return '0'; 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Idea (c) 2023 Nikita Zhavoronkov, nikzh@nikzh.com 4 | 5 | Copyright (c) 2023 3xpl developers, 3@3xpl.com, see CONTRIBUTORS.md 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /Modules/PolygonzkEVMMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'polygon-zkevm'; 15 | $this->module = 'polygon-zkevm-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2023-03-24'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'ethereum'; 20 | $this->currency_details = ['name' => 'Ethereum', 'symbol' => 'ETH', 'decimals' => 18, 'description' => null]; 21 | 22 | // EVMMainModule 23 | $this->evm_implementation = EVMImplementation::geth; 24 | $this->extra_features = [EVMSpecialFeatures::zkEVM]; 25 | $this->reward_function = function($block_id) 26 | { 27 | return '0'; 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Modules/LineaMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'linea'; 15 | $this->module = 'linea-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2023-07-06'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'ethereum'; 20 | $this->currency_details = ['name' => 'Ethereum', 'symbol' => 'ETH', 'decimals' => 18, 'description' => null]; 21 | $this->mempool_implemented = true; 22 | 23 | // EVMMainModule 24 | $this->evm_implementation = EVMImplementation::geth; 25 | $this->extra_features = [EVMSpecialFeatures::NoEIP1559BurnFee]; 26 | $this->reward_function = function($block_id) 27 | { 28 | return '0'; 29 | }; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Modules/PolygonMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'polygon'; 15 | $this->module = 'polygon-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2020-05-30'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'matic'; 20 | $this->currency_details = ['name' => 'MATIC', 'symbol' => 'MATIC', 'decimals' => 18, 'description' => null]; 21 | 22 | // EVMMainModule 23 | $this->evm_implementation = EVMImplementation::Erigon; 24 | $this->extra_features = [EVMSpecialFeatures::BorValidator]; 25 | $this->reward_function = function($block_id) 26 | { 27 | return '0'; 28 | }; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Modules/BitcoinCashMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bitcoin-cash'; 16 | $this->module = 'bitcoin-cash-main'; 17 | $this->is_main = true; 18 | $this->currency = 'bitcoin-cash'; // Static 19 | $this->currency_details = ['name' => 'Bitcoin Cash', 'symbol' => 'BCH', 'decimals' => 8, 'description' => null]; 20 | $this->first_block_date = '2009-01-03'; 21 | 22 | // UTXOMainModule 23 | $this->extra_features = [UTXOSpecialFeatures::HasAddressPrefixes, UTXOSpecialFeatures::IgnorePubKeyConversion]; 24 | $this->p2pk_prefix1 = ''; 25 | $this->p2pk_prefix2 = ''; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Modules/SolanaMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'solana'; 15 | $this->module = 'solana-main'; 16 | $this->is_main = true; 17 | 18 | // Special 19 | $this->first_block_date = '2020-03-16'; 20 | $this->first_block_id = 0; 21 | 22 | // Blockchain-specific 23 | $this->currency = 'solana'; 24 | $this->currency_details = ['name' => 'Solana', 'symbol' => 'SOL', 'decimals' => 9, 'description' => null]; 25 | 26 | // Handles 27 | $this->handles_implemented = true; 28 | $this->handles_regex = '/(.*)\.sol/'; 29 | $this->api_get_handle = function ($handle) 30 | { 31 | if (!preg_match($this->handles_regex, $handle)) 32 | return null; 33 | return $this->get_domain_owner($handle); 34 | }; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Modules/ArbitrumOneTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'arbitrum-one'; 18 | $this->module = 'arbitrum-one-trace'; 19 | $this->complements = 'arbitrum-one-main'; 20 | $this->is_main = false; 21 | $this->first_block_date = '2022-08-31'; 22 | $this->first_block_id = 22207817; 23 | 24 | // EVMTraceModule 25 | $this->evm_implementation = EVMImplementation::geth; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Modules/BeaconChainDepositsModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'beacon-chain'; 15 | $this->module = 'beacon-chain-deposits'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2020-12-01'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'beacon-ethereum'; // We can't use `ethereum` here as this one has a different number of decimals 20 | $this->currency_details = ['name' => 'Ethereum', 'symbol' => 'ETH', 'decimals' => 9, 'description' => null]; 21 | $this->extra_indexed_hint_blockchain = 'ethereum'; 22 | 23 | // BeaconChainLikeModule 24 | $this->chain_config = [ 25 | 'BELLATRIX_FORK_EPOCH' => 144896, 26 | 'SLOT_PER_EPOCH' => 32, 27 | 'DELAY' => 2, 28 | ]; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Init.php: -------------------------------------------------------------------------------- 1 | blockchain = 'beacon-chain'; 15 | $this->module = 'beacon-chain-penalties'; 16 | $this->complements = 'beacon-chain-deposits'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2020-12-01'; 19 | $this->first_block_id = 0; 20 | 21 | // BeaconChainLikeModule 22 | $this->chain_config = [ 23 | 'PHASE0_FORK_EPOCH' => 0, 24 | 'ALTAIR_FORK_EPOCH' => 74240, 25 | 'BELLATRIX_FORK_EPOCH' => 144896, 26 | 'MIN_SLASHING_PENALTY_QUOTIENT' => 128, 27 | 'MIN_SLASHING_PENALTY_QUOTIENT_ALTAIR' => 64, 28 | 'MIN_SLASHING_PENALTY_QUOTIENT_BELLATRIX' => 32, 29 | 'WHISTLEBLOWER_REWARD_QUOTIENT' => 512, 30 | 'SLOT_PER_EPOCH' => 32, 31 | 'DELAY' => 2, 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Engine/Crypto/Base32.php: -------------------------------------------------------------------------------- 1 | 255) 13 | throw new Error('The given data is not a byte array'); 14 | 15 | return true; 16 | } 17 | 18 | throw new Error('The given data is not a byte array'); 19 | } 20 | 21 | public function encode($data): string 22 | { 23 | self::isByteArray($data); 24 | $base32 = ''; 25 | 26 | for ($i = 0; $i < count($data); ++$i) 27 | { 28 | $value = $data[$i]; 29 | assert(0 <= $value && $value < 32, 'Invalid value: ' . $value . '.'); 30 | $base32 .= self::CHARSET[$value]; 31 | } 32 | 33 | return $base32; 34 | } 35 | 36 | public function decode($data) 37 | { 38 | assert(is_string($data), 'Invalid base32-encoded string: ' . $data . '.'); 39 | $result = []; 40 | 41 | for ($i = 0; $i < strlen($data); ++$i) 42 | { 43 | $value = $data[$i]; 44 | assert(str_contains(self::CHARSET, $value), 'Invalid value: ' . $value . '.'); 45 | $result[$i] = strpos(self::CHARSET, $value); 46 | } 47 | 48 | return $result; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /Modules/ZcashMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'zcash'; 18 | $this->module = 'zcash-main'; 19 | $this->is_main = true; 20 | $this->currency = 'zcash'; 21 | $this->currency_details = ['name' => 'Zcash', 'symbol' => 'ZEC', 'decimals' => 8, 'description' => null]; 22 | $this->first_block_date = '2016-10-28'; 23 | 24 | // UTXOMainModule 25 | $this->extra_features = [UTXOSpecialFeatures::HasShieldedPools]; 26 | $this->p2pk_prefix1 = ''; 27 | $this->p2pk_prefix2 = '1CB8'; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Modules/SolanaFTModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'solana'; 14 | $this->module = 'solana-ft'; 15 | $this->is_main = false; 16 | $this->first_block_date = '2020-03-16'; 17 | $this->first_block_id = 0; 18 | $this->currency_type = CurrencyType::FT; 19 | 20 | $this->programs = [ 21 | 'SPL_NAME_SERVICE_PROGRAM_ID' => 'namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX', 22 | 'DOMAIN_HASH_PREFIX' => 'SPL Name Service', 23 | 'TWITTER_ROOT_PARENT_REGISTERY_KEY' => '4YcexoW3r78zz16J2aqmukBLRwGq6rAvWzJpkYAXqebv', 24 | 'SOL_TLD_AUTHORITY' => '58PwtjSDuFHuUkYjH9BYnnQKHfwo9reZhC2zMJv9JPkx', 25 | 'METAPLEX_ID' => 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', 26 | 'TOKEN_2022_PROGRAM_ID' => 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', 27 | 'TOKEN_PROGRAM_ID' => 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 28 | ]; 29 | 30 | $this->tokens_list = unserialize(file_get_contents(__DIR__ . '/Genesis/SolanaTokenList.data')); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Modules/SolanaNFTModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'solana'; 14 | $this->module = 'solana-nft'; 15 | $this->is_main = false; 16 | $this->first_block_date = '2020-03-16'; 17 | $this->first_block_id = 0; 18 | $this->currency_type = CurrencyType::NFT; 19 | 20 | $this->programs = [ 21 | 'SPL_NAME_SERVICE_PROGRAM_ID' => 'namesLPneVptA9Z5rqUDD9tMTWEJwofgaYwp8cawRkX', 22 | 'DOMAIN_HASH_PREFIX' => 'SPL Name Service', 23 | 'TWITTER_ROOT_PARENT_REGISTERY_KEY' => '4YcexoW3r78zz16J2aqmukBLRwGq6rAvWzJpkYAXqebv', 24 | 'SOL_TLD_AUTHORITY' => '58PwtjSDuFHuUkYjH9BYnnQKHfwo9reZhC2zMJv9JPkx', 25 | 'METAPLEX_ID' => 'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s', 26 | 'TOKEN_2022_PROGRAM_ID' => 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb', 27 | 'TOKEN_PROGRAM_ID' => 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', 28 | ]; 29 | 30 | $this->tokens_list = unserialize(file_get_contents(__DIR__ . '/Genesis/SolanaTokenList.data')); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Modules/GroestlcoinMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'groestlcoin'; 19 | $this->module = 'groestlcoin-main'; 20 | $this->is_main = true; 21 | $this->currency = 'groestlcoin'; // Static 22 | $this->currency_details = ['name' => 'Groestlcoin', 'symbol' => 'GRS', 'decimals' => 8, 'description' => null]; 23 | $this->first_block_date = '2014-03-20'; 24 | 25 | // UTXOMainModule 26 | $this->extra_features = [UTXOSpecialFeatures::OneAddressInScriptPubKey, UTXOSpecialFeatures::IgnorePubKeyConversion]; 27 | $this->p2pk_prefix1 = ''; 28 | $this->p2pk_prefix2 = '24'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Modules/opBNBMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'opbnb'; 15 | $this->module = 'opbnb-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2023-08-11'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'bnb'; 20 | $this->currency_details = ['name' => 'BNB', 'symbol' => 'BNB', 'decimals' => 18, 'description' => null]; 21 | 22 | // EVMMainModule 23 | $this->mempool_implemented = false; 24 | $this->evm_implementation = EVMImplementation::geth; 25 | $this->extra_features = [EVMSpecialFeatures::HasSystemTransactions, EVMSpecialFeatures::OPStackBaseFeeRecipient, EVMSpecialFeatures::OPStackL1FeeVault]; 26 | $this->reward_function = function($block_id) 27 | { 28 | return '0'; 29 | }; 30 | 31 | $this->l1_fee_vault = '0x420000000000000000000000000000000000001a'; // https://github.com/bnb-chain/op-geth/blob/aead14eeda87794899daed7fbdcca11fb9021fbd/params/protocol_params.go#L29 32 | $this->base_fee_recipient = '0x4200000000000000000000000000000000000019'; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Modules/BlastERC721Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'blast'; 15 | $this->module = 'blast-erc-721'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2024-02-24'; 18 | $this->first_block_id = 0; 19 | 20 | $this->tests = [ 21 | ['block' => 6127912, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:8:{s:11:"transaction";s:66:"0xf0f4f280b3c63f45c5b42b4084a1bc7ebcaa6b582d53c85ca84a2814a880382a";s:8:"currency";s:42:"0x4c1bb1e30f500f6fafeb1809fb572290029463da";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:0;s:6:"effect";s:2:"-1";s:5:"extra";s:5:"62752";s:5:"block";i:6127912;s:4:"time";s:19:"2024-07-15 17:47:19";}i:1;a:8:{s:11:"transaction";s:66:"0xf0f4f280b3c63f45c5b42b4084a1bc7ebcaa6b582d53c85ca84a2814a880382a";s:8:"currency";s:42:"0x4c1bb1e30f500f6fafeb1809fb572290029463da";s:7:"address";s:42:"0xe325bca338951f94a0de6f1677638f15cb578d29";s:8:"sort_key";i:1;s:6:"effect";s:1:"1";s:5:"extra";s:5:"62752";s:5:"block";i:6127912;s:4:"time";s:19:"2024-07-15 17:47:19";}}s:10:"currencies";a:1:{i:0;a:3:{s:2:"id";s:42:"0x4c1bb1e30f500f6fafeb1809fb572290029463da";s:4:"name";s:4:"seng";s:6:"symbol";s:5:"senga";}}}'], 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BaseMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'base'; 15 | $this->module = 'base-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2023-06-15'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'ethereum'; 20 | $this->currency_details = ['name' => 'Ethereum', 'symbol' => 'ETH', 'decimals' => 18, 'description' => null]; 21 | $this->mempool_implemented = false; // Unlike other EVMMainModule heirs, Base doesn't implement mempool 22 | 23 | // EVMMainModule 24 | $this->evm_implementation = EVMImplementation::geth; 25 | $this->extra_features = [EVMSpecialFeatures::HasSystemTransactions, EVMSpecialFeatures::OPStackBaseFeeRecipient, EVMSpecialFeatures::OPStackL1FeeVault]; // Base is a fork of Optimism, so it has the same special txs 26 | $this->reward_function = function($block_id) 27 | { 28 | return '0'; 29 | }; 30 | $this->l1_fee_vault = '0x420000000000000000000000000000000000001a'; // https://github.com/ethereum-optimism/op-geth/blob/c6ea6fa09d4e7df6d1ca6b2d32bcb139f021b1e2/params/protocol_params.go#L29 as it uses the same code base 31 | $this->base_fee_recipient = '0x4200000000000000000000000000000000000019'; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Modules/EthereumClassicMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ethereum-classic'; 17 | $this->module = 'ethereum-classic-main'; 18 | $this->is_main = true; 19 | $this->first_block_date = '2015-07-30'; 20 | $this->currency = 'ethereum-classic'; 21 | $this->currency_details = ['name' => 'Ethereum Classic', 'symbol' => 'ETC', 'decimals' => 18, 'description' => null]; 22 | 23 | // EVMMainModule 24 | $this->evm_implementation = EVMImplementation::geth; 25 | $this->extra_features = [EVMSpecialFeatures::HasOrHadUncles]; 26 | $this->reward_function = function($block_id) 27 | { 28 | // https://ecips.ethereumclassic.org/ECIPs/ecip-1017 29 | // https://ethereumclassic.org/why-classic/sound-money#known-future-supply 30 | 31 | $base_reward = '5000000000000000000'; 32 | $reductions = intdiv($block_id - 1, 5_000_000); 33 | 34 | for ($i = 0; $i < $reductions; $i++) 35 | $base_reward = bcmul($base_reward, '0.8'); 36 | 37 | return $base_reward; 38 | }; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Modules/PolygonzkEVMTraceModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'polygon-zkevm'; 15 | $this->module = 'polygon-zkevm-trace'; 16 | $this->complements = 'polygon-zkevm-main'; 17 | $this->is_main = false; 18 | $this->first_block_date = '2023-03-24'; 19 | $this->first_block_id = 0; 20 | 21 | // EVMTraceModule 22 | $this->evm_implementation = EVMImplementation::geth; 23 | $this->extra_features = [EVMSpecialFeatures::zkEVM]; 24 | 25 | // Tests 26 | $this->tests = [ 27 | // Empty batches 28 | ['block' => 0, 'result' => 'a:2:{s:6:"events";a:0:{}s:10:"currencies";N;}'], 29 | ['block' => 1, 'result' => 'a:2:{s:6:"events";a:0:{}s:10:"currencies";N;}'], 30 | // First non-empty batch 31 | ['block' => 2, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:7:{s:11:"transaction";s:66:"0x1b1cc77d663d9176b791e94124eecffe49d1c69837ee6e9ed09356f2c70a065d";s:7:"address";s:42:"0x2a3dd3eb832af982ec71669e178424b10dca2ede";s:8:"sort_key";i:0;s:6:"effect";s:19:"-100000000000000000";s:5:"extra";N;s:5:"block";i:2;s:4:"time";s:19:"2023-03-24 17:30:15";}i:1;a:7:{s:11:"transaction";s:66:"0x1b1cc77d663d9176b791e94124eecffe49d1c69837ee6e9ed09356f2c70a065d";s:7:"address";s:42:"0x1dba1131000664b884a1ba238464159892252d3a";s:8:"sort_key";i:1;s:6:"effect";s:18:"100000000000000000";s:5:"extra";N;s:5:"block";i:2;s:4:"time";s:19:"2023-03-24 17:30:15";}}s:10:"currencies";N;}'], 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Engine/ModuleInterface.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bnb'; 15 | $this->module = 'bnb-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2020-08-29'; 18 | $this->first_block_id = 0; 19 | 20 | // EVMMainModule 21 | $this->currency = 'bnb'; 22 | $this->currency_details = ['name' => 'BNB', 'symbol' => 'BNB', 'decimals' => 18, 'description' => null]; 23 | $this->evm_implementation = EVMImplementation::Erigon; // Change to geth if you're running geth, but this would be slower 24 | $this->reward_function = function($block_id) 25 | { 26 | return '0'; 27 | }; 28 | 29 | // Handles 30 | $this->handles_implemented = true; 31 | $this->handles_regex = '/(.*)\.bnb/'; 32 | $this->api_get_handle = function($handle) 33 | { 34 | if (!preg_match($this->handles_regex, $handle)) 35 | return null; 36 | 37 | require_once __DIR__ . '/../Engine/Crypto/Keccak.php'; 38 | 39 | $hash = $this->ens_name_to_hash($handle); 40 | 41 | if (is_null($hash) || $hash === '') 42 | return null; 43 | 44 | $resolver = $this->ens_get_data($hash, '0x0178b8bf', '0x08ced32a7f3eec915ba84415e9c07a7286977956'); 45 | $address = $this->ens_get_data_from_resolver($resolver, $hash, '0x3b3b57de', -40); 46 | 47 | if ($address) 48 | return '0x' . $address; 49 | else 50 | return null; 51 | }; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Modules/CardanoMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'cardano'; 16 | $this->module = 'cardano-main'; 17 | $this->is_main = true; 18 | $this->currency = 'cardano'; 19 | $this->currency_details = ['name' => 'Cardano', 'symbol' => 'ADA', 'decimals' => 6, 'description' => null]; 20 | $this->first_block_id = 1; 21 | $this->first_block_date = '2017-09-23'; 22 | 23 | // Handles 24 | $this->handles_implemented = true; 25 | $this->handles_regex = '/\$(.*)/'; 26 | $this->api_get_handle = function($handle) 27 | { 28 | // Note that debugger should be called like this: `php 3xpl.php cardano-main H '$ada'` (with quotes around the name) 29 | 30 | if (!preg_match($this->handles_regex, $handle)) 31 | return null; 32 | 33 | $handle_without_dollar = substr($handle, 1); 34 | 35 | $handle_nodes = envm($this->module, 'HANDLE_NODES'); 36 | $handle_node = $handle_nodes[array_rand($handle_nodes)]; 37 | 38 | $request = requester_single(daemon: $handle_node, 39 | endpoint: "handles/{$handle_without_dollar}", 40 | valid_codes: [200, 202, 404, 406, 451]); // 202 is valid and returned when the indexer is not fully synced 41 | 42 | if (!isset($request['name']) || $request['name'] !== $handle_without_dollar) 43 | return null; 44 | 45 | return $request['resolved_addresses']['ada'] ?? null; // There's also `holder_address` for the owner 46 | }; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Modules/RootstockMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'rootstock'; 15 | $this->module = 'rootstock-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2018-01-02'; 18 | $this->currency = 'smart-bitcoin'; 19 | $this->currency_details = ['name' => 'Smart Bitcoin', 'symbol' => 'RBTC', 'decimals' => 18, 'description' => null]; 20 | 21 | // EVMMainModule 22 | $this->evm_implementation = EVMImplementation::geth; 23 | $this->extra_features = [EVMSpecialFeatures::rskEVM, EVMSpecialFeatures::FeeCollectorAddress]; 24 | $this->reward_function = function ($block_id) { 25 | return '0'; 26 | }; 27 | $this->fee_collector_address = '0x0000000000000000000000000000000001000008'; 28 | 29 | // Handles (RNS) 30 | // https://dev.rootstock.io/rif/rns/mainnet/ 31 | $this->handles_implemented = true; 32 | $this->handles_regex = '/(.*)\.rsk/'; 33 | $this->api_get_handle = function($handle) 34 | { 35 | if (!preg_match($this->handles_regex, $handle)) 36 | return null; 37 | 38 | require_once __DIR__ . '/../Engine/Crypto/Keccak.php'; 39 | 40 | $hash = $this->ens_name_to_hash($handle); 41 | 42 | if (is_null($hash) || $hash === '') 43 | return null; 44 | 45 | $resolver = $this->ens_get_data($hash, '0x0178b8bf', '0xcb868aeabd31e2b66f74e9a55cf064abb31a4ad5'); 46 | $address = $this->ens_get_data_from_resolver($resolver, $hash, '0x3b3b57de', -40); 47 | 48 | if ($address) 49 | return '0x' . $address; 50 | else 51 | return null; 52 | }; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Modules/ArbitrumOneMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'arbitrum-one'; 15 | $this->module = 'arbitrum-one-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2021-05-28'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'ethereum'; 20 | $this->currency_details = ['name' => 'Ethereum', 'symbol' => 'ETH', 'decimals' => 18, 'description' => null]; 21 | $this->mempool_implemented = false; // Unlike other EVMMainModule heirs, Arbitrum One doesn't implement mempool 22 | 23 | // EVMMainModule 24 | $this->evm_implementation = EVMImplementation::geth; 25 | $this->extra_features = [EVMSpecialFeatures::AllowEmptyRecipient]; 26 | $this->reward_function = function($block_id) 27 | { 28 | return '0'; 29 | }; 30 | 31 | // Handles 32 | $this->handles_implemented = true; 33 | $this->handles_regex = '/(.*)\.arb/'; 34 | $this->api_get_handle = function($handle) 35 | { 36 | if (!preg_match($this->handles_regex, $handle)) 37 | return null; 38 | 39 | require_once __DIR__ . '/../Engine/Crypto/Keccak.php'; 40 | 41 | $hash = $this->ens_name_to_hash($handle); 42 | 43 | if (is_null($hash) || $hash === '') 44 | return null; 45 | 46 | $resolver = $this->ens_get_data($hash, '0x0178b8bf', '0x4a067ee58e73ac5e4a43722e008dfdf65b2bf348'); 47 | $address = $this->ens_get_data_from_resolver($resolver, $hash, '0x3b3b57de', -40); 48 | 49 | if ($address) 50 | return '0x' . $address; 51 | else 52 | return null; 53 | }; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /Modules/HandshakeMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'handshake'; 16 | $this->module = 'handshake-main'; 17 | $this->is_main = true; 18 | $this->currency = 'handshake'; 19 | $this->currency_details = ['name' => 'Handshake', 'symbol' => 'HNS', 'decimals' => 6, 'description' => null]; 20 | $this->first_block_date = '2020-02-03'; 21 | 22 | // Handles 23 | $this->handles_implemented = true; 24 | $this->handles_regex = '/(.*)\//'; 25 | $this->api_get_handle = function($handle) 26 | { 27 | if (!preg_match($this->handles_regex, $handle)) 28 | return null; 29 | 30 | $handle = substr($handle, 0, -1); // Removes the trailing slash 31 | 32 | try 33 | { 34 | $owner = requester_single($this->select_node(), 35 | params: ['method' => 'getnameinfo', 'params' => [$handle]], 36 | result_in: 'result', 37 | timeout: $this->timeout)['info']['owner'] ?? null; 38 | } 39 | catch (RequesterException $e) 40 | { 41 | if (str_contains($e->getMessage(), 'Invalid name')) 42 | return null; 43 | else 44 | throw $e; 45 | } 46 | 47 | if ($owner && $owner['hash'] !== '0000000000000000000000000000000000000000000000000000000000000000') 48 | { 49 | $address = requester_single($this->select_node(), 50 | endpoint: "tx/{$owner['hash']}", 51 | timeout: $this->timeout); 52 | 53 | return $address['outputs'][($owner['index'])]['address']; 54 | } 55 | else 56 | { 57 | return null; 58 | } 59 | }; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Engine/Database.php: -------------------------------------------------------------------------------- 1 | [1, 4, 'INT'], // Block id 13 | 'transaction' => [2, -1, 'BYTEA'], // Transaction id (hash) 14 | 'sort_key' => [3, 4, 'INT'], // Event position within the block 15 | 'time' => [4, 8, 'TIMESTAMP'], // Event timestamp 16 | 'address' => [5, -1, 'BYTEA'], // Affected address 17 | 'currency' => [6, -1, 'BYTEA'], // Currency id 18 | 'effect' => [7, -1, 'NUMERIC'], // Amount transferred 19 | 'failed' => [8, 1, 'BOOLEAN'], // Whether it has been really transferred 20 | 'extra' => [9, -1, 'BYTEA'], // Extra properties of the event 21 | 'extra_indexed' => [10, -1, 'BYTEA'], // Extra property which is indexed 22 | ]; 23 | 24 | // Which fields are mandatory. Non-mandatory fields may be skipped from the output. 25 | const EVENTS_TABLE_MANDATORY_COLUMNS = ['block', 'sort_key', 'time', 'address', 'effect']; 26 | // `transaction` is not mandatory as there can be events which don't belong to a block rather than to a transaction 27 | 28 | // Which fields can not be nulls 29 | const EVENTS_TABLE_NOT_NULLABLE_COLUMNS = ['block', 'sort_key', 'time', 'address', 'effect']; 30 | 31 | // Currencies 32 | 33 | // List of currency fields 34 | const CURRENCIES_TABLE_COLUMNS = ['id' => [1, -1, 'BYTEA'], // Currency id (e.g. bitcoin) 35 | 'name' => [2, -1, 'BYTEA'], // Currency name (e.g. Bitcoin) 36 | 'symbol' => [3, -1, 'BYTEA'], // Currency symbol (e.g. BTC) 37 | 'decimals' => [4, 2, 'SMALLINT'], // Amount of decimals (e.g. 8) 38 | 'description' => [5, -1, 'BYTEA'], // Currency description 39 | ]; 40 | 41 | const CURRENCIES_TABLE_MANDATORY_COLUMNS = ['id']; 42 | 43 | const CURRENCIES_TABLE_NOT_NULLABLE_COLUMNS = ['id']; 44 | -------------------------------------------------------------------------------- /Modules/RippleNFTModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'xrp-ledger'; 13 | $this->module = 'xrp-ledger-nft'; 14 | $this->is_main = false; 15 | $this->currency = 'xrp-nft'; 16 | $this->currency_details = ['name' => 'XRP NFT', 'symbol' => 'NFT', 'decimals' => 0, 'description' => null]; 17 | $this->first_block_date = '2013-01-01'; 18 | $this->first_block_id = 32570; 19 | 20 | $this->tests = [ 21 | ['block' => 82834311, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:8:{s:11:"transaction";s:64:"a046ff9c68877853e46dac85df2e53ea174cbf38d856f4813ce29f46ff9abadd";s:7:"address";s:34:"rhTEeYTzZn3tL1BrYrxQtS6f5Jf83BYT5z";s:8:"sort_key";i:0;s:6:"effect";s:2:"-1";s:6:"failed";s:1:"f";s:5:"extra";s:64:"00080000640FD1B918CE562578FE15FBF388ED724CA452B7C13F5C1000000754";s:5:"block";i:82834311;s:4:"time";s:19:"2023-09-27 19:18:21";}i:1;a:8:{s:11:"transaction";s:64:"a046ff9c68877853e46dac85df2e53ea174cbf38d856f4813ce29f46ff9abadd";s:7:"address";s:34:"rpZqTPC8GvrSvEfFsUuHkmPCg29GdQuXhC";s:8:"sort_key";i:1;s:6:"effect";s:1:"1";s:6:"failed";s:1:"f";s:5:"extra";s:64:"00080000640FD1B918CE562578FE15FBF388ED724CA452B7C13F5C1000000754";s:5:"block";i:82834311;s:4:"time";s:19:"2023-09-27 19:18:21";}}s:10:"currencies";N;}'], 22 | ['block' => 82477530, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:8:{s:11:"transaction";s:64:"7b34ae6e6a4c2b562a7de7e1dfe347b3a42195c1e30057ebaa872542f13d72c7";s:7:"address";s:34:"rhssY88ZGmw82A1wXnxxG6ayQgpH3WMnJg";s:8:"sort_key";i:0;s:6:"effect";s:2:"-1";s:6:"failed";s:1:"f";s:5:"extra";s:64:"00080000214B5618CDD949616DE1F1217B6AC97B60C663F4DEFF4B2600000058";s:5:"block";i:82477530;s:4:"time";s:19:"2023-09-11 23:22:01";}i:1;a:8:{s:11:"transaction";s:64:"7b34ae6e6a4c2b562a7de7e1dfe347b3a42195c1e30057ebaa872542f13d72c7";s:7:"address";s:34:"r4hfwL6FmzfTsFKGctf4VJE9XwBafUmm2N";s:8:"sort_key";i:1;s:6:"effect";s:1:"1";s:6:"failed";s:1:"f";s:5:"extra";s:64:"00080000214B5618CDD949616DE1F1217B6AC97B60C663F4DEFF4B2600000058";s:5:"block";i:82477530;s:4:"time";s:19:"2023-09-11 23:22:01";}}s:10:"currencies";N;}'], 23 | ]; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Engine/Exceptions.php: -------------------------------------------------------------------------------- 1 | getMessage()}\n"; 48 | 49 | echo $log_row; 50 | 51 | throw new Exception('Failed', previous: $e); 52 | } 53 | 54 | set_error_handler("error_handler", E_ALL); 55 | set_exception_handler("exception_handler"); 56 | -------------------------------------------------------------------------------- /Modules/GnosisChainMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'gnosis-chain'; 18 | $this->module = 'gnosis-chain-main'; 19 | $this->is_main = true; 20 | $this->first_block_date = '2018-10-08'; 21 | $this->first_block_id = 0; 22 | $this->currency = 'xdai'; 23 | $this->currency_details = ['name' => 'xDAI', 'symbol' => 'xDAI', 'decimals' => 18, 'description' => null]; 24 | 25 | // EVMMainModule 26 | $this->evm_implementation = EVMImplementation::Erigon; // Change to geth if you're running Nethermind, but this would be slower 27 | $this->extra_features = [EVMSpecialFeatures::EffectiveGasPriceCanBeZero]; 28 | $this->reward_function = function($block_id) 29 | { 30 | return '0'; 31 | }; 32 | 33 | // Handles 34 | $this->handles_implemented = true; 35 | $this->handles_regex = '/(.*)\.(gno|owl)/'; 36 | $this->api_get_handle = function($handle) 37 | { 38 | if (!preg_match($this->handles_regex, $handle)) 39 | return null; 40 | 41 | require_once __DIR__ . '/../Engine/Crypto/Keccak.php'; 42 | 43 | $hash = $this->ens_name_to_hash($handle); 44 | 45 | if (is_null($hash) || $hash === '') 46 | return null; 47 | 48 | $resolver = $this->ens_get_data($hash, '0x0178b8bf', '0x4f132a7e39b1d717b39c789eb9ec1e790092042b'); 49 | $address = $this->ens_get_data_from_resolver($resolver, $hash, '0x3b3b57de', -40); 50 | 51 | if ($address) 52 | return '0x' . $address; 53 | else 54 | return null; 55 | }; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Modules/AvalancheMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'avalanche'; // C-Chain 15 | $this->module = 'avalanche-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2015-07-30'; // That's for block #0, in reality it starts on 2020-09-23 with block #1... ¯\_(ツ)_/¯ 18 | $this->first_block_id = 0; 19 | $this->mempool_implemented = false; // Unlike other EVMMainModule heirs, Avalanche doesn't implement mempool 20 | $this->forking_implemented = false; // And all blocks are instantly finalized 21 | 22 | // EVMMainModule 23 | $this->currency = 'avalanche'; 24 | $this->currency_details = ['name' => 'Avalanche', 'symbol' => 'AVAX', 'decimals' => 18, 'description' => null]; 25 | $this->evm_implementation = EVMImplementation::geth; 26 | $this->reward_function = function($block_id) 27 | { 28 | return '0'; 29 | }; 30 | 31 | // Handles 32 | $this->handles_implemented = true; 33 | $this->handles_regex = '/(.*)\.avax/'; 34 | $this->api_get_handle = function($handle) 35 | { 36 | if (!preg_match($this->handles_regex, $handle)) 37 | return null; 38 | 39 | $address = strtolower(hex2bin(substr(requester_single($this->select_node(), 40 | params: ['jsonrpc' => '2.0', 41 | 'method' => 'eth_call', 42 | 'id' => 0, 43 | 'params' => [['to' => '0x1ea4e7a798557001b99d88d6b4ba7f7fc79406a9', 44 | 'data' => '0x08991a1d' . $this->encode_abi('string,uint256', [$handle, '3']), 45 | ], 46 | 'latest', 47 | ], 48 | ], 49 | result_in: 'result', 50 | timeout: $this->timeout), 130, 84))); 51 | 52 | if (!preg_match(StandardPatterns::HexWith0x40->value, $address)) 53 | return null; 54 | 55 | return $address; 56 | }; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Modules/TronMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'tron'; 15 | $this->module = 'tron-main'; 16 | $this->is_main = true; 17 | $this->first_block_id = 0; 18 | $this->first_block_date = '2018-06-25'; 19 | $this->currency = 'tron'; 20 | $this->currency_details = ['name' => 'TRON', 'symbol' => 'TRX', 'decimals' => 6, 'description' => null]; 21 | 22 | // TVMMainModule 23 | $this->extra_features = [TVMSpecialFeatures::AllowEmptyRecipient]; 24 | $this->extra_data_details = array_flip(TVMSpecialTransactions::to_assoc_array()); 25 | $this->reward_function = function ($block_id) { 26 | $sr_reward = '0'; 27 | $partners_reward = '0'; 28 | if ($block_id >= 0 && $block_id <= 14_228_705) { 29 | $sr_reward = '32000000'; 30 | $partners_reward = '16000000'; 31 | } elseif ($block_id > 14_228_705) { 32 | $sr_reward = '16000000'; 33 | $partners_reward = '160000000'; 34 | } 35 | return [$sr_reward, $partners_reward]; 36 | }; 37 | 38 | // Handles 39 | $this->handles_implemented = true; 40 | $this->handles_regex = '/(.*)\.(trx|tron|tns|usdd)/'; // https://forum.trondao.org/t/tns-domains-trx-name-services/16921 41 | $this->api_get_handle = function ($handle) 42 | { 43 | if (!preg_match($this->handles_regex, $handle)) 44 | return null; 45 | 46 | require_once __DIR__ . '/../Engine/Crypto/Keccak.php'; 47 | 48 | $hash = $this->ens_name_to_hash($handle); 49 | 50 | if (is_null($hash) || $hash === '') 51 | return null; 52 | 53 | $resolver = $this->ens_get_data($hash, '0xc677966d', '0xa209893e28339d8aa2fd3454dc322151c502947e'); 54 | $address = $this->ens_get_data_from_resolver($resolver, $hash, '0x3b3b57de', -40); 55 | $res = null; 56 | if (strlen($address) == 40) 57 | { 58 | try 59 | { 60 | $res = $this->encode_address_to_base58("0x" . $address); 61 | } 62 | catch (Exception) 63 | { 64 | $res = null; 65 | } 66 | 67 | } 68 | return $res; 69 | }; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Modules/zkSyncEraMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'zksync-era'; 15 | $this->module = 'zksync-era-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2023-02-15'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'ethereum'; 20 | $this->currency_details = ['name' => 'Ethereum', 'symbol' => 'ETH', 'decimals' => 18, 'description' => null]; 21 | $this->mempool_implemented = false; 22 | 23 | // EVMMainModule 24 | $this->evm_implementation = EVMImplementation::geth; 25 | $this->extra_features = [EVMSpecialFeatures::EffectiveGasPriceCanBeZero]; 26 | $this->reward_function = function($block_id) 27 | { 28 | return '0'; 29 | }; 30 | $this->tests = [ 31 | ['block' => 53356379, 'result' => 'a:2:{s:6:"events";a:6:{i:0;a:8:{s:11:"transaction";s:66:"0xd3086b71c95ce83e7f3d30ab1890ada2334695a05b65715e56f42d96b22c8674";s:7:"address";s:42:"0x0000000000000000000000000000000000008007";s:6:"effect";s:15:"-63717656250000";s:6:"failed";s:1:"f";s:5:"extra";s:1:"b";s:5:"block";i:53356379;s:4:"time";s:19:"2025-01-10 14:25:13";s:8:"sort_key";i:0;}i:1;a:8:{s:11:"transaction";s:66:"0xd3086b71c95ce83e7f3d30ab1890ada2334695a05b65715e56f42d96b22c8674";s:7:"address";s:4:"0x00";s:6:"effect";s:14:"63717656250000";s:6:"failed";s:1:"f";s:5:"extra";s:1:"b";s:5:"block";i:53356379;s:4:"time";s:19:"2025-01-10 14:25:13";s:8:"sort_key";i:1;}i:2;a:8:{s:11:"transaction";s:66:"0xd3086b71c95ce83e7f3d30ab1890ada2334695a05b65715e56f42d96b22c8674";s:7:"address";s:42:"0x0000000000000000000000000000000000008007";s:6:"effect";s:2:"-0";s:6:"failed";s:1:"f";s:5:"extra";N;s:5:"block";i:53356379;s:4:"time";s:19:"2025-01-10 14:25:13";s:8:"sort_key";i:2;}i:3;a:8:{s:11:"transaction";s:66:"0xd3086b71c95ce83e7f3d30ab1890ada2334695a05b65715e56f42d96b22c8674";s:7:"address";s:42:"0x0000000000000000000000000000000000008006";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";N;s:5:"block";i:53356379;s:4:"time";s:19:"2025-01-10 14:25:13";s:8:"sort_key";i:3;}i:4;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:53356379;s:4:"time";s:19:"2025-01-10 14:25:13";s:8:"sort_key";i:4;}i:5;a:8:{s:11:"transaction";N;s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";s:1:"r";s:5:"block";i:53356379;s:4:"time";s:19:"2025-01-10 14:25:13";s:8:"sort_key";i:5;}}s:10:"currencies";N;}'], 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Engine/Env.php: -------------------------------------------------------------------------------- 1 | (string)PHP_INT_MAX) 77 | throw new DeveloperError("Value {$return} is too big for `int` in the config"); 78 | 79 | return (int)$return; 80 | } 81 | 82 | if (is_string($return) && (preg_match('/^\d+\.\d+$/D', $return))) 83 | { 84 | return (float)$return; 85 | } 86 | 87 | if ($return === 'false' || $return === 'FALSE') 88 | return false; 89 | 90 | if ($return === 'true' || $return === 'TRUE') 91 | return true; 92 | 93 | return $return; 94 | } 95 | -------------------------------------------------------------------------------- /Modules/Common/TONTraits.php: -------------------------------------------------------------------------------- 1 | select_node(), endpoint: 'lastNum', timeout: $this->timeout); 15 | 16 | return (int)$result[($this->workchain)][(array_key_first($result[($this->workchain)]))]['seqno']; 17 | // This may be not the best solution in case there are several shard with different heights 18 | } 19 | 20 | public function ensure_block($block_id, $break_on_first = false) 21 | { 22 | if ($block_id === 0) // Block #0 is there, but the node doesn't return data for it 23 | { 24 | $this->block_hash = ""; 25 | return; 26 | } 27 | 28 | $multi_curl = []; 29 | 30 | foreach ($this->nodes as $node) 31 | { 32 | $multi_curl[] = requester_multi_prepare($node, endpoint: "getHashByHeight?workchain={$this->workchain}&seqno={$block_id}", timeout: $this->timeout); 33 | 34 | if ($break_on_first) 35 | break; 36 | } 37 | 38 | try 39 | { 40 | $curl_results = requester_multi($multi_curl, limit: count($this->nodes), timeout: $this->timeout); 41 | } 42 | catch (RequesterException $e) 43 | { 44 | throw new RequesterException("ensure_block(block_id: {$block_id}): no connection, previously: " . $e->getMessage()); 45 | } 46 | 47 | $hashes = requester_multi_process($curl_results[0]); 48 | ksort($hashes, SORT_STRING); 49 | 50 | $shard_list = $final_filehash = []; 51 | 52 | foreach ($hashes as $shard => $shard_hashes) 53 | { 54 | $shard_list[] = $shard; 55 | $final_filehash[] = $shard_hashes['filehash']; 56 | 57 | $this->shards[$shard] = ['filehash' => $shard_hashes['filehash'], 'roothash' => $shard_hashes['roothash']]; 58 | } 59 | 60 | $this->block_hash = strtolower(implode($final_filehash)); 61 | 62 | $this->block_extra = strtolower(implode('/', $shard_list)); 63 | 64 | if (count($curl_results) > 0) 65 | { 66 | foreach ($curl_results as $result) 67 | { 68 | $this_hashes = requester_multi_process($result); 69 | ksort($this_hashes, SORT_STRING); 70 | 71 | $this_final_filehash = []; 72 | 73 | foreach ($this_hashes as $shard => $shard_hashes) 74 | { 75 | $this_final_filehash[] = $shard_hashes['filehash']; 76 | } 77 | 78 | if (strtolower(implode($this_final_filehash)) !== $this->block_hash) 79 | { 80 | throw new ConsensusException("ensure_block(block_id: {$block_id}): no consensus"); 81 | } 82 | } 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /Modules/BlastERC20Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'blast'; 15 | $this->module = 'blast-erc-20'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2024-02-24'; 18 | $this->first_block_id = 0; 19 | 20 | $this->tests = [ 21 | ['block' => 6127912, 'result' => 'a:2:{s:6:"events";a:6:{i:0;a:7:{s:11:"transaction";s:66:"0xc085fccb448e9af99942dc2484f009246c2f82eea96b219aaa69a1d64b6d0598";s:8:"currency";s:42:"0x4300000000000000000000000000000000000003";s:7:"address";s:42:"0x5430561b09c627264549fdb3a6154c34f5cabea7";s:8:"sort_key";i:0;s:6:"effect";s:22:"-140011454880034479561";s:5:"block";i:6127912;s:4:"time";s:19:"2024-07-15 17:47:19";}i:1;a:7:{s:11:"transaction";s:66:"0xc085fccb448e9af99942dc2484f009246c2f82eea96b219aaa69a1d64b6d0598";s:8:"currency";s:42:"0x4300000000000000000000000000000000000003";s:7:"address";s:42:"0x6a372dbc1968f4a07cf2ce352f410962a972c257";s:8:"sort_key";i:1;s:6:"effect";s:21:"140011454880034479561";s:5:"block";i:6127912;s:4:"time";s:19:"2024-07-15 17:47:19";}i:2;a:7:{s:11:"transaction";s:66:"0xf70808a043c2ee7acf9a07a15bd77dddeadd8fc8d003c2c6a5212956b7a703bc";s:8:"currency";s:42:"0x113f0f20d851906b310abd1e5afba1639938347f";s:7:"address";s:42:"0x337827814155ecbf24d20231fca4444f530c0555";s:8:"sort_key";i:2;s:6:"effect";s:2:"-1";s:5:"block";i:6127912;s:4:"time";s:19:"2024-07-15 17:47:19";}i:3;a:7:{s:11:"transaction";s:66:"0xf70808a043c2ee7acf9a07a15bd77dddeadd8fc8d003c2c6a5212956b7a703bc";s:8:"currency";s:42:"0x113f0f20d851906b310abd1e5afba1639938347f";s:7:"address";s:42:"0xe79fce9f014b4eebb156213407dbbd20ac61dd78";s:8:"sort_key";i:3;s:6:"effect";s:1:"1";s:5:"block";i:6127912;s:4:"time";s:19:"2024-07-15 17:47:19";}i:4;a:7:{s:11:"transaction";s:66:"0xf70808a043c2ee7acf9a07a15bd77dddeadd8fc8d003c2c6a5212956b7a703bc";s:8:"currency";s:42:"0x113f0f20d851906b310abd1e5afba1639938347f";s:7:"address";s:42:"0x337827814155ecbf24d20231fca4444f530c0555";s:8:"sort_key";i:4;s:6:"effect";s:2:"-1";s:5:"block";i:6127912;s:4:"time";s:19:"2024-07-15 17:47:19";}i:5;a:7:{s:11:"transaction";s:66:"0xf70808a043c2ee7acf9a07a15bd77dddeadd8fc8d003c2c6a5212956b7a703bc";s:8:"currency";s:42:"0x113f0f20d851906b310abd1e5afba1639938347f";s:7:"address";s:42:"0xb3a57ef4e5c5f12fa7d5a34d939ec3dbc82b994d";s:8:"sort_key";i:5;s:6:"effect";s:1:"1";s:5:"block";i:6127912;s:4:"time";s:19:"2024-07-15 17:47:19";}}s:10:"currencies";a:2:{i:0;a:4:{s:2:"id";s:42:"0x4300000000000000000000000000000000000003";s:4:"name";s:4:"USDB";s:6:"symbol";s:4:"USDB";s:8:"decimals";i:18;}i:1;a:4:{s:2:"id";s:42:"0x113f0f20d851906b310abd1e5afba1639938347f";s:4:"name";s:11:"OriginEther";s:6:"symbol";s:11:"tkether.org";s:8:"decimals";i:0;}}}'], 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BitcoinMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'bitcoin'; 16 | $this->module = 'bitcoin-main'; 17 | $this->is_main = true; 18 | $this->currency = 'bitcoin'; // Static 19 | $this->currency_details = ['name' => 'Bitcoin', 'symbol' => 'BTC', 'decimals' => 8, 'description' => null]; 20 | $this->first_block_date = '2009-01-03'; 21 | 22 | // UTXOMainModule 23 | $this->p2pk_prefix1 = '1'; 24 | $this->p2pk_prefix2 = '00'; 25 | 26 | // Tests 27 | $this->tests = [ 28 | // First Bitcoin block 29 | ['block' => 0, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:6:{s:11:"transaction";s:64:"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b";s:7:"address";s:8:"the-void";s:6:"effect";s:11:"-5000000000";s:5:"block";i:0;s:4:"time";s:19:"2009-01-03 18:15:05";s:8:"sort_key";i:0;}i:1;a:6:{s:11:"transaction";s:64:"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b";s:7:"address";s:34:"1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa";s:6:"effect";s:10:"5000000000";s:5:"block";i:0;s:4:"time";s:19:"2009-01-03 18:15:05";s:8:"sort_key";i:1;}}s:10:"currencies";N;}'], 30 | // First witness_v0_scripthash spending 31 | ['block' => 482133, 'transaction' => 'cab75da6d7fe1531c881d4efdb4826410a2604aa9e6442ab12a08363f34fb408', 'result' => 'a:1:{s:6:"events";a:3:{i:0;a:6:{s:11:"transaction";s:64:"cab75da6d7fe1531c881d4efdb4826410a2604aa9e6442ab12a08363f34fb408";s:7:"address";s:62:"bc1qj9hlju59t0m4389033r2x8mlxwc86qgqm9flm626sd22cdhfs9jsyrrp6q";s:6:"effect";s:6:"-86591";s:5:"block";i:482133;s:4:"time";s:19:"2017-08-27 02:32:03";s:8:"sort_key";i:9217;}i:1;a:6:{s:11:"transaction";s:64:"cab75da6d7fe1531c881d4efdb4826410a2604aa9e6442ab12a08363f34fb408";s:7:"address";s:42:"bc1qt4hs9aracmzhpy7ly3hrwsk0u83z4dqsln4vg5";s:6:"effect";s:5:"73182";s:5:"block";i:482133;s:4:"time";s:19:"2017-08-27 02:32:03";s:8:"sort_key";i:9218;}i:2;a:6:{s:11:"transaction";s:64:"cab75da6d7fe1531c881d4efdb4826410a2604aa9e6442ab12a08363f34fb408";s:7:"address";s:8:"the-void";s:6:"effect";s:5:"13409";s:5:"block";i:482133;s:4:"time";s:19:"2017-08-27 02:32:03";s:8:"sort_key";i:9219;}}}'], 32 | // Empty single coinbase transaction (`the-void` should be transferring `-0`, output address is a special starting with `script-`) 33 | ['block' => 501726, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:6:{s:11:"transaction";s:64:"9bf8853b3a823bbfa1e54017ae11a9e1f4d08a854dcce9f24e08114f2c921182";s:7:"address";s:8:"the-void";s:6:"effect";s:2:"-0";s:5:"block";i:501726;s:4:"time";s:19:"2017-12-30 12:55:20";s:8:"sort_key";i:0;}i:1;a:6:{s:11:"transaction";s:64:"9bf8853b3a823bbfa1e54017ae11a9e1f4d08a854dcce9f24e08114f2c921182";s:7:"address";s:39:"script-04ad42328809c33523c413effb44f42b";s:6:"effect";s:1:"0";s:5:"block";i:501726;s:4:"time";s:19:"2017-12-30 12:55:20";s:8:"sort_key";i:1;}}s:10:"currencies";N;}'], 34 | ]; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Modules/Common/BeaconChainLikeTraits.php: -------------------------------------------------------------------------------- 1 | select_node(), 14 | endpoint: 'eth/v1/beacon/headers', 15 | timeout: $this->timeout, 16 | result_in: 'data'); 17 | 18 | return intdiv((int)$result[0]['header']['message']['slot'], $this->chain_config['SLOT_PER_EPOCH']) - $this->chain_config['DELAY']; 19 | } 20 | 21 | public function ensure_block($block, $break_on_first = false) 22 | { 23 | $hashes = []; 24 | 25 | $block_start = $block * $this->chain_config['SLOT_PER_EPOCH']; 26 | $block_end = $block_start + ($this->chain_config['SLOT_PER_EPOCH'] - 1); 27 | 28 | foreach ($this->nodes as $node) 29 | { 30 | $multi_curl = []; 31 | 32 | for ($i = $block_start; $i <= $block_end; $i++) 33 | { 34 | $multi_curl[] = requester_multi_prepare($node, 35 | endpoint: "eth/v1/beacon/headers/{$i}", 36 | timeout: $this->timeout, 37 | ); 38 | } 39 | 40 | $curl_results = requester_multi( 41 | $multi_curl, 42 | limit: envm($this->module, 'REQUESTER_THREADS'), 43 | timeout: $this->timeout, 44 | valid_codes: [200, 404], 45 | ); 46 | 47 | foreach ($curl_results as $result) 48 | { 49 | $hash_result = requester_multi_process($result); 50 | 51 | if (isset($hash_result['code']) && $hash_result['code'] === '404') 52 | continue; 53 | elseif (isset($hash_result['code'])) 54 | throw new ModuleError('Unexpected response code'); 55 | 56 | $root = $hash_result['data']['root']; 57 | $slot = $hash_result['data']['header']['message']['slot']; 58 | 59 | $hashes_res[$slot] = $root; 60 | } 61 | 62 | ksort($hashes_res); 63 | $hash = join($hashes_res); 64 | $hashes[] = $hash; 65 | 66 | if ($break_on_first) 67 | break; 68 | } 69 | 70 | if (isset($hashes[1])) 71 | for ($i = 1; $i < count($hashes); $i++) 72 | if ($hashes[0] !== $hashes[$i]) 73 | throw new ConsensusException("ensure_block(block_id: {$block}): no consensus"); 74 | 75 | $hashes[0] = str_replace('0x', '', $hashes[0]); 76 | 77 | $this->block_hash = $hashes[0]; 78 | $this->block_id = $block; 79 | } 80 | 81 | private function get_epoch_time($block, $slots) 82 | { 83 | $block_time = 0; 84 | $this_slot_times = array_reverse($slots); 85 | 86 | foreach ($this_slot_times as $time) 87 | { 88 | if (!is_null($time)) 89 | { 90 | $block_time = $time; 91 | break; 92 | } 93 | } 94 | 95 | if ($block < $this->chain_config['BELLATRIX_FORK_EPOCH'] || $block_time === 0) 96 | { // 1606824023 - zero epoch time, 12 - seconds between slots, 384 = 32 (amount of slots in epoch) * 12 97 | $this->block_time = date('Y-m-d H:i:s', ($block + 1) * 384 + 1606824023 - 12); 98 | return; 99 | } 100 | 101 | $this->block_time = date('Y-m-d H:i:s', $block_time); 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /Modules/Common/TVMInternalModule.php: -------------------------------------------------------------------------------- 1 | version = 1; 43 | } 44 | 45 | final public function post_post_initialize() 46 | { 47 | 48 | } 49 | 50 | final public function pre_process_block($block_id) 51 | { 52 | try { 53 | $r1 = requester_single($this->select_node(), 54 | endpoint: "/wallet/gettransactioninfobyblocknum?num={$block_id}", 55 | timeout: $this->timeout); // example block_num 21575018 56 | } catch (RequesterEmptyArrayInResponseException) { 57 | $r1 = []; 58 | } 59 | 60 | $events = []; 61 | $sort_key = 0; 62 | foreach ($r1 as $transaction) { 63 | if (!isset($transaction['internal_transactions'])) 64 | continue; 65 | foreach ($transaction['internal_transactions'] as $internal_data) { 66 | foreach ($internal_data['callValueInfo'] as $data) { 67 | if (isset($data['callValue']) && !isset($data['tokenId'])) { 68 | $events[] = [ 69 | 'transaction' => $transaction['id'], 70 | 'address' => $this->encode_address_to_base58('0x' . substr($internal_data['caller_address'], 2)), 71 | 'sort_key' => $sort_key++, 72 | 'effect' => '-' . $data['callValue'], 73 | 'failed' => $internal_data['rejected'] ?? false 74 | ]; 75 | 76 | $events[] = [ 77 | 'transaction' => $transaction['id'], 78 | 'address' => $this->encode_address_to_base58('0x' . substr($internal_data['transferTo_address'], 2)), 79 | 'sort_key' => $sort_key++, 80 | 'effect' => strval($data['callValue']), 81 | 'failed' => $internal_data['rejected'] ?? false 82 | ]; 83 | } 84 | } 85 | } 86 | } 87 | 88 | //////////////// 89 | // Processing // 90 | //////////////// 91 | 92 | foreach ($events as &$event) { 93 | $event['block'] = $block_id; 94 | $event['time'] = $this->block_time; 95 | } 96 | 97 | $this->set_return_events($events); 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Modules/Common/MimbleWimbleModule.php: -------------------------------------------------------------------------------- 1 | version = 1; 60 | } 61 | 62 | final public function post_post_initialize() 63 | { 64 | 65 | } 66 | 67 | final public function pre_process_block($block_id) 68 | { 69 | $block = requester_single($this->select_node(), endpoint: "rest/block/{$this->block_hash}.json", timeout: $this->timeout); 70 | $this->block_time = date('Y-m-d H:i:s', (int)$block['time']); 71 | 72 | if (!isset($block['mweb'])) 73 | throw new ModuleError('No MWEB data in the block'); 74 | 75 | $events = []; 76 | $sort_key = 0; 77 | 78 | foreach ($block['mweb']['inputs'] as $input) 79 | { 80 | $events[] = [ 81 | 'address' => $input['output_id'], 82 | 'sort_key' => $sort_key++, 83 | 'effect' => '-?', // This is a special value for unknown outbound transfers 84 | ]; 85 | } 86 | 87 | foreach ($block['mweb']['outputs'] as $output) 88 | { 89 | $events[] = [ 90 | 'address' => $output['output_id'], 91 | 'sort_key' => $sort_key++, 92 | 'effect' => '+?', // This is a special value for unknown inbound transfers 93 | ]; 94 | } 95 | 96 | foreach ($events as &$event) 97 | { 98 | $event['block'] = $block_id; 99 | $event['time'] = $this->block_time; 100 | } 101 | 102 | $this->set_return_events($events); 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Engine/Crypto/Base58.php: -------------------------------------------------------------------------------- 1 | = 58) 27 | { 28 | $div = bcdiv($decimal, '58'); 29 | $mod = bcmod($decimal, '58'); 30 | $output .= self::ALPHABET[(int)$mod]; 31 | $decimal = $div; 32 | } 33 | 34 | if ($decimal > 0) 35 | { 36 | $output .= self::ALPHABET[$decimal]; 37 | } 38 | 39 | $output = strrev($output); 40 | 41 | foreach ($bytes as $byte) 42 | { 43 | if ($byte === 0) 44 | { 45 | $output = self::ALPHABET[0] . $output; 46 | continue; 47 | } 48 | break; 49 | } 50 | 51 | return $output; 52 | } 53 | 54 | private static function base58_decode($base58) 55 | { 56 | if (!$base58) 57 | return ''; 58 | 59 | $indexes = array_flip(str_split(self::ALPHABET)); 60 | $chars = str_split($base58); 61 | 62 | foreach ($chars as $char) 63 | if (isset($indexes[$char]) === false) 64 | return false; 65 | 66 | $decimal = $indexes[$chars[0]]; 67 | 68 | for ($i = 1, $l = count($chars); $i < $l; $i++) 69 | { 70 | $decimal = bcmul($decimal, '58'); 71 | $decimal = bcadd($decimal, $indexes[$chars[$i]]); 72 | } 73 | 74 | $output = ''; 75 | 76 | while ($decimal > 0) 77 | { 78 | $byte = bcmod($decimal, '256'); 79 | $output = pack('C', $byte) . $output; 80 | $decimal = bcdiv($decimal, '256'); 81 | } 82 | 83 | foreach ($chars as $char) 84 | { 85 | if ($indexes[$char] === 0) 86 | { 87 | $output = '\x00' . $output; 88 | continue; 89 | } 90 | 91 | break; 92 | } 93 | 94 | return $output; 95 | } 96 | 97 | public static function base58_nocheck_encode($str) 98 | { 99 | return self::base58_encode($str); 100 | } 101 | 102 | public static function base58_nocheck_decode($base58) 103 | { 104 | return self::base58_decode($base58); 105 | } 106 | 107 | public static function base58_check_encode($address) 108 | { 109 | $hash0 = hash('sha256', $address); 110 | $hash1 = hash('sha256', hex2bin($hash0)); 111 | $checksum = substr($hash1, 0, 8); 112 | $address = $address . hex2bin($checksum); 113 | $base58add = self::base58_encode($address); 114 | 115 | return $base58add; 116 | } 117 | 118 | public static function base58_check_decode($base58add) 119 | { 120 | $address = self::base58_decode($base58add); 121 | $size = strlen($address); 122 | 123 | if ($size != 25) 124 | return false; 125 | 126 | $checksum = substr($address, 21); 127 | $address = substr($address, 0, 21); 128 | $hash0 = hash('sha256', $address); 129 | $hash1 = hash('sha256', hex2bin($hash0)); 130 | $checksum0 = substr($hash1, 0, 8); 131 | $checksum1 = bin2hex($checksum); 132 | 133 | if (strcmp($checksum0, $checksum1)) 134 | return false; 135 | 136 | return $address; 137 | } 138 | 139 | public static function hex_to_base58_check($hex_string) 140 | { 141 | return self::base58_check_encode(hex2bin($hex_string)); 142 | } 143 | 144 | public static function base58_check_to_hex($base58) 145 | { 146 | return bin2hex(self::base58_check_decode($base58)); 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /Modules/EthereumMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'ethereum'; 15 | $this->module = 'ethereum-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2015-07-30'; 18 | $this->currency = 'ethereum'; 19 | $this->currency_details = ['name' => 'Ethereum', 'symbol' => 'ETH', 'decimals' => 18, 'description' => null]; 20 | 21 | // EVMMainModule 22 | $this->evm_implementation = EVMImplementation::Erigon; // Change to geth if you're running geth, but this would be slower 23 | $this->extra_features = [EVMSpecialFeatures::HasOrHadUncles, EVMSpecialFeatures::PoSWithdrawals, EVMSpecialFeatures::EIP4844]; 24 | $this->staking_contract = '0x00000000219ab540356cbb839cbe05303d7705fa'; 25 | $this->reward_function = function($block_id) 26 | { 27 | if ($block_id >= 0 && $block_id <= 4_369_999) 28 | { 29 | $base_reward = '5000000000000000000'; 30 | } 31 | elseif ($block_id >= 4_370_000 && $block_id <= 7_279_999) 32 | { 33 | $base_reward = '3000000000000000000'; 34 | } 35 | elseif ($block_id >= 7_280_000 && $block_id <= 15_537_393) 36 | { 37 | $base_reward = '2000000000000000000'; 38 | } 39 | elseif ($block_id >= 15_537_394) // The Merge 40 | { 41 | $base_reward = '0'; 42 | } 43 | 44 | return $base_reward; 45 | }; 46 | 47 | // Handles 48 | $this->handles_implemented = true; 49 | $this->handles_regex = '/(.*)\.eth/'; 50 | $this->api_get_handle = function($handle) 51 | { 52 | if (!preg_match($this->handles_regex, $handle)) 53 | return null; 54 | 55 | require_once __DIR__ . '/../Engine/Crypto/Keccak.php'; 56 | 57 | $hash = $this->ens_name_to_hash($handle); 58 | 59 | if (is_null($hash) || $hash === '') 60 | return null; 61 | 62 | $resolver = $this->ens_get_data($hash, '0x0178b8bf', '0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e'); 63 | $address = $this->ens_get_data_from_resolver($resolver, $hash, '0x3b3b57de', -40); 64 | 65 | if ($address) 66 | return '0x' . $address; 67 | else 68 | return null; 69 | }; 70 | 71 | // Tests 72 | $this->tests = [ 73 | // Blob transaction 74 | ['block' => 19429224, 'transaction' => "0xe876dc9e3e2a87fff5f43e9072f8046a0a46d2a2276f01bbb0a69ae0af6af4fa", "result" => 'a:1:{s:6:"events";a:6:{i:0;a:8:{s:11:"transaction";s:66:"0xe876dc9e3e2a87fff5f43e9072f8046a0a46d2a2276f01bbb0a69ae0af6af4fa";s:7:"address";s:42:"0x2c169dfe5fbba12957bdd0ba47d9cedbfe260ca7";s:6:"effect";s:17:"-8079000539885872";s:6:"failed";s:1:"f";s:5:"extra";s:1:"b";s:5:"block";i:19429224;s:4:"time";s:19:"2024-03-13 22:52:47";s:8:"sort_key";i:666;}i:1;a:8:{s:11:"transaction";s:66:"0xe876dc9e3e2a87fff5f43e9072f8046a0a46d2a2276f01bbb0a69ae0af6af4fa";s:7:"address";s:4:"0x00";s:6:"effect";s:16:"8079000539885872";s:6:"failed";s:1:"f";s:5:"extra";s:1:"b";s:5:"block";i:19429224;s:4:"time";s:19:"2024-03-13 22:52:47";s:8:"sort_key";i:667;}i:2;a:8:{s:11:"transaction";s:66:"0xe876dc9e3e2a87fff5f43e9072f8046a0a46d2a2276f01bbb0a69ae0af6af4fa";s:7:"address";s:42:"0x2c169dfe5fbba12957bdd0ba47d9cedbfe260ca7";s:6:"effect";s:15:"-13660000000000";s:6:"failed";s:1:"f";s:5:"extra";s:1:"f";s:5:"block";i:19429224;s:4:"time";s:19:"2024-03-13 22:52:47";s:8:"sort_key";i:668;}i:3;a:8:{s:11:"transaction";s:66:"0xe876dc9e3e2a87fff5f43e9072f8046a0a46d2a2276f01bbb0a69ae0af6af4fa";s:7:"address";s:42:"0x88c6c46ebf353a52bdbab708c23d0c81daa8134a";s:6:"effect";s:14:"13660000000000";s:6:"failed";s:1:"f";s:5:"extra";s:1:"f";s:5:"block";i:19429224;s:4:"time";s:19:"2024-03-13 22:52:47";s:8:"sort_key";i:669;}i:4;a:8:{s:11:"transaction";s:66:"0xe876dc9e3e2a87fff5f43e9072f8046a0a46d2a2276f01bbb0a69ae0af6af4fa";s:7:"address";s:42:"0x2c169dfe5fbba12957bdd0ba47d9cedbfe260ca7";s:6:"effect";s:2:"-0";s:6:"failed";s:1:"f";s:5:"extra";N;s:5:"block";i:19429224;s:4:"time";s:19:"2024-03-13 22:52:47";s:8:"sort_key";i:670;}i:5;a:8:{s:11:"transaction";s:66:"0xe876dc9e3e2a87fff5f43e9072f8046a0a46d2a2276f01bbb0a69ae0af6af4fa";s:7:"address";s:42:"0xc662c410c0ecf747543f5ba90660f6abebd9c8c4";s:6:"effect";s:1:"0";s:6:"failed";s:1:"f";s:5:"extra";N;s:5:"block";i:19429224;s:4:"time";s:19:"2024-03-13 22:52:47";s:8:"sort_key";i:671;}}}'] 75 | ]; 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /Modules/RippleFTModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'xrp-ledger'; 13 | $this->module = 'xrp-ledger-ft'; 14 | $this->is_main = false; 15 | $this->first_block_date = '2013-01-01'; 16 | $this->first_block_id = 32570; 17 | 18 | $this->tests = [ 19 | ['block' => 86029048, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:9:{s:8:"currency";s:67:"594F494E4B000000000000000000000000000000.rrrrrrrrrrrrrrrrrrrrBZbvji";s:11:"transaction";s:64:"abe84848188b1a9ed69018a0edf08c8ded9e50d209efe029829a2513a656b4c7";s:7:"address";s:34:"rMo7g7CJLYbERMvf1taHSEkNuyL4BqecD8";s:8:"sort_key";i:0;s:6:"effect";s:97:"-956620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";s:6:"failed";s:1:"f";s:5:"extra";s:2:"cb";s:5:"block";i:86029048;s:4:"time";s:19:"2024-02-17 13:26:31";}i:1;a:9:{s:8:"currency";s:67:"594F494E4B000000000000000000000000000000.rrrrrrrrrrrrrrrrrrrrBZbvji";s:11:"transaction";s:64:"abe84848188b1a9ed69018a0edf08c8ded9e50d209efe029829a2513a656b4c7";s:7:"address";s:8:"the-void";s:8:"sort_key";i:1;s:6:"effect";s:96:"956620000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";s:6:"failed";s:1:"f";s:5:"extra";s:2:"cb";s:5:"block";i:86029048;s:4:"time";s:19:"2024-02-17 13:26:31";}}s:10:"currencies";a:1:{i:0;a:4:{s:2:"id";s:67:"594F494E4B000000000000000000000000000000.rrrrrrrrrrrrrrrrrrrrBZbvji";s:4:"name";s:5:"YOINK";s:6:"symbol";s:5:"YOINK";s:8:"decimals";i:96;}}}'], 20 | ['block' => 86028986, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:9:{s:8:"currency";s:67:"594F494E4B000000000000000000000000000000.rrrrrrrrrrrrrrrrrrrrBZbvji";s:11:"transaction";s:64:"712246cf95073c254d12cddf7f8d93887562a5eb5a2f7b97dd2af1f3eb81af76";s:7:"address";s:34:"rHZCZ9M3LdDhk85Ax7DsAYywheqh83YQyC";s:8:"sort_key";i:0;s:6:"effect";s:97:"-956670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";s:6:"failed";s:1:"f";s:5:"extra";s:2:"cb";s:5:"block";i:86028986;s:4:"time";s:19:"2024-02-17 13:22:31";}i:1;a:9:{s:8:"currency";s:67:"594F494E4B000000000000000000000000000000.rrrrrrrrrrrrrrrrrrrrBZbvji";s:11:"transaction";s:64:"712246cf95073c254d12cddf7f8d93887562a5eb5a2f7b97dd2af1f3eb81af76";s:7:"address";s:8:"the-void";s:8:"sort_key";i:1;s:6:"effect";s:96:"956670000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";s:6:"failed";s:1:"f";s:5:"extra";s:2:"cb";s:5:"block";i:86028986;s:4:"time";s:19:"2024-02-17 13:22:31";}}s:10:"currencies";a:1:{i:0;a:4:{s:2:"id";s:67:"594F494E4B000000000000000000000000000000.rrrrrrrrrrrrrrrrrrrrBZbvji";s:4:"name";s:5:"YOINK";s:6:"symbol";s:5:"YOINK";s:8:"decimals";i:96;}}}'], 21 | ['block' => 9060986, 'result' => 'a:2:{s:6:"events";a:4:{i:0;a:9:{s:8:"currency";s:38:"CNY.rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK";s:11:"transaction";s:64:"370121a3af5ee118b04965579f690de6eceba744f6223253f2fccc46c18742f2";s:7:"address";s:34:"rshTJgRVZDo2EXfPVeBxFWEAMTFBJDWzo6";s:8:"sort_key";i:0;s:6:"effect";s:99:"-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";s:6:"failed";s:1:"t";s:5:"extra";s:1:"p";s:5:"block";i:9060986;s:4:"time";s:19:"2014-09-26 04:42:40";}i:1;a:9:{s:8:"currency";s:38:"CNY.rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK";s:11:"transaction";s:64:"370121a3af5ee118b04965579f690de6eceba744f6223253f2fccc46c18742f2";s:7:"address";s:34:"r4BV3UiUNa2WjRk6xC5QVSfGbMKwZhZfVA";s:8:"sort_key";i:1;s:6:"effect";s:98:"10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";s:6:"failed";s:1:"t";s:5:"extra";s:1:"p";s:5:"block";i:9060986;s:4:"time";s:19:"2014-09-26 04:42:40";}i:2;a:9:{s:8:"currency";s:38:"CNY.rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK";s:11:"transaction";s:64:"67d2263c7264021b01ae9e8c9f78f14e4805aa4e08cc3a4d01710c94c46b114b";s:7:"address";s:34:"rshTJgRVZDo2EXfPVeBxFWEAMTFBJDWzo6";s:8:"sort_key";i:2;s:6:"effect";s:99:"-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";s:6:"failed";s:1:"t";s:5:"extra";s:1:"p";s:5:"block";i:9060986;s:4:"time";s:19:"2014-09-26 04:42:40";}i:3;a:9:{s:8:"currency";s:38:"CNY.rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK";s:11:"transaction";s:64:"67d2263c7264021b01ae9e8c9f78f14e4805aa4e08cc3a4d01710c94c46b114b";s:7:"address";s:34:"r4BV3UiUNa2WjRk6xC5QVSfGbMKwZhZfVA";s:8:"sort_key";i:3;s:6:"effect";s:98:"10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";s:6:"failed";s:1:"t";s:5:"extra";s:1:"p";s:5:"block";i:9060986;s:4:"time";s:19:"2014-09-26 04:42:40";}}s:10:"currencies";a:1:{i:0;a:4:{s:2:"id";s:38:"CNY.rnuF96W4SZoCJmbHYBFoJZpR8eCaxNvekK";s:4:"name";s:3:"CNY";s:6:"symbol";s:3:"CNY";s:8:"decimals";i:96;}}}'], 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/BlastERC1155Module.php: -------------------------------------------------------------------------------- 1 | blockchain = 'blast'; 15 | $this->module = 'blast-erc-1155'; 16 | $this->is_main = false; 17 | $this->first_block_date = '2024-02-24'; 18 | $this->first_block_id = 0; 19 | 20 | $this->tests = [ 21 | ['block' => 6127913, 'result' => 'a:2:{s:6:"events";a:12:{i:0;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:0;s:6:"effect";s:2:"-2";s:5:"extra";s:2:"13";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:1;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x6d802f4667ad169af7bdd203f79666e10409b050";s:8:"sort_key";i:1;s:6:"effect";s:1:"2";s:5:"extra";s:2:"13";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:2;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:2;s:6:"effect";s:2:"-2";s:5:"extra";s:2:"19";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:3;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x6d802f4667ad169af7bdd203f79666e10409b050";s:8:"sort_key";i:3;s:6:"effect";s:1:"2";s:5:"extra";s:2:"19";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:4;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:4;s:6:"effect";s:2:"-2";s:5:"extra";s:2:"20";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:5;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x6d802f4667ad169af7bdd203f79666e10409b050";s:8:"sort_key";i:5;s:6:"effect";s:1:"2";s:5:"extra";s:2:"20";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:6;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:6;s:6:"effect";s:2:"-1";s:5:"extra";s:2:"16";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:7;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x6d802f4667ad169af7bdd203f79666e10409b050";s:8:"sort_key";i:7;s:6:"effect";s:1:"1";s:5:"extra";s:2:"16";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:8;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:8;s:6:"effect";s:2:"-1";s:5:"extra";s:2:"22";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:9;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x6d802f4667ad169af7bdd203f79666e10409b050";s:8:"sort_key";i:9;s:6:"effect";s:1:"1";s:5:"extra";s:2:"22";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:10;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x0000000000000000000000000000000000000000";s:8:"sort_key";i:10;s:6:"effect";s:2:"-1";s:5:"extra";s:2:"18";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}i:11;a:8:{s:11:"transaction";s:66:"0x35d80b5090b4af7835b0180582b2b7ec62441285f9b91b48ce63f0dec5508996";s:8:"currency";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:7:"address";s:42:"0x6d802f4667ad169af7bdd203f79666e10409b050";s:8:"sort_key";i:11;s:6:"effect";s:1:"1";s:5:"extra";s:2:"18";s:5:"block";i:6127913;s:4:"time";s:19:"2024-07-15 17:47:21";}}s:10:"currencies";a:1:{i:0;a:3:{s:2:"id";s:42:"0x3e99d1a52562454bf26d7c7112a303413a56bc08";s:4:"name";s:0:"";s:6:"symbol";s:0:"";}}}'], 22 | ]; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Modules/MoneroMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'monero'; 15 | $this->module = 'monero-main'; 16 | $this->is_main = true; 17 | $this->currency = 'monero'; 18 | $this->currency_details = ['name' => 'Monero', 'symbol' => 'XMR', 'decimals' => 12, 'description' => null, 'smallest' => 'piconero']; 19 | $this->first_block_id = 0; 20 | $this->first_block_date = '2014-04-18'; 21 | 22 | // Tests 23 | $this->tests = [ 24 | // First Monero block 25 | ['block' => 0, 'result' => 'a:2:{s:6:"events";a:2:{i:0;a:6:{s:11:"transaction";s:64:"c88ce9783b4f11190d7b9c17a69c1c52200f9faaee8e98dd07e6811175177139";s:7:"address";s:8:"the-void";s:6:"effect";s:15:"-17592186044415";s:8:"sort_key";i:0;s:5:"block";i:0;s:4:"time";s:19:"1970-01-01 00:00:00";}i:1;a:6:{s:11:"transaction";s:64:"c88ce9783b4f11190d7b9c17a69c1c52200f9faaee8e98dd07e6811175177139";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:14:"17592186044415";s:8:"sort_key";i:1;s:5:"block";i:0;s:4:"time";s:19:"1970-01-01 00:00:00";}}s:10:"currencies";N;}'], 26 | // Last v1 transaction 27 | ['block' => 1220516, 'transaction' => '2210683a0e0eaf8143c9989f45f9b505912b8236dc125dfd70139fe311281be0', 'result' => 'a:1:{s:6:"events";a:6:{i:0;a:6:{s:11:"transaction";s:64:"2210683a0e0eaf8143c9989f45f9b505912b8236dc125dfd70139fe311281be0";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:14:"-1000000000000";s:8:"sort_key";i:224;s:5:"block";i:1220516;s:4:"time";s:19:"2017-01-10 06:38:49";}i:1;a:6:{s:11:"transaction";s:64:"2210683a0e0eaf8143c9989f45f9b505912b8236dc125dfd70139fe311281be0";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:10:"1000000000";s:8:"sort_key";i:225;s:5:"block";i:1220516;s:4:"time";s:19:"2017-01-10 06:38:49";}i:2;a:6:{s:11:"transaction";s:64:"2210683a0e0eaf8143c9989f45f9b505912b8236dc125dfd70139fe311281be0";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:10:"9000000000";s:8:"sort_key";i:226;s:5:"block";i:1220516;s:4:"time";s:19:"2017-01-10 06:38:49";}i:3;a:6:{s:11:"transaction";s:64:"2210683a0e0eaf8143c9989f45f9b505912b8236dc125dfd70139fe311281be0";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:11:"50000000000";s:8:"sort_key";i:227;s:5:"block";i:1220516;s:4:"time";s:19:"2017-01-10 06:38:49";}i:4;a:6:{s:11:"transaction";s:64:"2210683a0e0eaf8143c9989f45f9b505912b8236dc125dfd70139fe311281be0";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:12:"900000000000";s:8:"sort_key";i:228;s:5:"block";i:1220516;s:4:"time";s:19:"2017-01-10 06:38:49";}i:5;a:6:{s:11:"transaction";s:64:"2210683a0e0eaf8143c9989f45f9b505912b8236dc125dfd70139fe311281be0";s:7:"address";s:8:"the-void";s:6:"effect";s:11:"40000000000";s:8:"sort_key";i:229;s:5:"block";i:1220516;s:4:"time";s:19:"2017-01-10 06:38:49";}}}'], 28 | // First v2 transation (non-coinbase) 29 | ['block' => 1220517, 'transaction' => '6f6f2eea2e549a69ad10246511ccc720193f1d41c9fa2c7aae0e47cb9884d898', 'result' => 'a:1:{s:6:"events";a:5:{i:0;a:6:{s:11:"transaction";s:64:"6f6f2eea2e549a69ad10246511ccc720193f1d41c9fa2c7aae0e47cb9884d898";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:2:"-?";s:8:"sort_key";i:2;s:5:"block";i:1220517;s:4:"time";s:19:"2017-01-10 06:39:06";}i:1;a:6:{s:11:"transaction";s:64:"6f6f2eea2e549a69ad10246511ccc720193f1d41c9fa2c7aae0e47cb9884d898";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:2:"-?";s:8:"sort_key";i:3;s:5:"block";i:1220517;s:4:"time";s:19:"2017-01-10 06:39:06";}i:2;a:6:{s:11:"transaction";s:64:"6f6f2eea2e549a69ad10246511ccc720193f1d41c9fa2c7aae0e47cb9884d898";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:2:"+?";s:8:"sort_key";i:4;s:5:"block";i:1220517;s:4:"time";s:19:"2017-01-10 06:39:06";}i:3;a:6:{s:11:"transaction";s:64:"6f6f2eea2e549a69ad10246511ccc720193f1d41c9fa2c7aae0e47cb9884d898";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:2:"+?";s:8:"sort_key";i:5;s:5:"block";i:1220517;s:4:"time";s:19:"2017-01-10 06:39:06";}i:4;a:6:{s:11:"transaction";s:64:"6f6f2eea2e549a69ad10246511ccc720193f1d41c9fa2c7aae0e47cb9884d898";s:7:"address";s:8:"the-void";s:6:"effect";s:11:"26000000000";s:8:"sort_key";i:6;s:5:"block";i:1220517;s:4:"time";s:19:"2017-01-10 06:39:06";}}}'], 30 | // No outputs transaction 31 | ['block' => 770439, 'transaction' => 'ee55915c178b9961c89d81f0059a9a3b54026e2be069d0d2e6dae12119bc0f69', 'result' => 'a:1:{s:6:"events";a:3:{i:0;a:6:{s:11:"transaction";s:64:"ee55915c178b9961c89d81f0059a9a3b54026e2be069d0d2e6dae12119bc0f69";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:11:"-7928990000";s:8:"sort_key";i:5;s:5:"block";i:770439;s:4:"time";s:19:"2015-10-06 14:54:39";}i:1;a:6:{s:11:"transaction";s:64:"ee55915c178b9961c89d81f0059a9a3b54026e2be069d0d2e6dae12119bc0f69";s:7:"address";s:13:"shielded-pool";s:6:"effect";s:11:"-3336980000";s:8:"sort_key";i:6;s:5:"block";i:770439;s:4:"time";s:19:"2015-10-06 14:54:39";}i:2;a:6:{s:11:"transaction";s:64:"ee55915c178b9961c89d81f0059a9a3b54026e2be069d0d2e6dae12119bc0f69";s:7:"address";s:8:"the-void";s:6:"effect";s:11:"11265970000";s:8:"sort_key";i:7;s:5:"block";i:770439;s:4:"time";s:19:"2015-10-06 14:54:39";}}}'], 32 | ]; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Modules/OptimismMainModule.php: -------------------------------------------------------------------------------- 1 | blockchain = 'optimism'; 15 | $this->module = 'optimism-main'; 16 | $this->is_main = true; 17 | $this->first_block_date = '2021-11-11'; 18 | $this->first_block_id = 0; 19 | $this->currency = 'ethereum'; 20 | $this->currency_details = ['name' => 'Ethereum', 'symbol' => 'ETH', 'decimals' => 18, 'description' => null]; 21 | $this->mempool_implemented = false; // Unlike other EVMMainModule heirs, Optimism doesn't implement mempool 22 | 23 | // EVMMainModule 24 | $this->evm_implementation = EVMImplementation::geth; 25 | $this->extra_features = [EVMSpecialFeatures::HasSystemTransactions, EVMSpecialFeatures::OPStackBaseFeeRecipient, EVMSpecialFeatures::OPStackL1FeeVault]; 26 | $this->reward_function = function($block_id) 27 | { 28 | return '0'; 29 | }; 30 | $this->l1_fee_vault = '0x420000000000000000000000000000000000001a'; // https://github.com/ethereum-optimism/op-geth/blob/c6ea6fa09d4e7df6d1ca6b2d32bcb139f021b1e2/params/protocol_params.go#L29 31 | $this->base_fee_recipient = '0x4200000000000000000000000000000000000019'; 32 | 33 | // Handles 34 | $this->handles_implemented = true; 35 | // This is the full list of names supported by 3DNS, including .box 36 | $this->handles_regex = '/(.*)\.(box|ac|academy|accountant|accountants|actor|agency|ai|airforce|apartments|app|archi|army|art|asia|associates|at|attorney|auction|audio|auto|autos|baby|band|bar|bargains|bayern|beauty|beer|best|bible|bid|bike|bingo|bio|biz|black|blackfriday|blog|blue|boats|bond|boston|boutique|builders|business|buzz|ca|cab|cafe|cam|camera|camp|capital|car|cards|care|careers|cars|casa|cash|casino|catering|cc|center|cfd|charity|chat|cheap|christmas|church|city|claims|cleaning|click|clinic|clothing|cloud|club|co|coach|codes|coffee|college|com|community|company|computer|condos|construction|consulting|contact|contractors|cooking|cool|coupons|courses|credit|creditcard|cricket|cruises|cyou|dance|date|dating|de|dealer|deals|degree|delivery|democrat|dental|dentist|design|dev|diamonds|diet|digital|direct|directory|discount|doctor|dog|domains|download|earth|education|email|energy|engineer|engineering|enterprises|equipment|estate|eu|events|exchange|expert|exposed|express|fail|faith|family|fans|farm|fashion|feedback|film|finance|financial|fish|fishing|fit|fitness|flights|florist|flowers|football|forsale|foundation|fun|fund|furniture|futbol|fyi|gallery|game|games|garden|gay|gift|gifts|gives|glass|global|gmbh|gold|golf|graphics|gratis|green|gripe|group|guide|guitars|guru|hair|haus|health|healthcare|help|hiphop|hiv|hockey|holdings|holiday|homes|horse|hospital|host|hosting|house|icu|immo|immobilien|in|inc|industries|info|ink|institute|insure|international|investments|io|irish|ist|istanbul|jetzt|jewelry|juegos|kaufen|kids|kim|kitchen|la|land|lat|law|lawyer|lease|legal|lgbt|life|lighting|limited|limo|link|live|llc|loan|loans|lol|london|love|ltd|luxe|maison|makeup|management|market|marketing|mba|me|media|melbourne|memorial|men|menu|miami|mobi|moda|moe|mom|money|monster|mortgage|motorcycles|movie|mx|navy|net|network|news|ninja|nl|nyc|observer|one|online|ooo|org|organic|page|partners|parts|party|pet|ph|photo|photography|photos|pics|pictures|pink|pizza|place|plumbing|plus|poker|press|pro|productions|promo|properties|property|protection|pub|pw|quest|racing|realty|recipes|red|rehab|reise|reisen|rent|rentals|repair|report|republican|rest|restaurant|review|reviews|rip|rocks|rodeo|run|sale|salon|sarl|sbs|school|schule|science|security|services|sexy|sh|shiksha|shoes|shop|shopping|show|singles|site|ski|skin|soccer|social|software|solar|solutions|space|storage|store|stream|studio|study|style|sucks|supplies|supply|support|surf|surgery|sydney|systems|tattoo|tax|taxi|team|tech|technology|tel|tennis|theater|theatre|tickets|tienda|tips|tires|today|tools|top|tours|town|toys|trade|training|travel|tube|tv|uk|university|uno|us|vacations|vegas|ventures|vet|viajes|video|villas|vin|vip|vision|vodka|vote|voyage|watch|webcam|website|wedding|whoswho|wiki|win|wine|work|works|world|ws|wtf|xyz|yachts|yoga|zone)/'; 37 | $this->api_get_handle = function($handle) 38 | { 39 | if (!preg_match($this->handles_regex, $handle)) 40 | return null; 41 | 42 | require_once __DIR__ . '/../Engine/Crypto/Keccak.php'; 43 | 44 | $hash = $this->ens_name_to_hash($handle); 45 | 46 | if (is_null($hash) || $hash === '') 47 | return null; 48 | 49 | // First, we look for forward resolution 50 | $address = $this->ens_get_data_from_resolver('0xf97aac6c8dbaebcb54ff166d79706e3af7a813c8', $hash, '0x3b3b57de', -40); 51 | 52 | if ($address === '0000000000000000000000000000000000000000') // Then, if nothing has been found, we look for the owner (ownerOf) 53 | $address = $this->ens_get_data_from_resolver('0xbb7b805b257d7c76ca9435b3ffe780355e4c4b17', $hash, '0x6352211e', -40); 54 | 55 | if ($address && $address !== '0000000000000000000000000000000000000000') 56 | return '0x' . $address; 57 | else 58 | return null; 59 | }; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Modules/Common/BeaconChainLikeWithdrawalsModule.php: -------------------------------------------------------------------------------- 1 | version = 1; 44 | } 45 | 46 | final public function post_post_initialize() 47 | { 48 | if (!isset($this->chain_config['BELLATRIX_FORK_EPOCH'])) throw new DeveloperError("`BELLATRIX_FORK_EPOCH` is not set"); 49 | if (!isset($this->chain_config['CAPELLA_FORK_EPOCH'])) throw new DeveloperError("`CAPELLA_FORK_EPOCH` is not set"); 50 | if (!isset($this->chain_config['SLOT_PER_EPOCH'])) throw new DeveloperError("`SLOT_PER_EPOCH` is not set"); 51 | if (!isset($this->chain_config['DELAY'])) throw new DeveloperError("`DELAY` is not set"); 52 | } 53 | 54 | final public function pre_process_block($block) // $block here is an epoch number 55 | { 56 | $events = []; 57 | $rq_slot_time = []; 58 | $withdrawals = []; // [i] -> [validator, address, amount, slot] 59 | $slot_data = []; 60 | 61 | $proposers = requester_single($this->select_node(), 62 | endpoint: "eth/v1/validator/duties/proposer/{$block}", 63 | timeout: $this->timeout, 64 | result_in: 'data', 65 | ); 66 | 67 | foreach ($proposers as $proposer) 68 | $slots[$proposer['slot']] = null; 69 | 70 | foreach ($slots as $slot => $tm) 71 | $rq_slot_time[] = requester_multi_prepare($this->select_node(), endpoint: "eth/v1/beacon/blocks/{$slot}"); 72 | 73 | $rq_slot_time_multi = requester_multi($rq_slot_time, 74 | limit: envm($this->module, 'REQUESTER_THREADS'), 75 | timeout: $this->timeout, 76 | valid_codes: [200, 404], 77 | ); 78 | 79 | foreach ($rq_slot_time_multi as $slot) 80 | $slot_data[] = requester_multi_process($slot); 81 | 82 | foreach ($slot_data as $slot_info) 83 | { 84 | $withdrawal = []; 85 | if (isset($slot_info['code']) && $slot_info['code'] === '404') 86 | continue; 87 | elseif (isset($slot_info['code'])) 88 | throw new ModuleError('Unexpected response code'); 89 | 90 | $slot_id = (string)$slot_info['data']['message']['slot']; 91 | 92 | if (isset($slot_info['data']['message']['body']['execution_payload'])) 93 | { 94 | $timestamp = (int)$slot_info['data']['message']['body']['execution_payload']['timestamp']; 95 | if ($block >= $this->chain_config['CAPELLA_FORK_EPOCH']) 96 | { 97 | $withdrawal = $slot_info['data']['message']['body']['execution_payload']['withdrawals']; 98 | } 99 | } 100 | else 101 | { 102 | $timestamp = 0; 103 | $withdrawal = []; 104 | } 105 | 106 | $slots[$slot_id] = $timestamp; 107 | 108 | foreach ($withdrawal as $w) 109 | { 110 | $withdrawals[] = [ 111 | $w['validator_index'], 112 | $w['address'], 113 | $w['amount'], 114 | $slot_id, 115 | ]; 116 | } 117 | } 118 | 119 | $this->get_epoch_time($block, $slots); 120 | $key_tes = 0; 121 | 122 | foreach ($withdrawals as [$index, $address, $amount, $slot]) 123 | { 124 | $events[] = [ 125 | 'block' => $block, 126 | 'transaction' => $slot, 127 | 'sort_key' => $key_tes++, 128 | 'time' => $this->block_time, 129 | 'address' => (string)$index, 130 | 'effect' => '-' . $amount, 131 | 'extra_indexed' => (string)$address 132 | ]; 133 | } 134 | 135 | $this->set_return_events($events); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /Modules/Common/BeaconChainLikeProposalsModule.php: -------------------------------------------------------------------------------- 1 | version = 1; 47 | } 48 | 49 | final public function post_post_initialize() 50 | { 51 | if (!isset($this->chain_config['BELLATRIX_FORK_EPOCH'])) throw new DeveloperError("`BELLATRIX_FORK_EPOCH` is not set"); 52 | if (!isset($this->chain_config['SLOT_PER_EPOCH'])) throw new DeveloperError("`SLOT_PER_EPOCH` is not set"); 53 | if (!isset($this->chain_config['DELAY'])) throw new DeveloperError("`DELAY` is not set"); 54 | } 55 | 56 | final public function pre_process_block($block) // $block here is an epoch number 57 | { 58 | $events = []; 59 | $rq_slot_time = []; 60 | $rewards_slots = []; // [slot] -> [validator, reward] 61 | $slot_data = []; 62 | 63 | $proposers = requester_single($this->select_node(), 64 | endpoint: "eth/v1/validator/duties/proposer/{$block}", 65 | timeout: $this->timeout, 66 | result_in: 'data', 67 | ); 68 | 69 | foreach ($proposers as $proposer) 70 | { 71 | $slots[$proposer['slot']] = null; 72 | $rewards_slots[$proposer['slot']] = [$proposer['validator_index'], null]; 73 | } 74 | 75 | foreach ($slots as $slot => $tm) 76 | $rq_slot_time[] = requester_multi_prepare($this->select_node(), endpoint: "eth/v1/beacon/blocks/{$slot}"); 77 | 78 | $rq_slot_time_multi = requester_multi($rq_slot_time, 79 | limit: envm($this->module, 'REQUESTER_THREADS'), 80 | timeout: $this->timeout, 81 | valid_codes: [200, 404], 82 | ); 83 | 84 | foreach ($rq_slot_time_multi as $slot) 85 | $slot_data[] = requester_multi_process($slot); 86 | 87 | foreach ($slot_data as $slot_info) 88 | { 89 | if (isset($slot_info['code']) && $slot_info['code'] === '404') 90 | continue; 91 | elseif (isset($slot_info['code'])) 92 | throw new ModuleError('Unexpected response code'); 93 | 94 | $slot_id = (string)$slot_info['data']['message']['slot']; 95 | 96 | if (isset($slot_info['data']['message']['body']['execution_payload'])) 97 | { 98 | $timestamp = (int)$slot_info['data']['message']['body']['execution_payload']['timestamp']; 99 | } 100 | else 101 | { 102 | $timestamp = 0; 103 | } 104 | 105 | $slots[$slot_id] = $timestamp; 106 | } 107 | 108 | $this->get_epoch_time($block, $slots); 109 | 110 | foreach ($slots as $slot => $tm) 111 | { 112 | $rq_block = requester_single( $this->select_node(), 113 | endpoint: "eth/v1/beacon/rewards/blocks/{$slot}", 114 | timeout: $this->timeout, 115 | valid_codes: [200, 404]); 116 | 117 | if (isset($rq_block['code']) && $rq_block['code'] === '404') 118 | continue; 119 | elseif (isset($rq_block['code'])) 120 | throw new ModuleError('Unexpected response code'); 121 | 122 | $rewards_slots[$slot][1] = bcadd($rq_block['data']['attestations'], $rq_block['data']['sync_aggregate']); 123 | } 124 | 125 | $key_tes = 0; 126 | 127 | foreach ($rewards_slots as $slot => [$validator, $reward]) 128 | { 129 | $events[] = [ 130 | 'block' => $block, 131 | 'transaction' => $slot, 132 | 'sort_key' => $key_tes++, 133 | 'time' => $this->block_time, 134 | 'address' => (string)$validator, 135 | 'effect' => ($reward ?? '0'), 136 | 'failed' => ($slots[$slot] === null), 137 | ]; 138 | } 139 | 140 | $this->set_return_events($events); 141 | } 142 | } 143 | --------------------------------------------------------------------------------