
In this section we go through what this course is, who it is for and what we will be building through out the lessons. I demonstrate the final functionality we are building towards (http://cryptodoggies.store)
Introduction to Ethereum; we'll go over some history of how it came about and what the creators of it were looking to solve
We discuss what a Smart Contract is and how it exists in the Ethereum Blockchain. We also talk about how it compares with other Blockchain technology and why Ethereum has such an interesting take on it.
Walkthrough of the steps required to install the following tools on Windows:
- NodeJS / NPM
- Ganache/Ganache CLI
Walkthrough of the steps required to install the following tools on MacOS:
- NodeJS / NPM
- Ganache/Ganache CLI
Walkthrough of the steps required to install the following tools on Linux/Ubuntu:
- NodeJS / NPM
- Ganache/Ganache CLI
We write the short couple of lines that make up the basis of our Smart Contract
We learn what the Version Pragma at the top is, and why it is important when creating Smart Contracts
We talk about State variables and how they are persisted in the blockchain permanently. We define some constant variables that we would like to use through out the life of our contract.
We create a basic struct to store some data that we'd like out CryptoDoggies to have
We create an array to store our newly created Struct items. Then we create a function that can be used to access and create new Doggies through our contract
We talk through creating a simple mapping for keep track of Who owns a Doggy, and also keep track of the total number of Doggies an owners address has on record.
We create an event that will fire when a Doggy is added to the Contract. These events can be caught by our web interface later on and be used to track the state of a pending transaction, and also get some useful information about whether a function was successful or not.
We load our Smart Contract into Remix and test to make sure the Event we created is firing successfully. This section is optional as we don't completely cover all the features of Remix quite yet. This information will be covered in a future tutorial
We setup the basics required to use Truffle to help us streamline development. This lecture includes information in creating the migration scripts that deploy our contract for us to the test blockchain.
We talk about the different files that make up the project that runs with Truffle. We talk about what a Mnemonic is and how we use it while developing smart contracts with Truffle and TestRPC
We talk through the basics of starting up the Ganache RPC client to host our own development blockchain to test our smart contracts with.
We create a simple unit test using the Web3 libraries and check to make sure we can deploy CryptoDoggies to the blockchain in our test environment
We take a dive into what ERC721 is and what makes it Unique
We add the ERC721 Interface and go over what the different functions and meta-tag information is available. We decide what we need for our Doggie Token and implement them.
AccessControl.sol
https://raw.githubusercontent.com/t04glovern/cryptodoggies/master/contracts/AccessControl.sol
ERC721.sol
https://raw.githubusercontent.com/t04glovern/cryptodoggies/master/contracts/ERC721.sol
SafeMath.sol
https://raw.githubusercontent.com/t04glovern/cryptodoggies/master/contracts/SafeMath.sol
We discuss how we will be using the DNA field for each Doggy to help make them Unique within their individual ERC721 token
We begin creating the skeleton code for our new CryptoDoggies ERC721 token contract. This includes making new Events, Mappings, Structs and Arrays to store our data
We write the code required to create a new Doggy token and create some private functions to ensure we are dealing with this creation safely
We write the Random DNA generation function that uses the current state of the blockchain it is deployed to in order to create the next Doggy DNA. We finish up by writing a function that returns the Tokens owned by a particular owner.
We write what is arguably the most important functions for our smart contract to function; being the Withdrawal function to extract funds, and the purchase token function that is used whenever a token is purchased.
We write the mathematical logic to handle the step increments of our token as it is purchased by subsequent people. We use the SafeMath library in order to do this safely without losing precision.
We write all the Override functions that are required to be implemented by the ERC721 token standard
We finish up writing some of the private functions that are used by our smart contract internally as utilities. This includes a way for our smart contract to tell if a sender is a Wallet or another smart contract.
We refactor our old Unit Tests from the previous section and port them across to work with the new CryptoDoggy tokens.
In this video we deploy our smart contract to Ropsten Testnet and interact with it using some of the development features available within Remix (https://remix.ethereum.org)
In this lecture we will go over setting up the base HTML layout from scratch. We will import all of the libraries we will for lectures later on in this section. The goal is to get as much of the UI work out of the way neatly, so we can easily see the changes we make as we work through the jQuery (JavaScript) code.
In this section we design the layout for our Doggy cards in the UI. We write all the code needed using Bootstrap and prepare ourselves for tying together the JavaScript we write next to the UI elements
We write the first bits of JavaScript that are needed to add new CryptoDoggy cards to the front end UI
We compile our smart contract locally using Truffle and migrate the CryptoDoggies.json contract definition over to the local development web server so we can test the UI loads new CryptoDoggies when prompted to.
We write the bound event that handles the onSubmit form data that is passed when a Doggy is purchased. We go through parsing this form data and then executing a MetaMask transaction when the button is pressed.
We implement the code required to load all the Doggies currently loaded into our smart contract from the Ethereum blockchain. This includes writing a safe way to parse each data field that we get from the getToken() function.
The full tutorial outlining how we go about deploying our, now complete contract to Ropsten, then update our frontend website to display the CryptoDoggies that the contract manage. Finally we create a new Doggy and confirm we can view it in the front end.
In this final optional lesson we deploy the CryptoDoggies smart contract onto the Ethereum Mainnet blockchain. We go through the process of consolidating the smart contract into 1 main solidity file and also add the source code for our smart contract to Etherscan.
I'm sure you've heard of CryptoKitties, the first highly successful Ethereum Smart Contract and Distributed Application (DApp) that took the world by storm!.
There is no denying that Ethereum and the amazing opportunities that come from writing Smart Contracts will only get bigger and more disruptive in the coming years as it continues to grow.
Learn How To Use:
I wrote this course for people who want to step through each of the steps required to implement their very own ERC721 Token called CryptoDoggies. Each of the Doggies created is completely unique and can be sold and collected on the Ethereum Blockchain.
By the end of this course you will have deployed your very own CryptoDoggy contract, and be fully capable in creating anything you can dream of using the amazing power of Ethereum Smart Contracts.