tx · 2b1ZHdD2TBZf7TxwqdhHkT3HWBM8aVhts8Tvxu3j32TW 3N3b5wban4PEUuND6PxSbTvoekc66fss78g: -0.14000000 Waves 2021.10.26 16:04 [1763294] smart account 3N3b5wban4PEUuND6PxSbTvoekc66fss78g > SELF 0.00000000 Waves
{ "type": 13, "id": "2b1ZHdD2TBZf7TxwqdhHkT3HWBM8aVhts8Tvxu3j32TW", "fee": 14000000, "feeAssetId": null, "timestamp": 1635253461856, "version": 2, "chainId": 84, "sender": "3N3b5wban4PEUuND6PxSbTvoekc66fss78g", "senderPublicKey": "DkMBTSHqT9hKVK1joeyL9DWKdzMAiCYZtYVkMPUx4Zwq", "proofs": [ "3FZwcnuVDou9pouGfUw7JDTVGsLGgDfxKxmAeWZ9kKE4P6ZpuRArp8MZyx29Dwui4T48FU4fXZR716iCR2yHWi35", "2gK93ocX7rbqYA4tYMRQ8YW4tnktvGvtYMkEg1F18VYgn587urJxqc2eYybTqufE3xRtZazovZgbmf61fVCfDmtq", "2Mfs7EZHw9PuHadPEk4Wemeu7rC26ShkmCsWEco2oXZiDmsFiKbgfKwszNKW3LZBgprLBWpfe3Ax4cXGit8WaNa3" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAADQAAAAARa2V5QWN0aXZhdGVIZWlnaHQCAAAAD2FjdGl2YXRlX2hlaWdodAAAAAAPa2V5RmluaXNoSGVpZ2h0AgAAAA1maW5pc2hfaGVpZ2h0AAAAAA5hY3RpdmF0ZUhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwUAAAARa2V5QWN0aXZhdGVIZWlnaHQAAAAADGZpbmlzaEhlaWdodAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAAEdGhpcwUAAAAPa2V5RmluaXNoSGVpZ2h0AAAAAA50b3RhbFNoYXJlRU5OTwAAAFrzEHpAAAAAAAAERU5OTwEAAAAgFbvcV9OA6rL+53m/DeV6nxGYIu+IXr9brrnP32tIN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25lZAAAAAAAAAAAAlZCggk=", "height": 1763294, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FC9dNG7Nm81unoR4kCupbTjBpeNakQ6hfnJyTQQmCEUA Next: GHw9NzBucj7vPzew668MM4JVno4rwAKS9S1jd8g5hTXV Diff:
Old | New | Differences | |
---|---|---|---|
58 | 58 | then height | |
59 | 59 | else finishHeight | |
60 | 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) | |
61 | + | if ((activateHeight > height)) | |
62 | + | then throw("Early Bird period has not been started yet.") | |
63 | + | else { | |
64 | + | let userClaimedAmount = getClaimedAmount(i.caller) | |
65 | + | let claimAmount = (fraction((currentDuration - activateHeight), userShare, blockDuration) - userClaimedAmount) | |
66 | + | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
64 | 67 | [ScriptTransfer(i.caller, claimAmount, ENNO), IntegerEntry((toString(i.caller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserENNOLastClaimedAmount), claimAmount)] | |
68 | + | } | |
65 | 69 | } | |
66 | 70 | ||
67 | 71 |
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 totalShareENNO = 100000000000000 | |
13 | 13 | ||
14 | 14 | let ENNO = base58'2Tqhz5PWbkijnzYpdLxLDFfVDw5ALQWm2rmxQ79ooMRZ' | |
15 | 15 | ||
16 | 16 | let keyUserENNOClaimedAmount = "_ENNO_claimed_amount" | |
17 | 17 | ||
18 | 18 | let keyUserENNOLastClaimedAmount = "_ENNO_last_claimed_amount" | |
19 | 19 | ||
20 | 20 | let adminPubKey1 = base58'DkMBTSHqT9hKVK1joeyL9DWKdzMAiCYZtYVkMPUx4Zwq' | |
21 | 21 | ||
22 | 22 | let adminPubKey2 = base58'DkMBTSHqT9hKVK1joeyL9DWKdzMAiCYZtYVkMPUx4Zwq' | |
23 | 23 | ||
24 | 24 | let adminPubKey3 = base58'DkMBTSHqT9hKVK1joeyL9DWKdzMAiCYZtYVkMPUx4Zwq' | |
25 | 25 | ||
26 | 26 | func getCallerShare (caller) = { | |
27 | 27 | let callerShare = getInteger(this, ("share_" + toString(caller))) | |
28 | 28 | let callerShareAmount = match callerShare { | |
29 | 29 | case share: Int => | |
30 | 30 | share | |
31 | 31 | case share: Unit => | |
32 | 32 | throw("Only early liquidity providers can call this function") | |
33 | 33 | case _ => | |
34 | 34 | throw("Match error") | |
35 | 35 | } | |
36 | 36 | callerShareAmount | |
37 | 37 | } | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | func getClaimedAmount (caller) = { | |
41 | 41 | let callerWithdrawn = getInteger(this, (toString(caller) + keyUserENNOClaimedAmount)) | |
42 | 42 | let callerWithdrawnAmount = match callerWithdrawn { | |
43 | 43 | case share: Int => | |
44 | 44 | share | |
45 | 45 | case share: Unit => | |
46 | 46 | 0 | |
47 | 47 | case _ => | |
48 | 48 | throw("Match error") | |
49 | 49 | } | |
50 | 50 | callerWithdrawnAmount | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | @Callable(i) | |
55 | 55 | func claimENNO () = { | |
56 | 56 | let blockDuration = (finishHeight - activateHeight) | |
57 | 57 | let currentDuration = if ((finishHeight > height)) | |
58 | 58 | then height | |
59 | 59 | else finishHeight | |
60 | 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) | |
61 | + | if ((activateHeight > height)) | |
62 | + | then throw("Early Bird period has not been started yet.") | |
63 | + | else { | |
64 | + | let userClaimedAmount = getClaimedAmount(i.caller) | |
65 | + | let claimAmount = (fraction((currentDuration - activateHeight), userShare, blockDuration) - userClaimedAmount) | |
66 | + | let userClaimedAmountNew = (userClaimedAmount + claimAmount) | |
64 | 67 | [ScriptTransfer(i.caller, claimAmount, ENNO), IntegerEntry((toString(i.caller) + keyUserENNOClaimedAmount), userClaimedAmountNew), IntegerEntry((toString(i.caller) + keyUserENNOLastClaimedAmount), claimAmount)] | |
68 | + | } | |
65 | 69 | } | |
66 | 70 | ||
67 | 71 | ||
68 | 72 | @Verifier(tx) | |
69 | 73 | func verify () = match tx { | |
70 | 74 | case _ => | |
71 | 75 | let adminPubKey1Signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], adminPubKey1)) | |
72 | 76 | then 1 | |
73 | 77 | else 0 | |
74 | 78 | let adminPubKey2Signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], adminPubKey2)) | |
75 | 79 | then 1 | |
76 | 80 | else 0 | |
77 | 81 | let adminPubKey3Signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], adminPubKey3)) | |
78 | 82 | then 1 | |
79 | 83 | else 0 | |
80 | 84 | (((adminPubKey1Signed + adminPubKey2Signed) + adminPubKey3Signed) >= 2) | |
81 | 85 | } | |
82 | 86 |
github/deemru/w8io/026f985 24.42 ms ◑