diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-09-13 20:04:13 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-09-19 23:56:23 +0800 |
commit | 5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911 (patch) | |
tree | 5a0c37be4be70f8b603e771cf232d1745b7d5f8a /packages/base-contract/src/index.ts | |
parent | 6701ec68bdbda91e63ab199510469e3e6a421b57 (diff) | |
download | dexon-sol-tools-5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911.tar dexon-sol-tools-5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911.tar.gz dexon-sol-tools-5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911.tar.bz2 dexon-sol-tools-5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911.tar.lz dexon-sol-tools-5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911.tar.xz dexon-sol-tools-5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911.tar.zst dexon-sol-tools-5b6c91bb3f0b5a1d0586b7e772ad96f3eab1f911.zip |
Fixes for the breaking changes in ethers
Diffstat (limited to 'packages/base-contract/src/index.ts')
-rw-r--r-- | packages/base-contract/src/index.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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]; |