- eosio.cdt --- branch: release/1.5.x 或以上
- eosio.contract --- tag: v1.5.2 或以上
1. 将flashloantest目录放入eosio.contracts内。
2. 编辑文件 eosio.contracts/CMakeLists.txt:
add_subdirectory(flashloantest)
3. 运行eosio.contracts/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'
cd build
cleos -u 'http://kylin.meet.one:8888' set contract flashloan22t ./flashloantest -p flashloan22t
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
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