tx · ECMx6uzT9saTaxjDdHWmqWSdMQW8EPTvK3RCuD75K7mu

3Mv3BEQ8WS2wzrEXuSfxDm7U9UKb5qLSnUc:  -0.01400000 Waves

2019.08.10 15:52 [624949] smart account 3Mv3BEQ8WS2wzrEXuSfxDm7U9UKb5qLSnUc > SELF 0.00000000 Waves

{ "type": 13, "id": "ECMx6uzT9saTaxjDdHWmqWSdMQW8EPTvK3RCuD75K7mu", "fee": 1400000, "feeAssetId": null, "timestamp": 1565441553374, "version": 1, "sender": "3Mv3BEQ8WS2wzrEXuSfxDm7U9UKb5qLSnUc", "senderPublicKey": "BoKgJQhf9RWMmneqYEhyMKeUXMCYRJRhaBTDd2w1Rtx", "proofs": [ "38CnGyuRu6bthaw13VhJrHnHANje6sz9sXwKu9YhogXnKJ8ahYHXaSCDaPoiJJkTdWTjq2RQLj8giVVG4uogeVPg" ], "script": "base64:AAIDAAAAAAAAAAAAAAACAAAAAApWU1RBc3NldElEAQAAACCucYFuBYSotpFz1qoINfKJVo0JlR9XCghLbxw/TM2XswAAAAANZWlnaHREZWNpbWFscwAAAAAABfXhAAAAAAYAAAABaQEAAAALbWFrZVNlbGxWU1QAAAABAAAABXByaWNlAwkAAGcAAAACAAAAAAAAAAAABQAAAAVwcmljZQkAAAIAAAABAgAAABZwcmljZSBtdXN0IGJlIHBvc2l0aXZlBAAAAAdwYXltZW50CQEAAAAHZXh0cmFjdAAAAAEIBQAAAAFpAAAAB3BheW1lbnQDCQEAAAACIT0AAAACCAUAAAAHcGF5bWVudAAAAAdhc3NldElkBQAAAApWU1RBc3NldElECQAAAgAAAAEJAAEsAAAAAgIAAAARYXNzZXQgaWQgbXVzdCBiZSAJAAJYAAAAAQUAAAAKVlNUQXNzZXRJRAQAAAAHb3JkZXJJZAkAASwAAAACAgAAAAVzZWxsXwkAAlgAAAABCAUAAAABaQAAAA10cmFuc2FjdGlvbklkCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAAC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B0byByZXR1cm4JAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAAB29yZGVySWQCAAAABl9zcGVudAUAAAAGYW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAAxyZXR1cm5BbW91bnQFAAAAClZTVEFzc2V0SUQFAAAAA25pbAAAAADPvwYJ", "chainId": 84, "height": 624949, "spentComplexity": 0 } View: original | compacted Prev: ERez6Q6cANpEW59DejHKMXyjFddobRj7GRrpRBimVqNb Next: 98aJXBwkB6LwXbGfASM3CZZVzreBYBFA1Eghu4HVYD85 Diff:
OldNewDifferences
66 let b = 100000000
77
88 @Callable(c)
9-func makeSellVST (d) = {
10- let e = extract(c.payment)
11- if ((e.assetId != a))
12- then throw(("asset id must be " + toBase58String(a)))
13- else {
14- let f = ("sell_" + toBase58String(c.transactionId))
15- WriteSet([DataEntry((f + "_amount"), e.amount), DataEntry((f + "_price"), d), DataEntry((f + "_owner"), toBase58String(c.caller.bytes)), DataEntry((f + "_spent"), 0)])
16- }
17- }
9+func makeSellVST (d) = if ((0 >= d))
10+ then throw("price must be positive")
11+ else {
12+ let e = extract(c.payment)
13+ if ((e.assetId != a))
14+ then throw(("asset id must be " + toBase58String(a)))
15+ else {
16+ let f = ("sell_" + toBase58String(c.transactionId))
17+ WriteSet([DataEntry((f + "_amount"), e.amount), DataEntry((f + "_price"), d), DataEntry((f + "_owner"), toBase58String(c.caller.bytes)), DataEntry((f + "_spent"), 0)])
18+ }
19+ }
1820
1921
2022
2123 @Callable(c)
22-func makeBuyVST (d) = {
23- let e = extract(c.payment)
24- if ((e.assetId != unit))
25- then throw("asset id must be WAVES")
26- else {
27- let f = ("buy_" + toBase58String(c.transactionId))
28- WriteSet([DataEntry((f + "_amount"), ((e.amount * d) / b)), DataEntry((f + "_price"), d), DataEntry((f + "_owner"), toBase58String(c.caller.bytes)), DataEntry((f + "_spent"), 0)])
29- }
30- }
24+func makeBuyVST (d) = if ((0 >= d))
25+ then throw("price must be positive")
26+ else {
27+ let e = extract(c.payment)
28+ if ((e.assetId != unit))
29+ then throw("asset id must be WAVES")
30+ else {
31+ let f = ("buy_" + toBase58String(c.transactionId))
32+ WriteSet([DataEntry((f + "_amount"), ((e.amount * d) / b)), DataEntry((f + "_price"), d), DataEntry((f + "_owner"), toBase58String(c.caller.bytes)), DataEntry((f + "_spent"), 0)])
33+ }
34+ }
3135
3236
3337
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let a = base58'CjxKp2kfytghpfforkYLSoXHzJyJ5QYKLYQYgN7pQV4E'
55
66 let b = 100000000
77
88 @Callable(c)
9-func makeSellVST (d) = {
10- let e = extract(c.payment)
11- if ((e.assetId != a))
12- then throw(("asset id must be " + toBase58String(a)))
13- else {
14- let f = ("sell_" + toBase58String(c.transactionId))
15- WriteSet([DataEntry((f + "_amount"), e.amount), DataEntry((f + "_price"), d), DataEntry((f + "_owner"), toBase58String(c.caller.bytes)), DataEntry((f + "_spent"), 0)])
16- }
17- }
9+func makeSellVST (d) = if ((0 >= d))
10+ then throw("price must be positive")
11+ else {
12+ let e = extract(c.payment)
13+ if ((e.assetId != a))
14+ then throw(("asset id must be " + toBase58String(a)))
15+ else {
16+ let f = ("sell_" + toBase58String(c.transactionId))
17+ WriteSet([DataEntry((f + "_amount"), e.amount), DataEntry((f + "_price"), d), DataEntry((f + "_owner"), toBase58String(c.caller.bytes)), DataEntry((f + "_spent"), 0)])
18+ }
19+ }
1820
1921
2022
2123 @Callable(c)
22-func makeBuyVST (d) = {
23- let e = extract(c.payment)
24- if ((e.assetId != unit))
25- then throw("asset id must be WAVES")
26- else {
27- let f = ("buy_" + toBase58String(c.transactionId))
28- WriteSet([DataEntry((f + "_amount"), ((e.amount * d) / b)), DataEntry((f + "_price"), d), DataEntry((f + "_owner"), toBase58String(c.caller.bytes)), DataEntry((f + "_spent"), 0)])
29- }
30- }
24+func makeBuyVST (d) = if ((0 >= d))
25+ then throw("price must be positive")
26+ else {
27+ let e = extract(c.payment)
28+ if ((e.assetId != unit))
29+ then throw("asset id must be WAVES")
30+ else {
31+ let f = ("buy_" + toBase58String(c.transactionId))
32+ WriteSet([DataEntry((f + "_amount"), ((e.amount * d) / b)), DataEntry((f + "_price"), d), DataEntry((f + "_owner"), toBase58String(c.caller.bytes)), DataEntry((f + "_spent"), 0)])
33+ }
34+ }
3135
3236
3337
3438 @Callable(c)
3539 func takeSellVST (g) = {
3640 let f = ("sell_" + g)
3741 let e = extract(c.payment)
3842 if ((e.assetId != unit))
3943 then throw("asset must be WAVES")
4044 else {
4145 let d = getIntegerValue(this, (f + "_price"))
4246 let h = e.amount
4347 let i = ((h * d) / b)
4448 let j = getIntegerValue(this, (f + "_amount"))
4549 let k = getIntegerValue(this, (f + "_spent"))
4650 let l = (k + i)
4751 if ((l > j))
4852 then throw("not enougth asset in order")
4953 else ScriptResult(WriteSet([DataEntry((f + "_spent"), l)]), TransferSet([ScriptTransfer(c.caller, i, a)]))
5054 }
5155 }
5256
5357
5458
5559 @Callable(c)
5660 func takeBuyVST (g) = {
5761 let f = ("buy_" + g)
5862 let e = extract(c.payment)
5963 if ((e.assetId != a))
6064 then throw(("asset must be " + toBase58String(a)))
6165 else {
6266 let d = getIntegerValue(this, (f + "_price"))
6367 let i = e.amount
6468 let h = ((i * b) / d)
6569 let j = getIntegerValue(this, (f + "_amount"))
6670 let k = getIntegerValue(this, (f + "_spent"))
6771 let l = (k + i)
6872 if ((l > j))
6973 then throw("not enougth asset in order")
7074 else ScriptResult(WriteSet([DataEntry((f + "_spent"), l)]), TransferSet([ScriptTransfer(c.caller, h, unit)]))
7175 }
7276 }
7377
7478
7579
7680 @Callable(c)
7781 func returnBuyVST (g) = {
7882 let f = ("buy_" + g)
7983 let m = getStringValue(this, (f + "_owner"))
8084 if ((m != toBase58String(c.caller.bytes)))
8185 then throw("return should be called by order owner")
8286 else {
8387 let j = getIntegerValue(this, (f + "_amount"))
8488 let k = getIntegerValue(this, (f + "_spent"))
8589 let d = getIntegerValue(this, (f + "_price"))
8690 let n = (((j - k) * b) / d)
8791 if ((0 >= n))
8892 then throw("nothing to return")
8993 else ScriptResult(WriteSet([DataEntry((f + "_spent"), j)]), TransferSet([ScriptTransfer(c.caller, n, unit)]))
9094 }
9195 }
9296
9397
9498
9599 @Callable(c)
96100 func returnSellVST (g) = {
97101 let f = ("sell_" + g)
98102 let m = getStringValue(this, (f + "_owner"))
99103 if ((m != toBase58String(c.caller.bytes)))
100104 then throw("return should be called by order owner")
101105 else {
102106 let j = getIntegerValue(this, (f + "_amount"))
103107 let k = getIntegerValue(this, (f + "_spent"))
104108 let n = (j - k)
105109 if ((0 >= n))
106110 then throw("nothing to return")
107111 else ScriptResult(WriteSet([DataEntry((f + "_spent"), j)]), TransferSet([ScriptTransfer(c.caller, n, a)]))
108112 }
109113 }
110114
111115

github/deemru/w8io/026f985 
36.39 ms