[SOLVED] Moralis.executeFunction doesn't find correct one in the multiple-defined functions

this is the first time to use this forum and sorry for an inconvenience.
Here are original codes.

deposit(tokenAddress: string, amount: BigNumber, userAddress: string) {
    return from(Moralis.Web3.enableWeb3()).pipe(
      concatNetworkVerification(),
      concatMap(() => {
        return from<ObservableInput<any>>(Moralis.Web3.executeFunction({
          contractAddress: "0xxx",
          abi: xxx.abi,
          functionName: 'deposit',
          params: {
            token: tokenAddress,
            amount: amount,
            to: userAddress
          },
        }));
      })
    );
  }

  depositAvax(amount: BigNumber) {
    return from(Moralis.Web3.enableWeb3()).pipe(
      concatNetworkVerification(),
      concatMap(() => {
        return from<ObservableInput<any>>(Moralis.Web3.executeFunction({
          contractAddress: "0xxxx",
          abi: xxx.abi,
          functionName: 'deposit',
          msgValue: amount.toString()
        }));
      })
    );
  }

Since it didn’t work properly I have made some modifications so that it gets fixed.

1 Like

I’ll get back to you in 1-2 hours after I test it

it looks like the problem was this typo with unit256 instead of uint256

3 Likes

wow, actually.
I was so stupid. because the function with topic was written in “”, the compiler didn’t notice it’s just error.
it’s fixed now and it works well.
Thank you very much for your help.

1 Like