Stake funds address

This commit is contained in:
Yohan Graterol 2018-02-21 22:27:25 -05:00
parent 65447da2e4
commit acd78eac7b
No known key found for this signature in database
GPG key ID: D8C4A70CC26A1F90
2 changed files with 15 additions and 3 deletions

View file

@ -610,9 +610,17 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
}
reward := new(big.Int).Set(blockReward)
// Treasury fee
treasuryReward := new(big.Int)
treasuryReward.Mul(reward, treasuryDevFunds)
treasuryReward.Div(treasuryReward, big.NewInt(100))
// Stake fee
stakeReward := new(big.Int)
stakeReward.Mul(reward, stakeFunds)
stakeReward.Div(treasuryReward, big.NewInt(100))
// Accumulate the rewards for the miner and any included uncles
r := new(big.Int)
for _, uncle := range uncles {
@ -628,7 +636,9 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
if config.IsCallisto(header.Number) {
reward.Sub(reward, treasuryReward)
reward.Sub(stakeReward, treasuryReward)
state.AddBalance(config.CallistoTreasuryAddress, treasuryReward)
state.AddBalance(config.CallistoStakeAddress, stakeReward)
}
state.AddBalance(header.Coinbase, reward)

View file

@ -87,6 +87,7 @@ var (
ByzantiumBlock: big.NewInt(4),
CallistoBlock: big.NewInt(4),
CallistoTreasuryAddress: common.HexToAddress("0x74682Fc32007aF0b6118F259cBe7bCCC21641600"),
CallistoStakeAddress: common.HexToAddress("0x3c06f218Ce6dD8E2c535a8925A2eDF81674984D9"),
Ethash: new(EthashConfig),
}
@ -114,16 +115,16 @@ var (
//
// This configuration is intentionally not using keyed fields to force anyone
// adding flags to the config to also have to set these fields.
AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), common.Address{}, new(EthashConfig), nil}
AllEthashProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), common.Address{}, common.Address{}, new(EthashConfig), nil}
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
// and accepted by the Ethereum core developers into the Clique consensus.
//
// This configuration is intentionally not using keyed fields to force anyone
// adding flags to the config to also have to set these fields.
AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), common.Address{},nil, &CliqueConfig{Period: 0, Epoch: 30000}}
AllCliqueProtocolChanges = &ChainConfig{big.NewInt(1337), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), common.Address{}, common.Address{},nil, &CliqueConfig{Period: 0, Epoch: 30000}}
TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), common.Address{}, new(EthashConfig), nil}
TestChainConfig = &ChainConfig{big.NewInt(1), big.NewInt(0), nil, false, big.NewInt(0), common.Hash{}, big.NewInt(0), big.NewInt(0), big.NewInt(0), big.NewInt(0), common.Address{}, common.Address{}, new(EthashConfig), nil}
TestRules = TestChainConfig.Rules(new(big.Int))
)
@ -151,6 +152,7 @@ type ChainConfig struct {
CallistoBlock *big.Int `json:"callistoBlock,omitempty"`
CallistoTreasuryAddress common.Address `json:"callistoTreasuryAddress,omitempty"`
CallistoStakeAddress common.Address `json:"callistoStakeAddress,omitempty"`
// Various consensus engines
Ethash *EthashConfig `json:"ethash,omitempty"`
Clique *CliqueConfig `json:"clique,omitempty"`