Skip to content

Commit

Permalink
Merge pull request nounsDAO#672 from nounsDAO/soli-fix-array-parsing
Browse files Browse the repository at this point in the history
Correctly Parse Array Function Call Arguments
  • Loading branch information
solimander authored Feb 1, 2023
2 parents 2176053 + 269c08c commit ae0b5ce
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export enum SupportedCurrencies {

const parseArguments = (abi: Interface | undefined, func: string, args: string[]) => {
return args.map((a, i) => {
if (abi?.functions[func]?.inputs?.[i].type === 'tuple') {
const type = abi?.functions[func]?.inputs?.[i].type;
if (type === 'tuple' || type?.endsWith('[]')) {
return JSON.parse(a);
}
return a;
Expand Down

0 comments on commit ae0b5ce

Please sign in to comment.