tx · 8D5m1eGqAPRib6yhCrNTYGYribD26hDwTakzVJSnWC84 3N5kVNm6a39KDPaaBaZBW8B5uFDzDYmvMSc: -0.01400000 Waves 2021.05.25 13:51 [1541090] smart account 3N5kVNm6a39KDPaaBaZBW8B5uFDzDYmvMSc > SELF 0.00000000 Waves
{ "type": 13, "id": "8D5m1eGqAPRib6yhCrNTYGYribD26hDwTakzVJSnWC84", "fee": 1400000, "feeAssetId": null, "timestamp": 1621939899249, "version": 2, "chainId": 84, "sender": "3N5kVNm6a39KDPaaBaZBW8B5uFDzDYmvMSc", "senderPublicKey": "GTDgFADWhacb21qpWoTwYz9PsE1KopJEUBts6Z7r2rq9", "proofs": [ "Lh1RSeUYy7XJYk7JBztPoihcF6wjjpuo1987XfCEEKAEj4Nt1thC5kmYtpJr8TE9TXHmP4vZuzuqL7evtjtCQnt" ], "script": "base64:AAIEAAAAAAAAAAwIAhIDCgEIEgMKAQEAAAAIAAAAAARkQXBwAgAAACMzTXVCYWtRZEZBb2Jtc0hIMzcxYktWWU5lZDZ5QTlZMldmeQEAAAAOZ2V0TnVtYmVyQnlLZXkAAAABAAAAA2tleQQAAAAGbnVtYmVyBAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABQAAAAZudW1iZXIAAAAABE5PTkUCAAAABG5vbmUBAAAADmdldFN0cmluZ0J5S2V5AAAAAQAAAANrZXkEAAAABnN0cmluZwQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQUAAAAETk9ORQUAAAAGc3RyaW5nAQAAAA9nZXRLZXlVc2VyRW1haWwAAAABAAAABHVzZXIJAAEsAAAAAgkAASwAAAACAgAAAAV1c2VyX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B2Fzc2V0SWQJAAQ4AAAAAQUAAAAFYXNzZXQJAARMAAAAAgUAAAAFYXNzZXQJAARMAAAAAgkBAAAAC0JpbmFyeUVudHJ5AAAAAgkBAAAAEWdldEtleURBcHBBc3NldElkAAAAAAUAAAAHYXNzZXRJZAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmQqPzb", "height": 1541090, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 4 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let dApp = "3MuBakQdFAobmsHH371bKVYNed6yA9Y2Wfy" | |
5 | + | ||
6 | + | func getNumberByKey (key) = { | |
7 | + | let number = match getInteger(this, key) { | |
8 | + | case a: Int => | |
9 | + | a | |
10 | + | case _ => | |
11 | + | 0 | |
12 | + | } | |
13 | + | number | |
14 | + | } | |
15 | + | ||
16 | + | ||
17 | + | let NONE = "none" | |
18 | + | ||
19 | + | func getStringByKey (key) = { | |
20 | + | let string = match getString(this, key) { | |
21 | + | case a: String => | |
22 | + | a | |
23 | + | case _ => | |
24 | + | NONE | |
25 | + | } | |
26 | + | string | |
27 | + | } | |
28 | + | ||
29 | + | ||
30 | + | func getKeyUserEmail (user) = (("user_" + user) + "_email") | |
31 | + | ||
32 | + | ||
33 | + | func getValueUserEmail (user) = getStringByKey(getKeyUserEmail(user)) | |
34 | + | ||
35 | + | ||
36 | + | func getKeyDAppAssetId () = "dApp_assetId" | |
37 | + | ||
38 | + | ||
39 | + | func getValueDAppAssetId () = getStringByKey(getKeyDAppAssetId()) | |
40 | + | ||
41 | + | ||
42 | + | @Callable(i) | |
43 | + | func signUp (email) = { | |
44 | + | let currentUserAddress = toBase58String(i.caller.bytes) | |
45 | + | let currentUserEmail = getValueUserEmail(currentUserAddress) | |
46 | + | if ((currentUserEmail != NONE)) | |
47 | + | then throw("user is already registered") | |
48 | + | else [StringEntry(getKeyUserEmail(currentUserAddress), email)] | |
49 | + | } | |
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | @Callable(i) | |
54 | + | func issueToken (quantity) = { | |
55 | + | let dAppAssetId = getValueDAppAssetId() | |
56 | + | if ((dAppAssetId != NONE)) | |
57 | + | then throw("token has already been issued") | |
58 | + | else { | |
59 | + | let asset = Issue("NYAN-25", "NYAN-25 token", quantity, 0, true) | |
60 | + | let assetId = calculateAssetId(asset) | |
61 | + | [asset, BinaryEntry(getKeyDAppAssetId(), assetId)] | |
62 | + | } | |
63 | + | } | |
64 | + | ||
65 | + | ||
66 | + | @Verifier(tx) | |
67 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
68 | + |
github/deemru/w8io/169f3d6 16.10 ms ◑