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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
pub mod build_version;
pub mod deadlines;
mod piece;
mod randomness;
pub mod sector;
mod state;
mod version;
#[cfg(feature = "json")]
pub mod genesis;
#[cfg(feature = "proofs")]
pub mod verifier;
pub use self::piece::*;
pub use self::randomness::*;
pub use self::sector::*;
pub use self::state::*;
pub use self::version::*;
use address::Address;
use clock::ChainEpoch;
use num_bigint::BigInt;
#[macro_use]
extern crate lazy_static;
lazy_static! {
pub static ref TOTAL_FILECOIN: BigInt = BigInt::from(TOTAL_FILECOIN_BASE) * FILECOIN_PRECISION;
pub static ref FIL_RESERVED: BigInt = BigInt::from(300_000_000) * FILECOIN_PRECISION;
pub static ref ZERO_ADDRESS: Address = "f3yaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaby2smx7a".parse().unwrap();
}
pub type ActorID = u64;
pub const HAMT_BIT_WIDTH: u32 = 5;
pub const BLOCK_GAS_LIMIT: i64 = 10_000_000_000;
pub const TOTAL_FILECOIN_BASE: i64 = 2_000_000_000;
pub const TICKET_RANDOMNESS_LOOKBACK: ChainEpoch = 1;
pub const WINNING_POST_SECTOR_SET_LOOKBACK: ChainEpoch = 10;
pub const BLOCKS_PER_EPOCH: u64 = 5;
pub const FILECOIN_PRECISION: i64 = 1_000_000_000_000_000_000;
pub const ALLOWABLE_CLOCK_DRIFT: u64 = 1;
pub trait NetworkParams {
const TOTAL_FILECOIN: i64;
const MINING_REWARD_TOTAL: i64;
fn initial_reward_balance() -> BigInt {
BigInt::from(Self::MINING_REWARD_TOTAL) * Self::TOTAL_FILECOIN
}
fn from_fil(i: i64) -> BigInt {
BigInt::from(i) * FILECOIN_PRECISION
}
}
pub struct DefaultNetworkParams;
impl NetworkParams for DefaultNetworkParams {
const TOTAL_FILECOIN: i64 = TOTAL_FILECOIN_BASE;
const MINING_REWARD_TOTAL: i64 = 1_400_000_000;
}