Skip to content

Commit

Permalink
fix args length for read/simulate method functions
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Sep 26, 2024
1 parent e15756e commit 32be80d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/address/contract/methods/useCallMethodPublicClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,14 @@ export default function useCallMethodPublicClient(): (params: Params) => Promise
}

const address = getAddress(addressHash);
// for write payable methods we add additional input for native coin value
// so in simulate mode we need to strip it off
const _args = args.slice(0, item.inputs.length);

const params = {
abi: [ item ],
functionName: item.name,
args: args,
args: _args,
address,
account,
};
Expand Down

0 comments on commit 32be80d

Please sign in to comment.