tx · GPtpm1W1S7WuimStp57L8Vrs5Hux9Ce382PgJvxZY2GD 3Mu5kasZ85VY5xUCpPYoWr6fBzh6eGZwcnt: -0.01000000 Waves 2023.05.18 09:58 [2583059] smart account 3Mu5kasZ85VY5xUCpPYoWr6fBzh6eGZwcnt > SELF 0.00000000 Waves
{ "type": 13, "id": "GPtpm1W1S7WuimStp57L8Vrs5Hux9Ce382PgJvxZY2GD", "fee": 1000000, "feeAssetId": null, "timestamp": 1684393136024, "version": 2, "chainId": 84, "sender": "3Mu5kasZ85VY5xUCpPYoWr6fBzh6eGZwcnt", "senderPublicKey": "6VehQ4nhpSn9EW76xuyThbHcUFYhjEbb4sJDrys5ZEx5", "proofs": [ "4WsJ87kEto5wnQzQQgUUVdNamQ4ZiPDNqWW4AE3JdSzTBf9dEz7XTjygMW41nkAF8e3jnJViseBRBq9YxbGkNkS1" ], "script": "base64:BgIMCAISAwoBARIDCgEBAAIBaQEOc2V0dGVySU5URVJOQUwBAW4EBWNoZWNrAwkAAAIIBQFpBmNhbGxlcgUEdGhpcwYJAAIBAgdFUlJPUiAxAwkAAAIFBWNoZWNrBQVjaGVjawkAzAgCCQEMSW50ZWdlckVudHJ5AgIIbnVtVmFsdWUFAW4FA25pbAkAAgECJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgFpAQZzZXR0ZXIBAW4EDW90aGVyQ29udHJhY3QJARFAZXh0ck5hdGl2ZSgxMDYyKQECIzNOQ1dGSER6ZFBIWkM2NjM2WmtNTE5EdXA5bWpwYlRMczdoBAJ0YwkA/AcEBQR0aGlzAg5zZXR0ZXJJTlRFUk5BTAkAzAgCBQFuBQNuaWwFA25pbAMJAAACBQJ0YwUCdGMEAm9jCQD8BwQFDW90aGVyQ29udHJhY3QCBnVwZGF0ZQUDbmlsBQNuaWwDCQAAAgUCb2MFAm9jBQNuaWwJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4JAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4ARAsmZw==", "height": 2583059, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D2RBDKCErsjK68y9e1sb7cKcwveqfetieCRCZwKgBYog Next: HpgSPVy6NazJM2RCaJSjBpBRX5XuL4cVE1rMCzV5cX9U Full:
Old | New | Differences | |
---|---|---|---|
1 | - | {-# STDLIB_VERSION | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | func randomizer (inv) = { | |
5 | - | let lastPlay = match getBinary(this, "lastPlay") { | |
6 | - | case s: ByteVector => | |
7 | - | s | |
8 | - | case a: Unit => | |
9 | - | base58'2ee4oFDYriWJ9EMeR' | |
10 | - | case _ => | |
11 | - | throw() | |
12 | - | } | |
13 | - | let rand = (((((lastPlay + inv.transactionId) + inv.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
14 | - | sha256(rand) | |
4 | + | ||
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func setterINTERNAL (n) = { | |
8 | + | let check = if ((i.caller == this)) | |
9 | + | then true | |
10 | + | else throw("ERROR 1") | |
11 | + | if ((check == check)) | |
12 | + | then [IntegerEntry("numValue", n)] | |
13 | + | else throw("Strict value is not equal to itself.") | |
15 | 14 | } | |
16 | 15 | ||
17 | 16 | ||
18 | - | func startLotto (inv) = { | |
19 | - | let playLimit = (wavesBalance(this) / 100) | |
20 | - | let payment = extract(inv.payment) | |
21 | - | if (!(isDefined(inv.payment))) | |
22 | - | then throw("Should be with Payment in Waves") | |
23 | - | else if (isDefined(payment.assetId)) | |
24 | - | then throw("Payment should be in Waves") | |
25 | - | else if ((payment.amount > playLimit)) | |
26 | - | then throw(("Payment should be less than " + toString(playLimit))) | |
27 | - | else { | |
28 | - | let randhash = randomizer(inv) | |
29 | - | let winTransfer = TransferSet([ScriptTransfer(inv.caller, ((payment.amount * 190) / 100), unit)]) | |
30 | - | let writeLastPlay = WriteSet([DataEntry("lastPlay", randhash)]) | |
31 | - | if ((500 > (toInt(randhash) % 1000))) | |
32 | - | then ScriptResult(writeLastPlay, winTransfer) | |
33 | - | else ScriptResult(writeLastPlay, TransferSet(nil)) | |
34 | - | } | |
17 | + | ||
18 | + | @Callable(i) | |
19 | + | func setter (n) = { | |
20 | + | let otherContract = addressFromStringValue("3NCWFHDzdPHZC6636ZkMLNDup9mjpbTLs7h") | |
21 | + | let tc = invoke(this, "setterINTERNAL", [n], nil) | |
22 | + | if ((tc == tc)) | |
23 | + | then { | |
24 | + | let oc = invoke(otherContract, "update", nil, nil) | |
25 | + | if ((oc == oc)) | |
26 | + | then nil | |
27 | + | else throw("Strict value is not equal to itself.") | |
28 | + | } | |
29 | + | else throw("Strict value is not equal to itself.") | |
35 | 30 | } | |
36 | - | ||
37 | - | ||
38 | - | @Callable(inv) | |
39 | - | func lotto () = startLotto(inv) | |
40 | - | ||
41 | - | ||
42 | - | ||
43 | - | @Callable(inv) | |
44 | - | func default () = startLotto(inv) | |
45 | 31 | ||
46 | 32 |
github/deemru/w8io/169f3d6 104.34 ms ◑