Sending ERC20 Moralis [SOLVED]

Hey guys can someone please help me fgure out the following error :slight_smile:

Trying to send ERC20 tokens from one address to another like ivan explained in the video.

cheers

Screen Shot 2021-09-02 at 9.21.10 AM

heres the code

<html>
    <head>
        <title>Moralis Homework</title>

        <script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script>
        <script src="https://unpkg.com/moralis/dist/moralis.js"></script>
    </head>

    <body>

        <button onclick="send()">Send Funds</button>
        <br>

        <script>

           const options = {type: "token", //DAI
                    receiver:"0x551Db4969866924066a3bCefbF876685f923700C",
                    contract_address: "0xff795577d9ac8bd7d90ee22b6c1703490b6512fd", 
                    amount:Moralis.Units.Token("50", "18")} 

                    

            async function send(){

                Moralis.transfer(options);
                    
                console.log("Funds Sent!");
            }
        </script>
    </body>
</html>
1 Like

Hi @dexda

Use type: "erc20" instead :man_mechanic:

1 Like

thank you a lot @Yomoo

1 Like