tx · EeFnu38kkvx7vDRVedP9mPM8Y9X3Xqj5qFi5YmNDqt1r 3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok: -0.01000000 Waves 2023.11.16 09:17 [2845549] smart account 3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok > SELF 0.00000000 Waves
{ "type": 13, "id": "EeFnu38kkvx7vDRVedP9mPM8Y9X3Xqj5qFi5YmNDqt1r", "fee": 1000000, "feeAssetId": null, "timestamp": 1700115443577, "version": 2, "chainId": 84, "sender": "3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok", "senderPublicKey": "Ba1WX1ZypN1wFcFgVrXgam9NFbnD3XA1P62kc37wpxzA", "proofs": [ "4En237p1fRXYtCqgnSubdgnSYp1LkL8KwBV86RR85qsvDgrmFV77asvLPRwEQnNdezSve5qorjh5kMZqkSkxCqzJ" ], "script": "base64:BgImCAISABIDCgEIEgQKAggBEgQKAggEEgMKAQgSAwoBARIDCgEIEgADABR3eF9zdGFrZWRfYW1vdW50X2tleQIQd3hfc3Rha2VkX2Ftb3VudAAQd3hfbW9ja19hc3NldF9pZAEgem0CwypAHTesH/u7a8MttNFWRQzQ3dvWhSiS4BwdmuMBCWFzUGF5bWVudAEBdgQHJG1hdGNoMAUBdgMJAAECBQckbWF0Y2gwAg9BdHRhY2hlZFBheW1lbnQEAXAFByRtYXRjaDAFAXAJAAIBAiFmYWlsIHRvIGNhc3QgaW50byBBdHRhY2hlZFBheW1lbnQIAWkBF3VzZXJNYXhEdXJhdGlvblJFQURPTkxZAAkAlAoCBQNuaWwJAJQKAgIHc3Rha2VXWAD4CgFpARh1c2VyTWF4RHVyYXRpb25SRUFET05MWTIBB2FkZHJlc3MJAJQKAgUDbmlsAJADAWkBGHVzZXJNYXhEdXJhdGlvblJFQURPTkxZMwIHYWRkcmVzcwV2YWx1ZQkAlAoCBQNuaWwCBUhlbGxvAWkBGHVzZXJNYXhEdXJhdGlvblJFQURPTkxZNAIHYWRkcmVzcwV2YWx1ZQkAlAoCBQNuaWwGAWkBGHVzZXJNYXhEdXJhdGlvblJFQURPTkxZNQEHYWRkcmVzcwkAlAoCBQNuaWwJAMwIAgABCQDMCAIAAgkAzAgCAgNhc2QFA25pbAFpAQdzdGFrZVdYAQlkdXJhY3Rpb24EB3BheW1lbnQJAQlhc1BheW1lbnQBCQCRAwIIBQFpCHBheW1lbnRzAAAEBmFtb3VudAgFB3BheW1lbnQGYW1vdW50BA1jdXJyZW50QW1vdW50CQELdmFsdWVPckVsc2UCCQCfCAEFFHd4X3N0YWtlZF9hbW91bnRfa2V5AAAJAMwIAgkBDEludGVnZXJFbnRyeQIFFHd4X3N0YWtlZF9hbW91bnRfa2V5CQBkAgUNY3VycmVudEFtb3VudAUGYW1vdW50BQNuaWwBaQEHY2xhaW1XWAEFdG9rZW4EE2N1cnJlbnRTdGFrZWRBbW91bnQJARFAZXh0ck5hdGl2ZSgxMDU1KQEFFHd4X3N0YWtlZF9hbW91bnRfa2V5BAxyZXdhcmRBbW91bnQJAGsDBRNjdXJyZW50U3Rha2VkQW1vdW50AOgHAJBOCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUMcmV3YXJkQW1vdW50BRB3eF9tb2NrX2Fzc2V0X2lkBQNuaWwBaQELY2xhaW1SZXdhcmQABBNjdXJyZW50U3Rha2VkQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBBRR3eF9zdGFrZWRfYW1vdW50X2tleQQMcmV3YXJkQW1vdW50CQBrAwUTY3VycmVudFN0YWtlZEFtb3VudADoBwCQTgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFDHJld2FyZEFtb3VudAUQd3hfbW9ja19hc3NldF9pZAUDbmlsAJglDGU=", "height": 2845549, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3meSTSRWJodaxZYQTh8AE5yU5x7DhhiQqgmJuGswLxn8 Next: 6BP8qpMGzBx7zCKEZJfG2dRiRzXGZk7o7FnqwQP3SsNw Diff:
Old | New | Differences | |
---|---|---|---|
15 | 15 | ||
16 | 16 | @Callable(i) | |
17 | 17 | func userMaxDurationREADONLY () = $Tuple2(nil, $Tuple2("stakeWX", 1400)) | |
18 | + | ||
19 | + | ||
20 | + | ||
21 | + | @Callable(i) | |
22 | + | func userMaxDurationREADONLY2 (address) = $Tuple2(nil, 400) | |
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | @Callable(i) | |
27 | + | func userMaxDurationREADONLY3 (address,value) = $Tuple2(nil, "Hello") | |
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | @Callable(i) | |
32 | + | func userMaxDurationREADONLY4 (address,value) = $Tuple2(nil, true) | |
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | @Callable(i) | |
37 | + | func userMaxDurationREADONLY5 (address) = $Tuple2(nil, [1, 2, "asd"]) | |
18 | 38 | ||
19 | 39 | ||
20 | 40 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let wx_staked_amount_key = "wx_staked_amount" | |
5 | 5 | ||
6 | 6 | let wx_mock_asset_id = base58'9Eu9de5GPPgLzY16bevCaxF4rFr4jA9wqyTfqcjksU82' | |
7 | 7 | ||
8 | 8 | func asPayment (v) = match v { | |
9 | 9 | case p: AttachedPayment => | |
10 | 10 | p | |
11 | 11 | case _ => | |
12 | 12 | throw("fail to cast into AttachedPayment") | |
13 | 13 | } | |
14 | 14 | ||
15 | 15 | ||
16 | 16 | @Callable(i) | |
17 | 17 | func userMaxDurationREADONLY () = $Tuple2(nil, $Tuple2("stakeWX", 1400)) | |
18 | + | ||
19 | + | ||
20 | + | ||
21 | + | @Callable(i) | |
22 | + | func userMaxDurationREADONLY2 (address) = $Tuple2(nil, 400) | |
23 | + | ||
24 | + | ||
25 | + | ||
26 | + | @Callable(i) | |
27 | + | func userMaxDurationREADONLY3 (address,value) = $Tuple2(nil, "Hello") | |
28 | + | ||
29 | + | ||
30 | + | ||
31 | + | @Callable(i) | |
32 | + | func userMaxDurationREADONLY4 (address,value) = $Tuple2(nil, true) | |
33 | + | ||
34 | + | ||
35 | + | ||
36 | + | @Callable(i) | |
37 | + | func userMaxDurationREADONLY5 (address) = $Tuple2(nil, [1, 2, "asd"]) | |
18 | 38 | ||
19 | 39 | ||
20 | 40 | ||
21 | 41 | @Callable(i) | |
22 | 42 | func stakeWX (duraction) = { | |
23 | 43 | let payment = asPayment(i.payments[0]) | |
24 | 44 | let amount = payment.amount | |
25 | 45 | let currentAmount = valueOrElse(getInteger(wx_staked_amount_key), 0) | |
26 | 46 | [IntegerEntry(wx_staked_amount_key, (currentAmount + amount))] | |
27 | 47 | } | |
28 | 48 | ||
29 | 49 | ||
30 | 50 | ||
31 | 51 | @Callable(i) | |
32 | 52 | func claimWX (token) = { | |
33 | 53 | let currentStakedAmount = getIntegerValue(wx_staked_amount_key) | |
34 | 54 | let rewardAmount = fraction(currentStakedAmount, 1000, 10000) | |
35 | 55 | [ScriptTransfer(i.caller, rewardAmount, wx_mock_asset_id)] | |
36 | 56 | } | |
37 | 57 | ||
38 | 58 | ||
39 | 59 | ||
40 | 60 | @Callable(i) | |
41 | 61 | func claimReward () = { | |
42 | 62 | let currentStakedAmount = getIntegerValue(wx_staked_amount_key) | |
43 | 63 | let rewardAmount = fraction(currentStakedAmount, 1000, 10000) | |
44 | 64 | [ScriptTransfer(i.caller, rewardAmount, wx_mock_asset_id)] | |
45 | 65 | } | |
46 | 66 | ||
47 | 67 |
github/deemru/w8io/169f3d6 19.67 ms ◑