tx · 2UcBXMT46wmcqK3X5VDzvfEDApV4G1eB3Vb4LKzNDURh 3N1DKtRdvNzipWeZiDbEFCRYxGZ76iqrhS1: -0.01000000 Waves 2022.05.19 15:06 [2058529] smart account 3N1DKtRdvNzipWeZiDbEFCRYxGZ76iqrhS1 > SELF 0.00000000 Waves
{ "type": 13, "id": "2UcBXMT46wmcqK3X5VDzvfEDApV4G1eB3Vb4LKzNDURh", "fee": 1000000, "feeAssetId": null, "timestamp": 1652962035302, "version": 2, "chainId": 84, "sender": "3N1DKtRdvNzipWeZiDbEFCRYxGZ76iqrhS1", "senderPublicKey": "H6xi3hzbfgsNKAndcJRBjBFE7rgp25iHTGrzb1aWSjkj", "proofs": [ "2HQSubQS9PsvvEftFgvGjxiWqCQ3UijSykMRvu3o58GpHeCWfJ4PUXz4CzYsDyvDy8gcYgNUgtdQPPiCLznDP5gG" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAFAAAAAAV0b2tlbgEAAAAg202DNWRHG5bvnwwvoM991XmdkujhmzUPwT/MewJwKQsAAAAABWxwVENJAQAAACC3I9Min9ZEc0LtD36dTSYiI+4w5QbrFjr+TbENSNggWwAAAAAJaXNTdG9wcGVkBwAAAAAJa2V5U3Rha2VkAgAAAAlTVEFLRURfTFAAAAAAC2tleUNvbXBvdW5kAgAAAA1Gcm9tX0NvbXBvdW5kAAAAAgAAAAFpAQAAAAVzdGFrZQAAAAAEAAAAA3BtdAkBAAAABXZhbHVlAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAJcG10QW1vdW50CAUAAAADcG10AAAABmFtb3VudAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAFdG9rZW4JAAACAAAAAQIAAAAdYXR0YWNoIFVTRFRVU0ROTFAgdG9rZW5zIG9ubHkDBQAAAAlpc1N0b3BwZWQJAAACAAAAAQIAAAAZc21hcnQgY29udHJhY3QgaXMgb24gbG9jawQAA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FsU3Rha2VkBQAAAAJjYQQAAAACdGMJAQAAAAxJbnRlZ2VyRW50cnkAAAACBQAAAAtrZXlDb21wb3VuZAkAAGQAAAACBQAAAAxmcm9tQ29tcG91bmQFAAAAAmNhCQAETAAAAAIFAAAAC3VwZGF0ZVN0YXRlCQAETAAAAAIFAAAAAnRjBQAAAANuaWwJAAACAAAAAQIAAAAkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAAAAAKDpFf4=", "height": 2058529, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 66Dn6ymqeNrfYCi27Y4JNUSQJzNcbqtpA7KVPwYbCpmU Next: 6iTSLZFJMBvWFWoMb7D2pqHHUG65wE7uu9vDzJYEQHsN Diff:
Old | New | Differences | |
---|---|---|---|
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let token = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS' | |
5 | 5 | ||
6 | - | let lpTCI = base58' | |
6 | + | let lpTCI = base58'DKuHxDzSRjVW5MUhnHqPZDeztYcXvEzpAYNNLDWtb39c' | |
7 | 7 | ||
8 | 8 | let isStopped = false | |
9 | 9 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let token = base58'Fm4qczu6Pepz8KUhh3Heb6LeTVfpSMX5vvNgw3x764CS' | |
5 | 5 | ||
6 | - | let lpTCI = base58' | |
6 | + | let lpTCI = base58'DKuHxDzSRjVW5MUhnHqPZDeztYcXvEzpAYNNLDWtb39c' | |
7 | 7 | ||
8 | 8 | let isStopped = false | |
9 | 9 | ||
10 | 10 | let keyStaked = "STAKED_LP" | |
11 | 11 | ||
12 | 12 | let keyCompound = "From_Compound" | |
13 | 13 | ||
14 | 14 | @Callable(i) | |
15 | 15 | func stake () = { | |
16 | 16 | let pmt = value(i.payments[0]) | |
17 | 17 | let pmtAmount = pmt.amount | |
18 | 18 | if ((pmt.assetId != token)) | |
19 | 19 | then throw("attach USDTUSDNLP tokens only") | |
20 | 20 | else if (isStopped) | |
21 | 21 | then throw("smart contract is on lock") | |
22 | 22 | else { | |
23 | 23 | let tkStaked = valueOrElse(getInteger(this, keyStaked), 100000000) | |
24 | 24 | let fromCompound = valueOrElse(getInteger(this, keyCompound), 0) | |
25 | 25 | let updateState = IntegerEntry(keyStaked, (tkStaked + i.payments[0].amount)) | |
26 | 26 | if ((updateState == updateState)) | |
27 | 27 | then { | |
28 | 28 | let totalIssued = match assetInfo(lpTCI) { | |
29 | 29 | case asset: Asset => | |
30 | 30 | asset.quantity | |
31 | 31 | case _ => | |
32 | 32 | throw("Can't find asset") | |
33 | 33 | } | |
34 | 34 | let forOne = fraction(totalIssued, 100000000, tkStaked) | |
35 | 35 | let toIssue = fraction(pmtAmount, forOne, 100000000) | |
36 | 36 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
37 | 37 | if ((LPstake == LPstake)) | |
38 | 38 | then { | |
39 | 39 | let LPIssue = Reissue(lpTCI, toIssue, true) | |
40 | 40 | let transfer = ScriptTransfer(i.caller, toIssue, lpTCI) | |
41 | 41 | [LPIssue, transfer, updateState] | |
42 | 42 | } | |
43 | 43 | else throw("Strict value is not equal to itself.") | |
44 | 44 | } | |
45 | 45 | else throw("Strict value is not equal to itself.") | |
46 | 46 | } | |
47 | 47 | } | |
48 | 48 | ||
49 | 49 | ||
50 | 50 | ||
51 | 51 | @Callable(i) | |
52 | 52 | func compound () = { | |
53 | 53 | let compound = value(i.payments[0]) | |
54 | 54 | let ca = compound.amount | |
55 | 55 | if ((compound.assetId != token)) | |
56 | 56 | then throw("attach USDTUSDNLP tokens only") | |
57 | 57 | else { | |
58 | 58 | let fromCompound = valueOrElse(getInteger(this, keyCompound), 0) | |
59 | 59 | let totalStaked = valueOrElse(getInteger(this, keyStaked), 0) | |
60 | 60 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
61 | 61 | if ((stakeC == stakeC)) | |
62 | 62 | then { | |
63 | 63 | let updateState = IntegerEntry(keyStaked, (totalStaked + ca)) | |
64 | 64 | let tc = IntegerEntry(keyCompound, (fromCompound + ca)) | |
65 | 65 | [updateState, tc] | |
66 | 66 | } | |
67 | 67 | else throw("Strict value is not equal to itself.") | |
68 | 68 | } | |
69 | 69 | } | |
70 | 70 | ||
71 | 71 |
github/deemru/w8io/169f3d6 40.03 ms ◑