diff --git a/src/contract.ts b/src/contract.ts index 94b8d192f8..cca2cd5dfe 100644 --- a/src/contract.ts +++ b/src/contract.ts @@ -4,9 +4,9 @@ import { getTransactionLastResult } from './providers'; import { PositionalArgsError, ArgumentTypeError } from './utils/errors'; // Makes `function.name` return given name -function nameFunction(name, body) { +function nameFunction(name: string, body: (args?: any[]) => {}) { return { - [name](...args) { + [name](...args: any[]) { return body(...args); } }[name];