From 5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 13 Sep 2018 14:04:13 +0200 Subject: Fixes for the breaking changes in ethers --- packages/base-contract/src/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/base-contract/src') diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts index 12f974445..35c830a46 100644 --- a/packages/base-contract/src/index.ts +++ b/packages/base-contract/src/index.ts @@ -87,10 +87,10 @@ export class BaseContract { // if it overflows the corresponding Solidity type, there is a bug in the // encoder, or the encoder performs unsafe type coercion. public static strictArgumentEncodingCheck(inputAbi: DataItem[], args: any[]): void { - const coder = ethers.utils.AbiCoder.defaultCoder; + const coder = new ethers.AbiCoder(); const params = abiUtils.parseEthersParams(inputAbi); - const rawEncoded = coder.encode(params.names, params.types, args); - const rawDecoded = coder.decode(params.names, params.types, rawEncoded); + const rawEncoded = coder.encode(inputAbi, args); + const rawDecoded = coder.decode(inputAbi, rawEncoded); for (let i = 0; i < rawDecoded.length; i++) { const original = args[i]; const decoded = rawDecoded[i]; -- cgit v1.2.3