|
6 | 6 | DIGas, |
7 | 7 | fromBN, |
8 | 8 | hasAllowance, |
9 | | - isEth, |
10 | 9 | mulBy1_3, |
11 | 10 | parseUnits, |
12 | 11 | smartNumber, |
@@ -56,7 +55,7 @@ export const swapTricrypto2Mixin = { |
56 | 55 | const _minRecvAmount = await _swapMinAmount.call(this, i, j, _amount, slippage); |
57 | 56 | const contract = this.curve.contracts[contractAddress].contract; |
58 | 57 | const exchangeMethod = 'exchange_underlying' in contract ? 'exchange_underlying' : 'exchange'; |
59 | | - const value = isEth(this.underlyingCoinAddresses[i]) ? _amount : this.curve.parseUnits("0"); |
| 58 | + const value = this.curve.isEth(this.underlyingCoinAddresses[i]) ? _amount : this.curve.parseUnits("0"); |
60 | 59 |
|
61 | 60 | const gas = await contract[exchangeMethod].estimateGas(i, j, _amount, _minRecvAmount, true, { ...this.curve.constantOptions, value }); |
62 | 61 | if (estimateGas) return smartNumber(gas); |
@@ -84,7 +83,7 @@ export const swapMetaFactoryMixin = { |
84 | 83 | const _minRecvAmount = await _swapMinAmount.call(this, i, j, _amount, slippage); |
85 | 84 | const contract = this.curve.contracts[contractAddress].contract; |
86 | 85 | const exchangeMethod = 'exchange_underlying' in contract ? 'exchange_underlying' : 'exchange'; |
87 | | - const value = isEth(this.underlyingCoinAddresses[i]) ? _amount : this.curve.parseUnits("0"); |
| 86 | + const value = this.curve.isEth(this.underlyingCoinAddresses[i]) ? _amount : this.curve.parseUnits("0"); |
88 | 87 |
|
89 | 88 | const gas = await contract[exchangeMethod].estimateGas(this.address, i, j, _amount, _minRecvAmount, { ...this.curve.constantOptions, value }); |
90 | 89 | if (estimateGas) return smartNumber(gas); |
@@ -112,7 +111,7 @@ export const swapCryptoMetaFactoryMixin = { |
112 | 111 | const _minRecvAmount = await _swapMinAmount.call(this, i, j, _amount, slippage); |
113 | 112 | const contract = this.curve.contracts[contractAddress].contract; |
114 | 113 | const exchangeMethod = 'exchange_underlying' in contract ? 'exchange_underlying' : 'exchange'; |
115 | | - const value = isEth(this.underlyingCoinAddresses[i]) ? _amount : this.curve.parseUnits("0"); |
| 114 | + const value = this.curve.isEth(this.underlyingCoinAddresses[i]) ? _amount : this.curve.parseUnits("0"); |
116 | 115 |
|
117 | 116 | const gas = await contract[exchangeMethod].estimateGas(this.address, i, j, _amount, _minRecvAmount, true, { ...this.curve.constantOptions, value }); |
118 | 117 | if (estimateGas) return smartNumber(gas); |
@@ -140,7 +139,7 @@ export const swapMixin = { |
140 | 139 | const _minRecvAmount = await _swapMinAmount.call(this, i, j, _amount, slippage); |
141 | 140 | const contract = this.curve.contracts[contractAddress].contract; |
142 | 141 | const exchangeMethod = 'exchange_underlying' in contract ? 'exchange_underlying' : 'exchange'; |
143 | | - const value = isEth(this.underlyingCoinAddresses[i]) ? _amount : this.curve.parseUnits("0"); |
| 142 | + const value = this.curve.isEth(this.underlyingCoinAddresses[i]) ? _amount : this.curve.parseUnits("0"); |
144 | 143 |
|
145 | 144 | const gas = await contract[exchangeMethod].estimateGas(i, j, _amount, _minRecvAmount, { ...this.curve.constantOptions, value }); |
146 | 145 | if (estimateGas) return smartNumber(gas); |
|
0 commit comments