mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
Stake funds address
This commit is contained in:
parent
65447da2e4
commit
acd78eac7b
2 changed files with 15 additions and 3 deletions
|
|
@ -610,9 +610,17 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
|
||||||
}
|
}
|
||||||
|
|
||||||
reward := new(big.Int).Set(blockReward)
|
reward := new(big.Int).Set(blockReward)
|
||||||
|
|
||||||
|
// Treasury fee
|
||||||
treasuryReward := new(big.Int)
|
treasuryReward := new(big.Int)
|
||||||
treasuryReward.Mul(reward, treasuryDevFunds)
|
treasuryReward.Mul(reward, treasuryDevFunds)
|
||||||
treasuryReward.Div(treasuryReward, big.NewInt(100))
|
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
|
// Accumulate the rewards for the miner and any included uncles
|
||||||
r := new(big.Int)
|
r := new(big.Int)
|
||||||
for _, uncle := range uncles {
|
for _, uncle := range uncles {
|
||||||
|
|
@ -628,7 +636,9 @@ func accumulateRewards(config *params.ChainConfig, state *state.StateDB, header
|
||||||
|
|
||||||
if config.IsCallisto(header.Number) {
|
if config.IsCallisto(header.Number) {
|
||||||
reward.Sub(reward, treasuryReward)
|
reward.Sub(reward, treasuryReward)
|
||||||
|
reward.Sub(stakeReward, treasuryReward)
|
||||||
state.AddBalance(config.CallistoTreasuryAddress, treasuryReward)
|
state.AddBalance(config.CallistoTreasuryAddress, treasuryReward)
|
||||||
|
state.AddBalance(config.CallistoStakeAddress, stakeReward)
|
||||||
}
|
}
|
||||||
|
|
||||||
state.AddBalance(header.Coinbase, reward)
|
state.AddBalance(header.Coinbase, reward)
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ var (
|
||||||
ByzantiumBlock: big.NewInt(4),
|
ByzantiumBlock: big.NewInt(4),
|
||||||
CallistoBlock: big.NewInt(4),
|
CallistoBlock: big.NewInt(4),
|
||||||
CallistoTreasuryAddress: common.HexToAddress("0x74682Fc32007aF0b6118F259cBe7bCCC21641600"),
|
CallistoTreasuryAddress: common.HexToAddress("0x74682Fc32007aF0b6118F259cBe7bCCC21641600"),
|
||||||
|
CallistoStakeAddress: common.HexToAddress("0x3c06f218Ce6dD8E2c535a8925A2eDF81674984D9"),
|
||||||
|
|
||||||
Ethash: new(EthashConfig),
|
Ethash: new(EthashConfig),
|
||||||
}
|
}
|
||||||
|
|
@ -114,16 +115,16 @@ var (
|
||||||
//
|
//
|
||||||
// This configuration is intentionally not using keyed fields to force anyone
|
// This configuration is intentionally not using keyed fields to force anyone
|
||||||
// adding flags to the config to also have to set these fields.
|
// 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
|
// AllCliqueProtocolChanges contains every protocol change (EIPs) introduced
|
||||||
// and accepted by the Ethereum core developers into the Clique consensus.
|
// and accepted by the Ethereum core developers into the Clique consensus.
|
||||||
//
|
//
|
||||||
// This configuration is intentionally not using keyed fields to force anyone
|
// This configuration is intentionally not using keyed fields to force anyone
|
||||||
// adding flags to the config to also have to set these fields.
|
// 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))
|
TestRules = TestChainConfig.Rules(new(big.Int))
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -151,6 +152,7 @@ type ChainConfig struct {
|
||||||
|
|
||||||
CallistoBlock *big.Int `json:"callistoBlock,omitempty"`
|
CallistoBlock *big.Int `json:"callistoBlock,omitempty"`
|
||||||
CallistoTreasuryAddress common.Address `json:"callistoTreasuryAddress,omitempty"`
|
CallistoTreasuryAddress common.Address `json:"callistoTreasuryAddress,omitempty"`
|
||||||
|
CallistoStakeAddress common.Address `json:"callistoStakeAddress,omitempty"`
|
||||||
// Various consensus engines
|
// Various consensus engines
|
||||||
Ethash *EthashConfig `json:"ethash,omitempty"`
|
Ethash *EthashConfig `json:"ethash,omitempty"`
|
||||||
Clique *CliqueConfig `json:"clique,omitempty"`
|
Clique *CliqueConfig `json:"clique,omitempty"`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue