tx · GjbDVL2zfsGX1tmivudb6dFrgZyC3p4Q3N9sDX9XDo6t 3MwRiKHmomSqxzrws6x5KYLtgnaBM1hhnRk: -0.01400000 Waves 2019.09.08 10:28 [666807] smart account 3MwRiKHmomSqxzrws6x5KYLtgnaBM1hhnRk > SELF 0.00000000 Waves
{ "type": 13, "id": "GjbDVL2zfsGX1tmivudb6dFrgZyC3p4Q3N9sDX9XDo6t", "fee": 1400000, "feeAssetId": null, "timestamp": 1567927739222, "version": 1, "sender": "3MwRiKHmomSqxzrws6x5KYLtgnaBM1hhnRk", "senderPublicKey": "4zBZb7taw23PGE9E91m2Kav1ZZGExTVYZkrxt8aPUtRt", "proofs": [ "2g11hUDDeFxZky5kkZsj8qW79Nqcg1YUacNKWHb2o7pMLZBpnZF9c2gU14i4gHS7SegewWhVcf2vUGHP9mJbLZrp" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAQAAAAtpc0FjdGl2YXRlZAAAAAAEAAAABHVzZXIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAABHVzZXIJAQAAAAIhPQAAAAIFAAAABHVzZXICAAAAAAEAAAAQdmVyaWZ5TWluRGVwb3NpdAAAAAAEAAAAB2RlcG9zaXQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAAB2RlcG9zaXQEAAAADnByaWNlUGVyTWludXRlCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAAA5wcmljZVBlck1pbnV0ZQQAAAALbWluaW11bVRpbWUJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAAC01pbmltdW1UaW1lCQAAZgAAAAIJAABpAAAAAgUAAAAHZGVwb3NpdAUAAAAOcHJpY2VQZXJNaW51dGUFAAAAC21pbmltdW1UaW1lAQAAABBpc1RpbWVMb2NrT3BlbmVkAAAAAQAAAAtjdXJyZW50VGltZQQAAAAJdGltZXN0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HRoZSByZW50ZXIAAAABaQEAAAAId2l0aGRyYXcAAAAAAwMJAQAAABBpc1RpbWVMb2NrT3BlbmVkAAAAAQgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAJAAAAAAAAAgUAAAAEdGhpcwgFAAAAAWkAAAAGY2FsbGVyBwQAAAAHZGVwb3NpdAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAHZGVwb3NpdAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAAB2RlcG9zaXQAAAAAAAAAAAAJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABHVzZXICAAAAAAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAJdGltZXN0YXJ0AgAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVzcwAAAAEJAAGbAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAARd2l0aERyYXdhbEFkZHJlc3MFAAAAB2RlcG9zaXQFAAAABHVuaXQFAAAAA25pbAkAAAIAAAABAgAAADJ3aXRoZHJhdyByZWplY3RlZCBiZWNhdXNlIHRpbWVsb2NrIGlzIHN0aWxsIGFjdGl2ZQAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAGxA5azg==", "chainId": 84, "height": 666807, "spentComplexity": 0 } View: original | compacted Prev: C1SvhTHknh3aZp8PUhpMkFxrzGtSm9mDgyYiGFLiGQkh Next: CanczYRYLF9TgkCw4jLwbrr5S1AuNHq1REQyx3HsLNTp Diff:
Old | New | Differences | |
---|---|---|---|
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(j) | |
27 | - | func init () = if (if ((this == j.caller)) | |
28 | - | then !(isDefined(getInteger(this, "pricePerMinute"))) | |
29 | - | else false) | |
27 | + | func init () = if ((this == j.caller)) | |
30 | 28 | then WriteSet([DataEntry("pricePerMinute", 10000000), DataEntry("user", ""), DataEntry("timestart", ""), DataEntry("deposit", 0), DataEntry("withDrawAddress", "")]) | |
31 | 29 | else throw("contract is already inited") | |
32 | 30 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func a () = { | |
5 | 5 | let b = getStringValue(this, "user") | |
6 | 6 | (b != "") | |
7 | 7 | } | |
8 | 8 | ||
9 | 9 | ||
10 | 10 | func c () = { | |
11 | 11 | let d = getIntegerValue(this, "deposit") | |
12 | 12 | let e = getIntegerValue(this, "pricePerMinute") | |
13 | 13 | let f = getIntegerValue(this, "MinimumTime") | |
14 | 14 | ((d / e) > f) | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | func g (h) = { | |
19 | 19 | let i = getIntegerValue(this, "timestart") | |
20 | 20 | let e = getIntegerValue(this, "pricePerMinute") | |
21 | 21 | let d = getIntegerValue(this, "deposit") | |
22 | 22 | ((h - i) > (d / e)) | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(j) | |
27 | - | func init () = if (if ((this == j.caller)) | |
28 | - | then !(isDefined(getInteger(this, "pricePerMinute"))) | |
29 | - | else false) | |
27 | + | func init () = if ((this == j.caller)) | |
30 | 28 | then WriteSet([DataEntry("pricePerMinute", 10000000), DataEntry("user", ""), DataEntry("timestart", ""), DataEntry("deposit", 0), DataEntry("withDrawAddress", "")]) | |
31 | 29 | else throw("contract is already inited") | |
32 | 30 | ||
33 | 31 | ||
34 | 32 | ||
35 | 33 | @Callable(j) | |
36 | 34 | func activate (d,k) = if (a()) | |
37 | 35 | then throw("The scooter is already activated") | |
38 | 36 | else if (!(c())) | |
39 | 37 | then throw("Your deposit should be for 30 minutes minimum") | |
40 | 38 | else WriteSet([DataEntry("deposit", d), DataEntry("user", k), DataEntry("timestart", lastBlock.timestamp)]) | |
41 | 39 | ||
42 | 40 | ||
43 | 41 | ||
44 | 42 | @Callable(j) | |
45 | 43 | func payAndStop (l) = { | |
46 | 44 | let m = addressFromPublicKey(toBytes(getStringValue(this, "user"))) | |
47 | 45 | let n = getStringValue(this, "withdrawal") | |
48 | 46 | let d = getIntegerValue(this, "deposit") | |
49 | 47 | let o = (d - l) | |
50 | 48 | if ((j.caller == m)) | |
51 | 49 | then TransferSet([ScriptTransfer(m, o, unit), ScriptTransfer(Address(toBytes(n)), l, unit)]) | |
52 | 50 | else throw("not the adress of the renter") | |
53 | 51 | } | |
54 | 52 | ||
55 | 53 | ||
56 | 54 | ||
57 | 55 | @Callable(j) | |
58 | 56 | func withdraw () = if (if (g(lastBlock.timestamp)) | |
59 | 57 | then (this == j.caller) | |
60 | 58 | else false) | |
61 | 59 | then { | |
62 | 60 | let d = getIntegerValue(this, "deposit") | |
63 | 61 | ScriptResult(WriteSet([DataEntry("deposit", 0), DataEntry("user", ""), DataEntry("timestart", "")]), TransferSet([ScriptTransfer(Address(toBytes(getStringValue(this, "withDrawalAddress"))), d, unit)])) | |
64 | 62 | } | |
65 | 63 | else throw("withdraw rejected because timelock is still active") | |
66 | 64 | ||
67 | 65 | ||
68 | 66 | @Verifier(p) | |
69 | 67 | func q () = true | |
70 | 68 |
github/deemru/w8io/169f3d6 44.70 ms ◑