Skip to content

Commit

Permalink
Merge pull request #357 from dcrescimbeni/fix/approval-assets-bug
Browse files Browse the repository at this point in the history
Fix: approval call was incorrectly decoded
  • Loading branch information
rossneilson authored Mar 29, 2023
2 parents 9c05d42 + 23e165b commit e3b1798
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const renderGenericCallParamValue = (
return `${param.value}`;
case 'tokenAmount':
// TODO: Handle number of decimals better
const number = BigNumber.from(param.value);
const number = BigNumber.from(param.value ?? 0);
let formatted = Number.parseFloat(formatUnits(number, 18));
return Math.round(formatted * Math.pow(10, 4)) / Math.pow(10, 4);
case 'contentHash':
Expand Down
2 changes: 1 addition & 1 deletion apps/davi/src/utils/encodingCalls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const encodeActions = async (
...newCall,
approval: {
...decodedApprovalCall,
amount: decodedApprovalCall?.args?._value,
amount: decodedApprovalCall?.args?.amount,
token: decodedApprovalCall?.to,
},
};
Expand Down

1 comment on commit e3b1798

@vercel
Copy link

@vercel vercel bot commented on e3b1798 Mar 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.