tx · 7fuHykfTK2JnuyABW5pvwNe49maJEQNPPacjxGHkhhht

3MpSTx1FM9aFVAjjZL48Xn8BhQsFq2dqa1a:  -0.01000000 Waves

2021.03.30 14:56 [1460465] smart account 3MpSTx1FM9aFVAjjZL48Xn8BhQsFq2dqa1a > SELF 0.00000000 Waves

{ "type": 13, "id": "7fuHykfTK2JnuyABW5pvwNe49maJEQNPPacjxGHkhhht", "fee": 1000000, "feeAssetId": null, "timestamp": 1617105404586, "version": 2, "chainId": 84, "sender": "3MpSTx1FM9aFVAjjZL48Xn8BhQsFq2dqa1a", "senderPublicKey": "4L5wicmAjiPH6pnWtdZQfrXQ9H45uCbVMTJcq7rU4vRf", "proofs": [ "4vTXiWT5CRCyQt39KbqyBNT7w7Um3bBqWiheMEq95KhcsQ8fMSPBVjoHFxvE4ngEEyA9v66Jonxuyr7xtHQoAXAV" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAADQAAAAARa2V5QWN0aXZhdGVIZWlnaHQCAAAAD2FjdGl2YXRlX2hlaWdodAAAAAAPa2V5RmluaXNoSGVpZ2h0AgAAAA1maW5pc2hfaGVpZ2h0AAAAAA5hY3RpdmF0ZUhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwUAAAARa2V5QWN0aXZhdGVIZWlnaHQAAAAADGZpbmlzaEhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwUAAAAPa2V5RmluaXNoSGVpZ2h0AAAAAA50b3RhbFNoYXJlU1dPUAAAAFrzEHpAAAAAAAAEU1dPUAEAAAAgEv+BIJFIbrNA9tN9ExhCV/1vofsy06rszWo/nWl9O/gAAAAAGGtleVVzZXJTV09QQ2xhaW1lZEFtb3VudAIAAAAUX1NXT1BfY2xhaW1lZF9hbW91bnQAAAAAHGtleVVzZXJTV09QTGFzdENsYWltZWRBbW91bnQCAAAAGV9TV09QX2xhc3RfY2xhaW1lZF9hbW91bnQAAAAAD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AACCQABLAAAAAIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyBQAAABxrZXlVc2VyU1dPUExhc3RDbGFpbWVkQW1vdW50BQAAAAtjbGFpbUFtb3VudAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXntz+36", "height": 1460465, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 4vhRdvuMFNdV3soNtfhaow52srUucKhmpUEo7yjz6xSg Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 4 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+let keyActivateHeight = "activate_height"
5+
6+let keyFinishHeight = "finish_height"
7+
8+let activateHeight = getIntegerValue(this, keyActivateHeight)
9+
10+let finishHeight = getIntegerValue(this, keyFinishHeight)
11+
12+let totalShareSWOP = 100000000000000
13+
14+let SWOP = base58'2HAJrwa8q4SxBx9cHYaBTQdBjdk5wwqdof7ccpAx2uhZ'
15+
16+let keyUserSWOPClaimedAmount = "_SWOP_claimed_amount"
17+
18+let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount"
19+
20+let adminPubKey1 = base58'DXDY2itiEcYBtGkVLnkpHtDFyWQUkoLJz79uJ7ECbMrA'
21+
22+let adminPubKey2 = base58'E6Wa1SGoktYcjHjsKrvjMiqJY3SWmGKcD8Q5L8kxSPS7'
23+
24+let adminPubKey3 = base58'AZmWJtuy4GeVrMmJH4hfFBRApe1StvhJSk4jcbT6bArQ'
25+
26+func getCallerShare (caller) = {
27+ let callerShare = getInteger(this, ("share_" + toString(caller)))
28+ let callerShareAmount = match callerShare {
29+ case share: Int =>
30+ share
31+ case share: Unit =>
32+ throw("Only early liquidity providers can call this function")
33+ case _ =>
34+ throw("Match error")
35+ }
36+ callerShareAmount
37+ }
38+
39+
40+func getClaimedAmount (caller) = {
41+ let callerWithdrawn = getInteger(this, (toString(caller) + keyUserSWOPClaimedAmount))
42+ let callerWithdrawnAmount = match callerWithdrawn {
43+ case share: Int =>
44+ share
45+ case share: Unit =>
46+ 0
47+ case _ =>
48+ throw("Match error")
49+ }
50+ callerWithdrawnAmount
51+ }
52+
53+
54+@Callable(i)
55+func claimSWOP () = {
56+ let blockDuration = (finishHeight - activateHeight)
57+ let currentDuration = if ((finishHeight > height))
58+ then height
59+ else finishHeight
60+ let userShare = getCallerShare(i.caller)
61+ let userClaimedAmount = getClaimedAmount(i.caller)
62+ let claimAmount = (fraction((currentDuration - activateHeight), userShare, blockDuration) - userClaimedAmount)
63+ let userClaimedAmountNew = (userClaimedAmount + claimAmount)
64+[ScriptTransfer(i.caller, claimAmount, SWOP), IntegerEntry((toString(i.caller) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserSWOPLastClaimedAmount), claimAmount)]
65+ }
66+
67+
68+@Verifier(tx)
69+func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
70+

github/deemru/w8io/169f3d6 
14.25 ms