Skip to content

Commit

Permalink
fix: Max approval bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronfigueiredo committed Oct 2, 2024
1 parent 5639952 commit ef82e3e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,14 @@ export const useApproveTokenSimulation = (
(param) =>
param.value !== undefined &&
!isHexString(param.value) &&
param.value.length === undefined &&
!isBoolean(param.value),
);
if (paramIndex === -1) {
return 0;
}

return new BigNumber(value.data[0].params[paramIndex].value)
return new BigNumber(value.data[0].params[paramIndex].value.toString())
.dividedBy(new BigNumber(10).pow(Number(decimals)))
.toNumber();
}, [value, decimals]);
Expand Down

0 comments on commit ef82e3e

Please sign in to comment.