Skip to content

Commit

Permalink
Check the parameters count
Browse files Browse the repository at this point in the history
  • Loading branch information
erikzhang committed Jun 11, 2020
1 parent 44ccf0b commit eb8f03d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/neo/SmartContract/ApplicationEngine.Contract.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ private void CallContractInternal(UInt160 contractHash, string method, Array arg

ContractMethodDescriptor md = contract.Manifest.Abi.GetMethod(method);
if (md is null) throw new InvalidOperationException();
if (args.Count != md.Parameters.Length) throw new InvalidOperationException();
int rvcount = md.ReturnType == ContractParameterType.Void ? 0 : 1;
ExecutionContext context_new = LoadScript(contract.Script, rvcount);
state = context_new.GetState<ExecutionContextState>();
Expand Down

0 comments on commit eb8f03d

Please sign in to comment.