Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

319
Views
How to use overloaded function from smart contract with wagmi?

So I have two function with the same name but different parameter in my solidity smart contract functionName(args1) and functionName(args1, args2)

And because of this function overloading, the ABI of the smart contract has 2 function with exactly the same name, functionName with 1 argument and functionName with 2 arguments

When I try to use wagmi useContractWrite to call the first function with:

const functionWrite = useContractWrite({
  ...ContractInstance,
  functionName: 'functionName',
  args: [args1],
});

or calling second function

const functionWrite = useContractWrite({
...ContractInstance,
functionName: 'functionName',
args: [args1, args2],
});

It seems wagmi didn't detect the function because of the duplicate name and it gave me this error: 'functionName' doesn't exist in interface for contract "{my contract address}"

Does anyone know how to use overloaded function with wagmi?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!