tx · 72e7XoE1DBBECxAtu1MrvSEY2185xMLSfHHiCFuEpqPx 3NAVJcqMw8AsPecAtd74CeNtAG2qRV2V1so: -0.04000000 Waves 2022.05.20 12:39 [2059827] smart account 3NAVJcqMw8AsPecAtd74CeNtAG2qRV2V1so > SELF 0.00000000 Waves
{ "type": 13, "id": "72e7XoE1DBBECxAtu1MrvSEY2185xMLSfHHiCFuEpqPx", "fee": 4000000, "feeAssetId": null, "timestamp": 1653039581831, "version": 2, "chainId": 84, "sender": "3NAVJcqMw8AsPecAtd74CeNtAG2qRV2V1so", "senderPublicKey": "EpvN8tsbEWeeqZSLaEVCda8PZfKa1JAF3ZFp7hRq1gWj", "proofs": [ "5AWc1fa6wkpk9XHy9AWWCoYGEQ2Ar89Wq9Yx3XvBcFKhsGuJLAzYFWjC99e3F65BNSmgHVpLEszcqDNDJfsNH9Fs" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAAGAAAAAAV0b2tlbgEAAAAg202DNWRHG5bvnwwvoM991XmdkujhmzUPwT/MewJwKQsAAAAABWxwVENJAQAAACBYukfmA8VHrjQiYf9ySqYH4A864xu2rNSaNwUvI60S5AAAAAAJaXNTdG9wcGVkBwAAAAAJa2V5U3Rha2VkAgAAAAlTVEFLRURfTFAAAAAAC2tleUNvbXBvdW5kAgAAAA1Gcm9tX0NvbXBvdW5kAAAAAARkZWZWAAAAAAAF9eEAAAAAAgAAAAFpAQAAAAVzdGFrZQAAAAAEAAAAA3BtdAkBAAAABXZhbHVlAAAAAQkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAJcG10QW1vdW50CAUAAAADcG10AAAABmFtb3VudAMJAQAAAAIhPQAAAAIIBQAAAANwbXQAAAAHYXNzZXRJZAUAAAAFdG9rZW4JAAACAAAAAQIAAAAdYXR0YWNoIFVTRFRVU0ROTFAgdG9rZW5zIG9ubHkDBQAAAAlpc1N0b3BwZWQJAAACAAAAAQIAAAAZc21hcnQgY29udHJhY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JFbnRyeQAAAAIFAAAACWtleVN0YWtlZAkAAGQAAAACBQAAAAt0b3RhbFN0YWtlZAUAAAACY2EEAAAAAnRjCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAALa2V5Q29tcG91bmQJAABkAAAAAgUAAAAMZnJvbUNvbXBvdW5kBQAAAAJjYQkABEwAAAACBQAAAAt1cGRhdGVTdGF0ZQkABEwAAAACBQAAAAJ0YwUAAAADbmlsCQAAAgAAAAECAAAAJFN0cmljdCB2YWx1ZSBpcyBub3QgZXF1YWwgdG8gaXRzZWxmLgAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V55lZE9A==", "height": 2059827, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4CqBAu93LiicP54PWBApoXKzeTqZAJPGFTvgqYXn2LhR Next: CmhLjTuBTwxcDRvyLgtfsoscSVJ7cm5L9bqhA6WSeHBA Diff:
Old | New | Differences | |
---|---|---|---|
24 | 24 | else { | |
25 | 25 | let tkStaked = valueOrElse(getInteger(this, keyStaked), 0) | |
26 | 26 | let fromCompound = valueOrElse(getInteger(this, keyCompound), 0) | |
27 | - | let updateState = IntegerEntry(keyStaked, | |
27 | + | let updateState = IntegerEntry(keyStaked, defV) | |
28 | 28 | if ((updateState == updateState)) | |
29 | 29 | then if ((updateState == updateState)) | |
30 | 30 | then { |
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 | 6 | let lpTCI = base58'6yMdFxB7ULdLQ8mMjkLtoQvTy9WFrBKoTRK5JXnwMPAb' | |
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 | let defV = 100000000 | |
15 | 15 | ||
16 | 16 | @Callable(i) | |
17 | 17 | func stake () = { | |
18 | 18 | let pmt = value(i.payments[0]) | |
19 | 19 | let pmtAmount = pmt.amount | |
20 | 20 | if ((pmt.assetId != token)) | |
21 | 21 | then throw("attach USDTUSDNLP tokens only") | |
22 | 22 | else if (isStopped) | |
23 | 23 | then throw("smart contract is on lock") | |
24 | 24 | else { | |
25 | 25 | let tkStaked = valueOrElse(getInteger(this, keyStaked), 0) | |
26 | 26 | let fromCompound = valueOrElse(getInteger(this, keyCompound), 0) | |
27 | - | let updateState = IntegerEntry(keyStaked, | |
27 | + | let updateState = IntegerEntry(keyStaked, defV) | |
28 | 28 | if ((updateState == updateState)) | |
29 | 29 | then if ((updateState == updateState)) | |
30 | 30 | then { | |
31 | 31 | let totalIssued = match assetInfo(lpTCI) { | |
32 | 32 | case asset: Asset => | |
33 | 33 | asset.quantity | |
34 | 34 | case _ => | |
35 | 35 | throw("Can't find asset") | |
36 | 36 | } | |
37 | 37 | let forOne = fraction(totalIssued, 100000000, tkStaked) | |
38 | 38 | let toIssue = fraction(pmtAmount, forOne, 100000000) | |
39 | 39 | let LPstake = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [pmt]) | |
40 | 40 | if ((LPstake == LPstake)) | |
41 | 41 | then { | |
42 | 42 | let LPIssue = Reissue(lpTCI, toIssue, true) | |
43 | 43 | let transfer = ScriptTransfer(i.caller, toIssue, lpTCI) | |
44 | 44 | [LPIssue, transfer, updateState] | |
45 | 45 | } | |
46 | 46 | else throw("Strict value is not equal to itself.") | |
47 | 47 | } | |
48 | 48 | else throw("Strict value is not equal to itself.") | |
49 | 49 | else throw("Strict value is not equal to itself.") | |
50 | 50 | } | |
51 | 51 | } | |
52 | 52 | ||
53 | 53 | ||
54 | 54 | ||
55 | 55 | @Callable(i) | |
56 | 56 | func compound () = { | |
57 | 57 | let compound = value(i.payments[0]) | |
58 | 58 | let ca = compound.amount | |
59 | 59 | if ((compound.assetId != token)) | |
60 | 60 | then throw("attach USDTUSDNLP tokens only") | |
61 | 61 | else { | |
62 | 62 | let fromCompound = valueOrElse(getInteger(this, keyCompound), 0) | |
63 | 63 | let totalStaked = valueOrElse(getInteger(this, keyStaked), 0) | |
64 | 64 | let stakeC = invoke(Address(base58'3Mx3zmXrMcLFCafMuPtXAzR4ZPVeZYb6qLz'), "stake", nil, [compound]) | |
65 | 65 | if ((stakeC == stakeC)) | |
66 | 66 | then { | |
67 | 67 | let updateState = IntegerEntry(keyStaked, (totalStaked + ca)) | |
68 | 68 | let tc = IntegerEntry(keyCompound, (fromCompound + ca)) | |
69 | 69 | [updateState, tc] | |
70 | 70 | } | |
71 | 71 | else throw("Strict value is not equal to itself.") | |
72 | 72 | } | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | @Verifier(tx) | |
77 | 77 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
78 | 78 |
github/deemru/w8io/026f985 31.23 ms ◑