tx · 69gRJR44dwFc8RW4GUDkBzcuZz7z24gK9xjSk5ARBezC

3MvMqdK5nmEzymfm7KxxCknWTaArgYUkZ2P:  -0.01000000 Waves

2019.07.15 14:49 [586854] smart account 3MvMqdK5nmEzymfm7KxxCknWTaArgYUkZ2P > SELF 0.00000000 Waves

{ "type": 13, "id": "69gRJR44dwFc8RW4GUDkBzcuZz7z24gK9xjSk5ARBezC", "fee": 1000000, "feeAssetId": null, "timestamp": 1563191433244, "version": 1, "sender": "3MvMqdK5nmEzymfm7KxxCknWTaArgYUkZ2P", "senderPublicKey": "BFpB6wovvdntJni2i87fjFJ9SV3Dcg91WaTXYTjeFYs1", "proofs": [ "4WMdXZynmNGHBWM1Yd5FBW6fgiQPbKVXXmRs4WS4uFjKZsHqSPsawwjFgyrJQgyHEaAGVGeQbzDZZtwKXfXxeKxE" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAQAAABJ1c2VySGFzQWRtaW5BY2Nlc3MAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwEAAAAEYWRkcgAAAAIAAAAHdG9rZW5JZAAAAANwYXIJAAEsAAAAAgkAASwAAAACCQACWAAAAAEFAAAAB3Rva2VuSWQCAAAAAV8FAAAAA3BhcgEAAAAFc2FkZHIAAAACAAAAB3Rva2VuSWQAAAADcGFyCQABLAAAAAIJAAEsAAAAAgUAAAAHdG9rZW5JZAIAAAABXwUAAAADcGFyAAAAAwAAAAFpAQAAAANiZXQAAAABAAAADXRva2VuSWRTdHJpbmcEAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMJAQAAAAVzYWRkcgAAAAIFAAAADXRva2VuSWRTdHJpbmcCAAAABXN0YXJ0BAAAAAl0aW1lRGVsdGEJAABlAAAAAgUAAAAGaGVpZ2h0BQAAABZzdGFydFRyYW5zYWN0aW9uSGVpZ2h0BAAAAAZtY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oaXMJAQAAAARhZGRyAAAAAgUAAAAHdG9rZW5JZAIAAAALbWF4QmV0T3duZXIJAQAAAAxTY3JpcHRSZXN1bHQAAAACCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAEYWRkcgAAAAIFAAAAB3Rva2VuSWQCAAAABXN0YXJ0AAAAAAAAAAAABQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAALbWF4QmV0T3duZXIAAAAAAAAAAAEFAAAAB3Rva2VuSWQFAAAAA25pbAAAAAD5g5PZ", "chainId": 84, "height": 586854, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+func userHasAdminAccess (address) = (address == this)
5+
6+
7+func addr (tokenId,par) = ((toBase58String(tokenId) + "_") + par)
8+
9+
10+func saddr (tokenId,par) = ((tokenId + "_") + par)
11+
12+
13+@Callable(i)
14+func bet (tokenIdString) = {
15+ let startTransactionHeight = getIntegerValue(this, saddr(tokenIdString, "start"))
16+ let timeDelta = (height - startTransactionHeight)
17+ let maxBet = getIntegerValue(this, saddr(tokenIdString, "maxBet"))
18+ let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, saddr(tokenIdString, "maxBetOwner"))))
19+ let pmt = extract(i.payment)
20+ if ((timeDelta > getIntegerValue(this, saddr(tokenIdString, "duration"))))
21+ then throw("The betting was closed.")
22+ else if (!(isDefined(pmt.assetId)))
23+ then {
24+ let price = pmt.amount
25+ if ((price > maxBet))
26+ then ScriptResult(WriteSet([DataEntry(saddr(tokenIdString, "maxBet"), price), DataEntry(saddr(tokenIdString, "maxBetOwner"), toBase58String(i.callerPublicKey))]), TransferSet([ScriptTransfer(maxBetOwner, maxBet, unit)]))
27+ else throw("Your bet isn't the max bet")
28+ }
29+ else throw("You need to place a bet using waves currency")
30+ }
31+
32+
33+
34+@Callable(i)
35+func start (startPrice,auctionDuration) = {
36+ let pmt = extract(i.payment)
37+ let tokenId = extract(pmt.assetId)
38+ throw("alRight")
39+ }
40+
41+
42+
43+@Callable(i)
44+func finish (tokenIdString) = {
45+ let tokenId = toBytes(tokenIdString)
46+ let length = (getIntegerValue(this, addr(tokenId, "start")) - height)
47+ let delta = (getIntegerValue(this, addr(tokenId, "duration")) - length)
48+ if ((delta > 0))
49+ then throw((("The auction cannot be finished yet! " + toString(delta)) + " minutes remaining"))
50+ else {
51+ let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner"))))
52+ ScriptResult(WriteSet([DataEntry(addr(tokenId, "start"), 0)]), TransferSet([ScriptTransfer(maxBetOwner, 1, tokenId)]))
53+ }
54+ }
55+
56+

github/deemru/w8io/169f3d6 
16.27 ms