-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathEthereumClassicMainModule.php
More file actions
40 lines (33 loc) · 1.68 KB
/
EthereumClassicMainModule.php
File metadata and controls
40 lines (33 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php declare(strict_types = 1);
/* Idea (c) 2023 Nikita Zhavoronkov, nikzh@nikzh.com
* Copyright (c) 2023-2024 3xpl developers, 3@3xpl.com, see CONTRIBUTORS.md
* Distributed under the MIT software license, see LICENSE.md */
/* This is the main Ethereum Classic module. It requires either a geth node to run. Please note that `status` is
* not available on geth for some older transactions when requesting receipts and a special fix is required,
* see https://github.com/3xplcom/ethereum-classic */
final class EthereumClassicMainModule extends EVMMainModule implements Module, BalanceSpecial, TransactionSpecials, AddressSpecials, BroadcastTransactionSpecial
{
function initialize()
{
// CoreModule
$this->blockchain = 'ethereum-classic';
$this->module = 'ethereum-classic-main';
$this->is_main = true;
$this->first_block_date = '2015-07-30';
$this->currency = 'ethereum-classic';
$this->currency_details = ['name' => 'Ethereum Classic', 'symbol' => 'ETC', 'decimals' => 18, 'description' => null];
// EVMMainModule
$this->evm_implementation = EVMImplementation::geth;
$this->extra_features = [EVMSpecialFeatures::HasOrHadUncles];
$this->reward_function = function($block_id)
{
// https://ecips.ethereumclassic.org/ECIPs/ecip-1017
// https://ethereumclassic.org/why-classic/sound-money#known-future-supply
$base_reward = '5000000000000000000';
$reductions = intdiv($block_id - 1, 5_000_000);
for ($i = 0; $i < $reductions; $i++)
$base_reward = bcmul($base_reward, '0.8');
return $base_reward;
};
}
}