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 eightDecimals = 100000000
77
88 @Callable(i)
9-func makeSellVST (price) = {
10- let payment = extract(i.payment)
11- if ((payment.assetId != VSTAssetID))
12- then throw(("asset id must be " + toBase58String(VSTAssetID)))
13- else {
14- let orderId = ("sell_" + toBase58String(i.transactionId))
15- WriteSet([DataEntry((orderId + "_amount"), payment.amount), DataEntry((orderId + "_price"), price), DataEntry((orderId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((orderId + "_spent"), 0)])
16- }
17- }
9+func makeSellVST (price) = if ((0 >= price))
10+ then throw("price must be positive")
11+ else {
12+ let payment = extract(i.payment)
13+ if ((payment.assetId != VSTAssetID))
14+ then throw(("asset id must be " + toBase58String(VSTAssetID)))
15+ else {
16+ let orderId = ("sell_" + toBase58String(i.transactionId))
17+ WriteSet([DataEntry((orderId + "_amount"), payment.amount), DataEntry((orderId + "_price"), price), DataEntry((orderId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((orderId + "_spent"), 0)])
18+ }
19+ }
1820
1921
2022
2123 @Callable(i)
22-func makeBuyVST (price) = {
23- let payment = extract(i.payment)
24- if ((payment.assetId != unit))
25- then throw("asset id must be WAVES")
26- else {
27- let orderId = ("buy_" + toBase58String(i.transactionId))
28- WriteSet([DataEntry((orderId + "_amount"), ((payment.amount * price) / eightDecimals)), DataEntry((orderId + "_price"), price), DataEntry((orderId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((orderId + "_spent"), 0)])
29- }
30- }
24+func makeBuyVST (price) = if ((0 >= price))
25+ then throw("price must be positive")
26+ else {
27+ let payment = extract(i.payment)
28+ if ((payment.assetId != unit))
29+ then throw("asset id must be WAVES")
30+ else {
31+ let orderId = ("buy_" + toBase58String(i.transactionId))
32+ WriteSet([DataEntry((orderId + "_amount"), ((payment.amount * price) / eightDecimals)), DataEntry((orderId + "_price"), price), DataEntry((orderId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((orderId + "_spent"), 0)])
33+ }
34+ }
3135
3236
3337
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let VSTAssetID = base58'CjxKp2kfytghpfforkYLSoXHzJyJ5QYKLYQYgN7pQV4E'
55
66 let eightDecimals = 100000000
77
88 @Callable(i)
9-func makeSellVST (price) = {
10- let payment = extract(i.payment)
11- if ((payment.assetId != VSTAssetID))
12- then throw(("asset id must be " + toBase58String(VSTAssetID)))
13- else {
14- let orderId = ("sell_" + toBase58String(i.transactionId))
15- WriteSet([DataEntry((orderId + "_amount"), payment.amount), DataEntry((orderId + "_price"), price), DataEntry((orderId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((orderId + "_spent"), 0)])
16- }
17- }
9+func makeSellVST (price) = if ((0 >= price))
10+ then throw("price must be positive")
11+ else {
12+ let payment = extract(i.payment)
13+ if ((payment.assetId != VSTAssetID))
14+ then throw(("asset id must be " + toBase58String(VSTAssetID)))
15+ else {
16+ let orderId = ("sell_" + toBase58String(i.transactionId))
17+ WriteSet([DataEntry((orderId + "_amount"), payment.amount), DataEntry((orderId + "_price"), price), DataEntry((orderId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((orderId + "_spent"), 0)])
18+ }
19+ }
1820
1921
2022
2123 @Callable(i)
22-func makeBuyVST (price) = {
23- let payment = extract(i.payment)
24- if ((payment.assetId != unit))
25- then throw("asset id must be WAVES")
26- else {
27- let orderId = ("buy_" + toBase58String(i.transactionId))
28- WriteSet([DataEntry((orderId + "_amount"), ((payment.amount * price) / eightDecimals)), DataEntry((orderId + "_price"), price), DataEntry((orderId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((orderId + "_spent"), 0)])
29- }
30- }
24+func makeBuyVST (price) = if ((0 >= price))
25+ then throw("price must be positive")
26+ else {
27+ let payment = extract(i.payment)
28+ if ((payment.assetId != unit))
29+ then throw("asset id must be WAVES")
30+ else {
31+ let orderId = ("buy_" + toBase58String(i.transactionId))
32+ WriteSet([DataEntry((orderId + "_amount"), ((payment.amount * price) / eightDecimals)), DataEntry((orderId + "_price"), price), DataEntry((orderId + "_owner"), toBase58String(i.caller.bytes)), DataEntry((orderId + "_spent"), 0)])
33+ }
34+ }
3135
3236
3337
3438 @Callable(i)
3539 func takeSellVST (id) = {
3640 let orderId = ("sell_" + id)
3741 let payment = extract(i.payment)
3842 if ((payment.assetId != unit))
3943 then throw("asset must be WAVES")
4044 else {
4145 let price = getIntegerValue(this, (orderId + "_price"))
4246 let wavesAmount = payment.amount
4347 let vstAmount = ((wavesAmount * price) / eightDecimals)
4448 let amount = getIntegerValue(this, (orderId + "_amount"))
4549 let spent = getIntegerValue(this, (orderId + "_spent"))
4650 let newSpent = (spent + vstAmount)
4751 if ((newSpent > amount))
4852 then throw("not enougth asset in order")
4953 else ScriptResult(WriteSet([DataEntry((orderId + "_spent"), newSpent)]), TransferSet([ScriptTransfer(i.caller, vstAmount, VSTAssetID)]))
5054 }
5155 }
5256
5357
5458
5559 @Callable(i)
5660 func takeBuyVST (id) = {
5761 let orderId = ("buy_" + id)
5862 let payment = extract(i.payment)
5963 if ((payment.assetId != VSTAssetID))
6064 then throw(("asset must be " + toBase58String(VSTAssetID)))
6165 else {
6266 let price = getIntegerValue(this, (orderId + "_price"))
6367 let vstAmount = payment.amount
6468 let wavesAmount = ((vstAmount * eightDecimals) / price)
6569 let amount = getIntegerValue(this, (orderId + "_amount"))
6670 let spent = getIntegerValue(this, (orderId + "_spent"))
6771 let newSpent = (spent + vstAmount)
6872 if ((newSpent > amount))
6973 then throw("not enougth asset in order")
7074 else ScriptResult(WriteSet([DataEntry((orderId + "_spent"), newSpent)]), TransferSet([ScriptTransfer(i.caller, wavesAmount, unit)]))
7175 }
7276 }
7377
7478
7579
7680 @Callable(i)
7781 func returnBuyVST (id) = {
7882 let orderId = ("buy_" + id)
7983 let owner = getStringValue(this, (orderId + "_owner"))
8084 if ((owner != toBase58String(i.caller.bytes)))
8185 then throw("return should be called by order owner")
8286 else {
8387 let amount = getIntegerValue(this, (orderId + "_amount"))
8488 let spent = getIntegerValue(this, (orderId + "_spent"))
8589 let price = getIntegerValue(this, (orderId + "_price"))
8690 let returnAmount = (((amount - spent) * eightDecimals) / price)
8791 if ((0 >= returnAmount))
8892 then throw("nothing to return")
8993 else ScriptResult(WriteSet([DataEntry((orderId + "_spent"), amount)]), TransferSet([ScriptTransfer(i.caller, returnAmount, unit)]))
9094 }
9195 }
9296
9397
9498
9599 @Callable(i)
96100 func returnSellVST (id) = {
97101 let orderId = ("sell_" + id)
98102 let owner = getStringValue(this, (orderId + "_owner"))
99103 if ((owner != toBase58String(i.caller.bytes)))
100104 then throw("return should be called by order owner")
101105 else {
102106 let amount = getIntegerValue(this, (orderId + "_amount"))
103107 let spent = getIntegerValue(this, (orderId + "_spent"))
104108 let returnAmount = (amount - spent)
105109 if ((0 >= returnAmount))
106110 then throw("nothing to return")
107111 else ScriptResult(WriteSet([DataEntry((orderId + "_spent"), amount)]), TransferSet([ScriptTransfer(i.caller, returnAmount, VSTAssetID)]))
108112 }
109113 }
110114
111115

github/deemru/w8io/026f985 
35.40 ms