tx · AaZgphYVMBhxtE3PjdXxDXxxa6dCHfv44cA4UFjBa8hK

3Mxja9dzJwYYcgQLNS6srMSE57o4xEuLubp:  -0.01000000 Waves

2023.02.06 03:21 [2437052] smart account 3Mxja9dzJwYYcgQLNS6srMSE57o4xEuLubp > SELF 0.00000000 Waves

{ "type": 13, "id": "AaZgphYVMBhxtE3PjdXxDXxxa6dCHfv44cA4UFjBa8hK", "fee": 1000000, "feeAssetId": null, "timestamp": 1675642876656, "version": 2, "chainId": 84, "sender": "3Mxja9dzJwYYcgQLNS6srMSE57o4xEuLubp", "senderPublicKey": "494P1nGfsVKLpZQB1RZiM37znqRG58QQSHckhgaR52M7", "proofs": [ "sTDWh6qWyEjfMn3afrmuem7uxEM4saMKWTD4RSJdGcq8LZReKc11oK9q4hmmawGaagvCVGgR9nZ1keftRN6Skr9" ], "script": "base64:AAIFAAAAAAAAAAgIAhIECgIICAAAAAIBAAAAH2dldEJpbmFyeVZhbHVlRnJvbVNjcmlwdEFjY291bnQAAAACAAAAA2FkcgAAAANrZXkEAAAABGRhdGEEAAAAByRtYXRjaDAJAQAAABFAZXh0ck5hdGl2ZSgxMDUyKQAAAAIFAAAAA2FkcgUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeXRlVmVjdG9yBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAAFAAAABGRhdGEBAAAACGF1dGhVc2VyAAAAAQAAAA9jYWxsZXJQdWJsaWNLZXkEAAAAE2NhbGxlclB1YmxpY0tleUhhc2gJAAH3AAAAAQUAAAAPY2FsbGVyUHVibGljS2V5BAAAABpzY3JpcHRBY2NvdW50UHVibGljS2V5SGFzaAkBAAAAH2dldEJpbmFyeVZhbHVlRnJvbVNjcmlwdEFjY291bnQAAAACBQAAAAR0aGlzAgAAABRjb25uZWN0aW9uLkVnZ2VyLnJlZgMJAAAAAAAAAgUAAAAac2NyaXB0QWNjb3VudFB1YmxpY0tleUhhc2gFAAAAE2NhbGxlclB1YmxpY0tleUhhc2gGBwAAAAEAAAABaQEAAAAbc2F2ZVNpbmdsZUtleVZhbHVlT25BY2NvdW50AAAAAgAAAANrZXkAAAAIa2V5VmFsdWUEAAAADWF1dGhlbnRpY2F0ZWQJAQAAAAhhdXRoVXNlcgAAAAEIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQMFAAAADWF1dGhlbnRpY2F0ZWQJAARMAAAAAgkBAAAAC1N0cmluZ0VudHJ5AAAAAgUAAAADa2V5BQAAAAhrZXlWYWx1ZQUAAAADbmlsCQAAAgAAAAECAAAAPUFjY291bnQgaGF0IG5pY2h0IGRpZSBuw7Z0aWdlIEJlcmVjaHRpZ3VuZyBmw7xyIGRpZXNlIEFrdGlvbi4AAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleeY7o4M=", "height": 2437052, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HWCUpbrTeeUtmJsgjvk47E3wNcC1yVSDgXVcdLNLMi8D Next: none Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func getData (adr,key) = {
5- let data = match getBinary(adr, key) {
4+func getBinaryValueFromScriptAccount (adr,key) = {
5+ let data = match getBinaryValue(adr, key) {
66 case a: ByteVector =>
77 a
88 case _ =>
1212 }
1313
1414
15+func authUser (callerPublicKey) = {
16+ let callerPublicKeyHash = sha256(callerPublicKey)
17+ let scriptAccountPublicKeyHash = getBinaryValueFromScriptAccount(this, "connection.Egger.ref")
18+ if ((scriptAccountPublicKeyHash == callerPublicKeyHash))
19+ then true
20+ else false
21+ }
22+
23+
1524 @Callable(i)
16-func saveValueOnSupplierAccount (delInfTextKey,delInfTextValue) = {
17- let eggerPublicKeyHash = sha256(i.callerPublicKey)
18- let eggerPublicKeyHashOnSupplierAccount = getBinaryValue(this, "connection.Egger.ref")
19- if ((eggerPublicKeyHashOnSupplierAccount == eggerPublicKeyHash))
20- then [StringEntry(delInfTextKey, delInfTextValue)]
25+func saveSingleKeyValueOnAccount (key,keyValue) = {
26+ let authenticated = authUser(i.callerPublicKey)
27+ if (authenticated)
28+ then [StringEntry(key, keyValue)]
2129 else throw("Account hat nicht die nötige Berechtigung für diese Aktion.")
2230 }
2331
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-func getData (adr,key) = {
5- let data = match getBinary(adr, key) {
4+func getBinaryValueFromScriptAccount (adr,key) = {
5+ let data = match getBinaryValue(adr, key) {
66 case a: ByteVector =>
77 a
88 case _ =>
99 ""
1010 }
1111 data
1212 }
1313
1414
15+func authUser (callerPublicKey) = {
16+ let callerPublicKeyHash = sha256(callerPublicKey)
17+ let scriptAccountPublicKeyHash = getBinaryValueFromScriptAccount(this, "connection.Egger.ref")
18+ if ((scriptAccountPublicKeyHash == callerPublicKeyHash))
19+ then true
20+ else false
21+ }
22+
23+
1524 @Callable(i)
16-func saveValueOnSupplierAccount (delInfTextKey,delInfTextValue) = {
17- let eggerPublicKeyHash = sha256(i.callerPublicKey)
18- let eggerPublicKeyHashOnSupplierAccount = getBinaryValue(this, "connection.Egger.ref")
19- if ((eggerPublicKeyHashOnSupplierAccount == eggerPublicKeyHash))
20- then [StringEntry(delInfTextKey, delInfTextValue)]
25+func saveSingleKeyValueOnAccount (key,keyValue) = {
26+ let authenticated = authUser(i.callerPublicKey)
27+ if (authenticated)
28+ then [StringEntry(key, keyValue)]
2129 else throw("Account hat nicht die nötige Berechtigung für diese Aktion.")
2230 }
2331
2432
2533 @Verifier(tx)
2634 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
2735

github/deemru/w8io/169f3d6 
36.01 ms