feat: finish up challenges
Some checks failed
Lint / ci (lts/*, ubuntu-latest) (push) Has been cancelled
Some checks failed
Lint / ci (lts/*, ubuntu-latest) (push) Has been cancelled
This commit is contained in:
@@ -16,13 +16,15 @@ const DAI_ADDRESS = "0x6B175474E89094C44Da98b954EedeAC495271d0F";
|
||||
const WETH_ADDRESS = "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2";
|
||||
const UNISWAP_V2_FACTORY = "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f";
|
||||
const mainnet = hardhatConfig.networks.mainnet;
|
||||
const MAINNET_RPC = "url" in mainnet ? mainnet.url : "";
|
||||
const MAINNET_RPC = ""; //"url" in mainnet ? mainnet.url : "";
|
||||
|
||||
export const fetchPriceFromUniswap = async (): Promise<bigint> => {
|
||||
const config = getConfig();
|
||||
const cachedPrice = config.PRICE.CACHEDPRICE;
|
||||
const timestamp = config.PRICE.TIMESTAMP;
|
||||
|
||||
return parseEther(cachedPrice.toString());
|
||||
|
||||
if (Date.now() - timestamp < 1000 * 60 * 60) {
|
||||
return parseEther(cachedPrice.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user