Categories
solidity

Getting data from the internet with Oraclize

Smart contracts can interact with data living in the blockchain but it is impossible to get informations from the web. Using Oraclize, we’ll see how your smart contracts can get data from outside the blockchain and execute any API call. Some use cases can be: It’s hard to generate completely random data on the blockchain can […]

Categories
blog DeFi erc20 javascript solidity

Making a flash loan with Solidity (Aave, Dy/Dx, Kollateral)

Flash Loans are loans that allow the borrowing of an asset, as long as the borrowed amount (and a fee) is returned before the end of the transaction. Those types of loans enable you to perform actions without using your funds for a really small percentage fee (0.09% at the time of writing on Aave […]

Categories
Arbitrage Bot DeFi DEX javascript solidity

Trading and Arbitrage on Ethereum DEX: Get the rates (part 1)

In this series of tutorials, we explore how to build solutions around trading and making simple arbitrage bot using Ethereum decentralized exchanges (DEX). This series uses Javascript, Solidity, and the 1inch dex aggregator and flash loans. As the subject is wide, we have split the series into several parts below: Get the exchange rates to […]

Categories
erc20 solidity

Transfers and approval or ERC20 tokens from a solidity smart contract

In the previous tutorial we studied the anatomy of an ERC20 token in Solidity on the Ethereum blockchain. In this article we’ll see how we can use a smart contract to interact with a token using the Solidity language. For this smart contract, we’ll create a really dummy decentralized exchange where a user can trade […]

Categories
Getting started solidity

Interact with other contracts from Solidity

In the previous tutorials we learnt a lot how to deploy your first smart contract and add some features to it like control access with modifiers or error handling in Solidity. In this tutorial we’ll learn how to deploy a smart contract from an existing contract and interact with it. We’ll make a contract that […]

Categories
Getting started solidity

Handle Errors in Solidity With Require and Revert

A good programmer is someone that can imagine and handle all the cases that will happens during the execution of the program. For this, Solidity offers different functions that we’ll cover in this article: require and revert. Require The require Solidity function guarantees validity of the condition(s) passed as parameter that cannot be detected before […]

Categories
Getting started security solidity

Using Safe Math library to prevent from overflows

When your are working with numbers in any programming language you are subject to overflows. An overflow happens when the value of number is bigger than the maximum possible value offered by the machine. For example if you’re using an unsigned integer in Solidiy. The possible values of your variable ranges from 0 to  2^256 […]

Categories
erc20 Getting started solidity

Understand the ERC20 token smart contract

One of the most significant smart contract standard on Ethereum is known as ERC-20, which has emerged as the technical standard used for all smart contracts on the Ethereum blockchain for fungible token implementations. The ERC-20 defines a common list of rules that all Ethereum tokens must adhere to. Consequently, this token standard empowers developers […]

Categories
Getting started solidity

Organize your code and control access to your smart contract with modifiers

This tutorial will cover how to control who can interact with your smart contracts in a smart way using modifiers. You’ll alos learn how to make some part of your code only accessible under specific conditions like for example: only the owner of the smart contract can withdraw the funds. Let’s get back to our […]

Categories
Getting started solidity

Inheritance in Solidity, contracts are classes

In this tutorial, we’ll learn how you can easily use inheritance to organize your code. In object-oriented programming, a class is a blueprint for creating objects (a particular data structure), providing initial values for state (member variables or attributes), and implementations of behavior (member functions or methods). In Solidity, a contract acts like a class. […]