tx · 2wEC6v8EayocEeQyKWa4LKHVHjxfdvv7zquh7BSR1cwi

3NBiXxLpuHVS2dGSaLvyPfCQYMPRKCtGCVg:  -0.01400000 Waves

2019.07.09 22:57 [578555] smart account 3NBiXxLpuHVS2dGSaLvyPfCQYMPRKCtGCVg > SELF 0.00000000 Waves

{ "type": 13, "id": "2wEC6v8EayocEeQyKWa4LKHVHjxfdvv7zquh7BSR1cwi", "fee": 1400000, "feeAssetId": null, "timestamp": 1562702289450, "version": 1, "sender": "3NBiXxLpuHVS2dGSaLvyPfCQYMPRKCtGCVg", "senderPublicKey": "H2yzJU1BtKf9NAhJSK6nCVgmFdaRaFBs5y3zgajHTLGs", "proofs": [ "5Ka8iAZjsawhddk8LYdoz2rrLJyPAbompxrBiDLoeF252aS5jBGDbk4edGaBRotjzxAHHXYfN4gK2kDqZ3X2mVs" ], "script": "base64:AAIDAAAAAAAAAAAAAAAKAAAAAA5hZG1pblB1YmxpY0tleQEAAAAgoPq5TrIPqNMyX9LJ5ea1kHoixxLdZLkjdZ9lUlSz41QAAAAABXdjdElkAQAAACBAkwcahwxqDOVmEdNdlcYsRPoEBwsu3SMjVjLFv3jP4gAAAAAId3ZzUHJpY2UAAAAAAAX14QAAAAAACHdjdFByaWNlAAAAAAAAAABkAAAAAAhsYXN0Q2VsbAAAAAAAAAAAYwAAAAAIcm91bmRLZXkCAAAABXJvdW5kAAAAAAhjZWxsc0tleQIAAAAFY2VsbHMAAAAACmxhc3RXaW5LZXkCAAAAB2xhc3RXaW4AAAAADWxhc3RXaW5XY3RLZXkCAAAACmxhc3RXaW5XY3QAAAAADWxhc3RXaW5XdnNLZXkCAAAAC2xhc3RXaW5fd3ZzAAAAAQAAAAFpAQAAAANidXkAAAABAAAABGNlbGwEAAAABXJvdW5kCQEAAAAHZXh0cmFjdAAAAAEJAAQaAAAAAgUAAAAEdGhpcwUAAAAIcm91bmRLZXkEAAAABWNlbGxzCQEAAAAHZXh0cmFjdAAAAAEJAAQaAAAAAgUAA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WluU2hhcmUFAAAABXdjdElkBQAAAANuaWwJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAGkAAAAAQUAAAAEY2VsbAkAASwAAAACCQABLAAAAAIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyAgAAAAFfCQABpAAAAAEFAAAABXJvdW5kCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAhjZWxsc0tleQkAAGQAAAACBQAAAAVjZWxscwAAAAAAAAAAAQUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAQAAAAHJG1hdGNoMAUAAAACdHgJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5/xpoGw==", "chainId": 84, "height": 578555, "spentComplexity": 0 } View: original | compacted Prev: DGn5BtdPMuxHhrXBcKtQQ8BVQUDBabbhwB6oJnbuioQJ Next: none Diff:
OldNewDifferences
1717
1818 let lastWinKey = "lastWin"
1919
20-let lastWinWctKey = "lastWin_wct"
20+let lastWinWctKey = "lastWinWct"
2121
2222 let lastWinWvsKey = "lastWin_wvs"
2323
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let adminPublicKey = base58'BqPySUvbKdRTRZ33nGTtrQRdus5qwhnQkqZ7G9iNcDto'
55
66 let wctId = base58'5M58Edq3qciFLWMFS9kLLKfFQoENxokdi2hdE3ju4hrq'
77
88 let wvsPrice = 100000000
99
1010 let wctPrice = 100
1111
1212 let lastCell = 99
1313
1414 let roundKey = "round"
1515
1616 let cellsKey = "cells"
1717
1818 let lastWinKey = "lastWin"
1919
20-let lastWinWctKey = "lastWin_wct"
20+let lastWinWctKey = "lastWinWct"
2121
2222 let lastWinWvsKey = "lastWin_wvs"
2323
2424 @Callable(i)
2525 func buy (cell) = {
2626 let round = extract(getInteger(this, roundKey))
2727 let cells = extract(getInteger(this, cellsKey))
2828 if (if ((0 > cell))
2929 then true
3030 else (cell > lastCell))
3131 then throw("Invalid number")
3232 else {
3333 let pmt = valueOrErrorMessage(i.payment, "Where is payment?")
3434 let wvs = !(isDefined(pmt.assetId))
3535 let wct = (pmt.assetId == wctId)
3636 if (if (if (if (!(wct))
3737 then !(wvs)
3838 else false)
3939 then true
4040 else if (wct)
4141 then (pmt.amount != wctPrice)
4242 else false)
4343 then true
4444 else if (wvs)
4545 then (pmt.amount != wvsPrice)
4646 else false)
4747 then throw("Price is 1 WCT or 1 WAVES")
4848 else {
4949 let cellData = getString(this, toString(cell))
5050 let bought = if (isDefined(cellData))
5151 then {
5252 let cellRound = split(extract(cellData), "_")[1]
5353 if ((cellRound == toString(round)))
5454 then true
5555 else false
5656 }
5757 else false
5858 if (bought)
5959 then throw("Already bought")
6060 else {
6161 let last = (cells == lastCell)
6262 if (last)
6363 then {
6464 let wctFlag = if (wct)
6565 then 1
6666 else 0
6767 let wvsFlag = if (wvs)
6868 then 1
6969 else 0
7070 let wctAmount = (assetBalance(this, wctId) + (pmt.amount * wctFlag))
7171 let wvsAmount = (wavesBalance(this) + (pmt.amount * wvsFlag))
7272 let wvsAdminShare = (wvsAmount / 10)
7373 let wvsWinShare = (wvsAmount - wvsAdminShare)
7474 let wctAdminShare = (wctAmount / 10)
7575 let wctWinShare = (wctAmount - wctAdminShare)
7676 let adminAddress = addressFromPublicKey(adminPublicKey)
7777 let winCell = (toInt(lastBlock.generationSignature) % (lastCell + 1))
7878 let winData = extract(getString(this, toString(winCell)))
7979 let winAddress = if ((winCell == cell))
8080 then i.caller
8181 else extract(addressFromString(split(winData, "_")[0]))
8282 ScriptResult(WriteSet([DataEntry(toString(cell), ((toString(i.caller) + "_") + toString(round))), DataEntry(cellsKey, 0), DataEntry(roundKey, (round + 1)), DataEntry(lastWinKey, ((toString(winCell) + "_") + toString(winAddress))), DataEntry(lastWinWvsKey, wvsAmount), DataEntry(lastWinWctKey, wctAmount)]), TransferSet([ScriptTransfer(winAddress, wvsWinShare, unit), ScriptTransfer(adminAddress, wvsAdminShare, unit), ScriptTransfer(winAddress, wctWinShare, wctId), ScriptTransfer(adminAddress, wctAdminShare, wctId)]))
8383 }
8484 else WriteSet([DataEntry(toString(cell), ((toString(i.caller) + "_") + toString(round))), DataEntry(cellsKey, (cells + 1))])
8585 }
8686 }
8787 }
8888 }
8989
9090
9191 @Verifier(tx)
9292 func verify () = match tx {
9393 case _ =>
9494 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
9595 }
9696

github/deemru/w8io/169f3d6 
30.79 ms