Compare commits

..

1 Commits

Author SHA1 Message Date
c27d5e638c
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-21 10:56:11 +00:00

View File

@ -19,14 +19,11 @@ import { TornadoFeeOracleV5 } from './feeOracleV5';
*/
export class TornadoFeeOracleV6 extends TornadoFeeOracle implements ITornadoFeeOracle {
private fallbackFeeOracle: TornadoFeeOracleV5;
// Override value for BSC (Since old relayers use static value of 3.3 gwei)
public overrideGasPrice?: GasPriceParams;
public constructor(chainId: number, rpcUrl: string, overrideGasPrice?: GasPriceParams) {
public constructor(chainId: number, rpcUrl: string) {
super(6, chainId, rpcUrl);
this.fallbackFeeOracle = new TornadoFeeOracleV5(chainId, rpcUrl);
this.overrideGasPrice = overrideGasPrice;
}
/**
@ -49,9 +46,6 @@ export class TornadoFeeOracleV6 extends TornadoFeeOracle implements ITornadoFeeO
* (Can spike 12.5% per block accoring to the EIP-1559 metrics https://metamask.io/1559/)
*/
async getGasPriceParams(speed?: LegacyGasPriceKey, bumpPercent?: number): Promise<GasPriceParams> {
if (this.overrideGasPrice) {
return this.overrideGasPrice;
}
if (typeof bumpPercent === 'undefined') {
bumpPercent = this.chainId === ChainId.BSC ? undefined : 30;
}