Skip to content

Commit

Permalink
feat: add buffer to approvals
Browse files Browse the repository at this point in the history
  • Loading branch information
lcamargof committed Oct 4, 2023
1 parent d6cec9e commit 5fafb5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/transaction-modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const Approval = ({
address: token,
abi: ERC20,
functionName: 'approve',
args: [spender, amount],
args: [spender, (amount * 120n) / 100n],
})

const checkingAllowance = !gas.isLoading && !gas.estimateUsd
Expand Down
6 changes: 5 additions & 1 deletion src/views/issuance/components/issue/CollateralApprovals.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ const CollateralApproval = ({
functionName: 'approve',
args: [
rToken?.main ? rToken.address : RSV_MANAGER,
collateral.symbol === 'wcUSDCv3' ? BIGINT_MAX : amount ?? 0n,
collateral.symbol === 'wcUSDCv3'
? BIGINT_MAX
: amount
? (amount * 120n) / 100n
: 0n,
],
enabled: !loading && !!amount && !allowance,
})
Expand Down

0 comments on commit 5fafb5b

Please sign in to comment.