tx · 3FDc8DWkU3aGmDiMq5BjhMLCRYbeSN3w45vQ8bjGy6Go 3N1kVqVL4USL4Uoy2dEN6Rqk2pXhQgfsqUN: -0.01400000 Waves 2019.09.18 02:40 [680927] smart account 3N1kVqVL4USL4Uoy2dEN6Rqk2pXhQgfsqUN > SELF 0.00000000 Waves
{ "type": 13, "id": "3FDc8DWkU3aGmDiMq5BjhMLCRYbeSN3w45vQ8bjGy6Go", "fee": 1400000, "feeAssetId": null, "timestamp": 1568763664965, "version": 1, "sender": "3N1kVqVL4USL4Uoy2dEN6Rqk2pXhQgfsqUN", "senderPublicKey": "6qNq3Wug6srPUuAQrggzvR3nvagzN3AzsR4fABCH1qMm", "proofs": [ "4AF5rnJsKbmw5k96CvprcRNrjX2DzwcCVZVdpNa1ySHmTRkrk8xpYMcHbCwpUw3exuAQ7tAmG2FkJ9RLQqEh5fGD" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAwAAAAFpAQAAAAZjcmVhdGUAAAABAAAAAnBrBAAAAAdwYXltZW50CQEAAAATdmFsdWVPckVycm9yTWVzc2FnZQAAAAIIBQAAAAFpAAAAB3BheW1lbnQCAAAAE1doZXJlIGlzIGEgcGF5bWVudD8DCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAB3BheW1lbnQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACRZb3UgY2FuIHVzZSBvbmx5IFdBVkVTIGF0IHRoZSBtb21lbnQEAAAACmNvZGVFeGlzdHMEAAAAByRtYXRjaDAJAAQbAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAJwawIAAAAFX3VzZWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAB0Jvb2xlYW4EAAAAAWIFAAAAByRtYXRjaDAJAQAAAAEhAAAAAQUAAAABYgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAcJAQAAAAV0aHJvdwAAAAADBQAAAApjb2RlRXhpc3RzCQAAAgAAAAECAAAAD1RoZSBjb2RlI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sZXIFAAAABmFtb3VudAUAAAAEdW5pdAUAAAADbmlsAAAAAWkBAAAABHRlc3QAAAAACQAAAgAAAAEJAAGkAAAAAQgFAAAACWxhc3RCbG9jawAAAAl0aW1lc3RhbXAAAAAAJSmoDg==", "chainId": 84, "height": 680927, "spentComplexity": 0 } View: original | compacted Prev: BGB7PLb3ER7WNHsrj4QHnZrEXMDBEhRgiZ24uW5HXizg Next: none Diff:
Old | New | Differences | |
---|---|---|---|
30 | 30 | let codeUsed = valueOrErrorMessage(getBoolean(this, (pk + "_used")), "The code doesn't exist") | |
31 | 31 | if (codeUsed) | |
32 | 32 | then throw("The code has already been used") | |
33 | - | else if (if ((i.fee > 500000)) | |
34 | - | then true | |
35 | - | else (i.feeAssetId != unit)) | |
36 | - | then throw("Fee must be less than or equal to 0.005 WAVES") | |
33 | + | else if ((i.feeAssetId != unit)) | |
34 | + | then throw("Fee must be in WAVES") | |
37 | 35 | else { | |
38 | 36 | let valid = sigVerify(i.callerPublicKey, fromBase58String(sig), fromBase58String(pk)) | |
39 | 37 | if (!(valid)) | |
40 | 38 | then throw("Invalid code") | |
41 | 39 | else { | |
42 | 40 | let amount = getIntegerValue(this, (pk + "_amount")) | |
43 | - | ScriptResult(WriteSet([DataEntry((pk + "_used"), true)]), TransferSet([ScriptTransfer(i.caller, | |
41 | + | ScriptResult(WriteSet([DataEntry((pk + "_used"), true)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
44 | 42 | } | |
45 | 43 | } | |
46 | 44 | } | |
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | @Callable(i) | |
49 | + | func test () = throw(toString(lastBlock.timestamp)) | |
47 | 50 | ||
48 | 51 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func create (pk) = { | |
8 | 8 | let payment = valueOrErrorMessage(i.payment, "Where is a payment?") | |
9 | 9 | if (isDefined(payment.assetId)) | |
10 | 10 | then throw("You can use only WAVES at the moment") | |
11 | 11 | else { | |
12 | 12 | let codeExists = match getBoolean(this, (pk + "_used")) { | |
13 | 13 | case b: Boolean => | |
14 | 14 | !(b) | |
15 | 15 | case _: Unit => | |
16 | 16 | false | |
17 | 17 | case _ => | |
18 | 18 | throw() | |
19 | 19 | } | |
20 | 20 | if (codeExists) | |
21 | 21 | then throw("The code exists") | |
22 | 22 | else WriteSet([DataEntry((pk + "_amount"), payment.amount), DataEntry((pk + "_used"), false)]) | |
23 | 23 | } | |
24 | 24 | } | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | ||
28 | 28 | @Callable(i) | |
29 | 29 | func withdraw (pk,sig) = { | |
30 | 30 | let codeUsed = valueOrErrorMessage(getBoolean(this, (pk + "_used")), "The code doesn't exist") | |
31 | 31 | if (codeUsed) | |
32 | 32 | then throw("The code has already been used") | |
33 | - | else if (if ((i.fee > 500000)) | |
34 | - | then true | |
35 | - | else (i.feeAssetId != unit)) | |
36 | - | then throw("Fee must be less than or equal to 0.005 WAVES") | |
33 | + | else if ((i.feeAssetId != unit)) | |
34 | + | then throw("Fee must be in WAVES") | |
37 | 35 | else { | |
38 | 36 | let valid = sigVerify(i.callerPublicKey, fromBase58String(sig), fromBase58String(pk)) | |
39 | 37 | if (!(valid)) | |
40 | 38 | then throw("Invalid code") | |
41 | 39 | else { | |
42 | 40 | let amount = getIntegerValue(this, (pk + "_amount")) | |
43 | - | ScriptResult(WriteSet([DataEntry((pk + "_used"), true)]), TransferSet([ScriptTransfer(i.caller, | |
41 | + | ScriptResult(WriteSet([DataEntry((pk + "_used"), true)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
44 | 42 | } | |
45 | 43 | } | |
46 | 44 | } | |
45 | + | ||
46 | + | ||
47 | + | ||
48 | + | @Callable(i) | |
49 | + | func test () = throw(toString(lastBlock.timestamp)) | |
47 | 50 | ||
48 | 51 |
github/deemru/w8io/026f985 33.60 ms ◑