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