Compare commits

..

1 Commits

Author SHA1 Message Date
b65b0ee16b
Remove broken external oracle and fixed EIP-1559 gasPrice calculation
* Updated 1inch Oracle link and use multicall3 ( because this is the only contract supported on sepolia )
* Simplify EIP-1559 gasPrice calculation ( EIP-1559 removes necessity of using external oracles, just enough premium of basefee will ensure transaction being mined )
* Apply respective premium for fees ( Only applied on V6 Oracle class )
* Removed @tornado/gas-price-oracle oracle
2024-11-23 18:12:22 +00:00
2 changed files with 1 additions and 12 deletions

View File

@ -283,18 +283,9 @@ export abstract class TornadoFeeOracle implements ITornadoFeeOracle {
tokenPriceInEth, tokenPriceInEth,
predefinedGasLimit, predefinedGasLimit,
predefinedGasPrice, predefinedGasPrice,
bumpGasLimitPercent,
bumpGasPricePercent,
}: GetWithdrawalFeeViaRelayerInput): Promise<HexadecimalStringifiedNumber> { }: GetWithdrawalFeeViaRelayerInput): Promise<HexadecimalStringifiedNumber> {
const relayerFee = this.calculateRelayerFeeInWei(relayerFeePercent, amount, decimals); const relayerFee = this.calculateRelayerFeeInWei(relayerFeePercent, amount, decimals);
const { gasPrice, gasLimit } = await this.getGasParams({ const { gasPrice, gasLimit } = await this.getGasParams({ tx, txType, predefinedGasLimit, predefinedGasPrice });
tx,
txType,
predefinedGasLimit,
predefinedGasPrice,
bumpGasLimitPercent,
bumpGasPricePercent,
});
const gasCosts = BigNumber.from(gasPrice).mul(gasLimit); const gasCosts = BigNumber.from(gasPrice).mul(gasLimit);
const hasTokenPrice = const hasTokenPrice =

View File

@ -117,6 +117,4 @@ export type GetWithdrawalFeeViaRelayerInput = {
tokenPriceInEth?: HexadecimalStringifiedNumber | string; // Token (currency) price in ETH wei, if withdrawing non-native currency tokenPriceInEth?: HexadecimalStringifiedNumber | string; // Token (currency) price in ETH wei, if withdrawing non-native currency
predefinedGasPrice?: HexadecimalStringifiedNumber; // Predefined gas price for withdrawal tx (wont be calculated again in function) predefinedGasPrice?: HexadecimalStringifiedNumber; // Predefined gas price for withdrawal tx (wont be calculated again in function)
predefinedGasLimit?: number; // Predefined gas limit for withdrawal tx (wont be calculated again in function) predefinedGasLimit?: number; // Predefined gas limit for withdrawal tx (wont be calculated again in function)
bumpGasLimitPercent?: number; // Gas limit bump percent to prioritize transaction (recenlty used)
bumpGasPricePercent?: number; // Gas price bump percent to prioritize transaction (rarely used)
}; };