Skip to content

Commit

Permalink
Better large number handling
Browse files Browse the repository at this point in the history
  • Loading branch information
philipjames44 committed Sep 6, 2024
1 parent 353bdbb commit 523c8ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "boring-vault-ui",
"version": "1.6.2",
"version": "1.6.3",
"description": "A reusable package to quickly integrate boring vaults onto a UI.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
18 changes: 9 additions & 9 deletions src/contexts/v1/BoringVaultContextV1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ export const BoringVaultV1Provider: React.FC<{
console.log("Approving token ...");
const approveTx = await erc20Contract.approve(
vaultContract,
amountDepositBaseDenom.toNumber()
amountDepositBaseDenom.toFixed(0)
);

// Wait for confirmation
Expand Down Expand Up @@ -487,7 +487,7 @@ export const BoringVaultV1Provider: React.FC<{
// TODO: Allow for custom gas limits
const depositTx = await tellerContractWithSigner.deposit(
token.address,
amountDepositBaseDenom.toNumber(),
amountDepositBaseDenom.toFixed(0),
0
);

Expand Down Expand Up @@ -610,7 +610,7 @@ export const BoringVaultV1Provider: React.FC<{
console.log("Approving token ...");
const approveTx = await vaultContractWithSigner.approve(
delayWithdrawContract,
amountWithdrawBaseDenom.toNumber()
amountWithdrawBaseDenom.toFixed(0)
);

// Wait for confirmation
Expand Down Expand Up @@ -647,8 +647,8 @@ export const BoringVaultV1Provider: React.FC<{
const withdrawTx =
await delayWithdrawContractWithSigner.requestWithdraw(
tokenOut.address,
amountWithdrawBaseDenom.toNumber(),
maxLossBaseDenom.toNumber(),
amountWithdrawBaseDenom.toFixed(0),
maxLossBaseDenom.toFixed(0),
thirdPartyClaimer
);

Expand Down Expand Up @@ -1018,7 +1018,7 @@ export const BoringVaultV1Provider: React.FC<{
console.log("Approving token ...");
const approveTx = await vaultContractWithSigner.approve(
withdrawQueueContract,
amountWithdrawBaseDenom.toNumber()
amountWithdrawBaseDenom.toFixed(0)
);

// Wait for confirmation
Expand Down Expand Up @@ -1079,13 +1079,13 @@ export const BoringVaultV1Provider: React.FC<{
vaultContract, // offer
token.address, // want
[
deadline.toNumber(), // Deadline
deadline.toFixed(0), // Deadline
Number(0),//discountedSharePrice.toNumber(), // atomicPrice, this is actually overriden in safeUpdateAtomicRequest
amountWithdrawBaseDenom.toNumber(), // offerAmount
amountWithdrawBaseDenom.toFixed(0), // offerAmount
false, // inSolver
],
accountantContract, // accountant
formattedDiscountPercent.toNumber()
formattedDiscountPercent.toFixed(0)
);

// Wait for confirmation
Expand Down

0 comments on commit 523c8ab

Please sign in to comment.