From 5dd859209c81ca6084881afca206e8ceed8111c2 Mon Sep 17 00:00:00 2001 From: Bernardo Ramos Date: Mon, 23 May 2022 00:41:39 -0300 Subject: [PATCH] [contract] check if contract exists on calls --- contract/contract.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contract/contract.go b/contract/contract.go index fa8fbe42d..3cdaab568 100644 --- a/contract/contract.go +++ b/contract/contract.go @@ -85,6 +85,12 @@ func Execute( } if !receiver.IsDeploy() && len(receiver.State().CodeHash) == 0 { + if txBody.Type == types.TxType_CALL || + txBody.Type == types.TxType_FEEDELEGATION { + if HardforkConfig.IsV3Fork(bi.No) { + err = newVmError(fmt.Errorf("The contract does not exist")) + } + } return }