tx · CwF5ERhJnbb2cWGH1CqrsVq8S3wiDbUrfqG14oh1xoVF

3NCVWoqgP5evS1BbN2RYeDofxSSfc83UPrm:  -0.14000000 Waves

2021.10.27 10:31 [1764400] smart account 3NCVWoqgP5evS1BbN2RYeDofxSSfc83UPrm > SELF 0.00000000 Waves

{ "type": 13, "id": "CwF5ERhJnbb2cWGH1CqrsVq8S3wiDbUrfqG14oh1xoVF", "fee": 14000000, "feeAssetId": null, "timestamp": 1635319897426, "version": 2, "chainId": 84, "sender": "3NCVWoqgP5evS1BbN2RYeDofxSSfc83UPrm", "senderPublicKey": "Ebjd61Ze5xP5ZS519XxDrSmiRo4s1e2BEaxbYCXzrSs2", "proofs": [ "2jeUJUGw3cJ18bXtYhddq7D5zZsX4N7twSArKeRT6Q9uX9yET7w9ACFbv6vimff68DF2MphGsjaW6CoxjXPj453e", "4NfnRPUHufrZE7Uc3fAnZXdFWH6FJW6aujyvG2F64znWDtS6PJjfUEi8kn2LQdR21Bx5svyZMagN5fbRwfktDxQc" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAALAAAAABhrZXlVc2VyRU5OT0NsYWltZWRBbW91bnQCAAAAFF9FTk5PX2NsYWltZWRfYW1vdW50AAAAABxrZXlVc2VyRU5OT0xhc3RDbGFpbWVkQW1vdW50AgAAABlfRU5OT19sYXN0X2NsYWltZWRfYW1vdW50AAAAAARFTk5PAQAAACAVu9xX04Dqsv7neb8N5XqfEZgi74hev1uuuc/fa0g3cAAAAAAMYWRtaW5QdWJLZXkxAQAAACDKDd7fzM1mZ5Htvcbud2oeN4XrWvIR2nKL78WnCFqVEQAAAAAMYWRtaW5QdWJLZXkyAQAAACDKDd7fzM1mZ5Htvcbud2oeN4XrWvIR2nKL78WnCFqVEQAAAAAMYWRtaW5QdWJLZXkzAQAAACDKDd7fzM1mZ5Htvcbud2oeN4XrWvIR2nKL78WnCFqVEQAAAAAJc2hhcmVEYXRhAQAAACBbQ+QzUMC1aF2T3qieo6NeRn/Nix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GQAAAACBQAAABJhZG1pblB1YktleTFTaWduZWQFAAAAEmFkbWluUHViS2V5MlNpZ25lZAUAAAASYWRtaW5QdWJLZXkzU2lnbmVkAAAAAAAAAAACiWnp9Q==", "height": 1764400, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7ftLy1XJiYguEBjKBMUvyR4fbeFfunkU4NBETjJijLjA Next: EbV29d2TrMVZSJyqpT3DiAPtprKCqNQ3K7pTupMoxRvR Diff:
OldNewDifferences
1515
1616 let shareData = base58'79G9MRTWPsir5gThDeuicpBuQxx8UFNqVaDUYcRfWtPA'
1717
18+let stakeDApp = addressFromPublicKey(base58'Ebjd61Ze5xP5ZS519XxDrSmiRo4s1e2BEaxbYCXzrSs2')
19+
1820 func getCallerShare (caller) = {
1921 let callerShare = getInteger(addressFromPublicKey(shareData), ("share_" + toString(caller)))
22+ let callerShareAmount = match callerShare {
23+ case share: Int =>
24+ share
25+ case share: Unit =>
26+ throw("Only governance qualifiers can call this function.")
27+ case _ =>
28+ throw("Match error")
29+ }
30+ callerShareAmount
31+ }
32+
33+
34+func getCallerLock (caller) = {
35+ let callerShare = getInteger(stakeDApp, (toString(caller) + "_ENNO_amount"))
2036 let callerShareAmount = match callerShare {
2137 case share: Int =>
2238 share
5773 }
5874
5975
76+
77+@Callable(i)
78+func lockENNO () = {
79+ let userShare = getCallerShare(i.caller)
80+ let userClaimedAmount = getClaimedAmount(i.caller)
81+ let claimAmount = (userShare - userClaimedAmount)
82+ if ((0 >= claimAmount))
83+ then throw("Claim amount must be bigger than 0")
84+ else {
85+ let userClaimedAmountNew = (userClaimedAmount + claimAmount)
86+ let amount = claimAmount
87+ let stake = invoke(stakeDApp, "lockENNO", nil, [AttachedPayment(ENNO, amount)])
88+ if ((stake == stake))
89+ then [ScriptTransfer(i.caller, claimAmount, ENNO), IntegerEntry((toString(i.caller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserENNOLastClaimedAmount), claimAmount)]
90+ else throw("Strict value is not equal to itself.")
91+ }
92+ }
93+
94+
6095 @Verifier(tx)
6196 func verify () = match tx {
6297 case _ =>
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 ENNO = base58'2Tqhz5PWbkijnzYpdLxLDFfVDw5ALQWm2rmxQ79ooMRZ'
99
1010 let adminPubKey1 = base58'Ebjd61Ze5xP5ZS519XxDrSmiRo4s1e2BEaxbYCXzrSs2'
1111
1212 let adminPubKey2 = base58'Ebjd61Ze5xP5ZS519XxDrSmiRo4s1e2BEaxbYCXzrSs2'
1313
1414 let adminPubKey3 = base58'Ebjd61Ze5xP5ZS519XxDrSmiRo4s1e2BEaxbYCXzrSs2'
1515
1616 let shareData = base58'79G9MRTWPsir5gThDeuicpBuQxx8UFNqVaDUYcRfWtPA'
1717
18+let stakeDApp = addressFromPublicKey(base58'Ebjd61Ze5xP5ZS519XxDrSmiRo4s1e2BEaxbYCXzrSs2')
19+
1820 func getCallerShare (caller) = {
1921 let callerShare = getInteger(addressFromPublicKey(shareData), ("share_" + toString(caller)))
22+ let callerShareAmount = match callerShare {
23+ case share: Int =>
24+ share
25+ case share: Unit =>
26+ throw("Only governance qualifiers can call this function.")
27+ case _ =>
28+ throw("Match error")
29+ }
30+ callerShareAmount
31+ }
32+
33+
34+func getCallerLock (caller) = {
35+ let callerShare = getInteger(stakeDApp, (toString(caller) + "_ENNO_amount"))
2036 let callerShareAmount = match callerShare {
2137 case share: Int =>
2238 share
2339 case share: Unit =>
2440 throw("Only governance qualifiers can call this function.")
2541 case _ =>
2642 throw("Match error")
2743 }
2844 callerShareAmount
2945 }
3046
3147
3248 func getClaimedAmount (caller) = {
3349 let callerWithdrawn = getInteger(this, (toString(caller) + keyUserENNOClaimedAmount))
3450 let callerWithdrawnAmount = match callerWithdrawn {
3551 case share: Int =>
3652 share
3753 case share: Unit =>
3854 0
3955 case _ =>
4056 throw("Match error")
4157 }
4258 callerWithdrawnAmount
4359 }
4460
4561
4662 @Callable(i)
4763 func claimENNO () = {
4864 let userShare = getCallerShare(i.caller)
4965 let userClaimedAmount = getClaimedAmount(i.caller)
5066 let claimAmount = (userShare - userClaimedAmount)
5167 if ((0 >= claimAmount))
5268 then throw("Claim amount must be bigger than 0")
5369 else {
5470 let userClaimedAmountNew = (userClaimedAmount + claimAmount)
5571 [ScriptTransfer(i.caller, claimAmount, ENNO), IntegerEntry((toString(i.caller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserENNOLastClaimedAmount), claimAmount)]
5672 }
5773 }
5874
5975
76+
77+@Callable(i)
78+func lockENNO () = {
79+ let userShare = getCallerShare(i.caller)
80+ let userClaimedAmount = getClaimedAmount(i.caller)
81+ let claimAmount = (userShare - userClaimedAmount)
82+ if ((0 >= claimAmount))
83+ then throw("Claim amount must be bigger than 0")
84+ else {
85+ let userClaimedAmountNew = (userClaimedAmount + claimAmount)
86+ let amount = claimAmount
87+ let stake = invoke(stakeDApp, "lockENNO", nil, [AttachedPayment(ENNO, amount)])
88+ if ((stake == stake))
89+ then [ScriptTransfer(i.caller, claimAmount, ENNO), IntegerEntry((toString(i.caller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserENNOLastClaimedAmount), claimAmount)]
90+ else throw("Strict value is not equal to itself.")
91+ }
92+ }
93+
94+
6095 @Verifier(tx)
6196 func verify () = match tx {
6297 case _ =>
6398 let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1))
6499 then 1
65100 else 0
66101 let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2))
67102 then 1
68103 else 0
69104 let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3))
70105 then 1
71106 else 0
72107 (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2)
73108 }
74109

github/deemru/w8io/169f3d6 
51.93 ms