tx · 6BP8qpMGzBx7zCKEZJfG2dRiRzXGZk7o7FnqwQP3SsNw 3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok: -0.01000000 Waves 2023.11.16 09:20 [2845553] smart account 3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok > SELF 0.00000000 Waves
{ "type": 13, "id": "6BP8qpMGzBx7zCKEZJfG2dRiRzXGZk7o7FnqwQP3SsNw", "fee": 1000000, "feeAssetId": null, "timestamp": 1700115625249, "version": 2, "chainId": 84, "sender": "3NCukxG6cc7pqKoEwTZsr1CRrHMHfvGM7ok", "senderPublicKey": "Ba1WX1ZypN1wFcFgVrXgam9NFbnD3XA1P62kc37wpxzA", "proofs": [ "2FEfeAnGFHawD9JteK11gUZSjL8ZU75HwFdqekP4VXbkAHqJSEH7H4S3U1kMmy5iHQA1woUScSQKofds4VpVyisG" ], "script": "base64:BgIrCAISABIDCgEIEgQKAggBEgQKAggEEgMKAQgSAwoBARIDCgEBEgMKAQgSAAMAFHd4X3N0YWtlZF9hbW91bnRfa2V5AhB3eF9zdGFrZWRfYW1vdW50ABB3eF9tb2NrX2Fzc2V0X2lkASB6bQLDKkAdN6wf+7trwy200VZFDNDd29aFKJLgHB2a4wEJYXNQYXltZW50AQF2BAckbWF0Y2gwBQF2AwkAAQIFByRtYXRjaDACD0F0dGFjaGVkUGF5bWVudAQBcAUHJG1hdGNoMAUBcAkAAgECIWZhaWwgdG8gY2FzdCBpbnRvIEF0dGFjaGVkUGF5bWVudAkBaQEXdXNlck1heER1cmF0aW9uUkVBRE9OTFkACQCUCgIFA25pbAkAlAoCAgdzdGFrZVdYAPgKAWkBGHVzZXJNYXhEdXJhdGlvblJFQURPTkxZMgEHYWRkcmVzcwkAlAoCBQNuaWwAkAMBaQEYdXNlck1heER1cmF0aW9uUkVBRE9OTFkzAgdhZGRyZXNzBXZhbHVlCQCUCgIFA25pbAIFSGVsbG8BaQEYdXNlck1heER1cmF0aW9uUkVBRE9OTFk0AgdhZGRyZXNzBXZhbHVlCQCUCgIFA25pbAYBaQEYdXNlck1heER1cmF0aW9uUkVBRE9OTFk1AQdhZGRyZXNzCQCUCgIFA25pbAkAzAgCAAEJAMwIAgACCQDMCAICA2FzZAUDbmlsAWkBGHVzZXJNYXhEdXJhdGlvblJFQURPTkxZNgEHYWRkcmVzcwkAlAoCBQNuaWwFB2FkZHJlc3MBaQEHc3Rha2VXWAEJZHVyYWN0aW9uBAdwYXltZW50CQEJYXNQYXltZW50AQkAkQMCCAUBaQhwYXltZW50cwAABAZhbW91bnQIBQdwYXltZW50BmFtb3VudAQNY3VycmVudEFtb3VudAkBC3ZhbHVlT3JFbHNlAgkAnwgBBRR3eF9zdGFrZWRfYW1vdW50X2tleQAACQDMCAIJAQxJbnRlZ2VyRW50cnkCBRR3eF9zdGFrZWRfYW1vdW50X2tleQkAZAIFDWN1cnJlbnRBbW91bnQFBmFtb3VudAUDbmlsAWkBB2NsYWltV1gBBXRva2VuBBNjdXJyZW50U3Rha2VkQW1vdW50CQERQGV4dHJOYXRpdmUoMTA1NSkBBRR3eF9zdGFrZWRfYW1vdW50X2tleQQMcmV3YXJkQW1vdW50CQBrAwUTY3VycmVudFN0YWtlZEFtb3VudADoBwCQTgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFDHJld2FyZEFtb3VudAUQd3hfbW9ja19hc3NldF9pZAUDbmlsAWkBC2NsYWltUmV3YXJkAAQTY3VycmVudFN0YWtlZEFtb3VudAkBEUBleHRyTmF0aXZlKDEwNTUpAQUUd3hfc3Rha2VkX2Ftb3VudF9rZXkEDHJld2FyZEFtb3VudAkAawMFE2N1cnJlbnRTdGFrZWRBbW91bnQA6AcAkE4JAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQxyZXdhcmRBbW91bnQFEHd4X21vY2tfYXNzZXRfaWQFA25pbAD7fjQM", "height": 2845553, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EeFnu38kkvx7vDRVedP9mPM8Y9X3Xqj5qFi5YmNDqt1r Next: 3uxAmk5vp8rhG1xiHKMKN5gkv5rWbcSWdV48kF544dgj Diff:
Old | New | Differences | |
---|---|---|---|
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(i) | |
42 | + | func userMaxDurationREADONLY6 (address) = $Tuple2(nil, address) | |
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | @Callable(i) | |
42 | 47 | func stakeWX (duraction) = { | |
43 | 48 | let payment = asPayment(i.payments[0]) | |
44 | 49 | let amount = payment.amount |
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 | 37 | func userMaxDurationREADONLY5 (address) = $Tuple2(nil, [1, 2, "asd"]) | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(i) | |
42 | + | func userMaxDurationREADONLY6 (address) = $Tuple2(nil, address) | |
43 | + | ||
44 | + | ||
45 | + | ||
46 | + | @Callable(i) | |
42 | 47 | func stakeWX (duraction) = { | |
43 | 48 | let payment = asPayment(i.payments[0]) | |
44 | 49 | let amount = payment.amount | |
45 | 50 | let currentAmount = valueOrElse(getInteger(wx_staked_amount_key), 0) | |
46 | 51 | [IntegerEntry(wx_staked_amount_key, (currentAmount + amount))] | |
47 | 52 | } | |
48 | 53 | ||
49 | 54 | ||
50 | 55 | ||
51 | 56 | @Callable(i) | |
52 | 57 | func claimWX (token) = { | |
53 | 58 | let currentStakedAmount = getIntegerValue(wx_staked_amount_key) | |
54 | 59 | let rewardAmount = fraction(currentStakedAmount, 1000, 10000) | |
55 | 60 | [ScriptTransfer(i.caller, rewardAmount, wx_mock_asset_id)] | |
56 | 61 | } | |
57 | 62 | ||
58 | 63 | ||
59 | 64 | ||
60 | 65 | @Callable(i) | |
61 | 66 | func claimReward () = { | |
62 | 67 | let currentStakedAmount = getIntegerValue(wx_staked_amount_key) | |
63 | 68 | let rewardAmount = fraction(currentStakedAmount, 1000, 10000) | |
64 | 69 | [ScriptTransfer(i.caller, rewardAmount, wx_mock_asset_id)] | |
65 | 70 | } | |
66 | 71 | ||
67 | 72 |
github/deemru/w8io/169f3d6 29.57 ms ◑