|
|
|
@ -31,8 +31,6 @@ type builtInSC uint |
|
|
|
|
const ( |
|
|
|
|
scFaucet builtInSC = iota |
|
|
|
|
scStaking |
|
|
|
|
scLottery |
|
|
|
|
scPuzzle |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
// AddStakingContractToPendingTransactions adds the deposit smart contract the genesis block.
|
|
|
|
@ -220,14 +218,6 @@ func (node *Node) AddContractKeyAndAddress(t builtInSC) { |
|
|
|
|
node.CurrentStakes = make(map[common.Address]*structs.StakeInfo) |
|
|
|
|
stakingPrivKey := contract_constants.GenesisBeaconAccountPriKey |
|
|
|
|
node.StakingContractAddress = crypto.CreateAddress(crypto.PubkeyToAddress(stakingPrivKey.PublicKey), uint64(0)) |
|
|
|
|
case scLottery: |
|
|
|
|
// lottery
|
|
|
|
|
lotteryPriKey, _ := crypto.HexToECDSA(contract_constants.DemoAccounts[0].Private) |
|
|
|
|
node.DemoContractAddress = crypto.CreateAddress(crypto.PubkeyToAddress(lotteryPriKey.PublicKey), uint64(0)) |
|
|
|
|
case scPuzzle: |
|
|
|
|
// puzzle
|
|
|
|
|
puzzlePriKey, _ := crypto.HexToECDSA(contract_constants.PuzzleAccounts[0].Private) |
|
|
|
|
node.PuzzleContractAddress = crypto.CreateAddress(crypto.PubkeyToAddress(puzzlePriKey.PublicKey), uint64(0)) |
|
|
|
|
default: |
|
|
|
|
utils.GetLogInstance().Error("AddContractKeyAndAddress", "unknown SC", t) |
|
|
|
|
} |
|
|
|
|