tx · Bbvf8SFv4shNNvv65LJHF91jRFuMSs38xp85n8m71aSr 3N4j4poQ68qJBrhuNWSEdDNCPQJcC7Z9e4m: -0.01000000 Waves 2019.07.15 13:58 [586804] smart account 3N4j4poQ68qJBrhuNWSEdDNCPQJcC7Z9e4m > SELF 0.00000000 Waves
{ "type": 13, "id": "Bbvf8SFv4shNNvv65LJHF91jRFuMSs38xp85n8m71aSr", "fee": 1000000, "feeAssetId": null, "timestamp": 1563188346507, "version": 1, "sender": "3N4j4poQ68qJBrhuNWSEdDNCPQJcC7Z9e4m", "senderPublicKey": "3qCxYuqx9qgQR7omVbDA2X8zdeZjbxGDHLtQDo8iaoAx", "proofs": [ "4NsdmtJ3qoaAgbepS2jRn71QbTR49mkhe4t3Wso5rEznGp8tp59M83j6ZPfuJLzwNnJ7KX6xg9bPR6cX17uszCz4" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAQAAABJ1c2VySGFzQWRtaW5BY2Nlc3MAAAABAAAAB2FkZHJlc3MJAAAAAAAAAgUAAAAHYWRkcmVzcwUAAAAEdGhpcwEAAAAEYWRkcgAAAAIAAAAHdG9rZW5JZAAAAANwYXIJAAEsAAAAAgkAASwAAAACCQACWAAAAAEFAAAAB3Rva2VuSWQCAAAAAV8FAAAAA3BhcgEAAAAFc2FkZHIAAAACAAAAB3Rva2VuSWQAAAADcGFyCQABLAAAAAIJAAEsAAAAAgUAAAAHdG9rZW5JZAIAAAABXwUAAAADcGFyAAAAAwAAAAFpAQAAAANiZXQAAAABAAAADXRva2VuSWRTdHJpbmcEAAAAFnN0YXJ0VHJhbnNhY3Rpb25IZWlnaHQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMJAQAAAAVzYWRkcgAAAAIFAAAADXRva2VuSWRTdHJpbmcCAAAABXN0YXJ0BAAAAAl0aW1lRGVsdGEJAABlAAAAAgUAAAAGaGVpZ2h0BQAAABZzdGFydFRyYW5zYWN0aW9uSGVpZ2h0BAAAAAZtY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nBAAAAAZsZW5ndGgJAABlAAAAAgkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwkBAAAABGFkZHIAAAACBQAAAAd0b2tlbklkAgAAAAVzdGFydAUAAAAGaGVpZ2h0BAAAAAVkZWx0YQkAAGUAAAACCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzCQEAAAAEYWRkcgAAAAIFAAAAB3Rva2VuSWQCAAAACGR1cmF0aW9uBQAAAAZsZW5ndGgDCQAAZgAAAAIFAAAABWRlbHRhAAAAAAAAAAAACQAAAgAAAAEJAAEsAAAAAgkAASwAAAACAgAAACRUaGUgYXVjdGlvbiBjYW5ub3QgYmUgZmluaXNoZWQgeWV0ISAJAAGkAAAAAQUAAAAFZGVsdGECAAAAEiBtaW51dGVzIHJlbWFpbmluZwQAAAALbWF4QmV0T3duZXIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEJAAGbAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwkBAAAABGFkZHIAAAACBQAAAAd0b2tlbklkAgAAAAttYXhCZXRPd25lcgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAARhZGRyAAAAAgUAAAAHdG9rZW5JZAIAAAAFc3RhcnQAAAAAAAAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAttYXhCZXRPd25lcgAAAAAAAAAAAQUAAAAHdG9rZW5JZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAdTEb6+", "chainId": 84, "height": 586804, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
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 | + | if (isDefined(tokenId)) | |
39 | + | then WriteSet([DataEntry(addr(tokenId, "start"), height), DataEntry(addr(tokenId, "maxBet"), startPrice), DataEntry(addr(tokenId, "duration"), auctionDuration), DataEntry(addr(tokenId, "maxBetOwner"), toBase58String(i.callerPublicKey))]) | |
40 | + | else throw("You can't sell waves using the auction") | |
41 | + | } | |
42 | + | ||
43 | + | ||
44 | + | ||
45 | + | @Callable(i) | |
46 | + | func finish (tokenIdString) = { | |
47 | + | let tokenId = toBytes(tokenIdString) | |
48 | + | let length = (getIntegerValue(this, addr(tokenId, "start")) - height) | |
49 | + | let delta = (getIntegerValue(this, addr(tokenId, "duration")) - length) | |
50 | + | if ((delta > 0)) | |
51 | + | then throw((("The auction cannot be finished yet! " + toString(delta)) + " minutes remaining")) | |
52 | + | else { | |
53 | + | let maxBetOwner = addressFromPublicKey(toBytes(getStringValue(this, addr(tokenId, "maxBetOwner")))) | |
54 | + | ScriptResult(WriteSet([DataEntry(addr(tokenId, "start"), 0)]), TransferSet([ScriptTransfer(maxBetOwner, 1, tokenId)])) | |
55 | + | } | |
56 | + | } | |
57 | + | ||
58 | + | ||
59 | + | @Verifier(tx) | |
60 | + | func verify () = false | |
61 | + |
github/deemru/w8io/169f3d6 15.73 ms ◑