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:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# 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) { |
---|
6 | 6 | | case a: ByteVector => |
---|
7 | 7 | | a |
---|
8 | 8 | | case _ => |
---|
|
12 | 12 | | } |
---|
13 | 13 | | |
---|
14 | 14 | | |
---|
| 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 | + | |
---|
15 | 24 | | @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)] |
---|
21 | 29 | | else throw("Account hat nicht die nötige Berechtigung für diese Aktion.") |
---|
22 | 30 | | } |
---|
23 | 31 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# 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) { |
---|
6 | 6 | | case a: ByteVector => |
---|
7 | 7 | | a |
---|
8 | 8 | | case _ => |
---|
9 | 9 | | "" |
---|
10 | 10 | | } |
---|
11 | 11 | | data |
---|
12 | 12 | | } |
---|
13 | 13 | | |
---|
14 | 14 | | |
---|
| 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 | + | |
---|
15 | 24 | | @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)] |
---|
21 | 29 | | else throw("Account hat nicht die nötige Berechtigung für diese Aktion.") |
---|
22 | 30 | | } |
---|
23 | 31 | | |
---|
24 | 32 | | |
---|
25 | 33 | | @Verifier(tx) |
---|
26 | 34 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
27 | 35 | | |
---|