tx · CfvuBDr5qBpKmQPB6oWskCer12tFgsJTXmu9qGLLfs3r
3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi: -0.01400000 Waves
2019.09.03 23:24 [660287] smart account 3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi > SELF 0.00000000 Waves
{
"type": 13,
"id": "CfvuBDr5qBpKmQPB6oWskCer12tFgsJTXmu9qGLLfs3r",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1567542350202,
"version": 1,
"sender": "3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi",
"senderPublicKey": "BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH",
"proofs": [
"3y3Z3hEvjSbn3bZifvLWFGo3eWBy35RstZr8A9j3KDB1D7Pf235ADW2KF8YZSXXpDLUxffnpRAZbQQmycWxPYxeF"
],
"script": "base64:AAIDAAAAAAAAAAAAAAAGAAAAAA5vd25lclB1YmxpY0tleQEAAAAgnOTxzRGlQL/gVO1uf4r6ecWijHA9iBu9xK1V+iHbiGoAAAAACmRlcGxveUluZm8CAAAAJGFkZGVkIGRhdGEgZnVuY3Rpb25hbGl0eSAodGVzdHBoYXNlKQEAAAAHZ2V0RGF0YQAAAAEAAAAHZGF0YUtleQQAAAALZGF0YVBhY2thZ2UJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMFAAAAB2RhdGFLZXkFAAAAC2RhdGFQYWNrYWdlAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0BAAAAAFhBQAAAAckbWF0Y2gwAQAAAAxXYXZlc0xvdHRvVjIJAQAA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AJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA5vd25lclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAEElzc3VlVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABJSZWlzc3VlVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGB62xAGk=",
"chainId": 84,
"height": 660287,
"spentComplexity": 0
}
View: original | compacted
Prev: D4QDtNwpfdM7VStggohUxtnf1FZ2QVMskXgsaViPQadK
Next: 2DnrS96vgKjqCWTEvLHL6QZTJSszcKZCZewozravCtif
Diff:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | let deployInfo = "added data functionality (testphase)" |
---|
7 | 7 | | |
---|
8 | | - | func writeData (dataKey,dataValue) = WriteSet([DataEntry(dataKey, dataValue)]) |
---|
9 | | - | |
---|
10 | | - | |
---|
11 | 8 | | func getData (dataKey) = { |
---|
12 | 9 | | let dataPackage = getStringValue(this, dataKey) |
---|
13 | 10 | | dataPackage |
---|
14 | 11 | | } |
---|
15 | 12 | | |
---|
16 | 13 | | |
---|
17 | | - | func emitToken (receiver,dispenseAmount,attachment) = { |
---|
18 | | - | let token = "KEKS-1" |
---|
19 | | - | token |
---|
| 14 | + | func randomizer (inv) = { |
---|
| 15 | + | let lastPlay = match getBinary(this, "lastPlay") { |
---|
| 16 | + | case s: ByteVector => |
---|
| 17 | + | s |
---|
| 18 | + | case a: Unit => |
---|
| 19 | + | base58'2ee4oFDYriWJ9EMeR' |
---|
| 20 | + | case _ => |
---|
| 21 | + | throw() |
---|
| 22 | + | } |
---|
| 23 | + | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) |
---|
| 24 | + | sha256(rand) |
---|
20 | 25 | | } |
---|
21 | 26 | | |
---|
22 | 27 | | |
---|
23 | | - | func listParser (list,separator) = { |
---|
24 | | - | let choppedList = "x" |
---|
25 | | - | choppedList |
---|
| 28 | + | func listParser (dataString,separator) = { |
---|
| 29 | + | let choppedlist = "x" |
---|
| 30 | + | choppedlist |
---|
26 | 31 | | } |
---|
27 | 32 | | |
---|
28 | 33 | | |
---|
|
37 | 42 | | let paid = extract(i.payment) |
---|
38 | 43 | | let message = "default message for now" |
---|
39 | 44 | | let callerAccount = toBase58String(extract(i.callerPublicKey)) |
---|
| 45 | + | let callerAddress = toBase58String(extract(i.caller.bytes)) |
---|
40 | 46 | | let callerTxId = i.transactionId |
---|
| 47 | + | let asset = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m' |
---|
41 | 48 | | let sizing = if ((paid.amount == 100000000)) |
---|
42 | 49 | | then "S" |
---|
43 | 50 | | else if ((paid.amount == 200000000)) |
---|
|
47 | 54 | | else "error" |
---|
48 | 55 | | let messageData = ((((((toBase58String(extract(i.callerPublicKey)) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + sizing) |
---|
49 | 56 | | if ((sizing == "error")) |
---|
50 | | - | then throw("Unrecognized sizing") |
---|
51 | | - | else writeData(callerAccount, messageData) |
---|
| 57 | + | then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract") |
---|
| 58 | + | else { |
---|
| 59 | + | let tokenAmount = (paid.amount * 3) |
---|
| 60 | + | ScriptResult(WriteSet([DataEntry(callerAccount, messageData)]), TransferSet([ScriptTransfer(i.caller, tokenAmount, asset)])) |
---|
| 61 | + | } |
---|
52 | 62 | | } |
---|
53 | 63 | | |
---|
54 | 64 | | |
---|
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 | 7 | | |
---|
8 | | - | func writeData (dataKey,dataValue) = WriteSet([DataEntry(dataKey, dataValue)]) |
---|
9 | | - | |
---|
10 | | - | |
---|
11 | 8 | | func getData (dataKey) = { |
---|
12 | 9 | | let dataPackage = getStringValue(this, dataKey) |
---|
13 | 10 | | dataPackage |
---|
14 | 11 | | } |
---|
15 | 12 | | |
---|
16 | 13 | | |
---|
17 | | - | func emitToken (receiver,dispenseAmount,attachment) = { |
---|
18 | | - | let token = "KEKS-1" |
---|
19 | | - | token |
---|
| 14 | + | func randomizer (inv) = { |
---|
| 15 | + | let lastPlay = match getBinary(this, "lastPlay") { |
---|
| 16 | + | case s: ByteVector => |
---|
| 17 | + | s |
---|
| 18 | + | case a: Unit => |
---|
| 19 | + | base58'2ee4oFDYriWJ9EMeR' |
---|
| 20 | + | case _ => |
---|
| 21 | + | throw() |
---|
| 22 | + | } |
---|
| 23 | + | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) |
---|
| 24 | + | sha256(rand) |
---|
20 | 25 | | } |
---|
21 | 26 | | |
---|
22 | 27 | | |
---|
23 | | - | func listParser (list,separator) = { |
---|
24 | | - | let choppedList = "x" |
---|
25 | | - | choppedList |
---|
| 28 | + | func listParser (dataString,separator) = { |
---|
| 29 | + | let choppedlist = "x" |
---|
| 30 | + | choppedlist |
---|
26 | 31 | | } |
---|
27 | 32 | | |
---|
28 | 33 | | |
---|
29 | 34 | | func listBuilder (receiver,amount,txid) = { |
---|
30 | 35 | | let compiledList = "placeholder" |
---|
31 | 36 | | compiledList |
---|
32 | 37 | | } |
---|
33 | 38 | | |
---|
34 | 39 | | |
---|
35 | 40 | | @Callable(i) |
---|
36 | 41 | | func dispense () = { |
---|
37 | 42 | | let paid = extract(i.payment) |
---|
38 | 43 | | let message = "default message for now" |
---|
39 | 44 | | let callerAccount = toBase58String(extract(i.callerPublicKey)) |
---|
| 45 | + | let callerAddress = toBase58String(extract(i.caller.bytes)) |
---|
40 | 46 | | let callerTxId = i.transactionId |
---|
| 47 | + | let asset = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m' |
---|
41 | 48 | | let sizing = if ((paid.amount == 100000000)) |
---|
42 | 49 | | then "S" |
---|
43 | 50 | | else if ((paid.amount == 200000000)) |
---|
44 | 51 | | then "M" |
---|
45 | 52 | | else if ((paid.amount == 400000000)) |
---|
46 | 53 | | then "L" |
---|
47 | 54 | | else "error" |
---|
48 | 55 | | let messageData = ((((((toBase58String(extract(i.callerPublicKey)) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + sizing) |
---|
49 | 56 | | if ((sizing == "error")) |
---|
50 | | - | then throw("Unrecognized sizing") |
---|
51 | | - | else writeData(callerAccount, messageData) |
---|
| 57 | + | then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract") |
---|
| 58 | + | else { |
---|
| 59 | + | let tokenAmount = (paid.amount * 3) |
---|
| 60 | + | ScriptResult(WriteSet([DataEntry(callerAccount, messageData)]), TransferSet([ScriptTransfer(i.caller, tokenAmount, asset)])) |
---|
| 61 | + | } |
---|
52 | 62 | | } |
---|
53 | 63 | | |
---|
54 | 64 | | |
---|
55 | 65 | | @Verifier(tx) |
---|
56 | 66 | | func verify () = match tx { |
---|
57 | 67 | | case d: SetScriptTransaction => |
---|
58 | 68 | | sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey) |
---|
59 | 69 | | case d: DataTransaction => |
---|
60 | 70 | | true |
---|
61 | 71 | | case d: TransferTransaction => |
---|
62 | 72 | | true |
---|
63 | 73 | | case d: IssueTransaction => |
---|
64 | 74 | | true |
---|
65 | 75 | | case d: ReissueTransaction => |
---|
66 | 76 | | true |
---|
67 | 77 | | case _ => |
---|
68 | 78 | | false |
---|
69 | 79 | | } |
---|
70 | 80 | | |
---|