tx · Fgdns7VYeydfBjZ8JHuqaXBmctWj4BrdVe5Kk6qh3oGE 3Mzp2SVcAMDBu3Q4aG4EtTQGTKRtpkSsGFy: -0.01000000 Waves 2022.04.02 01:12 [1990106] smart account 3Mzp2SVcAMDBu3Q4aG4EtTQGTKRtpkSsGFy > SELF 0.00000000 Waves
{ "type": 13, "id": "Fgdns7VYeydfBjZ8JHuqaXBmctWj4BrdVe5Kk6qh3oGE", "fee": 1000000, "feeAssetId": null, "timestamp": 1648851163570, "version": 2, "chainId": 84, "sender": "3Mzp2SVcAMDBu3Q4aG4EtTQGTKRtpkSsGFy", "senderPublicKey": "9VSM67p8B4gEswZ5qFTRqzuBxkRT9kvkvTbRjDdwiAD2", "proofs": [ "2DzpNbN8uKVYEedqQs6KLnv1KEQNKyrVhhn22jfQD4WvNpWDa5w1YBx1YYHiBtsu3cJApHP7PLAmEamQ3JAb7kzV" ], "script": "base64:AAIFAAAAAAAAAAQIAhIAAAAABAAAAAAEdXNkTgEAAAAgD/IcEqzkxDya7EYaqyWosOy6BytGzG2IcvC14pJJAbQAAAAABnN0YWtlcgkBAAAAB0FkZHJlc3MAAAABAQAAABoBVDRN1hxurYPxlZgKuniaPP5OOF3+bmEyywAAAAAJbGVhc2VQb29sCQEAAAAHQWRkcmVzcwAAAAEBAAAAGgFUNE3WHG6tg/GVmAq6eJo8/k44Xf5uYTLLAAAAAApzaGFyZVRva2VuAQAAACAN1EdMdSgTCfvPg6qwJMmO22iRJQqRdvbLCj8IyZLdtgAAAAEAAAABaQEAAAAMYWRkTGlxdWlkaXR5AAAAAAMDCQEAAAACIT0AAAACCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAdhc3NldElkBQAAAAR1bml0BgkBAAAAAiE9AAAAAggJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEAAAAHYXNzZXRJZAUAAAAEdXNkTgkAAAIAAAABAgAAABF1bmV4cGVjdGVkIGFzc2V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kBAAAAC0xlYXNlQ2FuY2VsAAAAAQkAAlkAAAABBQAAAAJpZAUAAAADbmlsCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAABWlkS2V5CQACWAAAAAEFAAAACm5ld0xlYXNlSWQFAAAAA25pbAkABE4AAAACBQAAAAZjYW5jZWwJAARMAAAAAgUAAAAIbmV3TGVhc2UJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAAABBQAAAApzaGFyZVRva2VuCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAA5sZWFzZUFtb3VudEtleQkAAGQAAAACBQAAAAxsZWFzZWRBbW91bnQICQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAAAAAABmFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAQc3Rha2luZ0Ftb3VudEtleQUAAAANc3Rha2luZ0Ftb3VudAUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAADTAQuC", "height": 1990106, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8ndH7wAZbp4FoYmRaf9BZx6apDQCdSaZkGkMwynbjhiR Next: none Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let staker = Address(base58'3MtgeA4XXgXJ8JUcFnX7U4X5GFzisbnoZcW') | |
7 | 7 | ||
8 | - | let leasePool = Address(base58' | |
8 | + | let leasePool = Address(base58'3MtgeA4XXgXJ8JUcFnX7U4X5GFzisbnoZcW') | |
9 | 9 | ||
10 | 10 | let shareToken = base58'vz3LSXQhs64FAd77oURX16nhJuB8YYe5NLB2em8AC5j' | |
11 | 11 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let usdN = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
5 | 5 | ||
6 | 6 | let staker = Address(base58'3MtgeA4XXgXJ8JUcFnX7U4X5GFzisbnoZcW') | |
7 | 7 | ||
8 | - | let leasePool = Address(base58' | |
8 | + | let leasePool = Address(base58'3MtgeA4XXgXJ8JUcFnX7U4X5GFzisbnoZcW') | |
9 | 9 | ||
10 | 10 | let shareToken = base58'vz3LSXQhs64FAd77oURX16nhJuB8YYe5NLB2em8AC5j' | |
11 | 11 | ||
12 | 12 | @Callable(i) | |
13 | 13 | func addLiquidity () = if (if ((i.payments[0].assetId != unit)) | |
14 | 14 | then true | |
15 | 15 | else (i.payments[1].assetId != usdN)) | |
16 | 16 | then throw("unexpected assets") | |
17 | 17 | else { | |
18 | 18 | let r = invoke(staker, "stake", nil, [i.payments[1]]) | |
19 | 19 | if ((r == r)) | |
20 | 20 | then { | |
21 | 21 | let stakingAmount = match r { | |
22 | 22 | case a: Int => | |
23 | 23 | a | |
24 | 24 | case _ => | |
25 | 25 | throw("unexpected result type from the staker") | |
26 | 26 | } | |
27 | 27 | let stakingAmountKey = ("STAKING_AMOUNT_" + toString(i.caller)) | |
28 | 28 | let leaseAmountKey = ("LEASE_AMOUNT_" + toString(i.caller)) | |
29 | 29 | let idKey = ("ID_" + toString(i.caller)) | |
30 | 30 | let leasedAmount = valueOrElse(getInteger(this, leaseAmountKey), 0) | |
31 | 31 | let leaseId = getString(this, idKey) | |
32 | 32 | let newLease = Lease(leasePool, (leasedAmount + i.payments[0].amount)) | |
33 | 33 | let newLeaseId = calculateLeaseId(newLease) | |
34 | 34 | let cancel = match leaseId { | |
35 | 35 | case id: String => | |
36 | 36 | [LeaseCancel(fromBase58String(id))] | |
37 | 37 | case _ => | |
38 | 38 | [StringEntry(idKey, toBase58String(newLeaseId))] | |
39 | 39 | } | |
40 | 40 | (cancel ++ [newLease, ScriptTransfer(i.caller, 1, shareToken), IntegerEntry(leaseAmountKey, (leasedAmount + i.payments[0].amount)), IntegerEntry(stakingAmountKey, stakingAmount)]) | |
41 | 41 | } | |
42 | 42 | else throw("Strict value is not equal to itself.") | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 |
github/deemru/w8io/169f3d6 74.48 ms ◑