Giter Site home page Giter Site logo

flashloantest's Introduction

flashloantest 介绍

flash loan on EOS network, you can loan eos in one transaction without collateral. here are some flash loan test units

flashloantest编译部署

依赖环境

  1. eosio.cdt --- branch: release/1.5.x 或以上
  2. eosio.contract --- tag: v1.5.2 或以上

编译

1. 将flashloantest目录放入eosio.contracts内,跟eosio.token同级即可。

2. 编辑文件 eosio.contracts/CMakeLists.txt:

add_subdirectory(flashloantest)

3. 运行eosio.contracts/build.sh完成编译

./build.sh

部署

//创建合约帐号
cleos -u 'http://kylin.meet.one:8888' system newaccount itokenpocket flashloan22t EOS61Lv9AArofgBUhE4JKtJ5zJrLdRbNBwgPc5sWsxMNT6HtNm5py EOS8gE7XgUVLmF8CN9CCixNaVGFzbxvagVdMm6pqP47eMpuRMUDx8 --buy-ram '20.0000 EOS' --stake-net '3.0000 EOS' --stake-cpu '20.0000 EOS'
//授权
cleos -u 'http://kylin.meet.one:8888' set account permission flashloan22t active '{"threshold": 1,"keys": [{"key": "EOS8gE7XgUVLmF8CN9CCixNaVGFzbxvagVdMm6pqP47eMpuRMUDx8", "weight": 1}],"accounts": [{"permission":{"actor":"flashloan22t","permission":"eosio.code"},"weight":1}]}' owner -p flashloan22t@owner

cd build
cleos -u 'http://kylin.meet.one:8888' set contract flashloan22t ./flashloantest -p flashloan22t

flashloantest测试

充值

cleos -u 'http://kylin.meet.one:8888' push action eosio.token transfer '["tokenfletest", "flashloana25", "10.0000 EOS", "deposit:1"]' -p tokenfletest
cleos -u 'http://kylin.meet.one:8888' push action eosio.token transfer '["tokenfletes1", "flashloana25", "3.0000 EOS", "deposit:1"]' -p tokenfletes1

赎回

cleos -u 'http://kylin.meet.one:8888' get currency balance flashloant25 tokenfletest TEOS
cleos -u 'http://kylin.meet.one:8888' push action flashloant25 transfer '["tokenfletest", "flashloana25", "10.0000 TEOS", "redeem:1"]' -p tokenfletest

触发借贷

cleos -u 'http://kylin.meet.one:8888' push action eosio.token transfer '["itokenpocket", "flashloan22t", "20.0000 EOS", ""]' -p itokenpocket
cleos -u 'http://kylin.meet.one:8888' push action flashloan22t testfloan '["1.0000 EOS"]' -p flashloan22t

flashloantest's People

Contributors

heipacker avatar

Forkers

drzedd42

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.