tx · 3J9iZuMWEC29XeQoFKUEkTHvgrRn4xYfsaDif17yAHqX 3MpUDmnN27gMSxHDEFQLW75epUMECTHDn6E: -0.01400000 Waves 2020.11.26 10:46 [1282101] smart account 3MpUDmnN27gMSxHDEFQLW75epUMECTHDn6E > SELF 0.00000000 Waves
{ "type": 13, "id": "3J9iZuMWEC29XeQoFKUEkTHvgrRn4xYfsaDif17yAHqX", "fee": 1400000, "feeAssetId": null, "timestamp": 1606376812448, "version": 2, "chainId": 84, "sender": "3MpUDmnN27gMSxHDEFQLW75epUMECTHDn6E", "senderPublicKey": "FJk5n9i5ysYBtjvPcos6iKm98yzpxms3gECZgg6Y8Bt1", "proofs": [ "3iBjD6m4FRrMdLPwU2t97RFEFhEHN39ruRTvchZRuSNk7bp8ZMFLm5p4VH3S34dVbyTNvvDZDgTCdEkpynWrXdBP" ], "script": "base64:AAIEAAAAAAAAAAcIAhIDCgEIAAAABAAAAAAFZGVsYXkAAAAAAAAAAAoAAAAADGFtb3VudFRvR2l2ZQAAAAACVAvkAAAAAAAHYXNzZXRJZAEAAAAg6KVqvMp3QvJwYTI1Sk9Fg7m5HuWZZxfDcerZC6EEresBAAAAD2dldEludGVnZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhCQAAZQAAAAIFAAAABmhlaWdodAUAAAAFZGVsYXkAAAABAAAAAWkBAAAAB2dldFNpZ24AAAABAAAABGFkZHIEAAAABmNhbGxlcgkABCUAAAABCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCAUAAAABaQAAAA9jYWxsZXJQdWJsaWNLZXkEAAAADmxhc3RDYWxsSGVpZ2h0CQEAAAAPZ2V0SW50ZWdlckJ5S2V5AAAAAQUAAAAGY2FsbGVyBAAAAAZjYW5HZXQJAABnAAAAAgkAAGUAAAACBQAAAAZoZWlnaHQFAAAADmxhc3RDYWxsSGVpZ2h0BQAAAAVkZWxheQMFAAAABmNhbkdldAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAGY2FsbGVyBQAAAAZoZWlnaHQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwkBAAAAB0FkZHJlc3MAAAABCQACWQAAAAEFAAAABGFkZHIFAAAADGFtb3VudFRvR2l2ZQUAAAAHYXNzZXRJZAUAAAADbmlsCQAAAgAAAAECAAAAI1lvdSBjYW5ub3QgZ2V0IFNJR04gVG9rZW4gYWdhaW4geWV0AAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBAAAAANpbnYFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAADc3N0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQfT8QMM", "height": 1282101, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8Z9PJAKd7xqqfsSc4EsUa76Q2oUJsvZq1DUvqmkVPWJX Next: HKYJZqd3zbkAVpp3NfUuw2uSiXtq7WCXB28HQnWUv1u7 Diff:
Old | New | Differences | |
---|---|---|---|
29 | 29 | @Verifier(tx) | |
30 | 30 | func verify () = match tx { | |
31 | 31 | case inv: InvokeScriptTransaction => | |
32 | - | let lastCallHeight = getIntegerByKey(toString(inv.sender)) | |
33 | - | let canGet = ((height - lastCallHeight) >= delay) | |
34 | - | if (canGet) | |
35 | - | then (inv.function == "getSign") | |
36 | - | else false | |
32 | + | true | |
37 | 33 | case sst: SetScriptTransaction => | |
38 | 34 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
39 | 35 | case _ => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let delay = 10 | |
5 | 5 | ||
6 | 6 | let amountToGive = 10000000000 | |
7 | 7 | ||
8 | 8 | let assetId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
9 | 9 | ||
10 | 10 | func getIntegerByKey (key) = match getInteger(this, key) { | |
11 | 11 | case a: Int => | |
12 | 12 | a | |
13 | 13 | case _ => | |
14 | 14 | (height - delay) | |
15 | 15 | } | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | @Callable(i) | |
19 | 19 | func getSign (addr) = { | |
20 | 20 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
21 | 21 | let lastCallHeight = getIntegerByKey(caller) | |
22 | 22 | let canGet = ((height - lastCallHeight) >= delay) | |
23 | 23 | if (canGet) | |
24 | 24 | then [IntegerEntry(caller, height), ScriptTransfer(Address(fromBase58String(addr)), amountToGive, assetId)] | |
25 | 25 | else throw("You cannot get SIGN Token again yet") | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | @Verifier(tx) | |
30 | 30 | func verify () = match tx { | |
31 | 31 | case inv: InvokeScriptTransaction => | |
32 | - | let lastCallHeight = getIntegerByKey(toString(inv.sender)) | |
33 | - | let canGet = ((height - lastCallHeight) >= delay) | |
34 | - | if (canGet) | |
35 | - | then (inv.function == "getSign") | |
36 | - | else false | |
32 | + | true | |
37 | 33 | case sst: SetScriptTransaction => | |
38 | 34 | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
39 | 35 | case _ => | |
40 | 36 | false | |
41 | 37 | } | |
42 | 38 |
github/deemru/w8io/169f3d6 33.97 ms ◑