GithubHelp home page GithubHelp logo

flashloan's Introduction

flashLoan

闪电贷

学习第一笔闪电贷参考 https://github.com/wenzhenxiang/flashLoan/blob/main/hecoFirstFlash.sol

目前已支持heco链借贷三傻与xcom借贷平台的清算功能(只支持以下币种的借贷清算,hbtc,eth,husd,usdt,mdx,ht,hltc,hfil)

Xcom闪电贷清算合约地址: 0xAD7958B141fd151910A67e973A4e1173d38C5801
Xcom闪电贷清算合约abi文件: FlashLiquidationAdapter.json

借贷三傻闪电贷清算合约地址:
0x6524a87301129E3419ad8E1eC8d6A5Ef133d59B2
借贷三傻闪电贷清算合约abi文件:
CompflashLiquidationAdapter.json

清算方法: 通过abi及合约地址获取合约实例,例如flashLiquidationAdapter
然后执行Execute函数,参数为
struct LiquidationParams {
address collateralCtoken; // 清算抵押币的ctoken地址
address borrowedCtoken; // 清算贷款币的ctoken地址
address user; // 清算用户地址
uint256 debtToCover; // 清算额度
bool useEthPath; // mdex交易是否添加ht路径
}
参考如下
flashLiquidationAdapter.Execute(["0xB16Df14C53C4bcfF220F4314ebCe70183dD804c0","0x4937A83Dc1Fa982e435aeB0dB33C90937d54E424","0x42278EB6A4Ba1F79077a0F048E6d5f7713B8E6cc",'1000000000000', false]);

flashloan's People

Contributors

wenzhenxiang 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.