Git Product home page Git Product logo

buidlerdao-flashloan's Introduction

Buidler DAO 系列课程: 闪电贷基础

Kovan 水龙头

学习资料

  1. 闪电贷源码: https://github.com/Wiger123/BuidlerDao-FlashLoan
  2. 经典攻击复现: https://github.com/Rivaill/CryptoVulhub
  3. 闪电贷套利: https://github.com/paco0x/amm-arbitrageur
  4. Uniswap 闪电贷: https://medium.com/uv-labs/flash-swap-5bcdbd9aaa14

Basic Demo

  1. PPT 讲解
  2. Basic Demo: 写 => 编译 => 输入构造函数 0x506B0B2CF20FAA8f38a4E2B524EE43e1f4458Cc5 部署 => 验证合约 000000000000000000000000506b0b2cf20faa8f38a4e2b524ee43e1f4458cc5
  3. Kovan Etherscan 调用: https://kovan.etherscan.io/address/0xbAECCE8aC87fd22e93f682565B392B029071bd61
  4. 提前传入 DAI / AAVE / ... 作为手续费
  5. 输入参数: 0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD 1000000000000000000000
  6. 完成闪电贷 Basic Demo

Pro Demo

  1. TokenA: 0xdcD910430D64E00207D7B6aC0f3F7458F7464581; TokenB: 0x6DC4FD9335eF0F5fe10Db08D0dea8426808B087F
  2. 建立 3 个池子: DAI - Token1, Token1 - Token2, Token2 - DAI
  3. DAI => TokenA => TokenB
  4. 授权 => 交易
  5. 还钱 => 转移利润
  6. Kovan Etherscan 调用: https://kovan.etherscan.io/address/0x87288733ef6f556d22221ee05734e454daac38e4
  7. 输入参数: 0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD 1000000000000000000000
  8. 完成闪电贷 Pro Demo

地址

  1. DAI 合约地址 address public dai = 0xFf795577d9AC8bD7D90Ee22b6C1703490b6512FD;
  2. TokenA 合约地址 address public tokenA = 0xdcD910430D64E00207D7B6aC0f3F7458F7464581;
  3. TokenB 合约地址 address public tokenB = 0x6DC4FD9335eF0F5fe10Db08D0dea8426808B087F;
  4. Uniswap V2 路由地址 address public router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;

buidlerdao-flashloan's People

Contributors

wiger123 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.