@@ -6,6 +6,7 @@ import { CallOverrides, PopulatedTransaction } from "@ethersproject/contracts";
6
6
import { ERC20 } from "../typechain-types/@openzeppelin/contracts/token/ERC20" ;
7
7
import { ERC20__factory } from "../typechain-types/factories/@openzeppelin/contracts/token/ERC20/ERC20__factory" ;
8
8
import { PromiseOrValue } from "../typechain-types/common" ;
9
+ import { defaultGasOverrides } from "./config/overrides" ;
9
10
10
11
export class ERC20Client {
11
12
private readonly contract : ERC20 ;
@@ -19,7 +20,7 @@ export class ERC20Client {
19
20
* @returns a promise that resolves with a BigNumber that represents the amount of tokens in existence
20
21
*/
21
22
public async totalSupply ( provider : Provider , overrides : CallOverrides = { } ) : Promise < BigNumber > {
22
- return this . contract . connect ( provider ) . totalSupply ( overrides ) ;
23
+ return this . contract . connect ( provider ) . totalSupply ( { ... defaultGasOverrides , ... overrides } ) ;
23
24
}
24
25
25
26
/**
@@ -30,7 +31,7 @@ export class ERC20Client {
30
31
account : PromiseOrValue < string > ,
31
32
overrides : CallOverrides = { }
32
33
) : Promise < BigNumber > {
33
- return this . contract . connect ( provider ) . balanceOf ( account , overrides ) ;
34
+ return this . contract . connect ( provider ) . balanceOf ( account , { ... defaultGasOverrides , ... overrides } ) ;
34
35
}
35
36
36
37
/**
@@ -42,7 +43,7 @@ export class ERC20Client {
42
43
spender : PromiseOrValue < string > ,
43
44
overrides : CallOverrides = { }
44
45
) : Promise < BigNumber > {
45
- return this . contract . connect ( provider ) . allowance ( owner , spender , overrides ) ;
46
+ return this . contract . connect ( provider ) . allowance ( owner , spender , { ... defaultGasOverrides , ... overrides } ) ;
46
47
}
47
48
48
49
/**
@@ -53,7 +54,7 @@ export class ERC20Client {
53
54
amount : PromiseOrValue < BigNumberish > ,
54
55
overrides : Overrides & { from ?: PromiseOrValue < string > } = { }
55
56
) : Promise < PopulatedTransaction > {
56
- return this . contract . populateTransaction . transfer ( to , amount , overrides ) ;
57
+ return this . contract . populateTransaction . transfer ( to , amount , { ... defaultGasOverrides , ... overrides } ) ;
57
58
}
58
59
59
60
/**
@@ -64,7 +65,7 @@ export class ERC20Client {
64
65
amount : PromiseOrValue < BigNumberish > ,
65
66
overrides : Overrides & { from ?: PromiseOrValue < string > } = { }
66
67
) : Promise < PopulatedTransaction > {
67
- return this . contract . populateTransaction . approve ( spender , amount , overrides ) ;
68
+ return this . contract . populateTransaction . approve ( spender , amount , { ... defaultGasOverrides , ... overrides } ) ;
68
69
}
69
70
70
71
/**
@@ -76,6 +77,6 @@ export class ERC20Client {
76
77
amount : PromiseOrValue < BigNumberish > ,
77
78
overrides : Overrides & { from ?: PromiseOrValue < string > } = { }
78
79
) : Promise < PopulatedTransaction > {
79
- return this . contract . populateTransaction . transferFrom ( from , to , amount , overrides ) ;
80
+ return this . contract . populateTransaction . transferFrom ( from , to , amount , { ... defaultGasOverrides , ... overrides } ) ;
80
81
}
81
82
}
0 commit comments