<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Selçuk</title>
    <description>The latest articles on DEV Community by Selçuk (@selcukoz05).</description>
    <link>https://dev.to/selcukoz05</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F813371%2F8b396b33-c602-424d-8301-709a677f7abb.jpeg</url>
      <title>DEV Community: Selçuk</title>
      <link>https://dev.to/selcukoz05</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/selcukoz05"/>
    <language>en</language>
    <item>
      <title>How to deploy your token to a testnet</title>
      <dc:creator>Selçuk</dc:creator>
      <pubDate>Fri, 11 Feb 2022 14:56:34 +0000</pubDate>
      <link>https://dev.to/selcukoz05/how-to-deploy-your-token-to-a-testnet-4c30</link>
      <guid>https://dev.to/selcukoz05/how-to-deploy-your-token-to-a-testnet-4c30</guid>
      <description>&lt;p&gt;In the last tutorial, you had created and deployed your ERC20 token locally. In this tutorial, you will learn to deploy your ERC20 token on a testnet.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is a testnet?
&lt;/h2&gt;

&lt;p&gt;Ethereum, as a whole, has multiple networks. Mainnet is the actual network that Ethereum uses, but there are other networks, which are used by developers to test their contracts. In this tutorial, we will be using the Kovan testnet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;You will need a &lt;a href="https://metamask.io/"&gt;MetaMask&lt;/a&gt; browser wallet.&lt;br&gt;
You will need an &lt;a href="https://infura.io/"&gt;Infura&lt;/a&gt; account.&lt;/p&gt;
&lt;h2&gt;
  
  
  Get test Ether
&lt;/h2&gt;

&lt;p&gt;Each testnet has its own type of Ether. We will be using the Kovan testnet in this tutorial, so you will need some Kovan ETH. To get Kovan ETH, you will need to use a faucet. Faucet, as understandable by its name, is a source where you can earn test ETH by accomplishing simple tasks.&lt;br&gt;
The faucet I personally use is the Chainlink faucet. From the following link, you can get free Kovan ETH by just typing your address that you get from MetaMask and solving an easy captcha.&lt;br&gt;
&lt;a href="https://faucets.chain.link/"&gt;Click this to go to the faucet&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  About environment variables
&lt;/h2&gt;

&lt;p&gt;When working with projects, you might have some sensitive data which should not be published at anywhere, as an example, we can think of API keys. To not publish sensitive data, but still reach to it in your local project, you will need environment variables. Brownie has an option for environment variables and this can be very helpful in some situations.&lt;br&gt;
In the base directory, create a file named &lt;code&gt;.env&lt;/code&gt;. In this file, you are going to store your project's environment variables.&lt;br&gt;
In &lt;code&gt;brownie-config.yaml&lt;/code&gt; which we had created earlier, add these options:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dotenv: .env
wallets:
  from_key: ${PRIVATE_KEY}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will be helpful later in the tutorial.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Infura Project ID
&lt;/h2&gt;

&lt;p&gt;To connect to the Kovan testnet, you will need an endpoint. Infura is a service which provides simple and reliable access to Ethereum. If you have already opened your Infura account, create a new project, open the project settings and copy the PROJECT ID. Paste in into the .env file we created earlier, like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WEB3_INFURA_PROJECT_ID=your_project_id
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now brownie will use this project to reach to the Kovan endpoint.&lt;/p&gt;

&lt;h2&gt;
  
  
  Get Metamask Private Key
&lt;/h2&gt;

&lt;p&gt;If you have already installed the MetaMask extension and opened an account, go to the extension window, click to the three dots at the top right, enter to 'Account Details', click 'Export Private Key', enter your password, copy your private key and paste it into the .env file like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PRIVATE_KEY=your_private_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;At the end, your .env file should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;WEB3_INFURA_PROJECT_ID=your_project_id
PRIVATE_KEY=your_private_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You have successfully set up the project environment variables.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploy the contract
&lt;/h2&gt;

&lt;p&gt;As you might recall, we had used a local account at the previous tutorial. It is time to change that into our MetaMask account.&lt;br&gt;
Open the scripts/deploy.py file again and change it to look like the following code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;brownie&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;MyToken&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;config&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;web3&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Web3&lt;/span&gt;

&lt;span class="n"&gt;initial_supply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000000&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"wallets"&lt;/span&gt;&lt;span class="p"&gt;][&lt;/span&gt;&lt;span class="s"&gt;"from_key"&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
    &lt;span class="n"&gt;my_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MyToken&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;initial_supply&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;'from'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We only changed the accounts, as we have set the private key path in our config earlier in the tutorial, we can get our account easily.&lt;br&gt;
Now, let's deploy our contract. Open a command line window at the base directory, and enter this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; brownie run scripts/deploy.py --network kovan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If no errors occur, your contract will be deployed, and you will be given info about the transaction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;Transaction&lt;/span&gt; &lt;span class="n"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0x8175029649fc9d6bacf90b1d4fb3789cc4e626d2cfe57c670b4b787dee296726&lt;/span&gt;
  &lt;span class="n"&gt;Gas&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;2.500000007&lt;/span&gt; &lt;span class="n"&gt;gwei&lt;/span&gt;   &lt;span class="n"&gt;Gas&lt;/span&gt; &lt;span class="n"&gt;limit&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;704322&lt;/span&gt;   &lt;span class="n"&gt;Nonce&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;26&lt;/span&gt;
  &lt;span class="n"&gt;MyToken&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;constructor&lt;/span&gt; &lt;span class="n"&gt;confirmed&lt;/span&gt;   &lt;span class="n"&gt;Block&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;29779219&lt;/span&gt;   &lt;span class="n"&gt;Gas&lt;/span&gt; &lt;span class="n"&gt;used&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;640293&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;90.91&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="n"&gt;MyToken&lt;/span&gt; &lt;span class="n"&gt;deployed&lt;/span&gt; &lt;span class="n"&gt;at&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;0x5BD01Af26009232e51A012C874881051Eee6239d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Congratulations, you have successfully deployed your token to a testnet! If you want to see your token on Etherscan, copy the address after &lt;code&gt;MyToken deployed at:&lt;/code&gt;, which is the smart contract address, paste it into &lt;a href="https://kovan.etherscan.io/"&gt;Kovan Etherscan&lt;/a&gt; explorer, and your token is visibly there.&lt;/p&gt;

&lt;p&gt;I hope this tutorial series was helpful for you to begin developing smart contracts. If you have any questions, or have noticed any problems, feel free to comment!&lt;/p&gt;

</description>
      <category>web3</category>
      <category>solidity</category>
      <category>python</category>
    </item>
    <item>
      <title>How to create your own token with Solidity and Python</title>
      <dc:creator>Selçuk</dc:creator>
      <pubDate>Fri, 11 Feb 2022 12:02:11 +0000</pubDate>
      <link>https://dev.to/selcukoz05/how-to-create-your-own-token-with-solidity-and-python-4762</link>
      <guid>https://dev.to/selcukoz05/how-to-create-your-own-token-with-solidity-and-python-4762</guid>
      <description>&lt;p&gt;In this tutorial, you will learn how to create a simple &lt;strong&gt;ERC20 token&lt;/strong&gt; with Solidity and deploy it onto a testnet with Python.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is an ERC20 token?
&lt;/h3&gt;

&lt;p&gt;ERC20 is a token standard that resides in a smart contract. What makes it different from other standards is that it is &lt;strong&gt;interchangeable&lt;/strong&gt;, which means one ERC20 token will always be equal to another of the same kind. The thing that makes ERC20 a token and not a coin is the fact that smart contracts that control ERC20 tokens live on the Ethereum and other EVM compatible blockchains such as Avalanche, meanwhile coins have their own native blockchains.&lt;/p&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;You will need &lt;strong&gt;Python 3.6 or greater&lt;/strong&gt; and &lt;strong&gt;pip&lt;/strong&gt;.&lt;br&gt;
You will also need &lt;strong&gt;npm&lt;/strong&gt;.&lt;br&gt;
We will be accomplishing things like tests and deployment using the Python package named &lt;strong&gt;Brownie&lt;/strong&gt;, so you will need to install it from pip.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; pip install eth-brownie
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will also need &lt;strong&gt;ganache-cli&lt;/strong&gt;, so that brownie can locally deploy/test the contracts.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; npm install ganache-cli
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Project setup
&lt;/h2&gt;

&lt;p&gt;Open a folder, launch a command line window inside of it and run the following command, which will initialize the basic files of your brownie project for you.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; brownie init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You will see that these files have been created.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;├───build
│   ├───contracts
│   ├───deployments
│   └───interfaces
├───contracts
├───interfaces
├───reports
├───scripts
└───tests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The only folders we will focus on this tutorial are &lt;code&gt;contracts&lt;/code&gt; and &lt;code&gt;scripts&lt;/code&gt;. The contracts folder will hold our smart contracts and the scripts folder is going to be the one where we write our deployment scripts.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configuration
&lt;/h2&gt;

&lt;p&gt;In this tutorial, we are going to use the &lt;strong&gt;OpenZeppelin&lt;/strong&gt; library. This library provides a lot of utilities and standards which can be easily imported and used in your project. To get OpenZeppelin for our project and add more settings further in the project, in the &lt;strong&gt;base directory&lt;/strong&gt; we need to create a &lt;code&gt;brownie-config.yaml&lt;/code&gt; file where we are going to configure our dependencies.&lt;br&gt;
After you create the file, add these so that the library gets installed when we compile our contract.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;dependencies&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;OpenZeppelin/openzeppelin-contracts@4.2.0&lt;/span&gt;

&lt;span class="na"&gt;compiler&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;solc&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;remappings&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;@openzeppelin=OpenZeppelin/openzeppelin-contracts@4.2.0"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the &lt;code&gt;dependencies&lt;/code&gt; section, we add the github repository of our target library and specify the version to be downloaded.&lt;br&gt;
In the &lt;code&gt;remappings&lt;/code&gt; section, we specify a remapping for the library path so that we do not have to type longer imports.&lt;/p&gt;
&lt;h2&gt;
  
  
  Writing the contract
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;smart contract&lt;/strong&gt; is basically code that resides on the Ethereum blockchain and is available to run functions, emit events and such. Create your smart contract code by creating a new file &lt;code&gt;MyToken.sol&lt;/code&gt; in the contracts folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight solidity"&gt;&lt;code&gt;&lt;span class="c1"&gt;// SPDX-License-Identifier: MIT
&lt;/span&gt;
&lt;span class="k"&gt;pragma&lt;/span&gt; &lt;span class="n"&gt;solidity&lt;/span&gt; &lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="mf"&gt;0.8&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="s"&gt;"@openzeppelin/contracts/token/ERC20/ERC20.sol"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;contract&lt;/span&gt; &lt;span class="n"&gt;MyToken&lt;/span&gt; &lt;span class="k"&gt;is&lt;/span&gt; &lt;span class="n"&gt;ERC20&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

    &lt;span class="k"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;uint256&lt;/span&gt; &lt;span class="n"&gt;initialSupply&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;ERC20&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"MyToken"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="s"&gt;"TKN"&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="n"&gt;_mint&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;initialSupply&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What does this code do?&lt;/strong&gt;&lt;br&gt;
The &lt;code&gt;pragma&lt;/code&gt; keyword lets us specify which versions our code will be compatible with. This means that our code will be compatible with versions of 0.8.0, which means our contract can run in 0.8.0, 0.8.5 and such, but can not run in 0.7.0 or 0.9.0.&lt;/p&gt;

&lt;p&gt;In the import statement, we reached to the &lt;strong&gt;ERC20.sol&lt;/strong&gt; file from the OpenZeppelin library so that we can use it in our contract.&lt;/p&gt;

&lt;p&gt;After we declared our contract, we added &lt;code&gt;is ERC20&lt;/code&gt;, which basically &lt;strong&gt;inherits&lt;/strong&gt; the functions of ERC20.sol, which technically makes our smart contract an ERC20.&lt;/p&gt;

&lt;p&gt;The constructor allows us to initialize our smart contract. We added &lt;code&gt;ERC20("MyToken", "TKN")&lt;/code&gt; to declare the name and symbol. The &lt;code&gt;initialSupply&lt;/code&gt; is the amount which will be &lt;strong&gt;minted&lt;/strong&gt; to the deployer of the contract.&lt;/p&gt;
&lt;h2&gt;
  
  
  Compiling the contract
&lt;/h2&gt;

&lt;p&gt;After you have written the contract, you will have to &lt;strong&gt;compile&lt;/strong&gt; the contract. To compile the contract to see if you have any errors, run the following command in the base directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; brownie compile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have no errors, now it is time to deploy it to the local ganache!&lt;/p&gt;

&lt;h2&gt;
  
  
  Local deployment
&lt;/h2&gt;

&lt;p&gt;Create &lt;code&gt;deploy.py&lt;/code&gt; in the &lt;code&gt;scripts&lt;/code&gt; folder.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;brownie&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;MyToken&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;web3&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Web3&lt;/span&gt;

&lt;span class="n"&gt;initial_supply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000000&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;account&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;accounts&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;my_token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MyToken&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deploy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;initial_supply&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;'from'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;account&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;my_token&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The accounts that we imported from brownie are local accounts created by ganache. These make it easier for us to do operations like deployment, tests, etc.&lt;br&gt;
By getting a local account and our contract MyToken from brownie, we are able to deploy the contract and use the deploy function. &lt;code&gt;{'from': account}&lt;/code&gt; is the parameter we give to the function which allows it to be transacted by the account.&lt;br&gt;
At the end, we print the use the inherited &lt;code&gt;name()&lt;/code&gt; function to get the name we had entered in the ERC20 constructor of our contract.&lt;/p&gt;

&lt;p&gt;After you finish coding, open your command line window in the base directory, and type the following command, which will run the script and show information about the transactions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; brownie run scripts/deploy.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If this runs without any problems and you get the output of the tokens name at the end, it means that you've made it!&lt;/p&gt;

&lt;p&gt;This is the end of this part of the tutorial. If you have seen any mistakes in this tutorial, or if you have any questions, feel free to comment about it. If you want to accomplish more and deploy your token onto a testnet, follow along the series. I hope this tutorial will be your starting point to Web3!&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
