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:AAIDAAAAAAAAAAAAAAADAQAAAAtpc0FjdGl2YXRlZAAAAAAEAAAABHVzZXIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMCAAAABHVzZXIJAQAAAAIhPQAAAAIFAAAABHVzZXICAAAAAAEAAAAQdmVyaWZ5TWluRGVwb3NpdAAAAAAEAAAAB2RlcG9zaXQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAAB2RlcG9zaXQEAAAADnByaWNlUGVyTWludXRlCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzAgAAAA5wcmljZVBlck1pbnV0ZQQAAAALbWluaW11bVRpbWUJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMCAAAAC01pbmltdW1UaW1lCQAAZgAAAAIJAABpAAAAAgUAAAAHZGVwb3NpdAUAAAAOcHJpY2VQZXJNaW51dGUFAAAAC21pbmltdW1UaW1lAQAAABBpc1RpbWVMb2NrT3BlbmVkAAAAAQAAAAtjdXJyZW50VGltZQQAAAAJdGltZXN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IHRoZSByZW50ZXIAAAABaQEAAAAId2l0aGRyYXcAAAAAAwMJAQAAABBpc1RpbWVMb2NrT3BlbmVkAAAAAQgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAJAAAAAAAAAgUAAAAEdGhpcwgFAAAAAWkAAAAGY2FsbGVyBwQAAAAHZGVwb3NpdAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwIAAAAHZGVwb3NpdAkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAAB2RlcG9zaXQAAAAAAAAAAAAJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAICAAAABHVzZXICAAAAAAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAAJdGltZXN0YXJ0AgAAAAAFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVzcwAAAAEJAAGbAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwIAAAARd2l0aERyYXdhbEFkZHJlc3MFAAAAB2RlcG9zaXQFAAAABHVuaXQFAAAAA25pbAkAAAIAAAABAgAAADJ3aXRoZHJhdyByZWplY3RlZCBiZWNhdXNlIHRpbWVsb2NrIGlzIHN0aWxsIGFjdGl2ZQAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAGxA5azg==", "chainId": 84, "height": 666807, "spentComplexity": 0 } View: original | compacted Prev: C1SvhTHknh3aZp8PUhpMkFxrzGtSm9mDgyYiGFLiGQkh Next: CanczYRYLF9TgkCw4jLwbrr5S1AuNHq1REQyx3HsLNTp Diff:
OldNewDifferences
2424
2525
2626 @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))
3028 then WriteSet([DataEntry("pricePerMinute", 10000000), DataEntry("user", ""), DataEntry("timestart", ""), DataEntry("deposit", 0), DataEntry("withDrawAddress", "")])
3129 else throw("contract is already inited")
3230
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func a () = {
55 let b = getStringValue(this, "user")
66 (b != "")
77 }
88
99
1010 func c () = {
1111 let d = getIntegerValue(this, "deposit")
1212 let e = getIntegerValue(this, "pricePerMinute")
1313 let f = getIntegerValue(this, "MinimumTime")
1414 ((d / e) > f)
1515 }
1616
1717
1818 func g (h) = {
1919 let i = getIntegerValue(this, "timestart")
2020 let e = getIntegerValue(this, "pricePerMinute")
2121 let d = getIntegerValue(this, "deposit")
2222 ((h - i) > (d / e))
2323 }
2424
2525
2626 @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))
3028 then WriteSet([DataEntry("pricePerMinute", 10000000), DataEntry("user", ""), DataEntry("timestart", ""), DataEntry("deposit", 0), DataEntry("withDrawAddress", "")])
3129 else throw("contract is already inited")
3230
3331
3432
3533 @Callable(j)
3634 func activate (d,k) = if (a())
3735 then throw("The scooter is already activated")
3836 else if (!(c()))
3937 then throw("Your deposit should be for 30 minutes minimum")
4038 else WriteSet([DataEntry("deposit", d), DataEntry("user", k), DataEntry("timestart", lastBlock.timestamp)])
4139
4240
4341
4442 @Callable(j)
4543 func payAndStop (l) = {
4644 let m = addressFromPublicKey(toBytes(getStringValue(this, "user")))
4745 let n = getStringValue(this, "withdrawal")
4846 let d = getIntegerValue(this, "deposit")
4947 let o = (d - l)
5048 if ((j.caller == m))
5149 then TransferSet([ScriptTransfer(m, o, unit), ScriptTransfer(Address(toBytes(n)), l, unit)])
5250 else throw("not the adress of the renter")
5351 }
5452
5553
5654
5755 @Callable(j)
5856 func withdraw () = if (if (g(lastBlock.timestamp))
5957 then (this == j.caller)
6058 else false)
6159 then {
6260 let d = getIntegerValue(this, "deposit")
6361 ScriptResult(WriteSet([DataEntry("deposit", 0), DataEntry("user", ""), DataEntry("timestart", "")]), TransferSet([ScriptTransfer(Address(toBytes(getStringValue(this, "withDrawalAddress"))), d, unit)]))
6462 }
6563 else throw("withdraw rejected because timelock is still active")
6664
6765
6866 @Verifier(p)
6967 func q () = true
7068

github/deemru/w8io/169f3d6 
44.70 ms