Transfer ERC20 not working

Hi, I’m using Moralis provided code:

const options = {

                type: "erc20",

                amount: Moralis.Units.Token("0.5", "18"),

                receiver: "0x...",

                contract_address: "0x..."

            }

            let result = await Moralis.transfer(options);

and it’s letting me transfer tokens, but it’s only letting me transfer to the address used to deploy the ER20 token contract not to other wallet address.

In the receiver: “0x…”, I’m trying to put address used in logging to my Dapp i.e the user address, so that user can claim their tokens but the transfer is failing.

I’m not quite sure what’s wrong here…, I’ve tried manually putting the wallet address in receiver section and it still failed.

Any help would be appreciated.

I didn’t understand what happens

in order to be able to transfer, you need to own those tokens or to be approved to spend them

what error do you get when it fails?

The address that deploy the contract owns the tokens, but I can’t transfer tokens to some different wallet?.

Here’s the error: MetaMask - RPC Error: Internal JSON-RPC error.

from same address that owns the tokens, you should able to transfer to a different address, you should have that address in metamask that owns the tokens

Wait so that transfer code above can’t be used to transfer tokens to other wallet besides owner wallet?

it can be used to transfer to any wallet, but only from the owner wallet, as in the owner has to be the one that runs that transaction

this is confusing me, so I need to transfer all token to my owner address and then I can transfer to user address?

not sure what you mean, isn’t already an owner address that owns the tokens?

ok I think I’ve made a mistake, in contract_address: “0x…” I put the token contract from Etherscan. I’ll correct it and get back to you.

I think that contract address should be the address of the contract that tracks the tokens.

And that’s the one that’s under contract in Token description on Etherscan?

I think that should be the one, it should be the contract that was deployed

That was the one I was using initially, where it wasn’t letting me transfer tokens to addresses other than the one used in deploying the contract.

Isn’t this the address that owns all the tokens?