tx · AL576tv4t5ZNJoETcS8Y7WPurMwY7jdvRdBsf3MqrZYd 3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY: -0.00700000 Waves 2022.07.06 20:58 [2128157] smart account 3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY > SELF 0.00000000 Waves
{ "type": 13, "id": "AL576tv4t5ZNJoETcS8Y7WPurMwY7jdvRdBsf3MqrZYd", "fee": 700000, "feeAssetId": null, "timestamp": 1657130335010, "version": 2, "chainId": 84, "sender": "3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY", "senderPublicKey": "A8DvbFTEjyHFvpK57CmHu6QKczzymTB5sgqq8xxjNsXG", "proofs": [ "4Ub6qtjyMH863xKCktCP5HsNfMWzzc3CghojH3R1oWtpuJtzTTi61KiVyb3XFP9jyiyStgFkqEjqduihdUndceKp" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAABgAAAAADU0VQAgAAAAJfXwEAAAAVa2V5QmVuZWZpY2lhcnlBZGRyZXNzAAAAAAIAAAAdJXMlc19fY2ZnX19iZW5lZmljaWFyeUFkZHJlc3MBAAAAFmtleUNvbnN0cnVjdG9ySW50ZXJ2YWwAAAAAAgAAACElcyVzX19jZmdfX25vZGVDb250cnVjdG9ySW50ZXJ2YWwBAAAAE2tleUxhc3RVcGRhdGVIZWlnaHQAAAAAAgAAABUlc19fbGFzdFVwZGF0ZWRIZWlnaHQBAAAAE2tleVNjcmlwdFVwZGF0ZUhhc2gAAAAAAgAAABQlc19fc2NyaXB0VXBkYXRlSGFzaAAAAAAMbm9kZVJlZ2lzdHJ5CQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABAgAAACMzTXNVOTM2YnJpcVEyWFpNcGtoV2RyVjhFc053bTVpQ3VSWQAAAAEAAAABaQEAAAALY29uc3RydWN0b3IAAAABAAAAF2JlbmVmaWNpYXJ5QWRkcmVzc1N0cjU4AwkBAAAAAiE9AAAAAgUAAAAEdGhpcwgFAAAAAWkAAA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Axub2RlUmVnaXN0cnkJAQAAABNrZXlTY3JpcHRVcGRhdGVIYXNoAAAAAAIAAAAABAAAAAthbGxvd0J5SGFzaAMJAQAAAAIhPQAAAAIFAAAAC2FsbG93ZWRIYXNoAgAAAAAJAAAAAAAAAgUAAAALYWxsb3dlZEhhc2gFAAAABGhhc2gHBAAAAAphbGxvd0J5U2lnCQAJxgAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleQMFAAAACmFsbG93QnlTaWcGBQAAAAthbGxvd0J5SGFzaAkAAAIAAAABAgAAAAtub3QgYWxsb3dlZNuVxGk=", "height": 2128157, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EUwaWMp11KX9TWQUdwzhtStRNThrPS4Fd9TmD6KQ1JSa Next: B4Yy3ovpSn5jGaBUonzhQcxt7eEaXSVXAqjbfBVqihWe Diff:
Old | New | Differences | |
---|---|---|---|
54 | 54 | then (allowedHash == hash) | |
55 | 55 | else false | |
56 | 56 | let allowBySig = sigVerify_32Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
57 | - | if ( | |
57 | + | if (allowBySig) | |
58 | 58 | then true | |
59 | - | else allowByHash) | |
60 | - | then true | |
61 | - | else throw(((("SetScriptTransaction - allowBySig=" + toString(allowBySig)) + " allowByHash=") + toString(allowByHash))) | |
59 | + | else allowByHash | |
62 | 60 | case _ => | |
63 | 61 | throw("not allowed") | |
64 | 62 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let SEP = "__" | |
5 | 5 | ||
6 | 6 | func keyBeneficiaryAddress () = "%s%s__cfg__beneficiaryAddress" | |
7 | 7 | ||
8 | 8 | ||
9 | 9 | func keyConstructorInterval () = "%s%s__cfg__nodeContructorInterval" | |
10 | 10 | ||
11 | 11 | ||
12 | 12 | func keyLastUpdateHeight () = "%s__lastUpdatedHeight" | |
13 | 13 | ||
14 | 14 | ||
15 | 15 | func keyScriptUpdateHash () = "%s__scriptUpdateHash" | |
16 | 16 | ||
17 | 17 | ||
18 | 18 | let nodeRegistry = addressFromStringValue("3MsU936briqQ2XZMpkhWdrV8EsNwm5iCuRY") | |
19 | 19 | ||
20 | 20 | @Callable(i) | |
21 | 21 | func constructor (beneficiaryAddressStr58) = if ((this != i.caller)) | |
22 | 22 | then throw("permissions denied") | |
23 | 23 | else { | |
24 | 24 | let beneficiaryAddress = addressFromStringValue(beneficiaryAddressStr58) | |
25 | 25 | if ((beneficiaryAddress == this)) | |
26 | 26 | then throw("mining node address is not allowed as a beneficiaryAddress") | |
27 | 27 | else [StringEntry(keyBeneficiaryAddress(), toString(beneficiaryAddress)), IntegerEntry(keyLastUpdateHeight(), height)] | |
28 | 28 | } | |
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Verifier(tx) | |
32 | 32 | func verify () = match tx { | |
33 | 33 | case inv: InvokeScriptTransaction => | |
34 | 34 | if ((inv.fee > (5 * 100000))) | |
35 | 35 | then throw(("InvokeScriptTransaction - fee amount is greater than max allowed: " + toString(inv.fee))) | |
36 | 36 | else if (isDefined(inv.feeAssetId)) | |
37 | 37 | then throw("InvokeScriptTransaction - only WAVES is allowed as feeAssetId") | |
38 | 38 | else if ((addressFromRecipient(inv.dApp) == nodeRegistry)) | |
39 | 39 | then true | |
40 | 40 | else if ((addressFromRecipient(inv.dApp) == this)) | |
41 | 41 | then { | |
42 | 42 | let lastUpdatedHeight = valueOrElse(getInteger(this, keyLastUpdateHeight()), 0) | |
43 | 43 | let constrInterval = valueOrElse(getInteger(nodeRegistry, keyConstructorInterval()), 43200) | |
44 | 44 | if ((constrInterval > (height - lastUpdatedHeight))) | |
45 | 45 | then throw("InvokeScriptTransaction - impossible to call constructor very often") | |
46 | 46 | else sigVerify_32Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
47 | 47 | } | |
48 | 48 | else throw("InvokeScriptTransaction - invalid dapp address") | |
49 | 49 | case stx: SetScriptTransaction => | |
50 | 50 | let scriptBytes = value(stx.script) | |
51 | 51 | let hash = toBase58String(keccak256_32Kb(blake2b256_32Kb(scriptBytes))) | |
52 | 52 | let allowedHash = valueOrElse(getString(nodeRegistry, keyScriptUpdateHash()), "") | |
53 | 53 | let allowByHash = if ((allowedHash != "")) | |
54 | 54 | then (allowedHash == hash) | |
55 | 55 | else false | |
56 | 56 | let allowBySig = sigVerify_32Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
57 | - | if ( | |
57 | + | if (allowBySig) | |
58 | 58 | then true | |
59 | - | else allowByHash) | |
60 | - | then true | |
61 | - | else throw(((("SetScriptTransaction - allowBySig=" + toString(allowBySig)) + " allowByHash=") + toString(allowByHash))) | |
59 | + | else allowByHash | |
62 | 60 | case _ => | |
63 | 61 | throw("not allowed") | |
64 | 62 | } | |
65 | 63 |
github/deemru/w8io/026f985 34.25 ms ◑