3 Commits

Author SHA1 Message Date
0fa430f85d Improve L1 fee calculation 2024-05-12 23:12:32 +00:00
0649c2da4c Mark version as 4 2024-05-12 20:59:47 +00:00
15b7967c03 Fixed token symbol formatting 2024-05-12 20:52:26 +00:00
3 changed files with 4 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@tornado/tornado-oracles",
"version": "3.3.0",
"version": "4.0.0",
"description": "Oracles for Tornado-specific transactions & actions",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",

View File

@@ -8,7 +8,7 @@ import { convertETHToTokenAmount } from './utils';
const DUMMY_ADDRESS = '0x1111111111111111111111111111111111111111';
const DUMMY_NONCE = '0x1111111111111111111111111111111111111111111111111111111111111111';
const DUMMY_NONCE = 1024;
const DUMMY_WITHDRAW_DATA =
'0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111';
@@ -54,10 +54,9 @@ export class TornadoFeeOracle {
tx = {
type: 0,
gasLimit: 1_000_000,
nonce: Number(DUMMY_NONCE),
nonce: DUMMY_NONCE,
data: DUMMY_WITHDRAW_DATA,
gasPrice: parseUnits('1', 'gwei'),
from: DUMMY_ADDRESS,
to: DUMMY_ADDRESS,
};
}

View File

@@ -46,7 +46,7 @@ export class TokenPriceOracle {
return prices.reduce((acc, price, index) => {
const tokenPriceInwei = (price * BigInt(10 ** tokens[index].decimals)) / BigInt(10 ** 18);
acc[tokens[index].symbol] = tokenPriceInwei.toString();
acc[tokens[index].symbol.toLowerCase()] = tokenPriceInwei.toString();
return acc;
}, {} as TokenPrices);