tx · RY88okCaxByZC5JUKqdTs3dgPNVevxSEoQjtrDafoXk

3NByvCG2T14xJ3bfRNpKCns37ehfBSTGja3:  -0.01400000 Waves

2019.07.28 18:28 [606101] smart account 3NByvCG2T14xJ3bfRNpKCns37ehfBSTGja3 > SELF 0.00000000 Waves

{ "type": 13, "id": "RY88okCaxByZC5JUKqdTs3dgPNVevxSEoQjtrDafoXk", "fee": 1400000, "feeAssetId": null, "timestamp": 1564327778782, "version": 1, "sender": "3NByvCG2T14xJ3bfRNpKCns37ehfBSTGja3", "senderPublicKey": "5ADSy4csCWyBrq24UKNhxf9g1q3ntYJ1JJC7582a5sF1", "proofs": [ "3u2jCRyCgUEy7qwYPopzV7BnzHgV6xV3CZsCYUEDsCZCmh1zSWCbajB8SMGHGbipGueUdw2boaXfcfHdEAYnExHy" ], "script": "base64:AAIDAAAAAAAAAAAAAAADAAAAAARzYWx0AgAAAARzYWx0AAAAAAZyZWJhaXQAAAAAAAAPaVABAAAAEmdldEludGVyZ2VyRGVmYXVsdAAAAAIAAAADa2V5AAAAB2RlZmF1bHQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAAB2RlZmF1bHQAAAADAAAAAWkBAAAAB3Nwb25zb3IAAAABAAAADm9yYWNsZUFkZGRyZXNzBAAAAANrZXkJAAEsAAAAAgIAAAAKc3BvbnNvcmVkXwUAAAAOb3JhY2xlQWRkZHJlc3MEAAAAB3BheW1lbnQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAIhPQAAAAIIBQAAAAdwYXltZW50AAAAB2Fzc2V0SWQFAAAABHVuaXQJAAACAAAAAQIAAAAcc3BvbnNvcnNoaXAgbXVzdCBiZSBpbiBXQVZFUwQAAAAIbmV3VmFsdWUJAABkAAAAAggFAAAAB3BheW1lbnQAAAA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yeQAAAAIFAAAACXJldmVhbEtleQUAAAAGcmFuZG9tBQAAAANuaWwAAAAAjxF51Q==", "chainId": 84, "height": 606101, "spentComplexity": 0 } View: original | compacted Prev: GRhoZrFn7UeBasXSDqY4KCPH1YXix5VkyUC5QmvjSFje Next: none Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let salt = "salt"
55
6-let rebait = 600000
6+let rebait = 1010000
77
88 func getIntergerDefault (key,default) = match getInteger(this, key) {
99 case a: Int =>
3232 let caller = toBase58String(i.caller.bytes)
3333 let commitKey = ((("commit_" + caller) + "_") + toString(height))
3434 if (isDefined(getString(this, commitKey)))
35- then throw("commit already done")
35+ then throw((("commit for height " + toString(height)) + " already done"))
3636 else WriteSet([DataEntry(commitKey, commit)])
3737 }
3838
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let salt = "salt"
55
6-let rebait = 600000
6+let rebait = 1010000
77
88 func getIntergerDefault (key,default) = match getInteger(this, key) {
99 case a: Int =>
1010 a
1111 case _ =>
1212 default
1313 }
1414
1515
1616 @Callable(i)
1717 func sponsor (oracleAdddress) = {
1818 let key = ("sponsored_" + oracleAdddress)
1919 let payment = extract(i.payment)
2020 if ((payment.assetId != unit))
2121 then throw("sponsorship must be in WAVES")
2222 else {
2323 let newValue = (payment.amount + getIntergerDefault(key, 0))
2424 WriteSet([DataEntry(key, newValue)])
2525 }
2626 }
2727
2828
2929
3030 @Callable(i)
3131 func commit (commit) = {
3232 let caller = toBase58String(i.caller.bytes)
3333 let commitKey = ((("commit_" + caller) + "_") + toString(height))
3434 if (isDefined(getString(this, commitKey)))
35- then throw("commit already done")
35+ then throw((("commit for height " + toString(height)) + " already done"))
3636 else WriteSet([DataEntry(commitKey, commit)])
3737 }
3838
3939
4040
4141 @Callable(i)
4242 func reveal (revealHeight,random) = if ((extract(parseInt(revealHeight)) >= height))
4343 then throw("reveal must be in the past blocks after commit")
4444 else {
4545 let caller = toBase58String(i.caller.bytes)
4646 let commit = extract(getString(this, ((("commit_" + caller) + "_") + revealHeight)))
4747 let correctCommit = toBase16String(sha256(toBytes((random + salt))))
4848 if ((commit != correctCommit))
4949 then throw("invalid reveal")
5050 else {
5151 let revealKey = ((("reveal_" + caller) + "_") + revealHeight)
5252 if (isDefined(getString(this, revealKey)))
5353 then throw("reveal already in blockchain")
5454 else {
5555 let sponsorKey = ("sponsored_" + caller)
5656 let sponsoredAmount = getIntergerDefault(sponsorKey, 0)
5757 if ((sponsoredAmount >= rebait))
5858 then ScriptResult(WriteSet([DataEntry(sponsorKey, (sponsoredAmount - rebait)), DataEntry(revealKey, random)]), TransferSet([ScriptTransfer(i.caller, rebait, unit)]))
5959 else WriteSet([DataEntry(revealKey, random)])
6060 }
6161 }
6262 }
6363
6464

github/deemru/w8io/169f3d6 
41.14 ms