blog DeFi javascript NFT web3js

NFT20: How to simply trade NFTs in JS

NFT20 is a platform that enables buying and selling NFTs in one click on Ethereum and Polygon without counterparty thanks to liquidity provided in the popular AMM Uniswap. In this article, we’ll learn how to simply add the functionality of buying NFTs to any website. To see the complete documentation and sample, go to the […]

blog data analytics javascript

How to access indexed Ethereum data with The Graph

When you’re trying to access Ethereum data generated by smart contracts and dapps on the blockchain you might find it hard to transform the data to a readable format. The Graph is an indexing protocol for querying networks like Ethereum and IPFS. Anyone can build and publish open APIs, called subgraphs, making data easily accessible. […]

DeFi javascript web3js

Reading Chainlink price oracles from JavaScript

A common problem you may face in Ethereum programming is getting a price feed of digital currencies. Chainlink is an oracle platform that is used by many DeFi projects and incentives actors to publish on-chain several information like prices of tokens or price of Ether. in this tutorial we’ll learn how you can retrieve the […]

ABI data analytics erc20 javascript web3js

How to decode event logs in Javascript using abi-decoder

In this tutorial we’ll see how to decode and make sense of event logs generated by Ethereum transactions. This tutorial will guide you on getting a transaction receipt and getting the data related to one event in their original types using the abi-decoder library. For this tutorial you’ll need : the ABI of the smart […]

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 […]

Arbitrage Bot DeFi DEX erc20 javascript web3js

Swap tokens with 1inch Exchange in JavaScript: DEX and Arbitrage part 2

For this tutorial will see how to execute a trade using 1inch DEX aggregator in Javascript with the web3.js library. At the end of the tutorial, you’ll know how to exchange ERC20 tokens and Ether directly on the Ethereum blockchain. This article is part 2 (part 1 here) of tutorials we started while using the […]

erc20 Getting started javascript

Waiting for a transaction to be mined on Ethereum with JS

In the previous tutorial we learnt how to send a transaction to an Ethereum smart contract, we’ll now see how to wait for a transaction to be mined and get it’s result. When you sbumit a transaction to the blockchain, you’ll receive the transaction hash of the new transaction. In order to wait for the […]

Getting started javascript

Compiling and deploying smart contracts in JavaScript and command line

This tutorial covers how to compile and deploy your smart contracts using JavaScript and Solidity comand line compiler solc. All our classes are made for beginners and advanced programmers to understand and build on the Ethereum blockchain. We really advise people to understand simple tools like solc compiler instead of jumping directly with complicated frameworks […]

erc20 Getting started javascript

Calling a smart contract from JavaScript

In this tutorial we’ll see how to call a smart contract function from JavaScript. First is reading the state of a smart contract (for eg the balance of an ERC20 holder), then we’ll modify the state of the blockchain by making a token transfer. You should be already be familiar with setting up JS environement […]

blog Getting started javascript

How to deal with big numbers in Javascript

Most of numeric values in Solidity smart contracts are expressed using uint256, unfortunately Javascript numbers are always 64-bit floating point. Therefore when you call a function that returns an uint256 you’ll receive a string instead of a Javascript number. Moreover Solidity does not handle floating number so Eth and token amounts are expressed as unsigned […]