tx · 4N8JDcePpondjFZ2YfCsGpR85pHJfoi7wwDapqpMWU1X 3N9kfEMrTjmxo1Sx7jMTzjsY6KVT1sjnkgc: -0.01400000 Waves 2021.02.03 00:32 [1381073] smart account 3N9kfEMrTjmxo1Sx7jMTzjsY6KVT1sjnkgc > SELF 0.00000000 Waves
{ "type": 13, "id": "4N8JDcePpondjFZ2YfCsGpR85pHJfoi7wwDapqpMWU1X", "fee": 1400000, "feeAssetId": null, "timestamp": 1612301587391, "version": 1, "sender": "3N9kfEMrTjmxo1Sx7jMTzjsY6KVT1sjnkgc", "senderPublicKey": "Abx2n2y8qRBULFmd16a9vk8EdFhFFJgYTGU498Z4CVty", "proofs": [ "2NrP4qKLMd5NZaBddPSAoqsfArcPk9ei1hfDSVber9aD4Lxv42gGZw2eiJQiUfFyAsFXA8WCBcCDiZDZHaBhAyZ4" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAACgAAAAARa2V5QWN0aXZhdGVIZWlnaHQCAAAAD2FjdGl2YXRlX2hlaWdodAAAAAAPa2V5RmluaXNoSGVpZ2h0AgAAAA1maW5pc2hfaGVpZ2h0AAAAAA5hY3RpdmF0ZUhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwUAAAARa2V5QWN0aXZhdGVIZWlnaHQAAAAADGZpbmlzaEhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwUAAAAPa2V5RmluaXNoSGVpZ2h0AAAAAA50b3RhbFNoYXJlU1dPUAAAAFrzEHpAAAAAAAAEU1dPUAEAAAAgBZi8XXEARXN0cD+GmsdMDJvvV9t9kMADB5+FCvE65koAAAAAGGtleVVzZXJTV09QQ2xhaW1lZEFtb3VudAIAAAAUX1NXT1BfY2xhaW1lZF9hbW91bnQAAAAAHGtleVVzZXJTV09QTGFzdENsYWltZWRBbW91bnQCAAAAGV9TV09QX2xhc3RfY2xhaW1lZF9hbW91bnQBAAAADmdldENhb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jdGl2YXRlSGVpZ2h0BAAAAA9jdXJyZW50RHVyYXRpb24DCQAAZgAAAAIFAAAADGZpbmlzaEhlaWdodAUAAAAGaGVpZ2h0BQAAAAZoZWlnaHQFAAAADGZpbmlzaEhlaWdodAQAAAAJdXNlclNoYXJlCQEAAAAOZ2V0Q2FsbGVyU2hhcmUAAAABCAUAAAABaQAAAAZjYWxsZXIEAAAAEXVzZXJDbGFpbWVkQW1vdW50CQEAAAAQZ2V0Q2xhaW1lZEFtb3VudAAAAAEIBQAAAAFpAAAABmNhbGxlcgQAAAALY2xhaW1BbW91bnQJAABlAAAAAgkAAGsAAAADCQAAZQAAAAIFAAAAD2N1cnJlbnREdXJhdGlvbgUAAAAOYWN0aXZhdGVIZWlnaHQFAAAACXVzZXJTaGFyZQUAAAANYmxvY2tEdXJhdGlvbgUAAAARdXNlckNsYWltZWRBbW91bnQEAAAAFHVzZXJDbGFpbWVkQW1vdW50TmV3CQAAZAAAAAIFAAAAEXVzZXJDbGFpbWVkQW1vdW50BQAAAAtjbGFpbUFtb3VudAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAAC2NsYWltQW1vdW50BQAAAARTV09QCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyBQAAABhrZXlVc2VyU1dPUENsYWltZWRBbW91bnQFAAAAFHVzZXJDbGFpbWVkQW1vdW50TmV3CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyBQAAABxrZXlVc2VyU1dPUExhc3RDbGFpbWVkQW1vdW50BQAAAAtjbGFpbUFtb3VudAUAAAADbmlsAAAAAAAEd/I=", "chainId": 84, "height": 1381073, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: LbdqfnMzQFkZsvqC5Uw38FjooBWq8cEyRpjcoh79LjQ Next: none Diff:
Old | New | Differences | |
---|---|---|---|
11 | 11 | ||
12 | 12 | let totalShareSWOP = 100000000000000 | |
13 | 13 | ||
14 | - | let SWOP = base58' | |
14 | + | let SWOP = base58'Nr7tfLqcNgqiPyFj8mw7hqHjUac9HDTjK5bKXnukSmw' | |
15 | 15 | ||
16 | 16 | let keyUserSWOPClaimedAmount = "_SWOP_claimed_amount" | |
17 | 17 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let keyActivateHeight = "activate_height" | |
5 | 5 | ||
6 | 6 | let keyFinishHeight = "finish_height" | |
7 | 7 | ||
8 | 8 | let activateHeight = getIntegerValue(this, keyActivateHeight) | |
9 | 9 | ||
10 | 10 | let finishHeight = getIntegerValue(this, keyFinishHeight) | |
11 | 11 | ||
12 | 12 | let totalShareSWOP = 100000000000000 | |
13 | 13 | ||
14 | - | let SWOP = base58' | |
14 | + | let SWOP = base58'Nr7tfLqcNgqiPyFj8mw7hqHjUac9HDTjK5bKXnukSmw' | |
15 | 15 | ||
16 | 16 | let keyUserSWOPClaimedAmount = "_SWOP_claimed_amount" | |
17 | 17 | ||
18 | 18 | let keyUserSWOPLastClaimedAmount = "_SWOP_last_claimed_amount" | |
19 | 19 | ||
20 | 20 | func getCallerShare (caller) = { | |
21 | 21 | let callerShare = getInteger(this, ("share_" + toString(caller))) | |
22 | 22 | let callerShareAmount = match callerShare { | |
23 | 23 | case share: Int => | |
24 | 24 | share | |
25 | 25 | case share: Unit => | |
26 | 26 | throw("Only early liquidity providers can call this function") | |
27 | 27 | case _ => | |
28 | 28 | throw("Match error") | |
29 | 29 | } | |
30 | 30 | callerShareAmount | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | func getClaimedAmount (caller) = { | |
35 | 35 | let callerWithdrawn = getInteger(this, (toString(caller) + keyUserSWOPClaimedAmount)) | |
36 | 36 | let callerWithdrawnAmount = match callerWithdrawn { | |
37 | 37 | case share: Int => | |
38 | 38 | share | |
39 | 39 | case share: Unit => | |
40 | 40 | 0 | |
41 | 41 | case _ => | |
42 | 42 | throw("Match error") | |
43 | 43 | } | |
44 | 44 | callerWithdrawnAmount | |
45 | 45 | } | |
46 | 46 | ||
47 | 47 | ||
48 | 48 | @Callable(i) | |
49 | 49 | func claimSWOP () = { | |
50 | 50 | let blockDuration = (finishHeight - activateHeight) | |
51 | 51 | let currentDuration = if ((finishHeight > height)) | |
52 | 52 | then height | |
53 | 53 | else finishHeight | |
54 | 54 | let userShare = getCallerShare(i.caller) | |
55 | 55 | let userClaimedAmount = getClaimedAmount(i.caller) | |
56 | 56 | let claimAmount = (fraction((currentDuration - activateHeight), userShare, blockDuration) - userClaimedAmount) | |
57 | 57 | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
58 | 58 | [ScriptTransfer(i.caller, claimAmount, SWOP), IntegerEntry((toString(i.caller) + keyUserSWOPClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserSWOPLastClaimedAmount), claimAmount)] | |
59 | 59 | } | |
60 | 60 | ||
61 | 61 |
github/deemru/w8io/169f3d6 19.13 ms ◑