tx · TyLrL1qwGrspWBN2qEKUjC744xCJEwN5u4yuP3Tuc4R

3NCCJWh4gk9p2FssfGtuHEQgbcBiEJNwfpY:  -0.14000000 Waves

2021.10.28 15:45 [1766161] smart account 3NCCJWh4gk9p2FssfGtuHEQgbcBiEJNwfpY > SELF 0.00000000 Waves

{ "type": 13, "id": "TyLrL1qwGrspWBN2qEKUjC744xCJEwN5u4yuP3Tuc4R", "fee": 14000000, "feeAssetId": null, "timestamp": 1635425187825, "version": 2, "chainId": 84, "sender": "3NCCJWh4gk9p2FssfGtuHEQgbcBiEJNwfpY", "senderPublicKey": "6uCSnTeNsFiTBE6u6npUmFezFkve5M54EgMVmfEEZ4Yn", "proofs": [ "5HgThq261FbXUgb4biQFBzMPJYKjuxkqZ2uArrismLg8E2gc5T6Cw6dJnxMF8kUmMHUceNam8jeX3u95LJaz3aar", "2uZmc2NHTKZD9WJ6MNVdDwd7MLn6fcTjPjftjavGgMaKS9jYbbC1gvBaZ9SxvRyEhjN4WpHvkb5v2AUVYJsD4tmp" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAPAAAAABhrZXlVc2VyRU5OT0NsYWltZWRBbW91bnQCAAAAFF9FTk5PX2NsYWltZWRfYW1vdW50AAAAABxrZXlVc2VyRU5OT0xhc3RDbGFpbWVkQW1vdW50AgAAABlfRU5OT19sYXN0X2NsYWltZWRfYW1vdW50AAAAABFrZXlVc2VyRU5OT0xvY2tlZAIAAAAMX0VOTk9fYW1vdW50AAAAABRrZXlVc2VyRU5OT0xvY2tlZFRhZwIAAAAGc2hhcmVfAAAAAAlrZXlBY3RpdmUCAAAABmFjdGl2ZQAAAAAIa2V5Q2F1c2UCAAAADnNodXRkb3duX2NhdXNlAAAAAAxhZG1pblB1YktleTEBAAAAIFepk7yEupOYL1euYnjVKBoA6QMFEEnH/ZuMJcQl4MoPAAAAAAxhZG1pblB1YktleTIBAAAAIFepk7yEupOYL1euYnjVKBoA6QMFEEnH/ZuMJcQl4MoPAAAAA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AgkAAGQAAAACCQAAZAAAAAIFAAAAEmFkbWluUHViS2V5MVNpZ25lZAUAAAASYWRtaW5QdWJLZXkyU2lnbmVkBQAAABJhZG1pblB1YktleTNTaWduZWQAAAAAAAAAAAKnHz9X", "height": 1766161, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2pc9QseAtA4QeJwqnGZxENGs8PwB41BoVxgb3bSLVeMR Next: none Diff:
OldNewDifferences
3030
3131 func getCallerShare (caller) = {
3232 let callerShare = getInteger(addressFromPublicKey(shareData), (keyUserENNOLockedTag + toString(caller)))
33- let callerShareAmount = match callerShare {
34- case share: Int =>
35- share
36- case share: Unit =>
37- throw("Only governance qualifiers can call this function.")
38- case _ =>
39- throw("Match error")
40- }
41- callerShareAmount
42- }
43-
44-
45-func getCallerLock (caller) = {
46- let callerShare = getInteger(stakeDApp, (toString(caller) + keyUserENNOLocked))
4733 let callerShareAmount = match callerShare {
4834 case share: Int =>
4935 share
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let keyUserENNOClaimedAmount = "_ENNO_claimed_amount"
55
66 let keyUserENNOLastClaimedAmount = "_ENNO_last_claimed_amount"
77
88 let keyUserENNOLocked = "_ENNO_amount"
99
1010 let keyUserENNOLockedTag = "share_"
1111
1212 let keyActive = "active"
1313
1414 let keyCause = "shutdown_cause"
1515
1616 let adminPubKey1 = base58'6uCSnTeNsFiTBE6u6npUmFezFkve5M54EgMVmfEEZ4Yn'
1717
1818 let adminPubKey2 = base58'6uCSnTeNsFiTBE6u6npUmFezFkve5M54EgMVmfEEZ4Yn'
1919
2020 let adminPubKey3 = base58'6uCSnTeNsFiTBE6u6npUmFezFkve5M54EgMVmfEEZ4Yn'
2121
2222 let shareData = base58'79G9MRTWPsir5gThDeuicpBuQxx8UFNqVaDUYcRfWtPA'
2323
2424 let stakeDApp = addressFromPublicKey(base58'Ese6jz6mtrhgwJWdXbAxHNHg2qzae5D2xXWuVF7tLfs8')
2525
2626 let isActive = valueOrElse(getBoolean(this, keyActive), true)
2727
2828 func suspend (cause) = [BooleanEntry(keyActive, false), StringEntry(keyCause, cause)]
2929
3030
3131 func getCallerShare (caller) = {
3232 let callerShare = getInteger(addressFromPublicKey(shareData), (keyUserENNOLockedTag + toString(caller)))
33- let callerShareAmount = match callerShare {
34- case share: Int =>
35- share
36- case share: Unit =>
37- throw("Only governance qualifiers can call this function.")
38- case _ =>
39- throw("Match error")
40- }
41- callerShareAmount
42- }
43-
44-
45-func getCallerLock (caller) = {
46- let callerShare = getInteger(stakeDApp, (toString(caller) + keyUserENNOLocked))
4733 let callerShareAmount = match callerShare {
4834 case share: Int =>
4935 share
5036 case share: Unit =>
5137 throw("Only governance qualifiers can call this function.")
5238 case _ =>
5339 throw("Match error")
5440 }
5541 callerShareAmount
5642 }
5743
5844
5945 func getClaimedAmount (caller) = {
6046 let callerWithdrawn = getInteger(stakeDApp, (toString(caller) + keyUserENNOClaimedAmount))
6147 let callerWithdrawnAmount = match callerWithdrawn {
6248 case share: Int =>
6349 share
6450 case share: Unit =>
6551 0
6652 case _ =>
6753 throw("Match error")
6854 }
6955 callerWithdrawnAmount
7056 }
7157
7258
7359 @Callable(i)
7460 func claimAndWithdrawENNO () = if (!(isActive))
7561 then throw("DApp is inactive at this moment")
7662 else {
7763 let userShare = getCallerShare(i.caller)
7864 let userClaimedAmount = getClaimedAmount(i.caller)
7965 let claimAmount = (userShare - userClaimedAmount)
8066 if ((0 >= claimAmount))
8167 then throw("Claim amount must be bigger than 0")
8268 else {
8369 let userClaimedAmountNew = (userClaimedAmount + claimAmount)
8470 let stake = invoke(stakeDApp, "claimAndWithdrawENNO", nil, nil)
8571 if ((stake == stake))
8672 then [IntegerEntry((toString(i.caller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserENNOLastClaimedAmount), claimAmount)]
8773 else throw("Strict value is not equal to itself.")
8874 }
8975 }
9076
9177
9278
9379 @Callable(i)
9480 func claimAndStakeENNO () = if (!(isActive))
9581 then throw("DApp is inactive at this moment")
9682 else {
9783 let userShare = getCallerShare(i.caller)
9884 let userClaimedAmount = getClaimedAmount(i.caller)
9985 let claimAmount = (userShare - userClaimedAmount)
10086 if ((0 >= claimAmount))
10187 then throw("Claim amount must be bigger than 0")
10288 else {
10389 let userClaimedAmountNew = (userClaimedAmount + claimAmount)
10490 let stake = invoke(stakeDApp, "claimAndStakeENNO", nil, nil)
10591 if ((stake == stake))
10692 then [IntegerEntry((toString(i.caller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserENNOLastClaimedAmount), claimAmount)]
10793 else throw("Strict value is not equal to itself.")
10894 }
10995 }
11096
11197
11298 @Verifier(tx)
11399 func verify () = match tx {
114100 case _ =>
115101 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
116102 then 1
117103 else 0
118104 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
119105 then 1
120106 else 0
121107 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
122108 then 1
123109 else 0
124110 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
125111 }
126112

github/deemru/w8io/026f985 
41.95 ms