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+iHbiGoAAAAACmRlcGxveUluZm8CAAAAJGFkZGVkIGRhdGEgZnVuY3Rpb25hbGl0eSAodGVzdHBoYXNlKQEAAAAHZ2V0RGF0YQAAAAEAAAAHZGF0YUtleQQAAAALZGF0YVBhY2thZ2UJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMFAAAAB2RhdGFLZXkFAAAAC2RhdGFQYWNrYWdlAQAAAApyYW5kb21pemVyAAAAAQAAAANpbnYEAAAACGxhc3RQbGF5BAAAAAckbWF0Y2gwCQAEHAAAAAIFAAAABHRoaXMCAAAACGxhc3RQbGF5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAARVbml0BAAAAAFhBQAAAAckbWF0Y2gwAQAAAAxXYXZlc0xvdHRvVjIJAQAAAAV0aHJv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AAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA5vd25lclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAEElzc3VlVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABJSZWlzc3VlVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGB62xAGk=", "chainId": 84, "height": 660287, "spentComplexity": 0 } View: original | compacted Prev: D4QDtNwpfdM7VStggohUxtnf1FZ2QVMskXgsaViPQadK Next: 2DnrS96vgKjqCWTEvLHL6QZTJSszcKZCZewozravCtif Diff:
OldNewDifferences
55
66 let deployInfo = "added data functionality (testphase)"
77
8-func writeData (dataKey,dataValue) = WriteSet([DataEntry(dataKey, dataValue)])
9-
10-
118 func getData (dataKey) = {
129 let dataPackage = getStringValue(this, dataKey)
1310 dataPackage
1411 }
1512
1613
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)
2025 }
2126
2227
23-func listParser (list,separator) = {
24- let choppedList = "x"
25- choppedList
28+func listParser (dataString,separator) = {
29+ let choppedlist = "x"
30+ choppedlist
2631 }
2732
2833
3742 let paid = extract(i.payment)
3843 let message = "default message for now"
3944 let callerAccount = toBase58String(extract(i.callerPublicKey))
45+ let callerAddress = toBase58String(extract(i.caller.bytes))
4046 let callerTxId = i.transactionId
47+ let asset = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m'
4148 let sizing = if ((paid.amount == 100000000))
4249 then "S"
4350 else if ((paid.amount == 200000000))
4754 else "error"
4855 let messageData = ((((((toBase58String(extract(i.callerPublicKey)) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + sizing)
4956 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+ }
5262 }
5363
5464
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ownerPublicKey = base58'BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH'
55
66 let deployInfo = "added data functionality (testphase)"
77
8-func writeData (dataKey,dataValue) = WriteSet([DataEntry(dataKey, dataValue)])
9-
10-
118 func getData (dataKey) = {
129 let dataPackage = getStringValue(this, dataKey)
1310 dataPackage
1411 }
1512
1613
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)
2025 }
2126
2227
23-func listParser (list,separator) = {
24- let choppedList = "x"
25- choppedList
28+func listParser (dataString,separator) = {
29+ let choppedlist = "x"
30+ choppedlist
2631 }
2732
2833
2934 func listBuilder (receiver,amount,txid) = {
3035 let compiledList = "placeholder"
3136 compiledList
3237 }
3338
3439
3540 @Callable(i)
3641 func dispense () = {
3742 let paid = extract(i.payment)
3843 let message = "default message for now"
3944 let callerAccount = toBase58String(extract(i.callerPublicKey))
45+ let callerAddress = toBase58String(extract(i.caller.bytes))
4046 let callerTxId = i.transactionId
47+ let asset = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m'
4148 let sizing = if ((paid.amount == 100000000))
4249 then "S"
4350 else if ((paid.amount == 200000000))
4451 then "M"
4552 else if ((paid.amount == 400000000))
4653 then "L"
4754 else "error"
4855 let messageData = ((((((toBase58String(extract(i.callerPublicKey)) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + sizing)
4956 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+ }
5262 }
5363
5464
5565 @Verifier(tx)
5666 func verify () = match tx {
5767 case d: SetScriptTransaction =>
5868 sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
5969 case d: DataTransaction =>
6070 true
6171 case d: TransferTransaction =>
6272 true
6373 case d: IssueTransaction =>
6474 true
6575 case d: ReissueTransaction =>
6676 true
6777 case _ =>
6878 false
6979 }
7080

github/deemru/w8io/169f3d6 
25.17 ms