tx · 3MyEkLhJ6z2DJLFH3L2dvcnetYd22rowLmKW5cs7h86Z 3MuDeVJtgnf32JCP1fx191gP6opExbcVKRD: -0.01400000 Waves 2020.09.26 11:29 [1194067] smart account 3MuDeVJtgnf32JCP1fx191gP6opExbcVKRD > SELF 0.00000000 Waves
{ "type": 13, "id": "3MyEkLhJ6z2DJLFH3L2dvcnetYd22rowLmKW5cs7h86Z", "fee": 1400000, "feeAssetId": null, "timestamp": 1601109022384, "version": 2, "chainId": 84, "sender": "3MuDeVJtgnf32JCP1fx191gP6opExbcVKRD", "senderPublicKey": "8JfsGbtUyoZCTL7z6ZM6Et5V6q227EzzkXcJ42FMN3fy", "proofs": [ "2XQDGRVUbgxgja7V7SgkUFVWqYe1mq7VxfjhMHxscEmVkAPQjwtJRgqZDhxmdQk8pF3oT8ts5wv5N7WDDtBjvJSR" ], "script": "base64:AAIEAAAAAAAAAAYIAhIAEgAAAAAEAAAAAAZMRVNTT04BAAAAIOjnSHw4js1vrbOhaypqBgUMh7yKo+Dj/vvXlCSDAODpAAAAAARQQVI3AQAAACDOWED9mOK0xZN34xzFUmgrQZwssasR1XxpyjfnkulHjAAAAAAIZWxlbWVudDcBAAAAIEtdmIFzzxIaN5YUPWUCLDXgYJocDCD80u+oMh4T0HwVAAAAAAhzd2FwUmF0ZQAAAAAAAAAAAQAAAAIAAAABaQEAAAAQaXNzdWVMZXNzb25Ub2tlbgAAAAAEAAAAA3BtdAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAEUEFSNwkAAAIAAAABAgAAABR3b3JrcyB3aXRoIFBBUjcgb25seQQAAAAKc3dhcEFtb3VudAkAAGgAAAACCAUAAAADcG10AAAABmFtb3VudAUAAAAIc3dhcFJhdGUEAAAADWFzc2V0SWRTdHJpbmcJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQgFAAAAA3BtdAAAAAdhc3NldEl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1vdW50BQAAAAhlbGVtZW50NwUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmUPQi1", "height": 1194067, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HS4CXydHG1KLcsbqVHKvcs7axpX3g6Zi7TSsH85vsLne Next: E5Bdt9PoaLrVi4K2NyPfJbKogEDfYLwvCPVxsJzZbzNj Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | let LESSON = base58'GgA8mL3SEYvuhYoZFd418Li4bqXAasGbYCKJshTt2MGU' | |
5 | 5 | ||
6 | 6 | let PAR7 = base58'EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm' | |
7 | + | ||
8 | + | let element7 = base58'65CMXQWHBRE4QstqUSENboXEDHTzY95Z9izADtQWiMNk' | |
7 | 9 | ||
8 | 10 | let swapRate = 1 | |
9 | 11 | ||
35 | 37 | } | |
36 | 38 | ||
37 | 39 | ||
40 | + | ||
41 | + | @Callable(i) | |
42 | + | func issueElement7Token () = { | |
43 | + | let pmt = i.payments[0] | |
44 | + | if ((pmt.assetId != PAR7)) | |
45 | + | then throw("works with PAR7 only") | |
46 | + | else { | |
47 | + | let swapAmount = (pmt.amount * swapRate) | |
48 | + | let assetIdString = toBase58String(value(pmt.assetId)) | |
49 | + | let currentAmount = match getInteger(this, assetIdString) { | |
50 | + | case a: Int => | |
51 | + | a | |
52 | + | case _ => | |
53 | + | 0 | |
54 | + | } | |
55 | + | let newAmount = (currentAmount + pmt.amount) | |
56 | + | let issuerCurrentKey = toBase58String(i.caller.bytes) | |
57 | + | let issuerCurrentAmount = match getInteger(this, issuerCurrentKey) { | |
58 | + | case a: Int => | |
59 | + | a | |
60 | + | case _ => | |
61 | + | 0 | |
62 | + | } | |
63 | + | let newIssuerAmount = (issuerCurrentAmount + pmt.amount) | |
64 | + | [Reissue(element7, swapAmount, true), IntegerEntry(assetIdString, newAmount), IntegerEntry(issuerCurrentKey, newIssuerAmount), ScriptTransfer(i.caller, swapAmount, element7)] | |
65 | + | } | |
66 | + | } | |
67 | + | ||
68 | + | ||
38 | 69 | @Verifier(tx) | |
39 | 70 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
40 | 71 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let LESSON = base58'GgA8mL3SEYvuhYoZFd418Li4bqXAasGbYCKJshTt2MGU' | |
5 | 5 | ||
6 | 6 | let PAR7 = base58'EtV3CXQ4wqm28WPB1KaBv5B9ke2bpXRZMutYNEJUQcXm' | |
7 | + | ||
8 | + | let element7 = base58'65CMXQWHBRE4QstqUSENboXEDHTzY95Z9izADtQWiMNk' | |
7 | 9 | ||
8 | 10 | let swapRate = 1 | |
9 | 11 | ||
10 | 12 | @Callable(i) | |
11 | 13 | func issueLessonToken () = { | |
12 | 14 | let pmt = i.payments[0] | |
13 | 15 | if ((pmt.assetId != PAR7)) | |
14 | 16 | then throw("works with PAR7 only") | |
15 | 17 | else { | |
16 | 18 | let swapAmount = (pmt.amount * swapRate) | |
17 | 19 | let assetIdString = toBase58String(value(pmt.assetId)) | |
18 | 20 | let currentAmount = match getInteger(this, assetIdString) { | |
19 | 21 | case a: Int => | |
20 | 22 | a | |
21 | 23 | case _ => | |
22 | 24 | 0 | |
23 | 25 | } | |
24 | 26 | let newAmount = (currentAmount + pmt.amount) | |
25 | 27 | let issuerCurrentKey = toBase58String(i.caller.bytes) | |
26 | 28 | let issuerCurrentAmount = match getInteger(this, issuerCurrentKey) { | |
27 | 29 | case a: Int => | |
28 | 30 | a | |
29 | 31 | case _ => | |
30 | 32 | 0 | |
31 | 33 | } | |
32 | 34 | let newIssuerAmount = (issuerCurrentAmount + pmt.amount) | |
33 | 35 | [IntegerEntry(assetIdString, newAmount), IntegerEntry(issuerCurrentKey, newIssuerAmount), ScriptTransfer(i.caller, swapAmount, LESSON)] | |
34 | 36 | } | |
35 | 37 | } | |
36 | 38 | ||
37 | 39 | ||
40 | + | ||
41 | + | @Callable(i) | |
42 | + | func issueElement7Token () = { | |
43 | + | let pmt = i.payments[0] | |
44 | + | if ((pmt.assetId != PAR7)) | |
45 | + | then throw("works with PAR7 only") | |
46 | + | else { | |
47 | + | let swapAmount = (pmt.amount * swapRate) | |
48 | + | let assetIdString = toBase58String(value(pmt.assetId)) | |
49 | + | let currentAmount = match getInteger(this, assetIdString) { | |
50 | + | case a: Int => | |
51 | + | a | |
52 | + | case _ => | |
53 | + | 0 | |
54 | + | } | |
55 | + | let newAmount = (currentAmount + pmt.amount) | |
56 | + | let issuerCurrentKey = toBase58String(i.caller.bytes) | |
57 | + | let issuerCurrentAmount = match getInteger(this, issuerCurrentKey) { | |
58 | + | case a: Int => | |
59 | + | a | |
60 | + | case _ => | |
61 | + | 0 | |
62 | + | } | |
63 | + | let newIssuerAmount = (issuerCurrentAmount + pmt.amount) | |
64 | + | [Reissue(element7, swapAmount, true), IntegerEntry(assetIdString, newAmount), IntegerEntry(issuerCurrentKey, newIssuerAmount), ScriptTransfer(i.caller, swapAmount, element7)] | |
65 | + | } | |
66 | + | } | |
67 | + | ||
68 | + | ||
38 | 69 | @Verifier(tx) | |
39 | 70 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
40 | 71 |
github/deemru/w8io/169f3d6 25.21 ms ◑