From 7233a11ba018a5b8c1ffc2eda3b00e207b245f15 Mon Sep 17 00:00:00 2001 From: Olaf Tomalka Date: Wed, 3 Jan 2018 12:28:06 +0100 Subject: Added stateMutability to ABIs In the newest version of Solidity, additional property was added, called state mutability, specyfing what kind of access does the function have to memory and storage. Additionally, constructor mutability is limited to payable/non-payable as it HAS to modify the storage to actually deploy the contract --- packages/web3-typescript-typings/index.d.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'packages') diff --git a/packages/web3-typescript-typings/index.d.ts b/packages/web3-typescript-typings/index.d.ts index aa15ad86e..8ecb8420f 100644 --- a/packages/web3-typescript-typings/index.d.ts +++ b/packages/web3-typescript-typings/index.d.ts @@ -57,12 +57,16 @@ declare module 'web3' { Fallback = 'fallback', } + type ConstructorStateMutability = 'nonpayable' | 'payable'; + type StateMutability = 'pure' | 'view' | ConstructorStateMutability; + interface MethodAbi { type: AbiType.Function; name: string; inputs: FunctionParameter[]; outputs: FunctionParameter[]; constant: boolean; + stateMutability: StateMutability; payable: boolean; } @@ -70,6 +74,7 @@ declare module 'web3' { type: AbiType.Constructor; inputs: FunctionParameter[]; payable: boolean; + stateMutability: ConstructorStateMutability; } interface FallbackAbi { -- cgit v1.2.3