Coding Journey: An Idea turned Obsession

Day 8, Day 9, Day 10
I got further in my Javascript challenge, 75% completed. I did this for two days. Covering switch cases and functions is making me think and work for each challenge.


I also built an Election dApp from a DappUniversity tutorial. The tutorial was thorough but I ran into issues with versioning that I had to fix. It’s never fun when I hit a bug wall but it is always exciting when I solve or find the resolution.

Today, I started my 2nd Udemy course on Soldity and Blockchain and I even made sure to choose one that made use of OpenZeppelin. I’ve also been reading about the changes in version 3.0 and even have been reading main Solidity 6.0 docs. I also chipped away at one of my last remaining courses on CryptoZombies by Loom.

I structured my goals are:

  • Build a foundation in Javascript & React for Front-End development
  • Continue following tutorials and building dApps for a steady learning curve
  • Complete this new 2020 Udemy course
  • Complete Ethernaut
  • Master OpenZeppelin 3.0 << The big challenge
    ++ I’m looking to bring an OpenZeppelin project to public deployment. I’m liking the idea of an ERC721 collectible even a complete Token as well. My ideas are flowing and I’m loving it.

Resources:
JS> Http://FreeCodeCamp.com
React> https://youtu.be/dGcsHMXbSOA
React> https://react-finder.netlify.com/courses
Election dApp> https://www.dappuniversity.com/articles/the-ultimate-ethereum-dapp-tutorial
CyrptoZombies> https://cryptozombies.io/en/course/

1 Like

Hi @Proteu5,

I have worked on two ERC721’s (see: What is your favorite collectible?)

It is definitely fun to do and with OpenZeppelin Contracts 3.0 ERC721 implementation is fairly straight forward.

1 Like

Day11 to Day16
I got lost for a few days in your replay. I found the world of NFTs; OpenSea, SuperRare, and KnownOrigin. I even used Mintable to quickly make an NFT of my own. I feel guilty I didn’t code it myself haha >> https://opensea.io/assets/0xa1096d7ffc8476923e3de66bf05841d87aa97e40/0

Thank you for opening the door to the Crypto Art world for me. It’s a wonderful direction to be in. I started an Instagram and got my artwork together @0rionArt. I’m going to be turning them into tokens. I’m just trying to figure out how to create an ERC20 and reward my art holders with a token.

Over the past six days I have been coding daily following a Udemy course. I’m going back over the basics to ensure I have a solid foundation

1 Like

Hi @Proteu5,

Congratulations on creating an NFT!!
Great art, did you create the artwork yourself?

Next step is to write the code yourself, though with ERC721PresetMinterPauserAutoId in OpenZeppelin Contracts 3 this should be straight forward on the smart contract side, just need to host the metadata somewhere.

Also worth thinking about what rights your artwork holders should have. I like having the right to print a physical copy whilst I own the NFT. See my experiment around this:

1 Like

Thanks for sharing that link, it was a great read and answered many questions I had.

As for my piece on OpenSea, I generated that from an AI Breeder website but I didn’t take the initial photograph that was used as the base before I did the photo breeding and added the Chaos elements. However, https://www.instagram.com/0rionart/ holds all of my original art that I plan to tokenize! Half of the art are my drawings and illustrations that I turned into digital art and the other half is my photography. This is what I spent the better part of last week doing haha.

Day 17


Last night I covered more about mappings in my udemy course and also dove into ERC721PresetMinterPauserAutoId in OpenZeppelin Contracts 3. This is going to be a fun journey. I found my progress slowing with Solidity as I go back to basics and yearn for more advanced topics. However, I am glad I did that as subjects such as mapping, memory and storage do give me trouble. It was a breath of fresh air looking into the ERC721Preset and the challenge it poses to me.

Thank you again @abcoathup and thanks for your tips and advice.

1 Like

What does an AI Breeder website do? Can you share a link?


I think the presets are awesome.

I have been playing with an ERC20 preset contract (https://docs.openzeppelin.com/contracts/3.x/api/presets#ERC20PresetMinterPauser) so the community can deploy without writing Solidity for prototyping and testing.

Creating an ERC20 using Presets in OpenZeppelin Contracts with OpenZeppelin CLI without writing Solidity

Creating an ERC20 using Presets in OpenZeppelin Contracts with Truffle without writing Solidity

I am thinking to do something similar for ERC721.

1 Like

This website has a wealth of AI and Art information and links: https://aiartists.org/ai-generated-art-tools

ArtBreeder, https://www.artbreeder.com/, was the website I used to create the image you are referring to.

Personally I like RunwayML and want to get into Blender3D and programming GANs after I master solidty a little better. I have to keep my focus.

That preset is awesome for ERC20s. It’s useful, I like writing my own code, even if I’m just typing what is already written over again so that I learn, but having a preset will help so much for testing.

Day18 & Day19


I compiled the OpenZeppelin ERC721 contract you mentioned in a previous post and created a Faux Token as a proof of concept. I also have been reading the notes on the docs and the source code to better learn what the token is doing. I also learned about TokenURI.

1 Like

Hi @Proteu5,

I need to have a play with some art on the weekend. Thanks for sharing the links. :pray:

I am a big fan of the automatic token URI to reduce minting costs.

Really pleased to see it included in an ERC721 preset:
https://docs.openzeppelin.com/contracts/3.x/api/presets#ERC721PresetMinterPauserAutoId

1 Like

I’m using art as my escape from coding burnout. It’s nice that I’ll be able to tie in my work with NFTs when the time comes.

Thanks for your resources, I love the ERC721 Preset.!
Day 20, 21, 22
20200429_181822|666x500
I spent day 20 and 21 taking my Udemy course covering structs and mapping. I also progressed my Javascript programming. In the interim I launched Http://Proteu5.art to showcase my works for NFT creation. The website was an HTML template I purchased from Http://themeforest.net to save time. I editing the code and added some custom Javascript for the photo gallerys. I also added a PHP email form.

I also attempted an outdated ERC721 tutorial using Solidity 0.4.X. I got stuck coding the test.js file due to version changes and breaking changes in mocha, chai, and such. It was a mess so I scratched the project and chose to go fully with the OpenZepplin preset the next day.

On Day 22 I compiled the ERC721MinterPreset and the supplied test.js file successfully. I love the OpenZeppelin tools and resources, it makes solidity much simpler and I’m always trying to complicate things when it comes to code.

Day 23 - 28 (I took 1 day of coding off)

I covered a lot of basics in the Udemy course I’ve been taking and learned more about Assertions, Exception Handeling, Mappings, Structure, Arrays. I also covered debugging, ABI code, gas and importing files. I finished a project by creating a Simple Allowance Wallet.


Yesterday I coded a Simple Auction Contract from a tutorial which turned out not to be simple. The tutorial is in solidity version 0.4.8. I want to port it over to 0.6.0 and use OpenZeppelin Cli with it. I ran into a plethora of issues with the developers Web3 integration. However it was great to learn how the solidity code looks for an auction. I definitely want to do something with this in the future with IPFS. I was able to recode some bugs that occurred due to changes in Web3 and Metamask and put in an IPFS section but I’m still erroring out on the deployment of the auction. (https://medium.com/@bryn.bellomy/solidity-tutorial-building-a-simple-auction-contract-fcc918b0878a)

This Morning I covered more on the Udemy Course regarding Web3.I Loaded Web3 into my browser and connected it to the Ganache Provider. I used Remix to compile my Auction smartcontract, injected the ABI and Contract Address and then interacted with the contract.

Sorry I waited 6 days to post, but I did miss coding for 1 day.

1 Like

Hi @Proteu5,

Everyone needs some time off, you sound like you are making good progress. Thanks for sharing as always.

1 Like

Day 29


Began work on a Supply Chain Manager in Solidity on Remix to tract the purchase & delivery of an ‘Item’. The contract creates an item, triggers payment, & triggers a delivery in a function. So far its the most advanced contract I’ve worked on. This is from the Udemy: Ethereum Blockchain Developer Bootcamp with Solidity course I’m taking.

My organization is crazy I’m working on this main overarching tutorial to build my base while scraping the web for tutorials and resources to work on my own project. However, I have to remember, my goal was to learn Solidity in the first place. Thanks @abcoathup.

1 Like

If you are thinking supply chain, any thoughts to add on: Blockchain-based Life Cycle Inventory

1 Like

@abcoathup - I sent over a reply to the thread.

Day 30 & 31


Yesterday I finished my Supply Chain App, minus one bug in MetaMask that I will return to. Supply Chain is an interesting topic that I want to return to.


Today, I created an ERC20 token using OpenZeppelin and wrote the Unit Tests after deploying the contract to Ganache.

1 Like

Day 32


Wracking my brain trying to get this TokenURI JSON data to sync with OpenSea.

I successfully minted an NFT Token on the Rinkeby Blockchain and uploaded a NodeJS server to Heroku…(With a pause, a note to myself, that was a sentence I never thought would ever come out of my mouth). However, I had bug somewhere stopping OpenSea from seeing my JSON data. I have been at it since 7AM this morning and am taking a break. However, I won’t give up until I solve it and go Mainnet.

OpenSea Asset: https://rinkeby.opensea.io/assets/0x2c39cd072b3a125b4d29652560afc32e8f5f5ffc/0
NFT Image: https://gateway.pinata.cloud/ipfs/QmPYZ1gwj7P3VWK73RpHjgMNwj9CdymzocwitarHoAsqej
JSON: https://hashdeck2.herokuapp.com/api/token/1
Contract: https://rinkeby.etherscan.io/address/0x2c39cd072b3a125b4d29652560afc32e8f5f5ffc

1 Like

Hi @Proteu5,

I suggest verifying your token on Etherscan (so that people can easily call functions):

I used Remix to interact with your contract as an ERC721.

Your baseURI looks incorrect: https://hashdeck2.herokuapp.com/api/token/1

Which results in a tokenURI for tokenID 1 of: https://hashdeck2.herokuapp.com/api/token/11

If you have problems with OpenSea, you can ask in their Discord, they are super helpful: https://discord.com/invite/ga8EJbv

1 Like

Day32 & Day 33
You’re help @abcoathup allowed me to bring an ERC721 Mainnet Using the OpenZeppelin Preset! I ran into issues verifying the code and then I realized it would be much easier if I didn’t have to verify that entire preset.

Today I wrote a new ERC721 Solidity Contract from an older tutorial that I debugged to version 0.6.0 and adapted for the changes made to Open Zeppelin’s library.


I published my art to IPFS and uploaded the TokenURI NodeJs host to Heroku successfully. I then deployed the contract to Rinkeby and Minted the token to my address. It’s viewable on Rinkby.OpenSea!

I think this time I’m going to write some tests and verify the contract before going MainNet.
Thanks again for your help.

2 Likes

Hi @Proteu5,

Congratulations on deploying to mainnet! :partying_face: MAINNET!!

I want to create a tutorial for creating an art based ERC721 but haven’t come up with a simple way to create a JSON API. It would be great if you wanted to share what you did.

Feel free to ask all the questions that you need for verifying. The main issue I have found is ensuring you record what compiler version, optimization and EVM version was used to deploy the contract. A new issue is Solidity 0.6.8 introduces SPDX license identifiers and instead of flattening files, we will move to verifying multiple contract files.

I noticed in the screen shot of nft.sol that there isn’t any access control around mintUniqueTokenTo, so anyone can mint. I assume that is what you intended.

I am a big fan of auto token ID URI’s in the Preset to reduce gas cost. Though if you are including the IPFS hash in your tokenURI then this method isn’t for you.

I completely forget to add AccessControl to NFT.Sol and thank you for pointing that out to me. I will have to update my contract.

I will keep that in mind as I try and verify again after my changes. I may take you up on requesting for help as I keep getting errors.

For the JSON Api I followed the OpenSea MetaData Standards Documentation: https://docs.opensea.io/docs/metadata-standards and edited the NodeJs Server Example here following the GitHub Readme.md: https://github.com/ProjectOpenSea/metadata-api-nodejs

It was a sloppy edit but I needed something quick and dirty to get the Api Live. I edited the main body of index.js in the metadata-api-nodejs github

app.get('/api/token/:token_id', function(req, res) {
  const tokenId = parseInt(req.params.token_id).toString()
  const person = db[tokenId]
  const bdayParts = person.birthday.split(' ')
  const day = parseInt(bdayParts[1])
  const month = parseInt(bdayParts[0])
  const data = {
    'name': 'Castle Rays',
    'description': 'Bath, England - By: Proteu5.Art',
    'image': `https://gateway.pinata.cloud/ipfs/QmdeyMmvrP9dfoimozomsewLtDvSevep6czviirmXMXkbX`
  }

Removing all of the variables nullified the code I left in so that the output is as follows when hosted live:
{"name":"Castle Rays","description":"Bath, England - By: Proteu5.Art","image":"https://gateway.pinata.cloud/ipfs/QmdeyMmvrP9dfoimozomsewLtDvSevep6czviirmXMXkbX"}

Again, it was sloppy, but got the job done. I couldn’t find a good tutorial on hosting ERC721 Api data. I used Heroku to host the data.

Edit:
I cleaned up the NodeJS Api Example. All you have to do is edit constants.js with your base Heroku API and edit the metadata after deleting/commenting out the following:

const express = require('express')
const path = require('path')
const moment = require('moment')
const { HOST } = require('./src/constants')
const db = require('./src/database')

const PORT = process.env.PORT || 5000

const app = express()
  .set('port', PORT)
  .set('views', path.join(__dirname, 'views'))
  .set('view engine', 'ejs')

// Static public files
app.use(express.static(path.join(__dirname, 'public')))

app.get('/', function(req, res) {
  res.send('Get ready for OpenSea!');
})

app.get('/api/token/:token_id', function(req, res) {
  const tokenId = parseInt(req.params.token_id).toString()
  //const person = db[tokenId]
  //const bdayParts = person.birthday.split(' ')
  //const day = parseInt(bdayParts[1])
  //const month = parseInt(bdayParts[0])
  const data = {
    'name': 'Castle Rays',
    'description': 'Bath, England - By: Proteu5.Art',
    'image': `https://gateway.pinata.cloud/ipfs/QmdeyMmvrP9dfoimozomsewLtDvSevep6czviirmXMXkbX`
  }
  res.send(data)
})

app.listen(app.get('port'), function() {
  console.log('Node app is running on port', app.get('port'));
})

// returns the zodiac sign according to day and month ( https://coursesweb.net/javascript/zodiac-signs_cs )
//function zodiac(day, month) {
//  var zodiac =['', 'Capricorn', 'Aquarius', 'Pisces', 'Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpio', 'Sagittarius', 'Capricorn'];
//  var last_day =['', 19, 18, 20, 20, 21, 21, 22, 22, 21, 22, 21, 20, 19];
//  return (day > last_day[month]) ? zodiac[month*1 + 1] : zodiac[month];
//}

//function monthName(month) {
//  const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
//  ]
//  return monthNames[month - 1]
//}

An ERC721 Token Tutorial for Art would be awesome!

1 Like

Adding a test for a revert when an account without the minter role trying to mint is great at picking this up.

My quick and dirty effort was to manually generate the JSON and put them on GitHub pages.

It’s on my todo list. Still thinking of how to do the API. Heroku might be best.

1 Like