Interface | Params |
---|---|
add_bancor1_pair | [
"ratio",
"main_supply",
"main_sym",
"main_unit",
"main_fee",
"sub_supply",
"sub_sym",
"sub_unit",
"sub_fee"
] |
add_product_pair | [] |
init | [] |
rm_pair | [
"a",
"b",
"c"
] |
swap_bancor1_pair | [
"from_sym",
"from_amount",
"to_sym",
"to_amount"
] |
swap_product_pair | [
"from_sym",
"from_amount",
"to_sym",
"to_amount"
] |
Method | Caller | Call time | Transaction |
---|---|---|---|
stake_cfs |
2021-03-03 07:22:14
| ||
draw_cash |
2021-03-03 07:19:48
| ||
stake_cash |
2021-03-03 07:19:38
| ||
stake_cfs |
2021-03-03 00:26:52
| ||
stake_cfs |
2021-03-02 23:21:12
| ||
draw_cash |
2021-03-02 23:20:00
| ||
draw_cash |
2021-03-02 23:19:22
| ||
stake_cfs |
2021-03-02 20:47:38
| ||
draw_cros_mine |
2021-03-02 20:47:14
| ||
stake_cfs |
2021-03-02 20:12:30
| ||
stake_cfs |
2021-03-02 17:27:24
| ||
stake_cfs |
2021-03-02 15:59:10
| ||
draw_cfs |
2021-03-02 15:56:22
| ||
draw_cfs |
2021-03-02 15:56:18
| ||
stake_cash |
2021-03-02 15:47:18
| ||
draw_cash |
2021-03-02 15:46:30
| ||
draw_cfs |
2021-03-02 15:03:52
| ||
draw_cfs |
2021-03-02 15:03:48
| ||
draw_cash |
2021-03-02 15:03:38
| ||
draw_cfs |
2021-03-02 12:17:52
|
function init()
assert(chainhelper:is_owner(),'no auth')
chainhelper:read_chain()
if public_data == nil then
public_data = {}
public_data.bancor1_table={}
public_data.product1_table={}
end
public_data.a=5
chainhelper:write_chain()
end
function add_bancor1_pair(ratio,main_supply,main_sym,main_unit,main_fee, sub_supply,sub_sym,sub_unit,sub_fee)
chainhelper:read_chain()
for inx,trade_pair in pairs(public_data.bancor1_table) do
if(trade_pair.main_sym==main_sym and trade_pair.sub_sym==sub_sym) then
assert(false,'pair already exists')
end
if(trade_pair.main_sym==sub_sym and trade_pair.sub_sym==main_sym) then
assert(false,'pair already exists')
end
end
trade_pair = {}
trade_pair.ratio=ratio
trade_pair.price=main_supply/(sub_supply*ratio)
trade_pair.main_supply=main_supply
trade_pair.main_sym=main_sym
trade_pair.main_unit=main_unit
trade_pair.main_fee=main_fee
trade_pair.sub_supply=sub_supply
trade_pair.sub_sym=sub_sym
trade_pair.sub_unit=sub_unit
trade_pair.sub_fee=sub_fee
trade_pair.main_mask=0
trade_pair.sub_mask=0
trade_pair.share_keys=0
table.insert(public_data.bancor1_table, trade_pair)
chainhelper:write_chain()
end
function add_product_pair()
end
local function test1(a)
public_data.a=public_data.a+a
end
local function test2(a)
public_data.a=public_data.a+a
end
function rm_pair(a,b,c)
chainhelper:read_chain()
public_data.a=a
for i = 1, 10 do
chainhelper:read_chain()
test1(b)
test2(c)
chainhelper:write_chain()
end
chainhelper:write_chain()
end
function swap_bancor1_pair(from_sym,from_amount,to_sym,to_amount)
end
function swap_product_pair(from_sym,from_amount,to_sym,to_amount)
end