-
Notifications
You must be signed in to change notification settings - Fork 28
Add support to multiple networks #785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c333866
86711bd
17d11d0
a54ccb5
722badd
921f48e
770ffbd
cf6e808
8daf9bc
ac14cd3
d63a208
d229352
d6e5a0c
3649ff4
c3bfaad
87c57e8
5989ba1
de89ae0
092e58c
6508d9d
c1b293e
2ca26a4
4e47fcf
9ff1563
28f2de6
c09a273
95916a1
b249a87
3f8c237
3eca3d3
adbe05e
0d796b5
29e0f38
97ec4dc
7dca90f
247a2f3
764d57f
786cebd
9e7ba9e
8a1fbd3
49ad2c0
089d25b
794e090
77c26ef
a64f675
1585033
41d65da
a05ed0b
ce3d43d
7e125c9
8c83522
4b4da0a
e100c19
41000ae
702f9d0
e7b3d5b
54cdb2d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
REACT_APP_SUPPORTED_CHAIN_ID=1337 | ||
REACT_APP_MULTICALL_ADDRESS=0x086813525A7dC7dafFf015Cdf03896Fd276eab60 | ||
REACT_APP_DEFAULT_PROVIDER_CHAIN_ID=1337 | ||
REACT_APP_MULTICALL_ADDRESS=0xcA11bde05977b3631167028862bE2a173976CA11 | ||
REACT_APP_TACO_DOMAIN=dashboard |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,26 @@ | ||
import { FC } from "react" | ||
import { FormErrorMessage, FormHelperText } from "@threshold-network/components" | ||
import { | ||
Box, | ||
FormErrorMessage, | ||
FormHelperText, | ||
} from "@threshold-network/components" | ||
|
||
const HelperErrorText: FC<{ | ||
errorMsgText?: string | JSX.Element | ||
hasError?: boolean | ||
helperText?: string | JSX.Element | ||
}> = ({ errorMsgText, helperText, hasError }) => { | ||
if (hasError) { | ||
return ( | ||
<FormErrorMessage> | ||
{errorMsgText || "Please enter a valid value"} | ||
</FormErrorMessage> | ||
) | ||
} | ||
|
||
return helperText ? <FormHelperText>{helperText}</FormHelperText> : null | ||
return ( | ||
<Box mt={2} maxWidth="100%" overflow="hidden" textOverflow="ellipsis"> | ||
{hasError ? ( | ||
<FormErrorMessage> | ||
{errorMsgText || "Please enter a valid value"} | ||
</FormErrorMessage> | ||
) : helperText ? ( | ||
<FormHelperText>{helperText}</FormHelperText> | ||
) : null} | ||
</Box> | ||
) | ||
} | ||
|
||
export default HelperErrorText |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,9 +55,9 @@ const MintDurationTiers: FC<MintDurationTiersProps> = ({ | |
// is returned as is. | ||
const confirmations = getNumberOfConfirmationsByAmount(safeAmount) | ||
const durationInMinutes = | ||
getDurationByNumberOfConfirmations(confirmations) | ||
// Round up the minutes to the nearest half-hour | ||
const hours = (Math.round(durationInMinutes / 30) * 30) / 60 | ||
getDurationByNumberOfConfirmations(confirmations) * 1.5 | ||
// Round down the minutes to the nearest half-hour | ||
const hours = (Math.floor(durationInMinutes / 30) * 30) / 60 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the rounding down instead of up? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Math.floor is used instead of Math.round to ensure that it always get round down to the nearest 30-minute block avoiding overstating the number of hours. |
||
const formattedAmount = amount.toFixed(2) | ||
|
||
const hoursSuffix = hours === 1 ? "hour" : "hours" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this underlying calc based on the chain being used i.e was it specific to Ethereum, and now needs to be adjusted based on chain being used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The total time required for the minting process to finalize is at least one hour, consdiering the necessary
optimisticMintingDelay
inTBTCVault
contract time to elapse. This is not realistically aligned with how the code was originally implemented, since it was based solely on the duration of Bitcoin network confirmations.Thus, considering that the
finalizeOptimisticMint
function must be called for the deposit to be finalized, it becomes difficult to precisely determine how long the entire process will take. On top of that, this extra waiting period can include an additional 15-30 minutes that may be required for bridging from L1 to L2 in the event of a cross-chain deposit. Consequently, increasing the total estimated time by 50% provides a more flexible estimate, taking into account both the new dynamics introduced by optimistic minting and the 15–30 minutes typically needed for L1–L2 bridging.