tx · G3MK8bUADDKPPHJAwSinzJuXmxKLtcXYrM5pCurciFKt
3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi: -0.01400000 Waves
2019.08.29 10:43 [652217] smart account 3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi > SELF 0.00000000 Waves
{
"type": 13,
"id": "G3MK8bUADDKPPHJAwSinzJuXmxKLtcXYrM5pCurciFKt",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1567064663348,
"version": 1,
"sender": "3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi",
"senderPublicKey": "BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH",
"proofs": [
"4qVojUAvkRP6UBNzNTNZ9eHZV1jfcKbpRwB8siGATSdq5BcNVNoyf5SAhJo5BPKtjPtwgp47ogx93Mv1xFz9zF7d"
],
"script": "base64:AAIDAAAAAAAAAAAAAAAFAAAAAA5vd25lclB1YmxpY0tleQEAAAAgnOTxzRGlQL/gVO1uf4r6ecWijHA9iBu9xK1V+iHbiGoAAAAACmRlcGxveUluZm8CAAAAJGFkZGVkIGRhdGEgZnVuY3Rpb25hbGl0eSAodGVzdHBoYXNlKQEAAAAJd3JpdGVEYXRhAAAAAgAAAAdkYXRhS2V5AAAACWRhdGFWYWx1ZQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAHZGF0YUtleQUAAAAJZGF0YVZhbHVlBQAAAANuaWwBAAAAB2dldERhdGEAAAABAAAAB2RhdGFLZXkEAAAAC2RhdGFQYWNrYWdlCQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzBQAAAAdkYXRhS2V5BQAAAAtkYXRhUGFja2FnZQEAAAAJZW1pdFRva2VuAAAAAwAAAAhyZWNlaXZlcgAAAA5kaXNwZW5zZUFtb3VudAAAAAphdHRhY2htZW50BAAAAAV0b2tlbgIAAAAGS0VLUy0xBQAAAAV0b2t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AAAAckbWF0Y2gwAgAAABBJc3N1ZVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAASUmVpc3N1ZVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgewQm/L",
"chainId": 84,
"height": 652217,
"spentComplexity": 0
}
View: original | compacted
Prev: HhPfLTVr1iCp3kjxVDo3xHW5Dk3unwLfpRQ5Hj65QtCi
Next: 8AyCKdCUjVdBf7W9CDYqFqpqpigmeiLm7hL857jcxyfq
Diff:
Old | New | | Differences |
---|
4 | 4 | | let ownerPublicKey = base58'BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH' |
---|
5 | 5 | | |
---|
6 | 6 | | let deployInfo = "added data functionality (testphase)" |
---|
7 | | - | |
---|
8 | | - | let data = DataEntry("Age", 33) |
---|
9 | | - | |
---|
10 | | - | let key = data.key |
---|
11 | | - | |
---|
12 | | - | let val = data.value |
---|
13 | 7 | | |
---|
14 | 8 | | func writeData (dataKey,dataValue) = WriteSet([DataEntry(dataKey, dataValue)]) |
---|
15 | 9 | | |
---|
|
20 | 14 | | } |
---|
21 | 15 | | |
---|
22 | 16 | | |
---|
23 | | - | func issueDataRequest (sizing) = { |
---|
24 | | - | let x = "y" |
---|
25 | | - | x |
---|
| 17 | + | func emitToken (receiver,dispenseAmount,attachment) = { |
---|
| 18 | + | let token = "KEKS-1" |
---|
| 19 | + | token |
---|
26 | 20 | | } |
---|
27 | 21 | | |
---|
28 | 22 | | |
---|
|
30 | 24 | | func dispense () = { |
---|
31 | 25 | | let paid = extract(i.payment) |
---|
32 | 26 | | let message = "default message for now" |
---|
| 27 | + | let callerAccount = toBase58String(extract(i.callerPublicKey)) |
---|
| 28 | + | let callerTxId = i.transactionId |
---|
33 | 29 | | let sizing = if ((paid.amount == 100000000)) |
---|
34 | 30 | | then "S" |
---|
35 | 31 | | else if ((paid.amount == 200000000)) |
---|
|
39 | 35 | | else "error" |
---|
40 | 36 | | if ((sizing == "error")) |
---|
41 | 37 | | then throw("Unrecognized sizing") |
---|
42 | | - | else { |
---|
43 | | - | let dataPackage = "x" |
---|
44 | | - | TransferSet([ScriptTransfer(i.caller, paid.amount, unit)]) |
---|
45 | | - | } |
---|
| 38 | + | else writeData(callerAccount, message) |
---|
46 | 39 | | } |
---|
47 | 40 | | |
---|
48 | 41 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let ownerPublicKey = base58'BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH' |
---|
5 | 5 | | |
---|
6 | 6 | | let deployInfo = "added data functionality (testphase)" |
---|
7 | | - | |
---|
8 | | - | let data = DataEntry("Age", 33) |
---|
9 | | - | |
---|
10 | | - | let key = data.key |
---|
11 | | - | |
---|
12 | | - | let val = data.value |
---|
13 | 7 | | |
---|
14 | 8 | | func writeData (dataKey,dataValue) = WriteSet([DataEntry(dataKey, dataValue)]) |
---|
15 | 9 | | |
---|
16 | 10 | | |
---|
17 | 11 | | func getData (dataKey) = { |
---|
18 | 12 | | let dataPackage = getStringValue(this, dataKey) |
---|
19 | 13 | | dataPackage |
---|
20 | 14 | | } |
---|
21 | 15 | | |
---|
22 | 16 | | |
---|
23 | | - | func issueDataRequest (sizing) = { |
---|
24 | | - | let x = "y" |
---|
25 | | - | x |
---|
| 17 | + | func emitToken (receiver,dispenseAmount,attachment) = { |
---|
| 18 | + | let token = "KEKS-1" |
---|
| 19 | + | token |
---|
26 | 20 | | } |
---|
27 | 21 | | |
---|
28 | 22 | | |
---|
29 | 23 | | @Callable(i) |
---|
30 | 24 | | func dispense () = { |
---|
31 | 25 | | let paid = extract(i.payment) |
---|
32 | 26 | | let message = "default message for now" |
---|
| 27 | + | let callerAccount = toBase58String(extract(i.callerPublicKey)) |
---|
| 28 | + | let callerTxId = i.transactionId |
---|
33 | 29 | | let sizing = if ((paid.amount == 100000000)) |
---|
34 | 30 | | then "S" |
---|
35 | 31 | | else if ((paid.amount == 200000000)) |
---|
36 | 32 | | then "M" |
---|
37 | 33 | | else if ((paid.amount == 400000000)) |
---|
38 | 34 | | then "L" |
---|
39 | 35 | | else "error" |
---|
40 | 36 | | if ((sizing == "error")) |
---|
41 | 37 | | then throw("Unrecognized sizing") |
---|
42 | | - | else { |
---|
43 | | - | let dataPackage = "x" |
---|
44 | | - | TransferSet([ScriptTransfer(i.caller, paid.amount, unit)]) |
---|
45 | | - | } |
---|
| 38 | + | else writeData(callerAccount, message) |
---|
46 | 39 | | } |
---|
47 | 40 | | |
---|
48 | 41 | | |
---|
49 | 42 | | @Verifier(tx) |
---|
50 | 43 | | func verify () = match tx { |
---|
51 | 44 | | case d: SetScriptTransaction => |
---|
52 | 45 | | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey) |
---|
53 | 46 | | case d: DataTransaction => |
---|
54 | 47 | | true |
---|
55 | 48 | | case d: TransferTransaction => |
---|
56 | 49 | | true |
---|
57 | 50 | | case d: IssueTransaction => |
---|
58 | 51 | | true |
---|
59 | 52 | | case d: ReissueTransaction => |
---|
60 | 53 | | true |
---|
61 | 54 | | case _ => |
---|
62 | 55 | | false |
---|
63 | 56 | | } |
---|
64 | 57 | | |
---|