tx · DLBmJXK24o4Cp8tKu8vFgLT7g6mJH2kGtmZJLZcVkZhd
3MuBakQdFAobmsHH371bKVYNed6yA9Y2Wfy: -0.01400000 Waves
2021.05.25 12:59 [1541038] smart account 3MuBakQdFAobmsHH371bKVYNed6yA9Y2Wfy > SELF 0.00000000 Waves
{
"type": 13,
"id": "DLBmJXK24o4Cp8tKu8vFgLT7g6mJH2kGtmZJLZcVkZhd",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1621936849887,
"version": 2,
"chainId": 84,
"sender": "3MuBakQdFAobmsHH371bKVYNed6yA9Y2Wfy",
"senderPublicKey": "9BAE85H9Tsey8NGdpT5HxdVYHBCmY1prGiG1TSQJxnZe",
"proofs": [
"SkkSYcM2NFNGpHBb8TY2rTeQCY73z1pqafEkvG3jNoT5TGWsueU2jxpBx9VVBo1WnZoeN9auZJr5xQMxU2eqnuv"
],
"script": "base64:AAIEAAAAAAAAAAwIAhIDCgEIEgMKAQEAAAAHAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAZudW1iZXIEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAAFAAAABm51bWJlcgAAAAAETk9ORQIAAAAEbm9uZQEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAGc3RyaW5nBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhBQAAAAROT05FBQAAAAZzdHJpbmcBAAAAD2dldEtleVVzZXJFbWFpbAAAAAEAAAAEdXNlcgkAASwAAAACCQABLAAAAAICAAAABXVzZXJfBQAAAAR1c2VyAgAAAAZfZW1haWwBAAAAEWdldFZhbHV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cnkAAAACBQAAAAtkQXBwQXNzZXRJZAkAAlgAAAABBQAAAAdhc3NldElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleVEp+tY=",
"height": 1541038,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: CqTNAzrYTqVVZfRaGpb624TCuEjB3ZwsBdMsj6o8i3CN
Next: 8mTdgGVF5YZPpLfKf2SLfcKHuUqWA8dF49xReNdevnCb
Diff:
Old | New | | Differences |
---|
31 | 31 | | func getValueUserEmail (user) = getStringByKey(getKeyUserEmail(user)) |
---|
32 | 32 | | |
---|
33 | 33 | | |
---|
| 34 | + | func getKeyDAppAssetId () = "dApp_assetId" |
---|
| 35 | + | |
---|
| 36 | + | |
---|
| 37 | + | func getValueDAppAssetId () = getStringByKey(getKeyDAppAssetId()) |
---|
| 38 | + | |
---|
| 39 | + | |
---|
34 | 40 | | @Callable(i) |
---|
35 | 41 | | func signUp (email) = { |
---|
36 | 42 | | let currentUserAddress = toBase58String(i.caller.bytes) |
---|
|
41 | 47 | | } |
---|
42 | 48 | | |
---|
43 | 49 | | |
---|
| 50 | + | |
---|
| 51 | + | @Callable(i) |
---|
| 52 | + | func issueToken (quantity) = { |
---|
| 53 | + | let dAppAssetId = getKeyDAppAssetId() |
---|
| 54 | + | if ((dAppAssetId != NONE)) |
---|
| 55 | + | then throw("token already been issued") |
---|
| 56 | + | else { |
---|
| 57 | + | let asset = Issue("NYAN-25", "NYAN-25 token", quantity, 0, true) |
---|
| 58 | + | let assetId = calculateAssetId(asset) |
---|
| 59 | + | [StringEntry(dAppAssetId, toBase58String(assetId))] |
---|
| 60 | + | } |
---|
| 61 | + | } |
---|
| 62 | + | |
---|
| 63 | + | |
---|
44 | 64 | | @Verifier(tx) |
---|
45 | 65 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
46 | 66 | | |
---|
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 | + | func getKeyDAppAssetId () = "dApp_assetId" |
---|
| 35 | + | |
---|
| 36 | + | |
---|
| 37 | + | func getValueDAppAssetId () = getStringByKey(getKeyDAppAssetId()) |
---|
| 38 | + | |
---|
| 39 | + | |
---|
34 | 40 | | @Callable(i) |
---|
35 | 41 | | func signUp (email) = { |
---|
36 | 42 | | let currentUserAddress = toBase58String(i.caller.bytes) |
---|
37 | 43 | | let currentUserEmail = getKeyUserEmail(currentUserAddress) |
---|
38 | 44 | | if ((currentUserEmail != NONE)) |
---|
39 | 45 | | then throw("user already exists") |
---|
40 | 46 | | else [StringEntry(getKeyUserEmail(currentUserAddress), email)] |
---|
41 | 47 | | } |
---|
42 | 48 | | |
---|
43 | 49 | | |
---|
| 50 | + | |
---|
| 51 | + | @Callable(i) |
---|
| 52 | + | func issueToken (quantity) = { |
---|
| 53 | + | let dAppAssetId = getKeyDAppAssetId() |
---|
| 54 | + | if ((dAppAssetId != NONE)) |
---|
| 55 | + | then throw("token already been issued") |
---|
| 56 | + | else { |
---|
| 57 | + | let asset = Issue("NYAN-25", "NYAN-25 token", quantity, 0, true) |
---|
| 58 | + | let assetId = calculateAssetId(asset) |
---|
| 59 | + | [StringEntry(dAppAssetId, toBase58String(assetId))] |
---|
| 60 | + | } |
---|
| 61 | + | } |
---|
| 62 | + | |
---|
| 63 | + | |
---|
44 | 64 | | @Verifier(tx) |
---|
45 | 65 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
46 | 66 | | |
---|