Moralis ROCKS! Transferring ERC20 tokens

I had been having trouble making a ERC20 transfer . Until I found Moralis. However, I still desire to know the code that made it happen because Im not totally clear on the approve and send thing for ERC20 tokens. Is there a way I can see the code that does the transfer ?

I think I have found the right way to go with this web3 dapp stuff . After checking out every other possible alternative. Moralis is so awesome

1 Like
1 Like

Hey kid, can I ask you a bit more about this ? For example, I am using a very standard Open Zeppelin ERC20 smart contract (the newest one) for a source of tokens to giveaway. I know to transfer from one person to another just use transfer , I got that working. How different is the approve and send for getting the main contract (source of the erc20 in question) to send x amount of tokens to whatever user is authenticated in? Would the smart contract pick up on the fact that I am the owner of the contract and am able to do the approve and send ? Or can I do the approve and send from the dapp somehow ? It is not the same a s transfer I take it , or is there some example you can show me ? I have done my diligence on reading and googling about approve and transfer , but how with Moralis ? I hope this makes sense . thanks in advance

You approve an address(a different smart contract usually, not the one that has the token) to spend x tokens from your account and then the smart contract can transfer those tokens from your account to whatever address it wants.