Hi Devraj,

I investigated your error, and I think you might be using compiler version 0.5.0 or higher? There were a few pretty big changes that came with the move to 0.5.0, and I think some of them mean that the ERC721 standard as is defined in the EIPS will not work with Solidity 0.5.0 (at least without making a few small changes to the interfaces).

Keep in mind this is a compiler version of Solidity, and regardless of version, Solidity will always compile to bytecode. So you can still use an older version of the compiler (say 0.4.25) and your contracts will work fine once deployed.

Otherwise, if you need to use Solidity 0.5, the reason I made some functions public instead of external was so that I could re-use them elsewhere in my function, to save on gas as you alluded to above. But the simplest way to get from how my code is now, to a workable 0.5 solution, would be to change all the functions from the interface back to external, and then when they’re referenced from within the contract, append this. to the start of the function call.

For example, when the ownerOf function is public (as it is now), our approve function looks like this:

But if you change the visibility of ownerOf to external, our approve function will look like this:

Note the this on the second line. Make those changes to all the functions that are in the interfaces, and you should be fine for 0.5.0 — although I will admit I haven’t run fully through the whole thing to check its 5.0 compatibility, so if you hit another snag just let me know and I’ll do what I can.



Codeslinger. Melbourne based Solidity developer for hire.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store