tx · DbECe8vL7McZLEehdDZWgaYPx6VcSooTmJuuHLUiVrtu

3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi:  -0.01400000 Waves

2020.04.15 05:20 [954909] smart account 3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi > SELF 0.00000000 Waves

{ "type": 13, "id": "DbECe8vL7McZLEehdDZWgaYPx6VcSooTmJuuHLUiVrtu", "fee": 1400000, "feeAssetId": null, "timestamp": 1586917433839, "version": 1, "sender": "3MxorpV6jKdNhrzHSujnjVXu7fr8PCHhMwi", "senderPublicKey": "BZT5fzv8ZeHVn8xAGZVXZHUvoAkdRNCbtEuBn3pCuXEH", "proofs": [ "5BH85PH5NzqHbafFXZ2n18KHfr4xSJeWrL8LgurbHDKpMot1vMepGXBab9KAcY8fLVNedj2pdxH8kvutcMGZnrpF" ], "script": "base64:AAIDAAAAAAAAAAkIARIAEgMKAQgAAAAJAAAAAA5vd25lclB1YmxpY0tleQEAAAAgnOTxzRGlQL/gVO1uf4r6ecWijHA9iBu9xK1V+iHbiGoAAAAADFJhbmRvbWl6ZUtleQkAAlkAAAABAgAAACxCWlQ1Znp2OFplSFZuOHhBR1pWWFpIVXZvQWtkUk5DYnRFdUJuM3BDdVhFSAAAAAAKZGVwbG95SW5mbwIAAAAkYWRkZWQgZGF0YSBmdW5jdGlvbmFsaXR5ICh0ZXN0cGhhc2UpAAAAAAVhc3NldAEAAAAgVXxs3EW2jBqsaGzTqhCj5Mw9QqAAJNYM2NtCErS5DvoBAAAAC2VuY3J5cHREYXRhAAAAAgAAAAdtZXNzYWdlAAAABHBLZXkEAAAABm91dHB1dAIAAAAkcnNhVmVyaWZ5KFNoYTI1NiAsbWVzc2FnZSxwS2V5LHBLZXkpBQAAAAZvdXRwdXQBAAAACXNlc3Npb25JZAAAAAAEAAAAA2dpZAkABLEAAAABCQAB9wAAAAEJAAGaAAAAAQgFAAAACWxhc3RCbG9jawAAAAZoZWlnaHQFAAAAA2dpZAEAAAAHZ2V0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ZYBx Diff:
OldNewDifferences
2727 }
2828
2929
30+func updateUserTXrecord (callerAddress,newTXid) = {
31+ let currentRecord = getData(callerAddress)
32+ let newRecord = ((newTXid + ";") + currentRecord)
33+ let response = WriteSet([DataEntry(callerAddress, newRecord)])
34+ response
35+ }
36+
37+
3038 func updateField (dataList,listSeparator,fieldIndex,newFieldData) = {
3139 let numFields = size(dataList)
3240 if ((numFields >= fieldIndex))
5058
5159 @Callable(i)
5260 func initiate () = {
53- let gameId = toBase58String(i.transactionId)
61+ let transactionId = toBase58String(i.transactionId)
5462 let paid = extract(i.payment)
5563 let message = "default message for now"
5664 let callerAccount = toBase58String(extract(i.callerPublicKey))
6674 let messageData = (((((((("SUBMITTED" + ";") + toBase58String(extract(i.caller.bytes))) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + sizing)
6775 if ((sizing == "error"))
6876 then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract")
69- else WriteSet([DataEntry(gameId, messageData)])
77+ else {
78+ let returnTransactionList = match getString(this, (callerAccount + ":transactions")) {
79+ case c: String =>
80+ (transactionId + c)
81+ case _ =>
82+ transactionId
83+ }
84+ WriteSet([DataEntry(transactionId, messageData), DataEntry((callerAccount + ":transactions"), returnTransactionList)])
85+ }
7086 }
7187
7288
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 let asset = base58'6khhQRn6E7dsLqxnkGHnEKoZZJv9U7bhadzprWvjAi6m'
1111
1212 func encryptData (message,pKey) = {
1313 let output = "rsaVerify(Sha256 ,message,pKey,pKey)"
1414 output
1515 }
1616
1717
1818 func sessionId () = {
1919 let gid = toInt(sha256(toBytes(lastBlock.height)))
2020 gid
2121 }
2222
2323
2424 func getData (dataKey) = {
2525 let dataPackage = getStringValue(this, dataKey)
2626 dataPackage
2727 }
2828
2929
30+func updateUserTXrecord (callerAddress,newTXid) = {
31+ let currentRecord = getData(callerAddress)
32+ let newRecord = ((newTXid + ";") + currentRecord)
33+ let response = WriteSet([DataEntry(callerAddress, newRecord)])
34+ response
35+ }
36+
37+
3038 func updateField (dataList,listSeparator,fieldIndex,newFieldData) = {
3139 let numFields = size(dataList)
3240 if ((numFields >= fieldIndex))
3341 then if ((fieldIndex == 0))
3442 then {
3543 let field0 = newFieldData
3644 let field1 = extract(split(dataList, ";")[1])
3745 let field2 = extract(split(dataList, ";")[2])
3846 let field3 = extract(split(dataList, ";")[3])
3947 let field4 = extract(split(dataList, ";")[4])
4048 let field5 = extract(split(dataList, ";")[5])
4149 let field6 = extract(split(dataList, ";")[6])
4250 let field7 = extract(split(dataList, ";")[7])
4351 let returnString = ((((((((((((((field0 + listSeparator) + field1) + listSeparator) + field2) + listSeparator) + field3) + listSeparator) + field4) + listSeparator) + field5) + listSeparator) + field6) + listSeparator) + field7)
4452 returnString
4553 }
4654 else throw("error creating datastring")
4755 else throw(("field index out of range. Number of fields for string is: " + toString(numFields)))
4856 }
4957
5058
5159 @Callable(i)
5260 func initiate () = {
53- let gameId = toBase58String(i.transactionId)
61+ let transactionId = toBase58String(i.transactionId)
5462 let paid = extract(i.payment)
5563 let message = "default message for now"
5664 let callerAccount = toBase58String(extract(i.callerPublicKey))
5765 let callerAddress = toBase58String(extract(i.caller.bytes))
5866 let callerTxId = i.transactionId
5967 let sizing = if ((paid.amount == 100000000))
6068 then "S"
6169 else if ((paid.amount == 200000000))
6270 then "M"
6371 else if ((paid.amount == 400000000))
6472 then "L"
6573 else "error"
6674 let messageData = (((((((("SUBMITTED" + ";") + toBase58String(extract(i.caller.bytes))) + ";") + toString(paid.amount)) + ";") + toString(height)) + ";") + sizing)
6775 if ((sizing == "error"))
6876 then throw("Prices are 1, 2, and 4 waves. Other amounts will be rejected by the smart contract")
69- else WriteSet([DataEntry(gameId, messageData)])
77+ else {
78+ let returnTransactionList = match getString(this, (callerAccount + ":transactions")) {
79+ case c: String =>
80+ (transactionId + c)
81+ case _ =>
82+ transactionId
83+ }
84+ WriteSet([DataEntry(transactionId, messageData), DataEntry((callerAccount + ":transactions"), returnTransactionList)])
85+ }
7086 }
7187
7288
7389
7490 @Callable(i)
7591 func finalize (txId) = if ((i.callerPublicKey != ownerPublicKey))
7692 then throw("Only owner can call finalize function")
7793 else {
7894 let coinData = getData(txId)
7995 let coinAmount = parseIntValue(extract(split(coinData, ";")[8]))
8096 let statusField = parseIntValue(extract(split(coinData, ";")[0]))
8197 let messageData = updateField(coinData, ";", 0, "COMPLETED")
8298 ScriptResult(WriteSet([DataEntry(txId, messageData)]), TransferSet([ScriptTransfer(i.caller, coinAmount, asset)]))
8399 }
84100
85101
86102 @Verifier(tx)
87103 func verify () = match tx {
88104 case d: TransferTransaction|ReissueTransaction|IssueTransaction|SetScriptTransaction =>
89105 sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
90106 case d: DataTransaction =>
91107 sigVerify(tx.bodyBytes, tx.proofs[0], ownerPublicKey)
92108 case _ =>
93109 false
94110 }
95111

github/deemru/w8io/169f3d6 
27.17 ms