tx · CGFfGMD9cV3M9Kg7V5kM2jnNm2Jv3A1EQYCrbHshktSN 3N2uKeePNFjWTA1HgzWDRC1DTENWkn1S9ct: -0.01000000 Waves 2020.10.18 15:33 [1226025] smart account 3N2uKeePNFjWTA1HgzWDRC1DTENWkn1S9ct > SELF 0.00000000 Waves
{ "type": 13, "id": "CGFfGMD9cV3M9Kg7V5kM2jnNm2Jv3A1EQYCrbHshktSN", "fee": 1000000, "feeAssetId": null, "timestamp": 1603024428034, "version": 2, "chainId": 84, "sender": "3N2uKeePNFjWTA1HgzWDRC1DTENWkn1S9ct", "senderPublicKey": "2Zu93Nn4XQDQJh61td98RYfNB44AtMrZeguWMuNBS41n", "proofs": [ "62d4638RUQakaTwKZjsjY72qoAwcNqrXH7LEhEsV4VBoxUnJCv57zRsx4DwYmDGLGadCywX25p9kCeULjR3UY824" ], "script": "base64:AAIDAAAAAAAAAA8IARIAEgASABIDCgEBEgAAAAAAAAAABQAAAAFpAQAAAAhwYXlZaWVsZAAAAAAEAAAAC0dvdmVyblRva2VuAQAAACC8BnLNTH75zY/85pKTg3cOi9DRRgrZqRPS5vvLPGg8zQQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAMJAABmAAAAAgUAAAANY3VycmVudEFtb3VudAAAAAAAAAAAAAQAAAARR292ZXJuVG9rZW5BbW91bnQJAAPrAAAAAgUAAAAEdGhpcwUAAAALR292ZXJuVG9rZW4DCQAAZgAAAAIAAAAAAAAAAAEFAAAAEUdvdmVyblRva2VuQW1vdW50CQAAAgAAAAECAAAAIU5vIGVub3VnaCBHb3Zlcm5Ub2tlbiBJbiBDb250cmFjdA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AAAAQIAAAA0WW91IGFyZSBub3QgdGhlIHdpbm5lciBoZW5jZSBjYW5ub3QgY2xhaW0gdGhlIHJld2FyZAMDCQAAZgAAAAIFAAAAFVVzZXJHb3Zlcm5Ub2tlbkFtb3VudAAAAAAAAAAAZAkAAGYAAAACBQAAABVVc2VyU3Rha2VkVG9rZW5BbW91bnQAAAAAAAAAAAAHCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAALd2lubmVyUHJpemUFAAAAC1ByaXplQW1vdW50CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAdGdW5kQm94AAAAAAAAAAAACQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAABJVc2VyR292ZXJuVG9rZW5LZXkAAAAAAAAAAGQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAp3aW5BZGRyZXNzBQAAAAtQcml6ZUFtb3VudAUAAAALU3Rha2VkVG9rZW4JAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAABkBQAAAAtHb3Zlcm5Ub2tlbgUAAAADbmlsCQAAAgAAAAECAAAAR1lvdSBuZWVkIHRvIGhhdmUgU1Rha2VkIGFuZCBHb3Zlcm5Ub2tlbiBpbiB0aGUgQ29udHJhY3QgdG8gY2xhaW0gcmV3YXJkAAAAAIawSJQ=", "height": 1226025, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: DfaJDAhf9BA8HXEhooEeDSCAr1A1HPqw1mVHopVpURFV Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | ||
5 | + | ||
6 | + | @Callable(i) | |
7 | + | func payYield () = { | |
8 | + | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
9 | + | let currentKey = toBase58String(i.caller.bytes) | |
10 | + | let currentAmount = match getInteger(this, currentKey) { | |
11 | + | case a: Int => | |
12 | + | a | |
13 | + | case _ => | |
14 | + | 0 | |
15 | + | } | |
16 | + | if ((currentAmount > 0)) | |
17 | + | then { | |
18 | + | let GovernTokenAmount = assetBalance(this, GovernToken) | |
19 | + | if ((1 > GovernTokenAmount)) | |
20 | + | then throw("No enough GovernToken In Contract") | |
21 | + | else ScriptResult(WriteSet([DataEntry(currentKey, 10)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken)])) | |
22 | + | } | |
23 | + | else throw("You need to deposit Collateral Token to receive Govern Token") | |
24 | + | } | |
25 | + | ||
26 | + | ||
27 | + | ||
28 | + | @Callable(i) | |
29 | + | func Stake () = { | |
30 | + | let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
31 | + | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
32 | + | let pmt = extract(i.payment) | |
33 | + | if (if (isDefined(pmt.assetId)) | |
34 | + | then (extract(pmt.assetId) == CollateralToken) | |
35 | + | else false) | |
36 | + | then { | |
37 | + | let currentKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(CollateralToken)) | |
38 | + | let currentAmount = match getInteger(this, currentKey) { | |
39 | + | case a: Int => | |
40 | + | a | |
41 | + | case _ => | |
42 | + | 0 | |
43 | + | } | |
44 | + | let newAmount = (currentAmount + pmt.amount) | |
45 | + | let GovernTokenAmount = assetBalance(this, GovernToken) | |
46 | + | if ((1 > GovernTokenAmount)) | |
47 | + | then throw("No enough GovernToken In Contract") | |
48 | + | else ScriptResult(WriteSet([DataEntry(currentKey, 10), DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, 10, GovernToken)])) | |
49 | + | } | |
50 | + | else throw("Can deposit only MyToken") | |
51 | + | } | |
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | @Callable(i) | |
56 | + | func PayToken () = { | |
57 | + | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
58 | + | let pmt = extract(i.payment) | |
59 | + | if (if (isDefined(pmt.assetId)) | |
60 | + | then (extract(pmt.assetId) == GovernToken) | |
61 | + | else false) | |
62 | + | then { | |
63 | + | let currentKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
64 | + | let currentAmount = match getInteger(this, currentKey) { | |
65 | + | case a: Int => | |
66 | + | a | |
67 | + | case _ => | |
68 | + | 0 | |
69 | + | } | |
70 | + | let newAmount = (currentAmount + pmt.amount) | |
71 | + | let GovernTokenAmount = assetBalance(this, GovernToken) | |
72 | + | WriteSet([DataEntry(currentKey, newAmount)]) | |
73 | + | } | |
74 | + | else throw("Can deposit only Govern Token") | |
75 | + | } | |
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | @Callable(i) | |
80 | + | func withdrawFunds (amount) = { | |
81 | + | let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
82 | + | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
83 | + | let currentKey = toBase58String(i.caller.bytes) | |
84 | + | let currentAmount = match getInteger(this, currentKey) { | |
85 | + | case a: Int => | |
86 | + | a | |
87 | + | case _ => | |
88 | + | 0 | |
89 | + | } | |
90 | + | let newAmount = (currentAmount - amount) | |
91 | + | if ((0 > amount)) | |
92 | + | then throw("Can't withdraw negative amount") | |
93 | + | else if ((0 > newAmount)) | |
94 | + | then throw("User cannot withdraw more than deposited funds") | |
95 | + | else { | |
96 | + | let GovernTokenAmount = assetBalance(this, GovernToken) | |
97 | + | if ((1 > GovernTokenAmount)) | |
98 | + | then throw("No enough GovernToken In Contract") | |
99 | + | else ScriptResult(WriteSet([DataEntry(currentKey, 1), DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken), ScriptTransfer(i.caller, amount, CollateralToken)])) | |
100 | + | } | |
101 | + | } | |
102 | + | ||
103 | + | ||
104 | + | ||
105 | + | @Callable(i) | |
106 | + | func ClaimPrize () = { | |
107 | + | let StakedToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
108 | + | let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
109 | + | let winnerPrize = "3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA" | |
110 | + | let winAddress = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA') | |
111 | + | let FundBoxAddress = Address(base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD') | |
112 | + | let FundBox = "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD" | |
113 | + | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
114 | + | let UserStakedToken = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
115 | + | let UserGovernTokenAmount = match getInteger(this, UserGovernTokenKey) { | |
116 | + | case a: Int => | |
117 | + | a | |
118 | + | case _ => | |
119 | + | 0 | |
120 | + | } | |
121 | + | let UserStakedTokenAmount = match getInteger(this, UserStakedToken) { | |
122 | + | case a: Int => | |
123 | + | a | |
124 | + | case _ => | |
125 | + | 0 | |
126 | + | } | |
127 | + | let PrizeAmount = match getInteger(this, FundBox) { | |
128 | + | case a: Int => | |
129 | + | a | |
130 | + | case _ => | |
131 | + | 0 | |
132 | + | } | |
133 | + | if ((PrizeAmount == 0)) | |
134 | + | then throw("No prize to Claim") | |
135 | + | else if ((UserGovernTokenKey != winnerPrize)) | |
136 | + | then throw("You are not the winner hence cannot claim the reward") | |
137 | + | else if (if ((UserGovernTokenAmount > 100)) | |
138 | + | then (UserStakedTokenAmount > 0) | |
139 | + | else false) | |
140 | + | then ScriptResult(WriteSet([DataEntry(winnerPrize, PrizeAmount), DataEntry(FundBox, 0), DataEntry(UserGovernTokenKey, 100)]), TransferSet([ScriptTransfer(winAddress, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 100, GovernToken)])) | |
141 | + | else throw("You need to have STaked and GovernToken in the Contract to claim reward") | |
142 | + | } | |
143 | + | ||
144 | + |
github/deemru/w8io/169f3d6 18.18 ms ◑