tx · 4zScMVSEjUomSn2qj2bXPS4G76F9gAEShBkrxsQwCRd3

3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi:  -0.01400000 Waves

2019.10.05 00:22 [705536] smart account 3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi > SELF 0.00000000 Waves

{ "type": 13, "id": "4zScMVSEjUomSn2qj2bXPS4G76F9gAEShBkrxsQwCRd3", "fee": 1400000, "feeAssetId": null, "timestamp": 1570224289892, "version": 1, "sender": "3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi", "senderPublicKey": "BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH", "proofs": [ "2gj3HT6pN5W4eQVdEBCmHLoha8bWZ21NCkQc31uhH4K6v5b8ZcZaYycXBvksbniL67xkqNu3SfBVthDaVc3gUgVH" ], "script": "base64:AAIDAAAAAAAAAAAAAAAJAAAAAA5vd25lclB1YmxpY0tleQEAAAAgnOTxzRGlQL/gVO1uf4r6ecWijHA9iBu9xK1V+iHbiGoAAAAADFJhbmRvbWl6ZUtleQkAAlkAAAABAgAAACxCWlQ1Znp2OFplSFZuOHhBR1pWWFpIVXZvQWtkUk5DYnRFdUJuM3BDdVhFSAAAAAAKZGVwbG95SW5mbwIAAAAkYWRkZWQgZGF0YSBmdW5jdGlvbmFsaXR5ICh0ZXN0cGhhc2UpAQAAAAtlbmNyeXB0RGF0YQAAAAIAAAAHbWVzc2FnZQAAAARwS2V5BAAAAAZvdXRwdXQCAAAAJHJzYVZlcmlmeShTaGEyNTYgLG1lc3NhZ2UscEtleSxwS2V5KQUAAAAGb3V0cHV0AQAAAAlzZXNzaW9uSWQAAAAABAAAAANnaWQJAASxAAAAAQkAAfcAAAABCQABmgAAAAEIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0BQAAAANnaWQBAAAACXJhbmRvbWl6ZQAAAAIAAAAHcnNhU2lnbgAAAAt0aGlzU2Vzc2lvbgQAAAAGZ2FtZUlkBQAAA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QAAAAttZXNzYWdlRGF0YQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAALdG9rZW5BbW91bnQFAAAABWFzc2V0BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAABQAAAA5vd25lclB1YmxpY0tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAEElzc3VlVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABJSZWlzc3VlVHJhbnNhY3Rpb24EAAAAAWQFAAAAByRtYXRjaDAGB6QiFJ8=", "chainId": 84, "height": 705536, "spentComplexity": 0 } View: original | compacted Prev: 3Y61pD3A2KLV1vJA7MMu53hFE5xstD6iyNshVztvYg8e Next: 2VmMcdHo26tnp1JAaakP1VUMefPF8T2SkadYaHnuiZ4j Diff:
OldNewDifferences
5353
5454 @Callable(i)
5555 func dispense () = {
56- let thisSession = sessionId()
56+ let gameId = toBase58String(i.transactionId)
5757 let paid = extract(i.payment)
5858 let message = "default message for now"
5959 let callerAccount = toBase58String(extract(i.callerPublicKey))
6767 else if ((paid.amount == 400000000))
6868 then "L"
6969 else "error"
70- let messageData = ((((((((((toBase58String(extract(i.callerPublicKey)) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + toString(thisSession)) + ";") + toString(randomize(toString(thisSession), toString(thisSession)))) + ";") + sizing)
70+ let messageData = ((((((((toBase58String(extract(i.callerPublicKey)) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + gameId) + ";") + sizing)
7171 if ((sizing == "error"))
7272 then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract")
7373 else {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ownerPublicKey = base58'BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH'
55
66 let RandomizeKey = fromBase58String("BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH")
77
88 let deployInfo = "added data functionality (testphase)"
99
1010 func encryptData (message,pKey) = {
1111 let output = "rsaVerify(Sha256 ,message,pKey,pKey)"
1212 output
1313 }
1414
1515
1616 func sessionId () = {
1717 let gid = toInt(sha256(toBytes(lastBlock.height)))
1818 gid
1919 }
2020
2121
2222 func randomize (rsaSign,thisSession) = {
2323 let gameId = thisSession
2424 let rsaSigValid = sigVerify(toBytes(gameId), toBytes(rsaSign), RandomizeKey)
2525 if (rsaSigValid)
2626 then {
2727 let rand = (toInt(sha256(toBytes(rsaSign))) % 6)
2828 if ((0 > rand))
2929 then ((-1 * rand) + 1)
3030 else (rand + 1)
3131 }
3232 else throw("Invalid RSA signature")
3333 }
3434
3535
3636 func listParser (dataString,separator) = {
3737 let choppedlist = "x"
3838 choppedlist
3939 }
4040
4141
4242 func listBuilder (receiver,amount,txid) = {
4343 let compiledList = "placeholder"
4444 compiledList
4545 }
4646
4747
4848 func getData (dataKey) = {
4949 let dataPackage = getStringValue(this, dataKey)
5050 dataPackage
5151 }
5252
5353
5454 @Callable(i)
5555 func dispense () = {
56- let thisSession = sessionId()
56+ let gameId = toBase58String(i.transactionId)
5757 let paid = extract(i.payment)
5858 let message = "default message for now"
5959 let callerAccount = toBase58String(extract(i.callerPublicKey))
6060 let callerAddress = toBase58String(extract(i.caller.bytes))
6161 let callerTxId = i.transactionId
6262 let asset = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m'
6363 let sizing = if ((paid.amount == 100000000))
6464 then "S"
6565 else if ((paid.amount == 200000000))
6666 then "M"
6767 else if ((paid.amount == 400000000))
6868 then "L"
6969 else "error"
70- let messageData = ((((((((((toBase58String(extract(i.callerPublicKey)) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + toString(thisSession)) + ";") + toString(randomize(toString(thisSession), toString(thisSession)))) + ";") + sizing)
70+ let messageData = ((((((((toBase58String(extract(i.callerPublicKey)) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + gameId) + ";") + sizing)
7171 if ((sizing == "error"))
7272 then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract")
7373 else {
7474 let tokenAmount = (paid.amount * 3)
7575 ScriptResult(WriteSet([DataEntry(callerAccount, messageData)]), TransferSet([ScriptTransfer(i.caller, tokenAmount, asset)]))
7676 }
7777 }
7878
7979
8080 @Verifier(tx)
8181 func verify () = match tx {
8282 case d: SetScriptTransaction =>
8383 sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
8484 case d: DataTransaction =>
8585 true
8686 case d: TransferTransaction =>
8787 true
8888 case d: IssueTransaction =>
8989 true
9090 case d: ReissueTransaction =>
9191 true
9292 case _ =>
9393 false
9494 }
9595

github/deemru/w8io/169f3d6 
84.19 ms