aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlaf Tomalka <olaf@tomalka.me>2018-01-03 19:28:06 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-01-10 18:24:37 +0800
commit7233a11ba018a5b8c1ffc2eda3b00e207b245f15 (patch)
tree73b4fd3b1a38de0af70c004e4680bda470d82e68
parent3a1360ce115e19ffe9d8894c15415744e55cf4f3 (diff)
downloaddexon-sol-tools-7233a11ba018a5b8c1ffc2eda3b00e207b245f15.tar.gz
dexon-sol-tools-7233a11ba018a5b8c1ffc2eda3b00e207b245f15.tar.zst
dexon-sol-tools-7233a11ba018a5b8c1ffc2eda3b00e207b245f15.zip
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
-rw-r--r--packages/web3-typescript-typings/index.d.ts5
1 files changed, 5 insertions, 0 deletions
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 {