tx · 9GYPAyfhqiYimH47YRCuTtH4YP9W1tuJsBGd9iX3mfeq

3N5NY2v5wdKQJbCvQA5o5hSihn7t7wYZ496:  -0.01000000 Waves

2025.01.08 16:33 [3450261] smart account 3N5NY2v5wdKQJbCvQA5o5hSihn7t7wYZ496 > SELF 0.00000000 Waves

{ "type": 13, "id": "9GYPAyfhqiYimH47YRCuTtH4YP9W1tuJsBGd9iX3mfeq", "fee": 1000000, "feeAssetId": null, "timestamp": 1736343226237, "version": 2, "chainId": 84, "sender": "3N5NY2v5wdKQJbCvQA5o5hSihn7t7wYZ496", "senderPublicKey": "8Ti3dhEToApephiZ47QJeuQX3UYifveNLPQjNstsLho9", "proofs": [ "2ChfcG3Nme2NqQDMDbHDPfB1QpGFoZL9MzSqojb2FUgVb15F2V9gRLyh4SEWrY4gdRdvkoQsvQRguS943qdfpFwT" ], "script": "base64:AAIFAAAAAAAAABQIAhIFCgMICAgSAwoBCBIECgIICAAAAAMAAAAADGFkbWluQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVAqh3jB68WUdF1MeXFctJAWzG0XQgRHu1wAAAAALZEFwcEFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVSNFVN42dVClMcMW1BboH6NujWeWSoZV/ABAAAADXNlYXJjaEZvclVzZXIAAAABAAAAB2FkZHJlc3MEAAAABHVzZXIEAAAAByRtYXRjaDAJAAQiAAAAAQUAAAAHYWRkcmVzcwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwBQAAAAFzAgAAAAdObyBVc2VyBQAAAAR1c2VyAAAAAwAAAAFpAQAAAA9yZWdpc3RlckFjY291bnQAAAADAAAAB2FkZHJlc3MAAAAEcm9sZQAAAARuYW1lBAAAAAZjYWxsZXIIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQQAAAAEdXNlcgkBAAAADXNlYXJjaEZvclVzZXIAAAABCQACWAAAAAEFAA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/wAAAAEBQAAAAtkQXBwQWRkcmVzcwIAAAAIU2F2ZURhdGEFAAAACnBhcmFtZXRlcnMFAAAAA25pbAMJAQAAAAIhPQAAAAIFAAAACmludm9rZVRhc2sFAAAACmludm9rZVRhc2sJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuBQAAAANuaWwAAAAA3mAeMQ==", "height": 3450261, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: C6R1q8tzqP3tQXxuDn6b9cWyGBzoq2oxbE6KjeQ3ToqL Next: none Diff:
OldNewDifferences
1717
1818
1919 @Callable(i)
20-func registerAccount (address,role,name) = if ((i.caller != adminAddress))
21- then throw("Only the admin can register accounts")
22- else [StringEntry(address, role), StringEntry((address + "_name"), name)]
20+func registerAccount (address,role,name) = {
21+ let caller = i.callerPublicKey
22+ let user = searchForUser(toBase58String(caller))
23+ if ((user != "Admin"))
24+ then throw("Only the admin can delete accounts")
25+ else [StringEntry(address, role), StringEntry((address + "_name"), name)]
26+ }
2327
2428
2529
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let adminAddress = Address(base58'3MptJSctbAkp5fddvpQmWYjjKrSoim6dL38')
55
66 let dAppAddress = Address(base58'3N2n4bjG8CjdKiwLPyp3hBM4MDJ3XwMZR5h')
77
88 func searchForUser (address) = {
99 let user = match getString(address) {
1010 case s: String =>
1111 s
1212 case _ =>
1313 "No User"
1414 }
1515 user
1616 }
1717
1818
1919 @Callable(i)
20-func registerAccount (address,role,name) = if ((i.caller != adminAddress))
21- then throw("Only the admin can register accounts")
22- else [StringEntry(address, role), StringEntry((address + "_name"), name)]
20+func registerAccount (address,role,name) = {
21+ let caller = i.callerPublicKey
22+ let user = searchForUser(toBase58String(caller))
23+ if ((user != "Admin"))
24+ then throw("Only the admin can delete accounts")
25+ else [StringEntry(address, role), StringEntry((address + "_name"), name)]
26+ }
2327
2428
2529
2630 @Callable(i)
2731 func deleteAccount (address) = {
2832 let caller = i.callerPublicKey
2933 let user = searchForUser(toBase58String(caller))
3034 if ((user != "Admin"))
3135 then throw("Only the admin can delete accounts")
3236 else [DeleteEntry(address), DeleteEntry((address + "_name"))]
3337 }
3438
3539
3640
3741 @Callable(i)
3842 func saveData (temperature,humidity) = {
3943 let caller = i.callerPublicKey
4044 let user = searchForUser(toBase58String(caller))
4145 if ((user == "No User"))
4246 then throw("User not eligible")
4347 else {
4448 let parameters = [temperature, humidity]
4549 let invokeTask = invoke(dAppAddress, "SaveData", parameters, nil)
4650 if ((invokeTask != invokeTask))
4751 then throw("Strict value is not equal to itself.")
4852 else nil
4953 }
5054 }
5155
5256

github/deemru/w8io/169f3d6 
13.77 ms