tx · CAwvpc4nKLND1DSMzkNcaDhVQpVe1ijtyqTx2fVdDexm

3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY:  -0.00300000 Waves

2022.07.07 13:35 [2129155] smart account 3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY > SELF 0.00000000 Waves

{ "type": 13, "id": "CAwvpc4nKLND1DSMzkNcaDhVQpVe1ijtyqTx2fVdDexm", "fee": 300000, "feeAssetId": null, "timestamp": 1657190176796, "version": 2, "chainId": 84, "sender": "3MsEYrugWRGMvdKBKChVCjg2qoKea8Ko9vY", "senderPublicKey": "A8DvbFTEjyHFvpK57CmHu6QKczzymTB5sgqq8xxjNsXG", "proofs": [ "5ZarYsp8No4VJoaMFjo4UimTpnFdEpkzLGL25CjQABYPyGMfzMFPf9Gs2J9Kujhj8arxjynNEWsfnHnwFqHyMc7S" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAACAAAAAADU0VQAgAAAAJfXwAAAAAFTVVMVDgAAAAAAAX14QABAAAAFWtleUJlbmVmaWNpYXJ5QWRkcmVzcwAAAAACAAAAHSVzJXNfX2NmZ19fYmVuZWZpY2lhcnlBZGRyZXNzAQAAABZrZXlDb25zdHJ1Y3RvckludGVydmFsAAAAAAIAAAAhJXMlc19fY2ZnX19ub2RlQ29udHJ1Y3RvckludGVydmFsAQAAABNrZXlMYXN0VXBkYXRlSGVpZ2h0AAAAAAIAAAAVJXNfX2xhc3RVcGRhdGVkSGVpZ2h0AQAAABNrZXlTY3JpcHRVcGRhdGVIYXNoAAAAAAIAAAAdJXMlc19fbWluZXJfX3NjcmlwdFVwZGF0ZUhhc2gBAAAAGGtleVNjcmlwdFVwZGF0ZUFsbG93YW5jZQAAAAACAAAAIiVzJXNfX21pbmVyX19zY3JpcHRVcGRhdGVBbGxvd2FuY2UAAAAADG5vZGVSZWdpc3RyeQkBAAAAEUBleHRyTmF0aXZlKDEwNjIpAAAAAQIAAAAjM01zVTkzNmJyaXFRMlhaTXBraF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N0eAAAAANmZWUJAABpAAAAAgkAAGgAAAACAAAAAAAAAAACBQAAAAVNVUxUOAAAAAAAAAAACgkAAAIAAAABCQABLAAAAAICAAAAP1NldFNjcmlwdFRyYW5zYWN0aW9uIC0gZmVlIGFtb3VudCBpcyBncmVhdGVyIHRoYW4gbWF4IGFsbG93ZWQ6IAkAAaQAAAABCAUAAAADc3R4AAAAA2ZlZQQAAAALc2NyaXB0Qnl0ZXMJAQAAAAV2YWx1ZQAAAAEIBQAAAANzdHgAAAAGc2NyaXB0BAAAAARoYXNoCQACWAAAAAEJAArxAAAAAQUAAAALc2NyaXB0Qnl0ZXMEAAAAC2FsbG93ZWRIYXNoCQEAAAALdmFsdWVPckVsc2UAAAACCQAEHQAAAAIFAAAADG5vZGVSZWdpc3RyeQkBAAAAE2tleVNjcmlwdFVwZGF0ZUhhc2gAAAAAAgAAAAAEAAAAC3ZhbGlkQnlIYXNoAwkBAAAAAiE9AAAAAgUAAAALYWxsb3dlZEhhc2gCAAAAAAkAAAAAAAACBQAAAAthbGxvd2VkSGFzaAUAAAAEaGFzaAcEAAAADWFsbG93VG9VcGRhdGUJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQbAAAAAgUAAAAMbm9kZVJlZ2lzdHJ5CQEAAAAYa2V5U2NyaXB0VXBkYXRlQWxsb3dhbmNlAAAAAAcDBQAAAA1hbGxvd1RvVXBkYXRlBQAAAAt2YWxpZEJ5SGFzaAcJAAACAAAAAQIAAAALbm90IGFsbG93ZWQLxE0X", "height": 2129155, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: CSBoRczciNow8QSq5YFuNwKweECUXb7joYJX41uGJvky Next: none Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let SEP = "__"
55
66 let MULT8 = 100000000
77
88 func keyBeneficiaryAddress () = "%s%s__cfg__beneficiaryAddress"
99
1010
1111 func keyConstructorInterval () = "%s%s__cfg__nodeContructorInterval"
1212
1313
1414 func keyLastUpdateHeight () = "%s__lastUpdatedHeight"
1515
1616
1717 func keyScriptUpdateHash () = "%s%s__miner__scriptUpdateHash"
1818
1919
2020 func keyScriptUpdateAllowance () = "%s%s__miner__scriptUpdateAllowance"
2121
2222
2323 let nodeRegistry = addressFromStringValue("3MsU936briqQ2XZMpkhWdrV8EsNwm5iCuRY")
2424
2525 @Callable(i)
2626 func constructor (beneficiaryAddressStr58) = if ((this != i.caller))
2727 then throw("permissions denied")
2828 else {
2929 let beneficiaryAddress = addressFromStringValue(beneficiaryAddressStr58)
3030 if ((beneficiaryAddress == this))
3131 then throw("mining node address is not allowed as a beneficiaryAddress")
3232 else [StringEntry(keyBeneficiaryAddress(), toString(beneficiaryAddress)), IntegerEntry(keyLastUpdateHeight(), height)]
3333 }
3434
3535
3636 @Verifier(tx)
3737 func verify () = match tx {
3838 case inv: InvokeScriptTransaction =>
3939 if ((inv.fee > ((5 * MULT8) / 1000)))
4040 then throw(("InvokeScriptTransaction - fee amount is greater than max allowed: " + toString(inv.fee)))
4141 else if (isDefined(inv.feeAssetId))
4242 then throw("InvokeScriptTransaction - only WAVES is allowed as feeAssetId")
4343 else if ((addressFromRecipient(inv.dApp) == nodeRegistry))
4444 then true
4545 else if ((addressFromRecipient(inv.dApp) == this))
4646 then {
4747 let lastUpdatedHeight = valueOrElse(getInteger(this, keyLastUpdateHeight()), 0)
4848 let constrInterval = valueOrElse(getInteger(nodeRegistry, keyConstructorInterval()), 43200)
4949 if ((constrInterval > (height - lastUpdatedHeight)))
5050 then throw("InvokeScriptTransaction - impossible to call constructor very often")
5151 else sigVerify_32Kb(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
5252 }
5353 else throw("InvokeScriptTransaction - invalid dapp address")
5454 case stx: SetScriptTransaction =>
5555 if ((stx.fee > ((2 * MULT8) / 10)))
5656 then throw(("SetScriptTransaction - fee amount is greater than max allowed: " + toString(stx.fee)))
5757 else {
5858 let scriptBytes = value(stx.script)
5959 let hash = toBase58String(blake2b256_32Kb(scriptBytes))
6060 let allowedHash = valueOrElse(getString(nodeRegistry, keyScriptUpdateHash()), "")
6161 let validByHash = if ((allowedHash != ""))
6262 then (allowedHash == hash)
6363 else false
6464 let allowToUpdate = valueOrElse(getBoolean(nodeRegistry, keyScriptUpdateAllowance()), false)
6565 if (allowToUpdate)
6666 then validByHash
6767 else false
6868 }
6969 case _ =>
7070 throw("not allowed")
7171 }
7272

github/deemru/w8io/169f3d6 
27.08 ms