forked from Uniswap/interface
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace blocktimestamp, don't use chainlink for gasprice
- Loading branch information
1 parent
1b917ab
commit 4565e3a
Showing
5 changed files
with
11 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,5 @@ | ||
import { BigNumber } from '@ethersproject/bignumber' | ||
import { useSingleCallResult } from 'lib/hooks/multicall' | ||
import { useMemo } from 'react' | ||
|
||
import { useInterfaceMulticall } from './useContract' | ||
|
||
// gets the current timestamp from the blockchain | ||
export default function useCurrentBlockTimestamp(): BigNumber | undefined { | ||
const multicall = useInterfaceMulticall() | ||
const resultStr: string | undefined = useSingleCallResult( | ||
multicall, | ||
'getCurrentBlockTimestamp' | ||
)?.result?.[0]?.toString() | ||
return useMemo(() => (typeof resultStr === 'string' ? BigNumber.from(resultStr) : undefined), [resultStr]) | ||
export default function useCurrentBlockTimestamp(): BigNumber { | ||
return BigNumber.from(BigInt(Math.floor(Date.now() / 1000))) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters