aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-09-27 17:51:11 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-09-27 17:51:11 +0800
commit63d79faa85df1cc090837fc49befb5076b50203b (patch)
treeb4d748445c4d285a84d8b7d9f2bc42fa111e5675 /packages
parenta51919db0e2414dc345f55ce7ad4fc50286dfd19 (diff)
downloaddexon-sol-tools-63d79faa85df1cc090837fc49befb5076b50203b.tar
dexon-sol-tools-63d79faa85df1cc090837fc49befb5076b50203b.tar.gz
dexon-sol-tools-63d79faa85df1cc090837fc49befb5076b50203b.tar.bz2
dexon-sol-tools-63d79faa85df1cc090837fc49befb5076b50203b.tar.lz
dexon-sol-tools-63d79faa85df1cc090837fc49befb5076b50203b.tar.xz
dexon-sol-tools-63d79faa85df1cc090837fc49befb5076b50203b.tar.zst
dexon-sol-tools-63d79faa85df1cc090837fc49befb5076b50203b.zip
Fix linter errors
Diffstat (limited to 'packages')
-rw-r--r--packages/base-contract/src/index.ts5
1 files changed, 3 insertions, 2 deletions
diff --git a/packages/base-contract/src/index.ts b/packages/base-contract/src/index.ts
index 538c87431..981e6fca6 100644
--- a/packages/base-contract/src/index.ts
+++ b/packages/base-contract/src/index.ts
@@ -22,7 +22,8 @@ export interface EthersInterfaceByFunctionSignature {
const REVERT_ERROR_SELECTOR = '08c379a0';
const REVERT_ERROR_SELECTOR_OFFSET = 2;
-const REVERT_ERROR_SELECTOR_END = 10;
+const REVERT_ERROR_SELECTOR_BYTES_LENGTH = 4;
+const REVERT_ERROR_SELECTOR_END = REVERT_ERROR_SELECTOR_OFFSET + REVERT_ERROR_SELECTOR_BYTES_LENGTH * 2;
export class BaseContract {
protected _ethersInterfacesByFunctionSignature: EthersInterfaceByFunctionSignature;
@@ -90,7 +91,7 @@ export class BaseContract {
if (rawCallResult.slice(REVERT_ERROR_SELECTOR_OFFSET, REVERT_ERROR_SELECTOR_END) === REVERT_ERROR_SELECTOR) {
const revertReason = ethers.utils.defaultAbiCoder.decode(
['string'],
- ethers.utils.hexDataSlice(rawCallResult, 4),
+ ethers.utils.hexDataSlice(rawCallResult, REVERT_ERROR_SELECTOR_BYTES_LENGTH),
);
throw new Error(revertReason);
}