From 6280035239dd6b1c47cc9eca7acfbcec53397ff0 Mon Sep 17 00:00:00 2001 From: Aaron Buchwald Date: Fri, 18 Dec 2020 14:11:31 -0500 Subject: Add clarifying comment and enforce no yolov1 fork with apricot --- core/vm/contracts_stateful.go | 3 +++ params/config.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/core/vm/contracts_stateful.go b/core/vm/contracts_stateful.go index b91acfb..a7caf14 100644 --- a/core/vm/contracts_stateful.go +++ b/core/vm/contracts_stateful.go @@ -53,6 +53,9 @@ func newWrappedPrecompiledContract(p PrecompiledContract) StatefulPrecompiledCon // Run ... func (w *wrappedPrecompiledContract) Run(evm *EVM, caller ContractRef, addr common.Address, value *big.Int, input []byte, suppliedGas uint64, readOnly bool) (ret []byte, remainingGas uint64, err error) { + // [caller.Address()] has already been verified + // as having a sufficient balance before the + // precompiled contract runs. evm.Transfer(evm.StateDB, caller.Address(), addr, value) return RunPrecompiledContract(w.p, input, suppliedGas) } diff --git a/params/config.go b/params/config.go index f945f47..8d7bd92 100644 --- a/params/config.go +++ b/params/config.go @@ -560,6 +560,10 @@ func (c *ChainConfig) CheckConfigForkOrder() error { lastFork = cur } } + + if c.ApricotBlockTimestamp != nil && c.YoloV1Block != nil { + return fmt.Errorf("apricot fork is incomatible with yoloV1 fork") + } return nil } -- cgit v1.2.3-70-g09d2