My Coding Journey: Beginner to Pro

Yeah, he’s been really supportive on Twitter asking if I need help. I’m going to try out his Eth.build project over the next few days. It looks really cool. Very visually interactive.

I really love how supportive and friendly the dev side of crypto is. Seems to counteract the negative of some traders and more money-driven actors in the space.

That was a great video by the way! How likely or how long do you think before we start seeing flash-mintable tokens in the wild?

1 Like

Day 27:

  • Started building an NFT. Not sure what it’ll ultimately lead to.

  • Started going through the ETH.BUILD tutorials. It’s a really visually interactive way to see how things work under the hood.

  • Completed Ethernaut level 16: Preservation.

  • Found an interesting extension to the ERC-721 standard with ERC-998. What if a digital asset held its own assets? And what if those assets had an interest-earning wrapper like rDAI? Oh the possibilities…

Uniswap V2 includes Flash Swaps so I believe that we will see more Flash in the ecosystem before too long. Flash loans/minted tokens/swaps means that assumptions around behavior of whales will no longer apply. (there are a number of Flash posts: https://forum.openzeppelin.com/tag/flash-loan)

@Proteu5 has been building NFTs too. There might be potential to share ideas and lessons learnt.

I think ERC721PresetMinterPauserAutoId is a great place to start. Other than potentially adding functionality to change the base URI (which if you use a domain name you could do by changing where the domain name points to, so don't need to change it in the smart contract), it covers what I have used in the past.

NFTs owning assets is an interesting idea. I recall that @Nick_Mudge was working on EIP-998 and doing experiments with NFTs owning NFTs.

1 Like

That makes total sense regarding seeing more Flash in the ecosystem as various platforms integrate it. Just a matter of time.

Thank you for the resources @abcoathup! I’ll definitely check out the ERC721PresetMinterPauserAutoId, and reach out to @Proteu5. I’ve already learned a lot by reading through his coding journey, so I hope I can return the favor. It’s always nice to find someone who shares the same obsession.

Btw someone from the onemilliondevs forum reached out to me on Twitter because they saw my coding journey on there. Thanks for linking me there! I didn’t even know there was a forum for this. I’ll start adding there too.

1 Like

Hi @Jshanks21,

I love reading the coding journeys and encourage people to read them and even write their own.

I have drafted a tutorial that is still very much a work in progress for creating an NFT: [DRAFT] Create an NFT and deploy to a public testnet, using Truffle. Feedback is appreciated.

It is early days for the onemilliondevs forum, you might find one or two of my posts there :smile:.
It is nice to see different experiments of growing the developer community.

1 Like

Day 28:

  • Followed a tutorial to create a basic NFT minting app that mints NFTs for whatever color you input and displays the color on the page.

  • Deployed EthSwap to the Ropsten testnet and successfully hosting it with Github Pages.

  • Updated my personal site to include a recent project, latest experience, and some articles I’ve written. Also finally got the DNS name to display the correct URL on the homepage.

TODO: Excited to create an NFT and deploy it to a public testnet with a recent guide by @abcoathup.

TODO: I also now have a plethora of resources to get me to the next level of development thanks to @Proteu5!

2 Likes

@abcoathup I just finished the guide to deploy a NFT to a public network and it was as smooth as a hot knife through butter. Very straightforward and easy to follow. I also appreciated the information about metadata, my-json-server, and URIs as I'm unfamiliar with all of that. I still need to learn how to make it point to an image hosted somewhere, like IPFS I guess?

NFT on OpenSea Rinkeby:

That said, depending on who you intend this guide for, I would recommend adding more detail or explanation in some areas. If this is intended for beginners, a quick mention that the account deploying the contract which has the minter role is the first account in the list Truffle spins up could help someone unfamiliar with using a local blockchain.

I think the portion about not committing your API key and the mnemonic you use could include more instructions or resources on how to do this correctly. I'm used to using an env file for this info, but someone less familiar may not not realize the importance or know where to start looking for a "secret management solution." Recently, someone in one of my Slack groups lost about $1,000 because he accidentally, or unknowingly, committed this information to Github. It happened within the same day as the commit too, so it happened pretty quickly.

This help guide by Github could be a useful resource to add to the guide for anyone unfamiliar with using gitignore to protect sensitive files from being committed.

But great guide overall! Thanks for sharing. I look forward to seeing the final version.

2 Likes

Hi @Jshanks21,

Thank you for going through the tutorial and providing all the feedback. I'm pleased that you could get a token on a testnet.

NFT metadata is centralized because we use a URI (as per the specification). Even if we hosted the metadata on IPFS, then we would still need a centralized gateway to get there.

Agreed. A bit more detail and someone who has used Truffle before should be able to follow.

The original tutorial on connecting to a testnet used .env but it was simpler to just read from json for a tutorial.

I will add some more information on not adding your secrets to GitHub. I was thinking of this incident when I wrote the tutorial: https://www.reddit.com/r/ethereum/comments/gr74hq/i_lost_1200_in_100_seconds_by_a_github_hacker_bot/
I assume this was the person that you knew. The bots are quick at finding mnemonics or private keys on GitHub.

I hope to work on it this week so that I can promote next week. I will let you know when I have done an updated version.

1 Like

No problem @abcoathup.

I didn't know that. Is that why some projects are trying to store metadata directly on the blockchain even though it would be more costly?

Yep, that's him. I was surprised it happened so fast, but makes sense if it's a bot. That's pretty crazy you can program a bot to do all that automatically.

Looking forward to it!

1 Like

Day 29:

  • Minted an NFT on the Rinkeby Testnet using a guide by @abcouthup.

  • Brushed up on my React skills.

  • Made a simple interface for displaying and fetching fake API data using React. (The lag in the gif is from my computer recording and running the project locally, not from anything in the project itself.)

TODO: Build and NFT gallery/marketplace

Untitled_ Jun 4, 2020 8_16 AM

1 Like

Hi @Jshanks21,

Very nice. Now you can create an NFT viewer and mint some more tokens.

1 Like

Thank you @abcoathup,

That’s what I’m hoping! I’ve actually been working through a tutorial for creating an NFT market to do just that, but I’m very stuck. :sweat_smile:

I’m using the 0xcert framework and this guide to develop it, but I keep getting an error when I try to deploy the ledger meant to hold new NFTs.

It’s about 3/4 of the way through the guide right after adding the function async deployNewLedger() that I get this error in the console after refreshing the page: Error Error: invalid string value (arg="", coderType="string", value=undefined, version=4.0.47).

I think the issue has something to do with the argument types, but they’re both objects so I’m not sure why it’s resulting in an invalid string error.

I’d greatly appreciate any suggestions or resources on this issue if it’s not too much trouble!

Day 30:

  • Completed a tutorial for building a minimal viable decentralized exchange using scaffold-eth courtesy of Austin Griffith.

  • Built a basic interface with React for uploading files to IPFS.

– In regards to building an NFT marketplace; uploading files to a server, like IPFS, for reference was the final piece before putting it all together. Time to combine the last few days of development, building an NFT, leveling up React skills, and connecting to IPFS, in order to create the final product. Or at least, first iteration of the final product.

1 Like

Hey @abcoathup,

I ran across an issue while using the ERC721PresetMinterPauserAutoId contract and wanted to ask if you’re familiar with it or know what could be causing it.

I’m able to mint an NFT and show the owner by using the tokenId, so I’m pretty confident it exists, but it keeps returning false when I query the exists function.

I saw that _exists is internal in the original ERC-721 contract, so I created my own public one in my contract like so:

function exists(uint256 tokenId) public view returns(bool) { super._exists(tokenId); }

I’ll keep digging, but wanted to ask in case I’m just overlooking something simple. Any feedback or suggestions are greatly appreciated!

1 Like

I am working to increase my development velocity. Finding ways to automate redundant tasks, increasing my efficiency of turning time invested into features implemented.
I came upon the solidity loader in the docs and was immediately excited as this is exactly the sort of tool I was looking for to improve the flow and pace of development on the DApp projects I am working on.
Of course it was all built for React and my preference and projects code bases are in Vue, so I am looking to build the feature into my projects in the Vue ecosystem.
Then I would like to build a plugin for Vue-CLI to help spin up new DApps with hot reload in Vue. Also offering to install a provider, with selection from Ethers.js, Web3.js, etc would be great.
Thanks for your teams work building and documenting these great resources!

2 Likes

Hi @Jshanks21,

You aren’t returning the value from _exists.
I’m not sure what happens with Solidity if you don’t have an explicit return.

Have a look at my example below:

// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;


import "@openzeppelin/contracts/presets/ERC721PresetMinterPauserAutoId.sol";

contract MyNFT is ERC721PresetMinterPauserAutoId {
    constructor()
        public
        ERC721PresetMinterPauserAutoId(
            "My NFT",
            "NFT",
            "https://example.com/token/"
        )
    {}

    function exists(uint256 tokenId) public view returns (bool) {
        return _exists(tokenId);
    }
}

Also you can convert a uint256 into a string in one line in the console if you want:

truffle(development)> (await token.totalSupply()).toString()
'1'
truffle(development)> await token.ownerOf(0)
'0xFFcf8FDEE72ac11b5c542428B35EEF5769C409f0'
truffle(development)> await token.exists(0)
true
truffle(development)> await token.exists(1)
false
1 Like

Hi @Skyler_Fly,

Welcome to the community forum :wave: Thanks for posting here.

I keep coming across your coding journey on Twitter. It would be great if you wanted to join @Jshanks21 and @Proteu5 in sharing your coding journey here in the community forum. https://forum.openzeppelin.com/tag/coding-journey

It would be great if you could share your Vue knowledge with the community.

You may want to check out https://github.com/PaulRBerg/create-eth-app by @PaulRBerg which has a Vue template.

Please ask all the questions that you need.

3 Likes

Thank you @abcoathup! I thought it might be something simple, but I was running on fumes at that point so I was having a really hard time focusing.

In my case, it always returns false without an explicit return statement.

1 Like

Hi @Skyler_Fly,

It sounds like you already have a lot of experience and momentum. I’ve never used Vue before so it would be really cool to see your implementation using web3 tools like Web3.js and Ethers.js with that framework.

I look forward to following your progress!

2 Likes

I have definitely been there. That is where a second pair of eyes helps. Which is great to have a community to share it with.
Writing some unit tests can also help shake out the problem.

I was hunting through the Solidity documentation to see if it specifies what happens if there isn't an explicit return value. I am surprised that there isn't a warning in the compiler.

1 Like