I hope, however, that this tutorial serves as an effective conduit for you to learn more about these topics. Now we of course have only scratched the surface of Ethereum, Solidity, ERC20 tokens, and smart contracts. Checking the supply, name, or symbol of the token.This will allow you to test a number of functions such as: Once the contract has successfully deployed, the following interface will popup: If all goes right, MetaMask should ask you to pay a gas fee(With Rinkeby Test Eth) and you should see a successful deployment message after a couple seconds. Before deploying, double check that you are on the Rinkeby test network. Next, select your token under the Contract tab. You will end up paying with real ETH to deploy your contract if you are on the main Ethereum network. Make sure that you have the Rinkeby Test Network selected in Meta Mask. This should prompt MetaMask to ask you for your sign in. Once your code is compiled, head to the deploy tab and select “Injected Web3” for the environment. You can then press compile – Remix will notify you of any errors Keep in mind that the above gist uses Solidity version 0.8.11, you will need to change the pragma line at the beginning if that is no longer the case. So how can we compile and test our cryptocurrency? First navigate to the compiler tab and make sure you have the latest commit selected. In this example, we made it so new money can’t be minted on fridays. We can then edit the functions as necessary to add our custom logic. Notice that we are using OpenZeppilin’s ERC20 template as a baseline for our contract. I’m going to name mine codesphereToken.sol, but you can name it whatever you want. To get started, create a new solidity file (with a. To demonstrate how you can add your own logic, I’m going to show how you can set time restrictions on certain actions. We are going to be making a pretty boilerplate ERC-20 token. A faucet is a place where you can mint new Eth to your wallet on a test network.įinally, we’re going to be using an online Solidity compiler, Remix, to write, compile, and deploy our code on the test network. Now that we can use test networks with our MetaMask, head to the ChainLink Faucet and give yourself 0.1 test Eth on the Rinkeby network. Once your MetaMask is setup, make sure to navigate to settings and enable show test networks (it will be in the advanced settings tab). MetaMask is a browser extension that allows you to easily access your crypto wallets and interact with blockchain platforms. The first important step is to make sure that you have MetaMask installed on your browser and your wallet setup. For all the hype, blockchain technology is still pretty new and most blockchain devtools have pretty bad UX. I’ll give the warning now that setting this up is not a quick feat. This makes it much easier to test smart contracts and tokens. Rinkeby operates exactly like the Ethereum network, except we can give ourselves free ethereum whenever we want. Since we don’t want to deploy this token on the actual Ethereum network(That would cost money), we will be using a test network called Rinkeby. As long as your token conforms to the ERC-20 standard, it would be able to be used on most blockchain platforms. To define the logic of our ERC-20 token, we will create a smart contract which dictates how the token can be minted, transferred, and burned. While our token can function as any other cryptocurrency, it will be run on the Ethereum blockchain, instead of running on its own blockchain. We are going to be making what’s known as an ERC-20 token, which is a standardized template for how an Ethereum token works. In this tutorial, we’re going to be using Solidity, an Object-Oriented programming language for building smart contracts. As more and more dollars are poured into blockchain companies, blockchain development has become an increasingly lucrative skill.
0 Comments
Leave a Reply. |