Tutorials for Building Smart Contracts Using Defi on Ethereum
This selection of tutorials will guide you on how to build smart contracts that interacts.
What you will learn
- Where tutorials for building smart contracts using defi on ethereum fits into an Ethereum application.
- Which assumptions should be tested before a mainnet deployment.
- What to read next when this concept is working.
This selection of tutorials will guide you on how to build smart contracts that interacts with the most popular decentralized finance (DeFi) protocols.
ERC20 Tokens
Understand the ERC20 token smart contract
Before relying on a protocol integration, separate code behavior from market risk with the plain-English DeFi contracts, liquidity, and oracle guide.
Interact with ERC20 tokens with your Solidity smart contract: building a simple DEX/ICO
Reading the balance and making transfers of ERC20 tokens in JS
Token settlement does not make a dollar claim risk-free. Review stablecoin issuance, collateral, and peg mechanics.
Reading Chainlink Oracles for currency prices using JavaScript.
Decentralized exchanges
Trading and Arbitrage on Ethereum DEXes: Get the rates for a token swap (part 1)
For observed exchange-price context rather than issuer reserve proof, use the USDT/USD and USDC/USD peg-tracking tool.
Making flash loans to access Ether or ERC20 inside of your transactions
Testing
Fork the Ethereum main net to test your code with live protocols
Data
Using The Graph to query indexed Ethereum application data
NFTs
Using NFT20 developer library to buy/sell NFTs programmatically
Turn the example into production evidence
A working demo is the beginning of verification, not the end. Add tests for failure paths, inspect every permission, and record the chain, contract address, compiler, and dependency versions used for the deployment.
Check behavior
Test expected inputs, boundary values, reverts, events, and calls made to other contracts.
Check operations
Plan key storage, monitoring, pause or upgrade authority, and a response if an assumption stops being true.