tx · B4Yy3ovpSn5jGaBUonzhQcxt7eEaXSVXAqjbfBVqihWe

3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY:  -0.01300000 Waves

2022.07.06 21:31 [2128188] smart account 3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY > SELF 0.00000000 Waves

{ "type": 13, "id": "B4Yy3ovpSn5jGaBUonzhQcxt7eEaXSVXAqjbfBVqihWe", "fee": 1300000, "feeAssetId": null, "timestamp": 1657132357897, "version": 2, "chainId": 84, "sender": "3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY", "senderPublicKey": "A8DvbFTEjyHFvpK57CmHu6QKczzymTB5sgqq8xxjNsXG", "proofs": [ "3aDCBSVfoM22iwuDFo6wa7VyugZFACa2chBFurzUmbkEqZEQSZsQzJ3DXbEoDAKquZi2STotoxPGcWbzuyVh6riK" ], "script": null, "height": 2128188, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AL576tv4t5ZNJoETcS8Y7WPurMwY7jdvRdBsf3MqrZYd Next: 64P8Ctk9QtYDPcQc4hCiVLv29KjqEUXkkGTkBGcpbnr2 Full:
OldNewDifferences
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 (allowBySig)
58- then true
59- else allowByHash
60- case _ =>
61- throw("not allowed")
62-}
63-
1+# no script

github/deemru/w8io/026f985 
30.75 ms