Skip to content

Commit d24aa29

Browse files
committed
vm ops
1 parent 50cde02 commit d24aa29

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

vmhost/vmhooks/baseOps.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,16 @@ func TransferValueExecuteWithTypedArgs(
841841
}
842842
}
843843

844+
data := ""
845+
if contractCallInput != nil {
846+
data = makeCrossShardCallFromInput(contractCallInput.Function, contractCallInput.Arguments)
847+
}
848+
849+
if host.IsBuiltinFunctionCall([]byte(data)) {
850+
WithFaultAndHost(host, vmhost.ErrTransferValueOnESDTCall, runtime.BaseOpsErrorShouldFailExecution())
851+
return 1
852+
}
853+
844854
if host.AreInSameShard(sender, dest) && contractCallInput != nil && host.Blockchain().IsSmartContract(dest) {
845855
logEEI.Trace("eGLD pre-transfer execution begin")
846856
vmOutput, err := executeOnDestContextFromAPI(host, contractCallInput)
@@ -854,11 +864,6 @@ func TransferValueExecuteWithTypedArgs(
854864
return 0
855865
}
856866

857-
data := ""
858-
if contractCallInput != nil {
859-
data = makeCrossShardCallFromInput(contractCallInput.Function, contractCallInput.Arguments)
860-
}
861-
862867
err = metering.UseGasBounded(uint64(gasLimit))
863868
if WithFaultAndHost(host, err, runtime.UseGasBoundedShouldFailExecution()) {
864869
return 1

0 commit comments

Comments
 (0)