Posts

#56 Try Except (Python Tutorials)

Image
Error Handling in Python In this part of our python tutorials series, you will learn about the error handling in python. Errors can happen anywhere inside your code. There are times that you know where the problem comes from. There are also times that errors in some part of your code happen for an unknown reason at least until it gets solved. You can use try and except to handle these errors and not allow them to interfere the operation of the rest of your code at the time of running. Using the error handling will also let you know if a certain type of error occurs. You can also create your custom error and raise it when a specific event happens. Watch The Video on Youtube https://blog.arashtad.com/updates/56-try-except-python-tutorials/?feed_id=1762&_unique_id=65dde6341d8bb

How to Interact with the ERC-20 Smart Contract

Image
In this tutorial we are going to run the ERC-20 smart contract deployment on the Rinkeby chain and see the actual token created in our Metamask wallet. After you create and deploy your ERC-20 smart contract, you will be able to see that this token is added on the Rinkeby Etherscan, and by adding the address and specifications of the token, you can add it to your wallet and also you will be able to do the same on Uniswap afterward to be able to swap your token with other tokens. ERC-20 Smart Contract In our last related article on how to create an ERC-20 token , we learned how to create a token with the ERC-20 standard. Moreover, we showed how to run it via Ganache-CLI. In this tutorial, we are going to run the very same deployment on the Rinkeby network, and see the actual token created in our Metamask wallet. After you create and deploy your ERC-20 smart contract, you will be able to see that this token is added to the Rinkeby Etherscan. Then, by adding the address and speci...

#55 Math Module (Python Tutorials)

Image
Math Module In this part of our python tutorials series, you will learn about the math module in python. This module is one of the python built in modules that you can import and benefit from its mathematical functions and operators. As you have seen up to here, most of the mathematical operations in python do not need the math module. But some of the more complex ones need it. Watch The Video on Youtube https://blog.arashtad.com/updates/55-math-module-python-tutorials/?feed_id=1731&_unique_id=65dd3d4b64581

How to Create an ERC-20 Token + Writing Smart Contract

Image
In this tutorial, we are going to get familiar with the methods and events of the ERC-20 token. In addition to that, we want to create an ERC-20 token on the Rinkeby Testnet. By writing the smart contract , the deployment python file, helpful_scripts.py, and other files that help the creation and deployment of the ERC-20 token smart contract. This tutorial will go on in the next articles where we will explain the ERC-20 smart contract deeper and provide guidelines to add the created tokens to your Metamask wallet. What Is ERC-20? The ERC-20 is a token standard that implements an API for tokens within smart contracts. The acronym stands for Ethereum Request for Comments 20. The ERC-20 proposes a standard for fungible tokens (as opposed to Non-Fungible Tokens or NFTs that use ERC- 721) meaning that they have a property that makes each of them the same. This standard provides the following functionalities: 1. Transfering tokens from one account to another. 2. Tetting ...

#54 Date and Time (Python Tutorials)

Image
Date and Time In this part of our python tutorials series, you will learn about date and time module in python. Using the datetime module, you can find the current time online and you can also get the year or month or day and also other time specifications from it including the day of the week or day of the month, hour, minute, second and so on. Watch The Video on Youtube https://blog.arashtad.com/updates/54-date-and-time-python-tutorials/?feed_id=1700&_unique_id=65dc95044a5a2

Using Brownie to Switch between Different Networks

Image
In this article, we are going to switch between the different available networks we can connect to, using Brownie. Then, we'll write a statement in the Deploy.py to connect to the network requested in the terminal by the user (the developer). This kind of script for network management makes it easy for us to connect to any network that we want at any time it is required for testing and other purposes. How to Switch between Networks As you know, we have different networks to work with. We have already used some of them for deploying our contracts . Sometimes we need to write our deploy.py file in a way that we can switch between different networks and accounts and the deploy.py must understand which ones are available. Switch between Different Networks Before we get started with this task, we can check the keywords when we want to connect to different accounts. To look up the keyword related to any network, we write: Coppied to clipboard. brownie ...

#53 Modules in Python - Part 2 (Python Tutorials)

Image
Modules (Part 2) In this part of our python tutorials series, you will learn about the modules in python. We use modules to import variables, classes, methods and functions from another python code file. Some modules are built-in ones that you do not need to install them (They are pre-installed with python package). There are other ones that you do need to install them and in some other cases, you write a code and you import its file directory by mentioning its name inside your current code file. Watch The Video on Youtube https://blog.arashtad.com/updates/53-modules-in-python-part-2-python-tutorials/?feed_id=1669&_unique_id=65dbebe24bd30