tornado-pool-relayer/src/constants/variables.ts

56 lines
1.4 KiB
TypeScript
Raw Normal View History

2021-07-13 19:06:36 +02:00
import { BigNumber } from 'ethers';
2021-07-22 11:36:31 +02:00
import { ChainId } from '@/types';
const NETWORKS_INFO: { [chainId in ChainId] } = {
2021-10-11 18:06:41 +02:00
[ChainId.XDAI]: {
2021-10-21 16:45:02 +02:00
symbol: 'xDAI',
2021-10-18 20:16:11 +02:00
gasLimit: BigNumber.from(2000000),
2021-10-11 18:06:41 +02:00
minimumBalance: '0.5',
},
2021-07-22 11:36:31 +02:00
};
2021-07-13 19:06:36 +02:00
const numbers = {
ZERO: 0,
ONE: 1,
TWO: 2,
2021-09-27 11:10:19 +02:00
TEN: 10,
ONE_HUNDRED: 100,
2021-07-13 19:06:36 +02:00
SECOND: 1000,
ETH_DECIMALS: 18,
2021-07-23 14:46:35 +02:00
MERKLE_TREE_HEIGHT: 23,
2021-07-13 19:06:36 +02:00
};
2021-10-12 11:37:24 +02:00
export const jobStatus = {
QUEUED: 'QUEUED',
2021-10-12 11:37:24 +02:00
ACCEPTED: 'ACCEPTED',
CONFIRMED: 'CONFIRMED',
FAILED: 'FAILED',
MINED: 'MINED',
SENT: 'SENT',
};
2021-07-13 19:06:36 +02:00
const BG_ZERO = BigNumber.from(numbers.ZERO);
2021-07-22 11:36:31 +02:00
const FIELD_SIZE = BigNumber.from('21888242871839275222246405745257275088548364400416034343698204186575808495617');
2021-07-13 19:06:36 +02:00
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
2021-10-13 17:18:24 +02:00
const DAI_ADDRESS = '0x6b175474e89094c44da98b954eedeac495271d0f';
2021-07-13 19:06:36 +02:00
2021-10-13 17:18:24 +02:00
export { numbers, NETWORKS_INFO, DAI_ADDRESS, FIELD_SIZE, BG_ZERO, ZERO_ADDRESS };
export const CONTRACT_ERRORS = [
'Invalid merkle root',
'Input is already spent',
'Incorrect external data hash',
'Invalid fee',
'Invalid ext amount',
'Invalid public amount',
'Invalid transaction proof',
"Can't withdraw to zero address",
];
2021-12-15 11:24:09 +01:00
export const SERVICE_ERRORS = {
GAS_PRICE: 'Could not get gas price',
TOKEN_RATES: 'Could not get token rates',
GAS_SPIKE: 'Provided fee is not enough. Probably it is a Gas Price spike, try to resubmit.',
};