Not able to use ERC721 token in my project

0 votes

I am trying to use ERC721 in my code but I am getting this following error:

TypeError: Data location must be "calldata" for parameter in external function, but none was given.
    function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes data) external payable;
                                                                            ^--------^
Compilation failed. See above.
Truffle v5.0.2 (core: 5.0.2)
Node v10.14.1
Jan 23 in Blockchain by Sunil
71 views

1 answer to this question.

0 votes

Like this error indicates, you have to use calldata as location for data

Try this:

function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes calldata data) external payable;

Seems like you are using an external function and hence it is required to use calldata when you use external functions as above. 

answered Jan 23 by Omkar
• 67,660 points

Related Questions In Blockchain

0 votes
1 answer
0 votes
1 answer

How to use real world/live data in my smart contract?

You cant access/embed real world data using ...READ MORE

answered Jul 12, 2018 in Blockchain by digger
• 26,550 points
62 views
0 votes
1 answer
0 votes
1 answer

Blockchain peer not able to min block in Azure.

After trying out various ideas, making sure ...READ MORE

answered Aug 20, 2018 in Blockchain by Perry
• 17,020 points
37 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
172 views
0 votes
1 answer
0 votes
1 answer

Solidity geth: Error encountered during contract execution [Bad instruction]

recipes is a dynamic storage array. You need ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 67,660 points
107 views
+1 vote
3 answers

Not able to read a file from my assets folder

Hi.. I faced a similar problem in ...READ MORE

answered Oct 25, 2018 in Blockchain by Shrikanth
848 views
0 votes
1 answer

Not able to invoke a contract in Ethereum Private chain using geth

Hope this helps: contract mortal { /* ...READ MORE

answered Oct 22, 2018 in Blockchain by Omkar
• 67,660 points
50 views