tx · 2haiFjzhL9m2D1FczgfTZssMfnSkqeUsu18v6sURC1jC
3MuBakQdFAobmsHH371bKVYNed6yA9Y2Wfy: -0.01400000 Waves
2021.05.25 13:19 [1541060] smart account 3MuBakQdFAobmsHH371bKVYNed6yA9Y2Wfy > SELF 0.00000000 Waves
{
"type": 13,
"id": "2haiFjzhL9m2D1FczgfTZssMfnSkqeUsu18v6sURC1jC",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1621937985300,
"version": 2,
"chainId": 84,
"sender": "3MuBakQdFAobmsHH371bKVYNed6yA9Y2Wfy",
"senderPublicKey": "9BAE85H9Tsey8NGdpT5HxdVYHBCmY1prGiG1TSQJxnZe",
"proofs": [
"3yik4nLL6XLb2J8E8MQ3saQS5drmbzbwdvhUku5b1mRDzbjjEp2cvKa8gLPCGSdJHRPfjfcsqswBozZbmokKKvnR"
],
"script": "base64:AAIEAAAAAAAAABEIAhIDCgEIEgMKAQESAwoBAQAAAAcBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAABm51bWJlcgQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAAGbnVtYmVyAAAAAAROT05FAgAAAARub25lAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAZzdHJpbmcEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAABnN0cmluZwEAAAAPZ2V0S2V5VXNlckVtYWlsAAAAAQAAAAR1c2VyCQABLAAAAAIJAAEsAAAAAgIAAAAFdXNlcl8FAAAABHVzZXICAAAABl9lbWFpbAEAAAARZ2V0VmFsdWVVc2VyRW1ha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0CQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIJAQAAABFnZXRLZXlEQXBwQXNzZXRJZAAAAAAJAAJYAAAAAQUAAAAHYXNzZXRJZAUAAAADbmlsAAAAAWkBAAAADHJlaXNzdWVUb2tlbgAAAAEAAAAIcXVhbnRpdHkEAAAAC2RBcHBBc3NldElkCQEAAAATZ2V0VmFsdWVEQXBwQXNzZXRJZAAAAAADCQAAAAAAAAIFAAAAC2RBcHBBc3NldElkBQAAAAROT05FCQAAAgAAAAECAAAAGXRva2VuIGhhcyBub3QgYmVlbiBpc3N1ZWQJAARMAAAAAgkBAAAAB1JlaXNzdWUAAAADCQACWQAAAAEFAAAAC2RBcHBBc3NldElkBQAAAAhxdWFudGl0eQYFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5ezjpgw==",
"height": 1541060,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 27P81D7iWNJLoR5DEtwxxrpndoGZYfHHLbjbjHFLGRW1
Next: G65XF1r2QV6hbrSmMNaGThHX95ar6fBuwSbSEjiM17DW
Diff:
Old | New | | Differences |
---|
42 | 42 | | let currentUserAddress = toBase58String(i.caller.bytes) |
---|
43 | 43 | | let currentUserEmail = getValueUserEmail(currentUserAddress) |
---|
44 | 44 | | if ((currentUserEmail != NONE)) |
---|
45 | | - | then throw("user already exists") |
---|
| 45 | + | then throw("user is already registered") |
---|
46 | 46 | | else [StringEntry(getKeyUserEmail(currentUserAddress), email)] |
---|
47 | 47 | | } |
---|
48 | 48 | | |
---|
|
52 | 52 | | func issueToken (quantity) = { |
---|
53 | 53 | | let dAppAssetId = getValueDAppAssetId() |
---|
54 | 54 | | if ((dAppAssetId != NONE)) |
---|
55 | | - | then throw("token already been issued") |
---|
| 55 | + | then throw("token has 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 | | [asset, StringEntry(getKeyDAppAssetId(), toBase58String(assetId))] |
---|
60 | 60 | | } |
---|
| 61 | + | } |
---|
| 62 | + | |
---|
| 63 | + | |
---|
| 64 | + | |
---|
| 65 | + | @Callable(i) |
---|
| 66 | + | func reissueToken (quantity) = { |
---|
| 67 | + | let dAppAssetId = getValueDAppAssetId() |
---|
| 68 | + | if ((dAppAssetId == NONE)) |
---|
| 69 | + | then throw("token has not been issued") |
---|
| 70 | + | else [Reissue(fromBase58String(dAppAssetId), quantity, true)] |
---|
61 | 71 | | } |
---|
62 | 72 | | |
---|
63 | 73 | | |
---|
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 | 43 | | let currentUserEmail = getValueUserEmail(currentUserAddress) |
---|
44 | 44 | | if ((currentUserEmail != NONE)) |
---|
45 | | - | then throw("user already exists") |
---|
| 45 | + | then throw("user is already registered") |
---|
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 | 53 | | let dAppAssetId = getValueDAppAssetId() |
---|
54 | 54 | | if ((dAppAssetId != NONE)) |
---|
55 | | - | then throw("token already been issued") |
---|
| 55 | + | then throw("token has 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 | | [asset, StringEntry(getKeyDAppAssetId(), toBase58String(assetId))] |
---|
60 | 60 | | } |
---|
| 61 | + | } |
---|
| 62 | + | |
---|
| 63 | + | |
---|
| 64 | + | |
---|
| 65 | + | @Callable(i) |
---|
| 66 | + | func reissueToken (quantity) = { |
---|
| 67 | + | let dAppAssetId = getValueDAppAssetId() |
---|
| 68 | + | if ((dAppAssetId == NONE)) |
---|
| 69 | + | then throw("token has not been issued") |
---|
| 70 | + | else [Reissue(fromBase58String(dAppAssetId), quantity, true)] |
---|
61 | 71 | | } |
---|
62 | 72 | | |
---|
63 | 73 | | |
---|
64 | 74 | | @Verifier(tx) |
---|
65 | 75 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
66 | 76 | | |
---|