Skip to content

Commit

Permalink
kdc 정책 변경.
Browse files Browse the repository at this point in the history
메인넷 제네시스 블록 변경.
  • Loading branch information
hanryubank committed Oct 30, 2021
1 parent afa1c47 commit 41e66e1
Show file tree
Hide file tree
Showing 10 changed files with 171 additions and 127 deletions.
26 changes: 13 additions & 13 deletions BUILD_NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ fandom account new \
b67c637fbf846445852e87ba6d7ee9fe9e974090

====== GENERATE GENESIS BLOCK ======
// Deposit 10M KDC (10000000 KDC)
// Deposit 500K KDC (500000 KDC)

15000000 KDC/year = 10512000 blocks = 11680 epochs
=> 1284 KDC/epoch

300000000 KDC/year = 10512000 blocks = 11680 epochs
=> 25684 KDC/epoch

Year by year reward:
1st: 25684
2nd: 25684
3rd: 17122
4th: 17122
5th: 12842
6th: 12842
7th: 8560
8th: 8560
1st: 1284
2nd: 1284
3rd: 856
4th: 856
5th: 642
6th: 642
7th: 428
8th: 428
>=
9th: 4280
9th: 214

puppeth

Expand Down
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ var (
}
NetworkIdFlag = cli.Uint64Flag{
Name: "networkid",
Usage: "Network identifier (integer, 89=Fandomchain)",
Usage: "Network identifier (integer, 1222=Fandomchain)",
Value: eth.DefaultConfig.NetworkId,
}
TestnetFlag = cli.BoolFlag{
Expand Down
4 changes: 2 additions & 2 deletions contracts/validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ func NewValidator(transactOpts *bind.TransactOpts, contractAddr common.Address,

func DeployValidator(transactOpts *bind.TransactOpts, contractBackend bind.ContractBackend, validatorAddress []common.Address, caps []*big.Int, ownerAddress common.Address) (common.Address, *Validator, error) {
minDeposit := new(big.Int)
minDeposit.SetString("10000000000000000000000000", 10)
minDeposit.SetString("500000000000000000000000", 10)
minVoterCap := new(big.Int)
minVoterCap.SetString("10000000000000000000", 10)
// Deposit 10M KDC
// Deposit 500K KDC
// Min Voter Cap 10 KDC
// 150 masternodes
// Candidate Delay Withdraw 30 days = 864000 blocks
Expand Down
4 changes: 2 additions & 2 deletions contracts/validator/validator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func TestValidator(t *testing.T) {
transactOpts := bind.NewKeyedTransactor(key)

validatorCap := new(big.Int)
validatorCap.SetString("10000000000000000000000000", 10)
validatorCap.SetString("500000000000000000000000", 10)
validatorAddress, validator, err := DeployValidator(transactOpts, contractBackend, []common.Address{addr}, []*big.Int{validatorCap}, addr)
if err != nil {
t.Fatalf("can't deploy root registry: %v", err)
Expand Down Expand Up @@ -94,7 +94,7 @@ func TestRewardBalance(t *testing.T) {

// validatorAddr, _, baseValidator, err := contract.DeployFandomValidator(transactOpts, contractBackend, big.NewInt(50000), big.NewInt(99), big.NewInt(100), big.NewInt(100))
validatorCap := new(big.Int)
validatorCap.SetString("10000000000000000000000000", 10)
validatorCap.SetString("500000000000000000000000", 10)
validatorAddr, _, baseValidator, err := contractValidator.DeployFandomValidator(
transactOpts,
contractBackend,
Expand Down
8 changes: 4 additions & 4 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,13 @@ func GenesisBlockForTesting(db ethdb.Database, addr common.Address, balance *big
// DefaultGenesisBlock returns the Ethereum main net genesis block.
func DefaultGenesisBlock() *Genesis {
return &Genesis{
Config: params.FandomMainnetChainConfig,
Nonce: 0,
ExtraData: hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000005c8466817359c080ca8a429782c3ca79f91f8b3b7df2d6bb7ac5161e181d32b3ba3ce6a7b0d68a4ab67c637fbf846445852e87ba6d7ee9fe9e9740900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
Config: params.FandomMainnetChainConfig,
Nonce: 0,
ExtraData: hexutil.MustDecode("0x00000000000000000000000000000000000000000000000000000000000000001d13bc2982f221b6cb60a1ed70cf400c3cc4333b58bf47a37e996713daad2022f1b633b48a2f5a53715a5dc516931cd5034cc85af21767b169f049a2730229ce1ba478dcd821a1b5182ef165f8513e3391e1c208da4dcb4860a36f4ca4369974fc75f2320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
GasLimit: 4700000,
Difficulty: big.NewInt(1),
Alloc: DecodeMainnet(),
Timestamp: 1625215908,
Timestamp: 1635569363,
}
}

Expand Down
10 changes: 5 additions & 5 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -913,26 +913,26 @@ func GetValidators(bc *core.BlockChain, masternodes []common.Address) ([]byte, e
func rewardInflation(chainReward *big.Int, number uint64, blockPerYear uint64) *big.Int {
// 1st, 2nd year
if number < blockPerYear*2 {
return new(big.Int).Mul(new(big.Int).SetUint64(25684), new(big.Int).SetUint64(params.Ether))
return new(big.Int).Mul(new(big.Int).SetUint64(1284), new(big.Int).SetUint64(params.Ether))
}

// 3rd, 4th year
if blockPerYear*2 <= number && number < blockPerYear*4 {
return new(big.Int).Mul(new(big.Int).SetUint64(17122), new(big.Int).SetUint64(params.Ether))
return new(big.Int).Mul(new(big.Int).SetUint64(856), new(big.Int).SetUint64(params.Ether))
}

// 5th, 6th year
if blockPerYear*4 <= number && number < blockPerYear*6 {
return new(big.Int).Mul(new(big.Int).SetUint64(12842), new(big.Int).SetUint64(params.Ether))
return new(big.Int).Mul(new(big.Int).SetUint64(642), new(big.Int).SetUint64(params.Ether))
}

// 7th, 8th year
if blockPerYear*6 <= number && number < blockPerYear*8 {
return new(big.Int).Mul(new(big.Int).SetUint64(8560), new(big.Int).SetUint64(params.Ether))
return new(big.Int).Mul(new(big.Int).SetUint64(428), new(big.Int).SetUint64(params.Ether))
}

// from the 9th year
return new(big.Int).Mul(new(big.Int).SetUint64(4280), new(big.Int).SetUint64(params.Ether))
return new(big.Int).Mul(new(big.Int).SetUint64(214), new(big.Int).SetUint64(params.Ether))
}

func (s *Ethereum) GetPeer() int {
Expand Down
108 changes: 64 additions & 44 deletions genesis/mainnet.json

Large diffs are not rendered by default.

114 changes: 67 additions & 47 deletions genesis/testnet.json

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions params/bootnodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,22 @@ package params
// the main Ethereum network.
var MainnetBootnodes = []string{
// FandomChain Bootnodes Mainnet
"enode://bd26321c6a8306a3e167220ad506a0ffa19f9e720f6d73ede120b313d56b092c85daec055eb1dc48ff2aff47a87b1c5a21e9a73f707af468c70595456f534463@140.238.26.150:30303",
"enode://e0b20132d2cd37b0aa1b986ae7621ee8fb71863b7e636f568bad7a9329e626f4ce6677ebf3f7c30e9cc13a7623434ea123d86fbc025cacca6baac015591a9ed7@140.238.9.216:30303",
"enode://4067d8875a0684a0bdc786c66c8a592627d15491455b57f8342298b50654e00e30303ffa6d057dbcf76ebe114f592771dc2e4fd064dcb6e06274c3490564d910@140.238.2.213:30303",
"enode://5b1254aa4a7a91d5a95a3aa67aed2a2b8a12e2b686f6f48de2856055a71123a32b666974f2f273cdf28924228ace6dda424e54a7ca2ef061a308869a6f02116b@152.70.246.150:10303",
"enode://ea3b2ebd55f4c36a69bdc9e689a67d881aad9e30e05d24e97c4d8039a080b7765185d44969206ceedc51ff348b43fa304cb87418eeb9ab4dd5a10b8d91aa0a62@152.70.93.73:10303",
"enode://68927910ce58e6fef623988c78ff2ecd1b7001ba4f0f2afe8f4fb6180b52c7568b4d97b4cc606b0bb481f186458558dd78340b1b2680813dc509d063b5e7496f@132.226.171.251:10303",
"enode://a7022180f186a2e6f05c29404e7026bc8c2c92dab62dda13512314846129bac7eeb012ee14b27cb8f7484ff04c84ee0b8183efb233fd776883c1579bbd4c24c8@152.70.237.249:10303",
"enode://7800410d2383bf3f826be98189ed9df7b3e19cd1005d6f09feca35da19895cdc1defe9d8c01e8a5035e84de1eaff0df88fbce47b41ba58c5d69cd0dd46225c6b@146.56.171.183:10303",
}

// TestnetBootnodes are the enode URLs of the P2P bootstrap nodes running on the
// Ropsten test network.
var TestnetBootnodes = []string{
// FandomChain Bootnodes Testnet
"enode://846ba8638e7433d23293a3e9a8f6474a7ad2b1515733d3a8c96073314351f195466de2b757a0c4f4dbc041b6898fffad5ad79fdd5a3659f170c70785f69c875b@146.56.179.153:10303",
"enode://8de51d4bc9e3331d608bfb2e4ee21123f76a107805d13a7128a1e8ea2dd839b80945083529ac96dac4222c90b83b0ba77054822de13ac237413b8bb6b072144e@146.56.179.153:20303",
"enode://7776e27a3c77a6ddd8feecbdf40756242c97999d94e2cf7041e67883eda74b66e42c1cf89ef2d2356683f899312f7959ad0b0f60bdee4a33d648c1ff6f849f51@146.56.179.153:30303",
"enode://426d2092178adc391eb9fe99e78e985bf9e2dea03efb0aca4858495ea2f03847a3796ef51b760a3e240d892b274570c78de3871a642000e8783f958213306dbb@140.238.14.234:10303",
"enode://e5d7dc26402d2d79b330edc720fe07423cbd078216c6446ec3b3c4f099b7f4eacc3027086ccf89aedb8788ec00d05d4c9c566e20c4daaf3f03b159b92c9a8456@140.238.14.234:20303",
"enode://df1e3afb70f3e99cc64ad63f57c39c5bd478ed9e74a4d96f0468157f2b1e6903052ed9ca3d8de84502812e2cb76e9f472fd9c444924edf5ec7b450a169f32f3a@140.238.14.234:30303",
"enode://4dbbefa4092c07abbf1204c0992a16ca9aeba4072a353e60d0b0a6cd6b998d757ddfbd6fab26ba2e23c8f99b0d06300d25c143368a51c6f0e6973b155dac6447@140.238.14.234:40303",
"enode://0411b5250fc60b503f405dfa3188cdf7c468bdbdacd8a48077a37bf167651613a804a8823815f929564f2ee950a322ff332bc0bfdb2a28f4d81309704b375fcc@140.238.14.234:50303",
}

// RinkebyBootnodes are the enode URLs of the P2P bootstrap nodes running on the
Expand Down
6 changes: 3 additions & 3 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
)

var (
FandomMainnetGenesisHash = common.HexToHash("aa142a2ddf5349e90aafadcb4771782a76a478625ac1e5db3eab240ae9a2f39c") // Fandom Mainnet genesis hash to enforce below configs on
FandomMainnetGenesisHash = common.HexToHash("1e10d880e0fb427668f07a931b805c7f43fe720ed926ba2d8d173102840f8940") // Fandom Mainnet genesis hash to enforce below configs on
MainnetGenesisHash = common.HexToHash("8d13370621558f4ed0da587934473c0404729f28b0ff1d50e5fdd840457a2f17") // Mainnet genesis hash to enforce below configs on
TestnetGenesisHash = common.HexToHash("dffc8ae3b45965404b4fd73ce7f0e13e822ac0fc23ce7e95b42bc5f1e57023a5") // Testnet genesis hash to enforce below configs on
TestnetGenesisHash = common.HexToHash("b733d0c7dfae2c5858c0ff0fa434aedffee9db4fb04d649eee9d70ebf190abcb") // Testnet genesis hash to enforce below configs on
)

var (
Expand All @@ -42,7 +42,7 @@ var (
Posv: &PosvConfig{
Period: 3,
Epoch: 900,
Reward: 25684,
Reward: 1284,
RewardCheckpoint: 900,
Gap: 5,
FoudationWalletAddr: common.HexToAddress("0x0000000000000000000000000000000000000068"),
Expand Down

0 comments on commit 41e66e1

Please sign in to comment.