tx · HTkCbmirmEdbrF8eKCy8Dt3nDyyXp7grrCir5zx6SfRP

3N3HtdnBkqSSc16DaydiwtrMBUv3DfqKjSW:  -0.01400000 Waves

2021.11.22 19:53 [1802499] smart account 3N3HtdnBkqSSc16DaydiwtrMBUv3DfqKjSW > SELF 0.00000000 Waves

{ "type": 13, "id": "HTkCbmirmEdbrF8eKCy8Dt3nDyyXp7grrCir5zx6SfRP", "fee": 1400000, "feeAssetId": null, "timestamp": 1637600013390, "version": 2, "chainId": 84, "sender": "3N3HtdnBkqSSc16DaydiwtrMBUv3DfqKjSW", "senderPublicKey": "Aw1UftaEn1LLmCdG6VwWAuVtaSpcmPw18uZ4x2mvd9Wr", "proofs": [ "5anvucQtRYGfbBfzKQmLce5AXR1EYteJoXXU8ArnhfyJ4ggf3WNBVakuTtx6DNf93mBXXD9PAyxxTV3A7dmX52Bc", "5hbtcUvYrcqwrjgyL9kVkX6FqGniPb8cQpLQCLMvBX5VEdYqbR1hP8AWjX87evKnqtxyAyVxhGYjhFhv46MkiKr8" ], "script": "base64:AAIFAAAAAAAAAA4IAhIECgIIARIECgIRGAAAAA0AAAAAEGtleUFjaGlldmVtZW50SWQCAAAAA2lkXwAAAAAGb3JhY2xlCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFU6UWqHpAvOq7xug7mLpqSXxqYhOHzYrMIAAAAAA9rZXlBZG1pblB1YktleTECAAAAC2FkbWluX3B1Yl8xAAAAAA9rZXlBZG1pblB1YktleTICAAAAC2FkbWluX3B1Yl8yAAAAAA9rZXlBZG1pblB1YktleTMCAAAAC2FkbWluX3B1Yl8zAQAAAAtnZXRBZG1pblB1YgAAAAEAAAALa2V5QWRtaW5QdWIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAGb3JhY2xlBQAAAAtrZXlBZG1pblB1YgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAZzdHJpbmcFAAAAByRtYXRjaDAJAAJZAAAAAQUAAAAGc3Rya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AAZwcm9vZnMAAAAAAAAAAAAFAAAAEmFkbWluUHViS2V5U3Rha2luZwQAAAAHJG1hdGNoMAUAAAACdHgFAAAAE211bHRpU2lnbmVkQnlBZG1pbnM2+Cnj", "height": 1802499, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HdzT1Ntx7ce7hPVkHmBgwcpm4yZBL1kt6NzmdNC2HXWk Next: none Diff:
OldNewDifferences
4141
4242
4343 @Callable(i)
44-func add (achievementId,amount) = {
45- let debugKeyId = (keyAchievementId + achievementId)
46- if (!(containsElement(achievementsWriters, toString(this))))
47- then throw("Only achievment writer can call this function")
48- else if (!(isDefined(getString(this, debugKeyId))))
49- then throw("Unknown achievement id")
50- else {
51- let userAddress = toString(i.originCaller)
52- let amountOld = valueOrElse(getInteger(this, ((userAddress + "_") + achievementId)), 0)
44+func add (achievementId,amount) = if (!(containsElement(achievementsWriters, toString(i.caller))))
45+ then throw("Only achievment writer can call this function")
46+ else if (!(isDefined(getString(this, (keyAchievementId + achievementId)))))
47+ then throw("Unknown achievement id")
48+ else {
49+ let userAddress = toString(i.originCaller)
50+ let amountOld = valueOrElse(getInteger(this, ((userAddress + "_") + achievementId)), 0)
5351 [IntegerEntry(((userAddress + "_") + achievementId), (amountOld + amount))]
54- }
55- }
52+ }
5653
5754
5855
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyAchievementId = "id_"
55
66 let oracle = Address(base58'3NBBWfzZtZtszaXbitTKnrB2xXwv26Bn7H9')
77
88 let keyAdminPubKey1 = "admin_pub_1"
99
1010 let keyAdminPubKey2 = "admin_pub_2"
1111
1212 let keyAdminPubKey3 = "admin_pub_3"
1313
1414 func getAdminPub (keyAdminPub) = match getString(oracle, keyAdminPub) {
1515 case string: String =>
1616 fromBase58String(string)
1717 case nothing =>
1818 throw("Admin public key is empty")
1919 }
2020
2121
2222 let adminPubKey1 = getAdminPub(keyAdminPubKey1)
2323
2424 let adminPubKey2 = getAdminPub(keyAdminPubKey2)
2525
2626 let adminPubKey3 = getAdminPub(keyAdminPubKey3)
2727
2828 let adminPubKeyStaking = base58'Kn7NpzaG12dLZgcHf2ipUftU6hbJygmrhFqQYE4B7ZK'
2929
3030 let keyAchievementsWriters = "achievements_writers"
3131
3232 let achievementsWriters = split(valueOrElse(getString(oracle, keyAchievementsWriters), ""), ",")
3333
3434 func zipNext (acc,list2Element) = {
3535 let $t0922950 = acc
3636 let list1 = $t0922950._1
3737 let i = $t0922950._2
3838 let result = $t0922950._3
3939 $Tuple3(list1, (i + 1), (result :+ StringEntry((keyAchievementId + toString(list1[i])), list2Element)))
4040 }
4141
4242
4343 @Callable(i)
44-func add (achievementId,amount) = {
45- let debugKeyId = (keyAchievementId + achievementId)
46- if (!(containsElement(achievementsWriters, toString(this))))
47- then throw("Only achievment writer can call this function")
48- else if (!(isDefined(getString(this, debugKeyId))))
49- then throw("Unknown achievement id")
50- else {
51- let userAddress = toString(i.originCaller)
52- let amountOld = valueOrElse(getInteger(this, ((userAddress + "_") + achievementId)), 0)
44+func add (achievementId,amount) = if (!(containsElement(achievementsWriters, toString(i.caller))))
45+ then throw("Only achievment writer can call this function")
46+ else if (!(isDefined(getString(this, (keyAchievementId + achievementId)))))
47+ then throw("Unknown achievement id")
48+ else {
49+ let userAddress = toString(i.originCaller)
50+ let amountOld = valueOrElse(getInteger(this, ((userAddress + "_") + achievementId)), 0)
5351 [IntegerEntry(((userAddress + "_") + achievementId), (amountOld + amount))]
54- }
55- }
52+ }
5653
5754
5855
5956 @Callable(i)
6057 func addAchievements (achievementIds,achievementNames) = if (!(containsElement([adminPubKey1, adminPubKey2, adminPubKey3], i.callerPublicKey)))
6158 then throw("Only admin can call this function")
6259 else {
6360 let achievementsEtries = {
6461 let $l = achievementNames
6562 let $s = size($l)
6663 let $acc0 = $Tuple3(achievementIds, 0, nil)
6764 func 1 ($a,$i) = if (($i >= $s))
6865 then $a
6966 else zipNext($a, $l[$i])
7067
7168 func 2 ($a,$i) = if (($i >= $s))
7269 then $a
7370 else throw("List size exceeds 20")
7471
7572 2(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1(1($acc0, 0), 1), 2), 3), 4), 5), 6), 7), 8), 9), 10), 11), 12), 13), 14), 15), 16), 17), 18), 19), 20)
7673 }
7774 achievementsEtries._3
7875 }
7976
8077
8178 @Verifier(tx)
8279 func verify () = {
8380 let multiSignedByAdmins = {
8481 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
8582 then 1
8683 else 0
8784 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
8885 then 1
8986 else 0
9087 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
9188 then 1
9289 else 0
9390 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
9491 }
9592 let signedByAdmin = if (if (if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
9693 then true
9794 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey2))
9895 then true
9996 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey3))
10097 then true
10198 else sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKeyStaking)
10299 match tx {
103100 case _ =>
104101 multiSignedByAdmins
105102 }
106103 }
107104

github/deemru/w8io/169f3d6 
32.77 ms