From 0c906c03e31ff8961458669da604985db039234c Mon Sep 17 00:00:00 2001 From: Minh Doan Date: Sun, 2 Jun 2019 17:16:18 -0700 Subject: [PATCH] remove smart contract lottery and puzzle --- node/contract.go | 10 ---------- node/node.go | 9 --------- 2 files changed, 19 deletions(-) diff --git a/node/contract.go b/node/contract.go index c056ed374..563ac5ccd 100644 --- a/node/contract.go +++ b/node/contract.go @@ -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) } diff --git a/node/node.go b/node/node.go index a1c71878e..742e6a74d 100644 --- a/node/node.go +++ b/node/node.go @@ -337,15 +337,6 @@ func New(host p2p.Host, consensusObj *consensus.Consensus, chainDBFactory shardc node.AddContractKeyAndAddress(scStaking) } } - if node.isFirstTime { - // TODO(minhdoan): Think of a better approach to deploy smart contract. - // This is temporary for demo purpose. - node.AddLotteryContract() - node.AddPuzzleContract() - } else { - node.AddContractKeyAndAddress(scLottery) - node.AddContractKeyAndAddress(scPuzzle) - } } node.ContractCaller = contracts.NewContractCaller(node.Blockchain(), params.TestChainConfig)