tx · 74u5SEjkX9Js4mJDYUJjLoG3pjJYJyaBLQM6CqH4jbSS 3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok: -0.01000000 Waves 2023.11.16 10:41 [2845636] smart account 3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok > SELF 0.00000000 Waves
{ "type": 13, "id": "74u5SEjkX9Js4mJDYUJjLoG3pjJYJyaBLQM6CqH4jbSS", "fee": 1000000, "feeAssetId": null, "timestamp": 1700120515000, "version": 2, "chainId": 84, "sender": "3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok", "senderPublicKey": "Ba1WX1ZypN1wFcFgVrXgam9NFbnD3XA1P62kc37wpxzA", "proofs": [ "5PWsgrKxX1722R4EwhcLEXCS4xEj7QNDP8wxNmvsVaygjcgSknnry8p1vzKVuUCVg8fjnHfDBWkEQtUqKfuFF7Gu" ], "script": "base64:BgI1CAISABIDCgEIEgQKAggBEgQKAggEEgMKAQgSAwoBARIDCgEEEgMKAQgSAwoBARIDCgEIEgADABR3eF9zdGFrZWRfYW1vdW50X2tleQIQd3hfc3Rha2VkX2Ftb3VudAAQd3hfbW9ja19hc3NldF9pZAEgem0CwypAHTesH/u7a8MttNFWRQzQ3dvWhSiS4BwdmuMBCWFzUGF5bWVudAEBdgQHJG1hdGNoMAUBdgMJAAECBQckbWF0Y2gwAg9BdHRhY2hlZFBheW1lbnQEAXAFByRtYXRjaDAFAXAJAAIBAiFmYWlsIHRvIGNhc3QgaW50byBBdHRhY2hlZFBheW1lbnQLAWkBF3VzZXJNYXhEdXJhdGlvblJFQURPTkxZAAkAlAoCBQNuaWwJAJQKAgIHc3Rha2VXWAD4CgFpARh1c2VyTWF4RHVyYXRpb25SRUFET05MWTIBB2FkZHJlc3MJAJQKAgUDbmlsAJADAWkBGHVzZXJNYXhEdXJhdGlvblJFQURPTkxZMwIHYWRkcmVzcwV2YWx1ZQkAlAoCBQNuaWwCBUhlbGxvAWkBGHVzZXJNYXhEdXJhdGlvblJ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ZXdhcmRBbW91bnQJAGsDBRNjdXJyZW50U3Rha2VkQW1vdW50AOgHAJBOCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgUMcmV3YXJkQW1vdW50BRB3eF9tb2NrX2Fzc2V0X2lkBQNuaWwA7KahHA==", "height": 2845636, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3uxAmk5vp8rhG1xiHKMKN5gkv5rWbcSWdV48kF544dgj Next: none Diff:
Old | New | Differences | |
---|---|---|---|
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | - | func userMaxDurationREADONLY5 (address) = $Tuple2(nil, [1, 2, "asd"]) | |
37 | + | func userMaxDurationREADONLY5 (address) = $Tuple2(nil, [1, 2, "asd", $Tuple2(1, 2)]) | |
38 | 38 | ||
39 | 39 | ||
40 | 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 | 18 | ||
19 | 19 | ||
20 | 20 | ||
21 | 21 | @Callable(i) | |
22 | 22 | func userMaxDurationREADONLY2 (address) = $Tuple2(nil, 400) | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | ||
26 | 26 | @Callable(i) | |
27 | 27 | func userMaxDurationREADONLY3 (address,value) = $Tuple2(nil, "Hello") | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | 32 | func userMaxDurationREADONLY4 (address,value) = $Tuple2(nil, true) | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | ||
36 | 36 | @Callable(i) | |
37 | - | func userMaxDurationREADONLY5 (address) = $Tuple2(nil, [1, 2, "asd"]) | |
37 | + | func userMaxDurationREADONLY5 (address) = $Tuple2(nil, [1, 2, "asd", $Tuple2(1, 2)]) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(i) | |
42 | 42 | func userMaxDurationREADONLY6 (address) = $Tuple2(nil, address) | |
43 | 43 | ||
44 | 44 | ||
45 | 45 | ||
46 | 46 | @Callable(i) | |
47 | 47 | func userMaxDurationREADONLY7 (address) = $Tuple2(nil, address) | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(i) | |
52 | 52 | func userMaxDurationREADONLY8 (address) = $Tuple2(nil, address) | |
53 | 53 | ||
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(i) | |
57 | 57 | func stakeWX (duraction) = { | |
58 | 58 | let payment = asPayment(i.payments[0]) | |
59 | 59 | let amount = payment.amount | |
60 | 60 | let currentAmount = valueOrElse(getInteger(wx_staked_amount_key), 0) | |
61 | 61 | [IntegerEntry(wx_staked_amount_key, (currentAmount + amount))] | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | ||
66 | 66 | @Callable(i) | |
67 | 67 | func claimWX (token) = { | |
68 | 68 | let currentStakedAmount = getIntegerValue(wx_staked_amount_key) | |
69 | 69 | let rewardAmount = fraction(currentStakedAmount, 1000, 10000) | |
70 | 70 | [ScriptTransfer(i.caller, rewardAmount, wx_mock_asset_id)] | |
71 | 71 | } | |
72 | 72 | ||
73 | 73 | ||
74 | 74 | ||
75 | 75 | @Callable(i) | |
76 | 76 | func claimReward () = { | |
77 | 77 | let currentStakedAmount = getIntegerValue(wx_staked_amount_key) | |
78 | 78 | let rewardAmount = fraction(currentStakedAmount, 1000, 10000) | |
79 | 79 | [ScriptTransfer(i.caller, rewardAmount, wx_mock_asset_id)] | |
80 | 80 | } | |
81 | 81 | ||
82 | 82 |
github/deemru/w8io/169f3d6 39.61 ms ◑