一个EOS主链上基于Bancor协议的去中心化交易所智能合约
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
build.sh
eosbancor.abi
exchange.cpp
exchange.hpp
market.cpp
market.hpp

README.md

eosbancor

一个基于Bancor协议的去中心化交易所智能合约

清空数据库

cleos  transfer dddddddadmin  ddddcontract  '0.0001 EOS' 'opt=clear_db'

创建市场

cleos transfer dddddddadmin  ddddcontract  '100.0000 EOS' ''
cleos push action dddddddadmin transfer '["dddddddadmin", "ddddcontract", "1000.0000 USD", "" ]' -p dddddddadmin
cleos push action dddddddadmin transfer '["dddddddadmin", "ddddcontract", "0.0001 USD", "opt=create_market&eos_amount=1000000&token_amount=10000000" ]' -p dddddddadmin

打开市场

cleos push action dddddddadmin transfer '["dddddddadmin", "ddddcontract", "0.0001 USD", "opt=open_market" ]' -p dddddddadmin

买USD

cleos  transfer ddddddduser1  ddddcontract  '2.0000 EOS' 'USD'

卖 USD

cleos push action dddddddadmin transfer '["ddddddduser2", "ddddcontract", "1.0000 USD", "" ]' -p ddddddduser2

提取手续费

cleos  transfer dddddddadmin  ddddcontract  '0.0001 EOS' 'opt=take_fee&limit=1'