tx · EUwaWMp11KX9TWQUdwzhtStRNThrPS4Fd9TmD6KQ1JSa

3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY:  -0.00300000 Waves

2022.07.06 20:52 [2128152] smart account 3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
32.61 ms