tx · HVWnTxqeg6GuKFtBiWuAoJbMUGAscHxE7guJWASudaf2
3MuDeVJtgnf32JCP1fx191gP6opExbcVKRD: -0.01400000 Waves
2020.09.24 04:07 [1190697] smart account 3MuDeVJtgnf32JCP1fx191gP6opExbcVKRD > SELF 0.00000000 Waves
{
"type": 13,
"id": "HVWnTxqeg6GuKFtBiWuAoJbMUGAscHxE7guJWASudaf2",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1600909665352,
"version": 2,
"chainId": 84,
"sender": "3MuDeVJtgnf32JCP1fx191gP6opExbcVKRD",
"senderPublicKey": "8JfsGbtUyoZCTL7z6ZM6Et5V6q227EzzkXcJ42FMN3fy",
"proofs": [
"4m55tu7ua1bZmohtTLy6Ch7iGJuF6iCmZRyHnC2ftEAWSdAzY5t4WurLnm22wemWpgHSDtKLxQWfQpSWX6cr4sdj"
],
"script": "base64:AAIEAAAAAAAAAAQIAhIAAAAAAwAAAAAGTEVTU09OAQAAACDo50h8OI7Nb62zoWsqagYFDIe8iqPg4/7715QkgwDg6QAAAAAEUEFSNwEAAAAgzlhA/ZjitMWTd+McxVJoK0GcLLGrEdV8aco355LpR4wAAAAACHN3YXBSYXRlAAAAAAAAAAABAAAAAQAAAAFpAQAAABFpc3N1ZUxlc3NvblRpY2tldAAAAAAEAAAAA3BtdAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAEUEFSNwkAAAIAAAABAgAAABR3b3JrcyB3aXRoIFBBUjcgb25seQQAAAAKc3dhcEFtb3VudAkAAGgAAAACCAUAAAADcG10AAAABmFtb3VudAUAAAAIc3dhcFJhdGUEAAAADWFzc2V0SWRTdHJpbmcJAAJYAAAAAQkBAAAABXZhbHVlAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAD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ld0lzc3VlckFtb3VudAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAACnN3YXBBbW91bnQFAAAABkxFU1NPTgUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmG++fu",
"height": 1190697,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: EPF5UsyGWxuE1eAZ3KrAXBAfia3qRYdHxefunaU9jRey
Next: HhkodbarqXAdZyN6zRT7cuoBiqXKrnQa6KN2FXkpMx1D
Diff:
Old | New | | Differences |
---|
22 | 22 | | 0 |
---|
23 | 23 | | } |
---|
24 | 24 | | let newAmount = (currentAmount + pmt.amount) |
---|
| 25 | + | let issuerCurrentKey = toBase58String(i.caller.bytes) |
---|
| 26 | + | let issuerCurrentAmount = match getInteger(this, issuerCurrentKey) { |
---|
| 27 | + | case a: Int => |
---|
| 28 | + | a |
---|
| 29 | + | case _ => |
---|
| 30 | + | 0 |
---|
| 31 | + | } |
---|
| 32 | + | let newIssuerAmount = (issuerCurrentAmount + pmt.amount) |
---|
25 | 33 | | let issueCurrentKey = "issueNumber" |
---|
26 | 34 | | let issueCurrentNumber = match getInteger(this, issueCurrentKey) { |
---|
27 | 35 | | case a: Int => |
---|
|
30 | 38 | | 0 |
---|
31 | 39 | | } |
---|
32 | 40 | | let newIssueNumber = (issueCurrentNumber + 1) |
---|
33 | | - | [IntegerEntry(assetIdString, newAmount), IntegerEntry(issueCurrentKey, newIssueNumber), ScriptTransfer(i.caller, swapAmount, LESSON)] |
---|
| 41 | + | [IntegerEntry(assetIdString, newAmount), IntegerEntry(issueCurrentKey, newIssueNumber), IntegerEntry(issuerCurrentKey, newIssuerAmount), ScriptTransfer(i.caller, swapAmount, LESSON)] |
---|
34 | 42 | | } |
---|
35 | 43 | | } |
---|
36 | 44 | | |
---|
Full:
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 | 7 | | |
---|
8 | 8 | | let swapRate = 1 |
---|
9 | 9 | | |
---|
10 | 10 | | @Callable(i) |
---|
11 | 11 | | func issueLessonTicket () = { |
---|
12 | 12 | | let pmt = i.payments[0] |
---|
13 | 13 | | if ((pmt.assetId != PAR7)) |
---|
14 | 14 | | then throw("works with PAR7 only") |
---|
15 | 15 | | else { |
---|
16 | 16 | | let swapAmount = (pmt.amount * swapRate) |
---|
17 | 17 | | let assetIdString = toBase58String(value(pmt.assetId)) |
---|
18 | 18 | | let currentAmount = match getInteger(this, assetIdString) { |
---|
19 | 19 | | case a: Int => |
---|
20 | 20 | | a |
---|
21 | 21 | | case _ => |
---|
22 | 22 | | 0 |
---|
23 | 23 | | } |
---|
24 | 24 | | let newAmount = (currentAmount + pmt.amount) |
---|
| 25 | + | let issuerCurrentKey = toBase58String(i.caller.bytes) |
---|
| 26 | + | let issuerCurrentAmount = match getInteger(this, issuerCurrentKey) { |
---|
| 27 | + | case a: Int => |
---|
| 28 | + | a |
---|
| 29 | + | case _ => |
---|
| 30 | + | 0 |
---|
| 31 | + | } |
---|
| 32 | + | let newIssuerAmount = (issuerCurrentAmount + pmt.amount) |
---|
25 | 33 | | let issueCurrentKey = "issueNumber" |
---|
26 | 34 | | let issueCurrentNumber = match getInteger(this, issueCurrentKey) { |
---|
27 | 35 | | case a: Int => |
---|
28 | 36 | | a |
---|
29 | 37 | | case _ => |
---|
30 | 38 | | 0 |
---|
31 | 39 | | } |
---|
32 | 40 | | let newIssueNumber = (issueCurrentNumber + 1) |
---|
33 | | - | [IntegerEntry(assetIdString, newAmount), IntegerEntry(issueCurrentKey, newIssueNumber), ScriptTransfer(i.caller, swapAmount, LESSON)] |
---|
| 41 | + | [IntegerEntry(assetIdString, newAmount), IntegerEntry(issueCurrentKey, newIssueNumber), IntegerEntry(issuerCurrentKey, newIssuerAmount), ScriptTransfer(i.caller, swapAmount, LESSON)] |
---|
34 | 42 | | } |
---|
35 | 43 | | } |
---|
36 | 44 | | |
---|
37 | 45 | | |
---|
38 | 46 | | @Verifier(tx) |
---|
39 | 47 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
40 | 48 | | |
---|