tx · 9fK4VBQBZfUTLuKaYcRH15oqrF3u1MRnbKVGRyxpu5gv

3N8QXkBJ9Cw5SKQN9XrAvj6TQm3LQTJXMik:  -0.01000000 Waves

2023.08.14 11:59 [2710025] smart account 3N8QXkBJ9Cw5SKQN9XrAvj6TQm3LQTJXMik > SELF 0.00000000 Waves

{ "type": 13, "id": "9fK4VBQBZfUTLuKaYcRH15oqrF3u1MRnbKVGRyxpu5gv", "fee": 1000000, "feeAssetId": null, "timestamp": 1692003630867, "version": 2, "chainId": 84, "sender": "3N8QXkBJ9Cw5SKQN9XrAvj6TQm3LQTJXMik", "senderPublicKey": "3k1UfguhLASyNRUsyixsBqDL7EMm2UZqEsUMcZf9yQoW", "proofs": [ "3x9VT6bJDd4DEAUbfFxxE4Y7Anykm37qbF9VXHMRAb2MqKkScyLqZnYi9qp7Fbu5tsTmRbnjD19t5kgjmikx53aS" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAAAgEAAAAHZ2V0RGF0YQAAAAIAAAADYWRyAAAAA2tleQQAAAAEZGF0YQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAANhZHIFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAAFAAAABGRhdGEBAAAACGF1dGhVc2VyAAAAAQAAAA9jYWxsZXJQdWJsaWNLZXkEAAAAE2NhbGxlclB1YmxpY0tleUhhc2gJAAJYAAAAAQkAAfcAAAABBQAAAA9jYWxsZXJQdWJsaWNLZXkEAAAACWRhdGFWYWx1ZQkBAAAAB2dldERhdGEAAAACBQAAAAR0aGlzCQABLAAAAAIJAAEsAAAAAgIAAAALY29ubmVjdGlvbi4FAAAAE2NhbGxlclB1YmxpY0tleUhhc2gCAAAABy5zY3JpcHQEAAAADWV4cGVjdGVkVmFsdWUCAAAACmF1dGhvcml6ZWQDCQAAAAAAAAIFAAAACWRhdGFWYWx1ZQUAAAANZXhwZWN0ZWRWYWx1ZQYHAAAAAQAAAAFpAQAAAAtyZWZ1bmRXYXZlcwAAAAEAAAAEY29zdAQAAAANYXV0aGVudGljYXRlZAkBAAAACGF1dGhVc2VyAAAAAQgFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5AwkBAAAAASEAAAABBQAAAA1hdXRoZW50aWNhdGVkCQAAAgAAAAECAAAAPUFjY291bnQgaGF0IG5pY2h0IGRpZSBuw7Z0aWdlIEJlcmVjaHRpZ3VuZyBmw7xyIGRpZXNlIEFrdGlvbi4JAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAARjb3N0BQAAAAR1bml0BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleagB5D8=", "height": 2710025, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5kysFUKjUgCt1gk6YNhjiRMhGLu4cgbyidyRrEiRtzNB Next: none Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getData (adr,key) = {
5- let data = match getBoolean(adr, key) {
6- case a: Boolean =>
5+ let data = match getString(adr, key) {
6+ case a: String =>
77 a
88 case _ =>
9- false
9+ ""
1010 }
1111 data
1212 }
1313
1414
15+func authUser (callerPublicKey) = {
16+ let callerPublicKeyHash = toBase58String(sha256(callerPublicKey))
17+ let dataValue = getData(this, (("connection." + callerPublicKeyHash) + ".script"))
18+ let expectedValue = "authorized"
19+ if ((dataValue == expectedValue))
20+ then true
21+ else false
22+ }
23+
24+
1525 @Callable(i)
16-func refundWaves (timestamp,cost) = {
17- let key = ((timestamp + ".") + toBase58String(i.callerPublicKey))
18- let data = getData(this, key)
19- if (data)
20- then throw("Wurde bereits ausgezahlt.")
21- else [BooleanEntry(key, true), ScriptTransfer(i.caller, cost, unit)]
26+func refundWaves (cost) = {
27+ let authenticated = authUser(i.callerPublicKey)
28+ if (!(authenticated))
29+ then throw("Account hat nicht die nötige Berechtigung für diese Aktion.")
30+ else [ScriptTransfer(i.caller, cost, unit)]
2231 }
2332
2433
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 func getData (adr,key) = {
5- let data = match getBoolean(adr, key) {
6- case a: Boolean =>
5+ let data = match getString(adr, key) {
6+ case a: String =>
77 a
88 case _ =>
9- false
9+ ""
1010 }
1111 data
1212 }
1313
1414
15+func authUser (callerPublicKey) = {
16+ let callerPublicKeyHash = toBase58String(sha256(callerPublicKey))
17+ let dataValue = getData(this, (("connection." + callerPublicKeyHash) + ".script"))
18+ let expectedValue = "authorized"
19+ if ((dataValue == expectedValue))
20+ then true
21+ else false
22+ }
23+
24+
1525 @Callable(i)
16-func refundWaves (timestamp,cost) = {
17- let key = ((timestamp + ".") + toBase58String(i.callerPublicKey))
18- let data = getData(this, key)
19- if (data)
20- then throw("Wurde bereits ausgezahlt.")
21- else [BooleanEntry(key, true), ScriptTransfer(i.caller, cost, unit)]
26+func refundWaves (cost) = {
27+ let authenticated = authUser(i.callerPublicKey)
28+ if (!(authenticated))
29+ then throw("Account hat nicht die nötige Berechtigung für diese Aktion.")
30+ else [ScriptTransfer(i.caller, cost, unit)]
2231 }
2332
2433
2534 @Verifier(tx)
2635 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
2736

github/deemru/w8io/026f985 
214.62 ms