tx · 4HguWLWWXqu8FLj3BrPRyquLjCwQ6aHsgWdpET9SBHbe 3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u: -0.01440000 Waves 2021.05.29 14:25 [1546895] smart account 3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u > SELF 0.00000000 Waves
{ "type": 13, "id": "4HguWLWWXqu8FLj3BrPRyquLjCwQ6aHsgWdpET9SBHbe", "fee": 1440000, "feeAssetId": null, "timestamp": 1622287537760, "version": 2, "chainId": 84, "sender": "3N9eE86dXUm7rfc2WWCMLHkaEM4Y8yoNj7u", "senderPublicKey": "FFDorDp8bC9dyUK2w8hYPWPVEcbbk9zYkpHn3gcq9svn", "proofs": [ "2eQFNYJR9wR5TQnYYKDfKZcnozo7R7J592KFC6swcy6Y2bZQf2dxeiPWSDFhodeYJmwoHMBTjbYWkioARVEKNhDg" ], "script": "base64:AAIDAAAAAAAAABsIARIAEgASABIDCgEBEgMKAQESABIAEgMKAQgAAAAAAAAACAAAAAFpAQAAAAtEZXZXaXRoZHJhdwAAAAAEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAALR292ZXJuVG9rZW4BAAAAIBCA+Di6G71u5eBGn7OO/XvXyTq77GEaAEk/DSjFvl25AwkAAAAAAAACBQAAAApjdXJyZW50S2V5AgAAACMzUDc0YnVIdDk4Qm5vakZjYVJFSlp0Yjk4S0R5VW1aR2VtSgQAAAAMRGV2Qm94QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMCAAAABkRldkJveAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAGYAAAACAAAAAAAAAAAABQAAAAxEZXZCb3hBbW91bnQJAAACAAAAAQIAAAASTm90IGVub3VnaCBiYWxhbmNlCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAA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vIGJlIHRoZSB1c2VyIHdpdGggdGhlIGhpZ2hlc3QgUHVzaCBhbmQgd2FpdCB0aWxsIGNvdW50b3duIGlzIGZpbmlzaGVkLCB0byBjbGFpbSBSZXdhcmQAAAABaQEAAAAJQWRkbWVudG9yAAAAAQAAAAZNZW50b3IEAAAAC1N0YWtlZFRva2VuAQAAACC10ShhvOYEpzzeNL8op3J7Xvf8OAiWZygYbjjsBCwhsgQAAAALR292ZXJuVG9rZW4BAAAAIBCA+Di6G71u5eBGn7OO/XvXyTq77GEaAEk/DSjFvl25BAAAABFVc2VyTWVudG9yQWRkcmVzcwkAASwAAAACCQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAAB19NZW50b3IDCQEAAAACIT0AAAACBQAAAAZNZW50b3ICAAAAAAkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAARVXNlck1lbnRvckFkZHJlc3MFAAAABk1lbnRvcgUAAAADbmlsCQAAAgAAAAECAAAAIE1lbnRvcidzIEFkZHJlc3MgY2Fubm90IGJlIGVtcHR5AAAAAMPbdbU=", "height": 1546895, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9mVaQNWXxjxh9eZZgd89ui1jY63jxmxkvVkbx1KiWhef Next: 7sxo9pNpmtYVDL3BkiXXeK3fLcWMRevQkGoaB7yb8yQf Diff:
Old | New | Differences | |
---|---|---|---|
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | - | func | |
8 | - | let | |
7 | + | func DevWithdraw () = { | |
8 | + | let currentKey = toBase58String(i.caller.bytes) | |
9 | 9 | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
10 | - | let UserPush = (toBase58String(i.caller.bytes) + "_Push") | |
11 | - | WriteSet([DataEntry("DelayCost", 0), DataEntry("Delay", 0)]) | |
10 | + | if ((currentKey == "3P74buHt98BnojFcaREJZtb98KDyUmZGemJ")) | |
11 | + | then { | |
12 | + | let DevBoxAmount = match getInteger(this, "DevBox") { | |
13 | + | case a: Int => | |
14 | + | a | |
15 | + | case _ => | |
16 | + | 0 | |
17 | + | } | |
18 | + | if ((0 > DevBoxAmount)) | |
19 | + | then throw("Not enough balance") | |
20 | + | else ScriptResult(WriteSet([DataEntry("DevBox", 0)]), TransferSet([ScriptTransfer(i.caller, DevBoxAmount, GovernToken)])) | |
21 | + | } | |
22 | + | else throw("You cannot withdraw as your are not the Dev.") | |
12 | 23 | } | |
13 | 24 | ||
14 | 25 | ||
18 | 29 | let StakedToken = base58'DEjmrvdViZH7trtuAqaKQFjNjfbK6D7yMHm18UQ8Hj21' | |
19 | 30 | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
20 | 31 | let minPushBlock = 10 | |
21 | - | let minStakeBlock = 0 | |
22 | - | let DelayAfterPush = 20 | |
32 | + | let minStakeBlock = 7 | |
33 | + | let DelayAfterPush = 1440 | |
34 | + | let minref = 0 | |
35 | + | let userWalletGovernBalance = assetBalance(Address(i.caller.bytes), GovernToken) | |
23 | 36 | let pmt = extract(i.payment) | |
24 | - | if (if ((pmt.amount > 0)) | |
25 | - | then (pmt.assetId == GovernToken) | |
26 | - | else false) | |
27 | - | then { | |
28 | - | let UserPush = (toBase58String(i.caller.bytes) + "_Push") | |
29 | - | let UserLastPushBlock = (toBase58String(i.caller.bytes) + "_UserLastPushBlock") | |
30 | - | let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock") | |
31 | - | let UserStake = (toBase58String(i.caller.bytes) + "_Staking") | |
32 | - | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
33 | - | let StakeBalance = match getInteger(this, "StakeBalance") { | |
34 | - | case a: Int => | |
35 | - | a | |
36 | - | case _ => | |
37 | - | 0 | |
38 | - | } | |
39 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
40 | - | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
41 | - | case a: Int => | |
42 | - | a | |
43 | - | case _ => | |
44 | - | 0 | |
45 | - | } | |
46 | - | let PrizeHeightValue = if (if ((HeightTransactFundBox == 0)) | |
47 | - | then (PrizeAmount == 0) | |
48 | - | else false) | |
49 | - | then 0 | |
50 | - | else if (if ((HeightTransactFundBox == 0)) | |
51 | - | then (PrizeAmount != 0) | |
37 | + | let UserPush = (toBase58String(i.caller.bytes) + "_Push") | |
38 | + | let UserLastPushOldValue = match getInteger(this, UserPush) { | |
39 | + | case a: Int => | |
40 | + | a | |
41 | + | case _ => | |
42 | + | 0 | |
43 | + | } | |
44 | + | let UserRefsNum = (toBase58String(i.caller.bytes) + "_refs") | |
45 | + | let UserRefsNumValue = match getInteger(this, UserRefsNum) { | |
46 | + | case a: Int => | |
47 | + | a | |
48 | + | case _ => | |
49 | + | 0 | |
50 | + | } | |
51 | + | let HighestPushValue = match getInteger(this, "HighestPush") { | |
52 | + | case a: Int => | |
53 | + | a | |
54 | + | case _ => | |
55 | + | 0 | |
56 | + | } | |
57 | + | if ((userWalletGovernBalance > pmt.amount)) | |
58 | + | then if (if (((pmt.amount + UserLastPushOldValue) > HighestPushValue)) | |
59 | + | then (pmt.assetId == GovernToken) | |
60 | + | else false) | |
61 | + | then { | |
62 | + | let UserLastPushBlock = (toBase58String(i.caller.bytes) + "_UserLastPushBlock") | |
63 | + | let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock") | |
64 | + | let UserStake = (toBase58String(i.caller.bytes) + "_Staking") | |
65 | + | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
66 | + | let StakeBalance = match getInteger(this, "StakeBalance") { | |
67 | + | case a: Int => | |
68 | + | a | |
69 | + | case _ => | |
70 | + | 0 | |
71 | + | } | |
72 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
73 | + | case a: Int => | |
74 | + | a | |
75 | + | case _ => | |
76 | + | 0 | |
77 | + | } | |
78 | + | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
79 | + | case a: Int => | |
80 | + | a | |
81 | + | case _ => | |
82 | + | 0 | |
83 | + | } | |
84 | + | let PrizeHeightValue = if (if ((HeightTransactFundBox == 0)) | |
85 | + | then (PrizeAmount == 0) | |
86 | + | else false) | |
87 | + | then 0 | |
88 | + | else if (if ((HeightTransactFundBox == 0)) | |
89 | + | then (PrizeAmount != 0) | |
90 | + | else false) | |
91 | + | then height | |
92 | + | else if (if ((HeightTransactFundBox != 0)) | |
93 | + | then (PrizeAmount != 0) | |
94 | + | else false) | |
95 | + | then HeightTransactFundBox | |
96 | + | else 0 | |
97 | + | let ActualDelay = match getInteger(this, "Delay") { | |
98 | + | case a: Int => | |
99 | + | a | |
100 | + | case _ => | |
101 | + | 0 | |
102 | + | } | |
103 | + | let NewDelay = (ActualDelay + DelayAfterPush) | |
104 | + | let HighestPushAddress = match getInteger(this, "HighestPushAddress") { | |
105 | + | case a: Int => | |
106 | + | a | |
107 | + | case _ => | |
108 | + | 0 | |
109 | + | } | |
110 | + | let UserLastPushBlockValue = match getInteger(this, UserLastPushBlock) { | |
111 | + | case a: Int => | |
112 | + | a | |
113 | + | case _ => | |
114 | + | 0 | |
115 | + | } | |
116 | + | let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) { | |
117 | + | case a: Int => | |
118 | + | a | |
119 | + | case _ => | |
120 | + | 0 | |
121 | + | } | |
122 | + | let UserStakeValue = match getInteger(this, UserStake) { | |
123 | + | case a: Int => | |
124 | + | a | |
125 | + | case _ => | |
126 | + | 0 | |
127 | + | } | |
128 | + | let DevBoxBalance = match getInteger(this, "DevBox") { | |
129 | + | case a: Int => | |
130 | + | a | |
131 | + | case _ => | |
132 | + | 0 | |
133 | + | } | |
134 | + | let DevBoxAmount = (DevBoxBalance + ((pmt.amount * 5) / 1000)) | |
135 | + | let UserPushvalue = (pmt.amount + UserLastPushOldValue) | |
136 | + | let PrizeHeightValueNew = if (if ((height > ((PrizeHeightValue + NewDelay) + 1440))) | |
137 | + | then (HighestPushValue > 0) | |
52 | 138 | else false) | |
53 | 139 | then height | |
54 | - | else if (if ((HeightTransactFundBox != 0)) | |
55 | - | then (PrizeAmount != 0) | |
56 | - | else false) | |
57 | - | then HeightTransactFundBox | |
58 | - | else 0 | |
59 | - | let HighestPushValue = match getInteger(this, "HighestPush") { | |
60 | - | case a: Int => | |
61 | - | a | |
62 | - | case _ => | |
63 | - | 0 | |
64 | - | } | |
65 | - | let UserLastPushOldValue = match getInteger(this, UserPush) { | |
66 | - | case a: Int => | |
67 | - | a | |
68 | - | case _ => | |
69 | - | 0 | |
70 | - | } | |
71 | - | let ActualDelay = match getInteger(this, "Delay") { | |
72 | - | case a: Int => | |
73 | - | a | |
74 | - | case _ => | |
75 | - | 0 | |
76 | - | } | |
77 | - | let NewDelay = (ActualDelay + DelayAfterPush) | |
78 | - | let HighestPushAddress = match getInteger(this, "HighestPushAddress") { | |
79 | - | case a: Int => | |
80 | - | a | |
81 | - | case _ => | |
82 | - | 0 | |
83 | - | } | |
84 | - | let UserLastPushBlockValue = match getInteger(this, UserLastPushBlock) { | |
85 | - | case a: Int => | |
86 | - | a | |
87 | - | case _ => | |
88 | - | 0 | |
89 | - | } | |
90 | - | let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) { | |
91 | - | case a: Int => | |
92 | - | a | |
93 | - | case _ => | |
94 | - | 0 | |
95 | - | } | |
96 | - | let UserStakeValue = match getInteger(this, UserStake) { | |
97 | - | case a: Int => | |
98 | - | a | |
99 | - | case _ => | |
100 | - | 0 | |
101 | - | } | |
102 | - | let UserPushvalue = (pmt.amount + UserLastPushOldValue) | |
103 | - | if (if (if (if (if (if ((UserPushvalue > 0)) | |
104 | - | then ((height - UserLastStakeBlockValue) > (1440 * minStakeBlock)) | |
105 | - | else false) | |
106 | - | then ((height - UserLastPushBlockValue) > minPushBlock) | |
107 | - | else false) | |
108 | - | then (UserPushvalue > HighestPushValue) | |
109 | - | else false) | |
110 | - | then (UserStakeValue > 0) | |
111 | - | else false) | |
112 | - | then if (((PrizeHeightValue + NewDelay) > height)) | |
113 | - | then true | |
114 | - | else (height > ((PrizeHeightValue + NewDelay) + 1440)) | |
115 | - | else false) | |
116 | - | then WriteSet([DataEntry(UserPush, UserPushvalue), DataEntry("HighestPushAddress", toBase58String(i.caller.bytes)), DataEntry("HighestPush", UserPushvalue), DataEntry(UserLastStakeBlock, height), DataEntry("PrizeHeight", height), DataEntry("Delay", NewDelay)]) | |
117 | - | else throw("Your Push dot not comply one of the following conditions: | |
118 | - | 1. Positive Value | |
119 | - | 2. Must Staked ASIMI Token for a minimum of week | |
120 | - | 3. Should be Higher than last Highest Push 4. Should wait required time between Pushes | |
121 | - | ") | |
122 | - | } | |
123 | - | else throw("Can deposit only positive amounts of ASIMI Token") | |
140 | + | else PrizeHeightValue | |
141 | + | if (if ((UserPushvalue > 0)) | |
142 | + | then ((height - UserLastStakeBlockValue) > (1440 * minStakeBlock)) | |
143 | + | else false) | |
144 | + | then if (((height - UserLastPushBlockValue) > minPushBlock)) | |
145 | + | then if ((UserStakeValue > 0)) | |
146 | + | then if ((UserPushvalue > HighestPushValue)) | |
147 | + | then if ((PrizeAmount > 0)) | |
148 | + | then if (if (if (if (((PrizeHeightValueNew + NewDelay) > height)) | |
149 | + | then true | |
150 | + | else (height > ((PrizeHeightValueNew + NewDelay) + 1440))) | |
151 | + | then (HighestPushValue > 0) | |
152 | + | else false) | |
153 | + | then true | |
154 | + | else (HighestPushValue == 0)) | |
155 | + | then if ((UserRefsNumValue >= minref)) | |
156 | + | then WriteSet([DataEntry(UserPush, UserPushvalue), DataEntry("HighestPushAddress", toBase58String(i.caller.bytes)), DataEntry("HighestPush", UserPushvalue), DataEntry(UserLastPushBlock, height), DataEntry("PrizeHeight", PrizeHeightValueNew), DataEntry("Delay", NewDelay), DataEntry("DevBox", DevBoxAmount)]) | |
157 | + | else throw("You have to have 10 referrals already staking for a minimum of 10 days, to push") | |
158 | + | else { | |
159 | + | let txt = if ((HighestPushValue > 0)) | |
160 | + | then "You cannot Push after rewarding Prize and before One day has passed after award" | |
161 | + | else "Unexpected error" | |
162 | + | throw(txt) | |
163 | + | } | |
164 | + | else throw("You cannot push before the reward is unlocked, no reward has been detected yet") | |
165 | + | else throw("Your push in troikan token, should be Higher than last Highest Push") | |
166 | + | else throw("To be able to participate in Pushing for the reward you need to Stake ASIMIs in the dApp") | |
167 | + | else throw("You have to wait 10min before you can make a new Push") | |
168 | + | else throw(("Your Push dot not comply one of the following conditions: " + "1. Positive Value for Push in Troikan Toke | |
169 | + | 2. Must Staked ASIMI Token for a minimum of week ")) | |
170 | + | } | |
171 | + | else throw((("Can deposit only positive amounts of Troikan Token, or Check your Wallet balance in Troika, you should have more than " + toString(HighestPushValue)) + " to push")) | |
172 | + | else throw("You do not have enough Troikan Tokens in your Wallet Balance, Please Harvest if you have earned Troikan wallet or transfer to your wallet necessary Troikan amount !") | |
124 | 173 | } | |
125 | 174 | ||
126 | 175 | ||
136 | 185 | then { | |
137 | 186 | let GovernTokenSmartContractBalance = assetBalance(this, GovernToken) | |
138 | 187 | let UserAPY = (toBase58String(i.caller.bytes) + "_APY") | |
188 | + | let UserPush = (toBase58String(i.caller.bytes) + "_Push") | |
139 | 189 | let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Staking") | |
140 | 190 | let UserGovernTokenKey = (toBase58String(i.caller.bytes) + "_Earnings") | |
141 | 191 | let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock") | |
147 | 197 | case _ => | |
148 | 198 | 0 | |
149 | 199 | } | |
200 | + | let UserPushValue = match getInteger(this, UserPush) { | |
201 | + | case a: Int => | |
202 | + | a | |
203 | + | case _ => | |
204 | + | 0 | |
205 | + | } | |
206 | + | let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) { | |
207 | + | case a: Int => | |
208 | + | a | |
209 | + | case _ => | |
210 | + | 0 | |
211 | + | } | |
212 | + | let UserLastStakeBlockNewValue = if ((UserLastStakeBlockValue == 0)) | |
213 | + | then height | |
214 | + | else UserLastStakeBlockValue | |
150 | 215 | let NewUserStakeTransactions = (UserStakeTransactions + 1) | |
151 | 216 | let currentAmountStakedToken = match getInteger(this, UserStakedTokenKey) { | |
152 | 217 | case a: Int => | |
163 | 228 | 0 | |
164 | 229 | } | |
165 | 230 | let StakeBalanceAmount = (StakeBalance + pmt.amount) | |
166 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
231 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
232 | + | case a: Int => | |
233 | + | a | |
234 | + | case _ => | |
235 | + | 0 | |
236 | + | } | |
167 | 237 | let currentAmountGovernToken = match getInteger(this, UserGovernTokenKey) { | |
168 | 238 | case a: Int => | |
169 | 239 | a | |
201 | 271 | then ((100 * Reward) / currentAmountGovernToken) | |
202 | 272 | else 0 | |
203 | 273 | let newAmountGovernToken = (currentAmountGovernToken + Reward) | |
204 | - | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmountGovernToken), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry(" | |
274 | + | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmountGovernToken), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry("PrizeHeight", PrizeHeightValue), DataEntry(UserAPY, UserAPYValue), DataEntry(UserLastStakeBlock, UserLastStakeBlockNewValue), DataEntry(UserPush, UserPushValue)]), TransferSet([ScriptTransfer(i.caller, Reward, GovernToken)])) | |
205 | 275 | } | |
206 | 276 | } | |
207 | 277 | else throw("Can deposit only StakeToken") | |
213 | 283 | func WithdrawStakedFunds (amount) = { | |
214 | 284 | let StakedToken = base58'DEjmrvdViZH7trtuAqaKQFjNjfbK6D7yMHm18UQ8Hj21' | |
215 | 285 | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
286 | + | let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock") | |
216 | 287 | let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Staking") | |
217 | 288 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
218 | 289 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
290 | + | let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) { | |
291 | + | case a: Int => | |
292 | + | a | |
293 | + | case _ => | |
294 | + | 0 | |
295 | + | } | |
219 | 296 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
220 | 297 | case a: Int => | |
221 | 298 | a | |
222 | 299 | case _ => | |
223 | 300 | 0 | |
224 | 301 | } | |
225 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
302 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
303 | + | case a: Int => | |
304 | + | a | |
305 | + | case _ => | |
306 | + | 0 | |
307 | + | } | |
226 | 308 | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
227 | 309 | case a: Int => | |
228 | 310 | a | |
251 | 333 | } | |
252 | 334 | let newAmount = (currentAmount - amount) | |
253 | 335 | let StakeBalanceAmount = (StakeBalance - amount) | |
336 | + | let UserLastStakeBlockNewValue = if ((StakeBalanceAmount == 0)) | |
337 | + | then 0 | |
338 | + | else UserLastStakeBlockValue | |
254 | 339 | if ((0 > amount)) | |
255 | 340 | then throw("Can't withdraw negative amount") | |
256 | 341 | else if ((0 > newAmount)) | |
257 | 342 | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString((currentAmount / 100000000)))) | |
258 | 343 | else if ((100000000 > assetBalance(this, GovernToken))) | |
259 | 344 | then throw(("Not enough Troika In Contract: " + toString((assetBalance(this, GovernToken) / 100000000)))) | |
260 | - | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, 100000000), DataEntry(UserStakedTokenKey, newAmount), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry(" | |
345 | + | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, 100000000), DataEntry(UserStakedTokenKey, newAmount), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry("PrizeHeight", PrizeHeightValue), DataEntry(UserLastStakeBlock, UserLastStakeBlockNewValue)]), TransferSet([ScriptTransfer(i.caller, 100000000, GovernToken), ScriptTransfer(i.caller, amount, StakedToken)])) | |
261 | 346 | } | |
262 | 347 | ||
263 | 348 | ||
274 | 359 | case _ => | |
275 | 360 | 0 | |
276 | 361 | } | |
277 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
362 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
363 | + | case a: Int => | |
364 | + | a | |
365 | + | case _ => | |
366 | + | 0 | |
367 | + | } | |
278 | 368 | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
279 | 369 | case a: Int => | |
280 | 370 | a | |
306 | 396 | then throw("Can't withdraw negative amount") | |
307 | 397 | else if ((0 > newAmount)) | |
308 | 398 | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString((currentAmount / 100000000)))) | |
309 | - | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmount | |
399 | + | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmount), DataEntry("PrizeHeight", PrizeHeightValue)]), TransferSet([ScriptTransfer(i.caller, amount, GovernToken)])) | |
310 | 400 | } | |
311 | 401 | ||
312 | 402 | ||
325 | 415 | case _ => | |
326 | 416 | 0 | |
327 | 417 | } | |
328 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
418 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
419 | + | case a: Int => | |
420 | + | a | |
421 | + | case _ => | |
422 | + | 0 | |
423 | + | } | |
329 | 424 | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
330 | 425 | case a: Int => | |
331 | 426 | a | |
358 | 453 | 10 | |
359 | 454 | } | |
360 | 455 | let pmt = extract(i.payment) | |
456 | + | let DevBoxBalance = match getInteger(this, "DevBox") { | |
457 | + | case a: Int => | |
458 | + | a | |
459 | + | case _ => | |
460 | + | 0 | |
461 | + | } | |
361 | 462 | if (if (isDefined(pmt.assetId)) | |
362 | 463 | then (extract(pmt.assetId) == GovernToken) | |
363 | 464 | else false) | |
364 | - | then { | |
365 | - | let UserGovernTokenAmount = pmt.amount | |
366 | - | let NewDelayCost = if ((ActualDelayCost == 0)) | |
367 | - | then 1000000000 | |
368 | - | else (2 * ActualDelayCost) | |
369 | - | if ((UserGovernTokenAmount >= NewDelayCost)) | |
370 | - | then { | |
371 | - | let NewDelay = (ActualDelay + (1440 * DelayDays)) | |
372 | - | WriteSet([DataEntry("Delay", NewDelay), DataEntry("DelayCost", NewDelayCost), DataEntry("FundBox", PrizeAmount), DataEntry("PrizeHeight", height)]) | |
373 | - | } | |
374 | - | else throw((("To delay the release of the reward ONE DAY later than expected, you need " + toString(NewDelayCost)) + "TROIKAs")) | |
375 | - | } | |
465 | + | then if ((PrizeAmount > 0)) | |
466 | + | then { | |
467 | + | let UserGovernTokenAmount = pmt.amount | |
468 | + | let DevBoxAmount = (DevBoxBalance + ((pmt.amount * 5) / 1000)) | |
469 | + | let NewDelayCost = if ((ActualDelayCost == 0)) | |
470 | + | then 1000000000 | |
471 | + | else (2 * ActualDelayCost) | |
472 | + | if ((UserGovernTokenAmount >= NewDelayCost)) | |
473 | + | then { | |
474 | + | let NewDelay = (ActualDelay + (1440 * DelayDays)) | |
475 | + | WriteSet([DataEntry("Delay", NewDelay), DataEntry("DelayCost", NewDelayCost), DataEntry("PrizeHeight", PrizeHeightValue), DataEntry("DevBox", DevBoxAmount)]) | |
476 | + | } | |
477 | + | else throw((("To delay the release of the reward ONE DAY later than expected, you need " + toString(NewDelayCost)) + "TROIKAs")) | |
478 | + | } | |
479 | + | else throw("You cannot delay the reward before reward is received! Please wait until a reward is available") | |
376 | 480 | else throw("Can Use only Troika Token to Delay Reward") | |
377 | 481 | } | |
378 | 482 | ||
386 | 490 | let UserPush = (toBase58String(i.caller.bytes) + "_Push") | |
387 | 491 | let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock") | |
388 | 492 | let minStakeBlock = 7 | |
493 | + | let minref = 0 | |
389 | 494 | let ContractGovTokenBalance = assetBalance(this, GovernToken) | |
390 | 495 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
391 | 496 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
394 | 499 | case _ => | |
395 | 500 | 0 | |
396 | 501 | } | |
397 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
502 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
503 | + | case a: Int => | |
504 | + | a | |
505 | + | case _ => | |
506 | + | 0 | |
507 | + | } | |
398 | 508 | let UserPushValue = match getInteger(this, UserPush) { | |
399 | 509 | case a: Int => | |
400 | 510 | a | |
432 | 542 | case _ => | |
433 | 543 | 0 | |
434 | 544 | } | |
545 | + | let UserRefsNum = (toBase58String(i.caller.bytes) + "_refs") | |
546 | + | let UserRefsNumValue = match getInteger(this, UserRefsNum) { | |
547 | + | case a: Int => | |
548 | + | a | |
549 | + | case _ => | |
550 | + | 0 | |
551 | + | } | |
435 | 552 | if (if ((PrizeAmount == 0)) | |
436 | 553 | then true | |
437 | 554 | else (10000000000 > ContractGovTokenBalance)) | |
445 | 562 | else if (if ((height > (PrizeHeight + ActualDelay))) | |
446 | 563 | then (UserPushValue >= HighestPushValue) | |
447 | 564 | else false) | |
448 | - | then ScriptResult(WriteSet([DataEntry(PrizeWinner, PrizeAmount), DataEntry("FundBox", 0), DataEntry("HighestPush", 0), DataEntry(UserPush, 0), DataEntry("HighestPushAddress", ""), DataEntry("PrizeHeight", 0), DataEntry("Delay", 0), DataEntry("DelayCost", 0), DataEntry("LastWinner", PrizeWinner), DataEntry("LastPrize", PrizeAmount)]), TransferSet([ScriptTransfer(i.caller, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 1000000000, GovernToken)])) | |
449 | - | else throw("You have to deposit 100 GovernToken to claim Reward and/or wait till countown is finished") | |
565 | + | then if ((UserRefsNumValue >= minref)) | |
566 | + | then ScriptResult(WriteSet([DataEntry(PrizeWinner, PrizeAmount), DataEntry("FundBox", 0), DataEntry("HighestPush", 0), DataEntry(UserPush, 0), DataEntry("HighestPushAddress", ""), DataEntry("PrizeHeight", 0), DataEntry("Delay", 0), DataEntry("DelayCost", 0), DataEntry("LastWinner", PrizeWinner), DataEntry("LastPrize", PrizeAmount)]), TransferSet([ScriptTransfer(i.caller, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 1000000000, GovernToken)])) | |
567 | + | else throw("You have to have 10 referrals already staking for a minimum of 10 days to Claim the prize") | |
568 | + | else throw("You have to be the user with the highest Push and wait till countown is finished, to claim Reward") | |
569 | + | } | |
570 | + | ||
571 | + | ||
572 | + | ||
573 | + | @Callable(i) | |
574 | + | func Addmentor (Mentor) = { | |
575 | + | let StakedToken = base58'DEjmrvdViZH7trtuAqaKQFjNjfbK6D7yMHm18UQ8Hj21' | |
576 | + | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
577 | + | let UserMentorAddress = (toBase58String(i.caller.bytes) + "_Mentor") | |
578 | + | if ((Mentor != "")) | |
579 | + | then WriteSet([DataEntry(UserMentorAddress, Mentor)]) | |
580 | + | else throw("Mentor's Address cannot be empty") | |
450 | 581 | } | |
451 | 582 | ||
452 | 583 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | - | func | |
8 | - | let | |
7 | + | func DevWithdraw () = { | |
8 | + | let currentKey = toBase58String(i.caller.bytes) | |
9 | 9 | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
10 | - | let UserPush = (toBase58String(i.caller.bytes) + "_Push") | |
11 | - | WriteSet([DataEntry("DelayCost", 0), DataEntry("Delay", 0)]) | |
10 | + | if ((currentKey == "3P74buHt98BnojFcaREJZtb98KDyUmZGemJ")) | |
11 | + | then { | |
12 | + | let DevBoxAmount = match getInteger(this, "DevBox") { | |
13 | + | case a: Int => | |
14 | + | a | |
15 | + | case _ => | |
16 | + | 0 | |
17 | + | } | |
18 | + | if ((0 > DevBoxAmount)) | |
19 | + | then throw("Not enough balance") | |
20 | + | else ScriptResult(WriteSet([DataEntry("DevBox", 0)]), TransferSet([ScriptTransfer(i.caller, DevBoxAmount, GovernToken)])) | |
21 | + | } | |
22 | + | else throw("You cannot withdraw as your are not the Dev.") | |
12 | 23 | } | |
13 | 24 | ||
14 | 25 | ||
15 | 26 | ||
16 | 27 | @Callable(i) | |
17 | 28 | func PushReward () = { | |
18 | 29 | let StakedToken = base58'DEjmrvdViZH7trtuAqaKQFjNjfbK6D7yMHm18UQ8Hj21' | |
19 | 30 | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
20 | 31 | let minPushBlock = 10 | |
21 | - | let minStakeBlock = 0 | |
22 | - | let DelayAfterPush = 20 | |
32 | + | let minStakeBlock = 7 | |
33 | + | let DelayAfterPush = 1440 | |
34 | + | let minref = 0 | |
35 | + | let userWalletGovernBalance = assetBalance(Address(i.caller.bytes), GovernToken) | |
23 | 36 | let pmt = extract(i.payment) | |
24 | - | if (if ((pmt.amount > 0)) | |
25 | - | then (pmt.assetId == GovernToken) | |
26 | - | else false) | |
27 | - | then { | |
28 | - | let UserPush = (toBase58String(i.caller.bytes) + "_Push") | |
29 | - | let UserLastPushBlock = (toBase58String(i.caller.bytes) + "_UserLastPushBlock") | |
30 | - | let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock") | |
31 | - | let UserStake = (toBase58String(i.caller.bytes) + "_Staking") | |
32 | - | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
33 | - | let StakeBalance = match getInteger(this, "StakeBalance") { | |
34 | - | case a: Int => | |
35 | - | a | |
36 | - | case _ => | |
37 | - | 0 | |
38 | - | } | |
39 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
40 | - | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
41 | - | case a: Int => | |
42 | - | a | |
43 | - | case _ => | |
44 | - | 0 | |
45 | - | } | |
46 | - | let PrizeHeightValue = if (if ((HeightTransactFundBox == 0)) | |
47 | - | then (PrizeAmount == 0) | |
48 | - | else false) | |
49 | - | then 0 | |
50 | - | else if (if ((HeightTransactFundBox == 0)) | |
51 | - | then (PrizeAmount != 0) | |
37 | + | let UserPush = (toBase58String(i.caller.bytes) + "_Push") | |
38 | + | let UserLastPushOldValue = match getInteger(this, UserPush) { | |
39 | + | case a: Int => | |
40 | + | a | |
41 | + | case _ => | |
42 | + | 0 | |
43 | + | } | |
44 | + | let UserRefsNum = (toBase58String(i.caller.bytes) + "_refs") | |
45 | + | let UserRefsNumValue = match getInteger(this, UserRefsNum) { | |
46 | + | case a: Int => | |
47 | + | a | |
48 | + | case _ => | |
49 | + | 0 | |
50 | + | } | |
51 | + | let HighestPushValue = match getInteger(this, "HighestPush") { | |
52 | + | case a: Int => | |
53 | + | a | |
54 | + | case _ => | |
55 | + | 0 | |
56 | + | } | |
57 | + | if ((userWalletGovernBalance > pmt.amount)) | |
58 | + | then if (if (((pmt.amount + UserLastPushOldValue) > HighestPushValue)) | |
59 | + | then (pmt.assetId == GovernToken) | |
60 | + | else false) | |
61 | + | then { | |
62 | + | let UserLastPushBlock = (toBase58String(i.caller.bytes) + "_UserLastPushBlock") | |
63 | + | let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock") | |
64 | + | let UserStake = (toBase58String(i.caller.bytes) + "_Staking") | |
65 | + | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
66 | + | let StakeBalance = match getInteger(this, "StakeBalance") { | |
67 | + | case a: Int => | |
68 | + | a | |
69 | + | case _ => | |
70 | + | 0 | |
71 | + | } | |
72 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
73 | + | case a: Int => | |
74 | + | a | |
75 | + | case _ => | |
76 | + | 0 | |
77 | + | } | |
78 | + | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
79 | + | case a: Int => | |
80 | + | a | |
81 | + | case _ => | |
82 | + | 0 | |
83 | + | } | |
84 | + | let PrizeHeightValue = if (if ((HeightTransactFundBox == 0)) | |
85 | + | then (PrizeAmount == 0) | |
86 | + | else false) | |
87 | + | then 0 | |
88 | + | else if (if ((HeightTransactFundBox == 0)) | |
89 | + | then (PrizeAmount != 0) | |
90 | + | else false) | |
91 | + | then height | |
92 | + | else if (if ((HeightTransactFundBox != 0)) | |
93 | + | then (PrizeAmount != 0) | |
94 | + | else false) | |
95 | + | then HeightTransactFundBox | |
96 | + | else 0 | |
97 | + | let ActualDelay = match getInteger(this, "Delay") { | |
98 | + | case a: Int => | |
99 | + | a | |
100 | + | case _ => | |
101 | + | 0 | |
102 | + | } | |
103 | + | let NewDelay = (ActualDelay + DelayAfterPush) | |
104 | + | let HighestPushAddress = match getInteger(this, "HighestPushAddress") { | |
105 | + | case a: Int => | |
106 | + | a | |
107 | + | case _ => | |
108 | + | 0 | |
109 | + | } | |
110 | + | let UserLastPushBlockValue = match getInteger(this, UserLastPushBlock) { | |
111 | + | case a: Int => | |
112 | + | a | |
113 | + | case _ => | |
114 | + | 0 | |
115 | + | } | |
116 | + | let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) { | |
117 | + | case a: Int => | |
118 | + | a | |
119 | + | case _ => | |
120 | + | 0 | |
121 | + | } | |
122 | + | let UserStakeValue = match getInteger(this, UserStake) { | |
123 | + | case a: Int => | |
124 | + | a | |
125 | + | case _ => | |
126 | + | 0 | |
127 | + | } | |
128 | + | let DevBoxBalance = match getInteger(this, "DevBox") { | |
129 | + | case a: Int => | |
130 | + | a | |
131 | + | case _ => | |
132 | + | 0 | |
133 | + | } | |
134 | + | let DevBoxAmount = (DevBoxBalance + ((pmt.amount * 5) / 1000)) | |
135 | + | let UserPushvalue = (pmt.amount + UserLastPushOldValue) | |
136 | + | let PrizeHeightValueNew = if (if ((height > ((PrizeHeightValue + NewDelay) + 1440))) | |
137 | + | then (HighestPushValue > 0) | |
52 | 138 | else false) | |
53 | 139 | then height | |
54 | - | else if (if ((HeightTransactFundBox != 0)) | |
55 | - | then (PrizeAmount != 0) | |
56 | - | else false) | |
57 | - | then HeightTransactFundBox | |
58 | - | else 0 | |
59 | - | let HighestPushValue = match getInteger(this, "HighestPush") { | |
60 | - | case a: Int => | |
61 | - | a | |
62 | - | case _ => | |
63 | - | 0 | |
64 | - | } | |
65 | - | let UserLastPushOldValue = match getInteger(this, UserPush) { | |
66 | - | case a: Int => | |
67 | - | a | |
68 | - | case _ => | |
69 | - | 0 | |
70 | - | } | |
71 | - | let ActualDelay = match getInteger(this, "Delay") { | |
72 | - | case a: Int => | |
73 | - | a | |
74 | - | case _ => | |
75 | - | 0 | |
76 | - | } | |
77 | - | let NewDelay = (ActualDelay + DelayAfterPush) | |
78 | - | let HighestPushAddress = match getInteger(this, "HighestPushAddress") { | |
79 | - | case a: Int => | |
80 | - | a | |
81 | - | case _ => | |
82 | - | 0 | |
83 | - | } | |
84 | - | let UserLastPushBlockValue = match getInteger(this, UserLastPushBlock) { | |
85 | - | case a: Int => | |
86 | - | a | |
87 | - | case _ => | |
88 | - | 0 | |
89 | - | } | |
90 | - | let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) { | |
91 | - | case a: Int => | |
92 | - | a | |
93 | - | case _ => | |
94 | - | 0 | |
95 | - | } | |
96 | - | let UserStakeValue = match getInteger(this, UserStake) { | |
97 | - | case a: Int => | |
98 | - | a | |
99 | - | case _ => | |
100 | - | 0 | |
101 | - | } | |
102 | - | let UserPushvalue = (pmt.amount + UserLastPushOldValue) | |
103 | - | if (if (if (if (if (if ((UserPushvalue > 0)) | |
104 | - | then ((height - UserLastStakeBlockValue) > (1440 * minStakeBlock)) | |
105 | - | else false) | |
106 | - | then ((height - UserLastPushBlockValue) > minPushBlock) | |
107 | - | else false) | |
108 | - | then (UserPushvalue > HighestPushValue) | |
109 | - | else false) | |
110 | - | then (UserStakeValue > 0) | |
111 | - | else false) | |
112 | - | then if (((PrizeHeightValue + NewDelay) > height)) | |
113 | - | then true | |
114 | - | else (height > ((PrizeHeightValue + NewDelay) + 1440)) | |
115 | - | else false) | |
116 | - | then WriteSet([DataEntry(UserPush, UserPushvalue), DataEntry("HighestPushAddress", toBase58String(i.caller.bytes)), DataEntry("HighestPush", UserPushvalue), DataEntry(UserLastStakeBlock, height), DataEntry("PrizeHeight", height), DataEntry("Delay", NewDelay)]) | |
117 | - | else throw("Your Push dot not comply one of the following conditions: | |
118 | - | 1. Positive Value | |
119 | - | 2. Must Staked ASIMI Token for a minimum of week | |
120 | - | 3. Should be Higher than last Highest Push 4. Should wait required time between Pushes | |
121 | - | ") | |
122 | - | } | |
123 | - | else throw("Can deposit only positive amounts of ASIMI Token") | |
140 | + | else PrizeHeightValue | |
141 | + | if (if ((UserPushvalue > 0)) | |
142 | + | then ((height - UserLastStakeBlockValue) > (1440 * minStakeBlock)) | |
143 | + | else false) | |
144 | + | then if (((height - UserLastPushBlockValue) > minPushBlock)) | |
145 | + | then if ((UserStakeValue > 0)) | |
146 | + | then if ((UserPushvalue > HighestPushValue)) | |
147 | + | then if ((PrizeAmount > 0)) | |
148 | + | then if (if (if (if (((PrizeHeightValueNew + NewDelay) > height)) | |
149 | + | then true | |
150 | + | else (height > ((PrizeHeightValueNew + NewDelay) + 1440))) | |
151 | + | then (HighestPushValue > 0) | |
152 | + | else false) | |
153 | + | then true | |
154 | + | else (HighestPushValue == 0)) | |
155 | + | then if ((UserRefsNumValue >= minref)) | |
156 | + | then WriteSet([DataEntry(UserPush, UserPushvalue), DataEntry("HighestPushAddress", toBase58String(i.caller.bytes)), DataEntry("HighestPush", UserPushvalue), DataEntry(UserLastPushBlock, height), DataEntry("PrizeHeight", PrizeHeightValueNew), DataEntry("Delay", NewDelay), DataEntry("DevBox", DevBoxAmount)]) | |
157 | + | else throw("You have to have 10 referrals already staking for a minimum of 10 days, to push") | |
158 | + | else { | |
159 | + | let txt = if ((HighestPushValue > 0)) | |
160 | + | then "You cannot Push after rewarding Prize and before One day has passed after award" | |
161 | + | else "Unexpected error" | |
162 | + | throw(txt) | |
163 | + | } | |
164 | + | else throw("You cannot push before the reward is unlocked, no reward has been detected yet") | |
165 | + | else throw("Your push in troikan token, should be Higher than last Highest Push") | |
166 | + | else throw("To be able to participate in Pushing for the reward you need to Stake ASIMIs in the dApp") | |
167 | + | else throw("You have to wait 10min before you can make a new Push") | |
168 | + | else throw(("Your Push dot not comply one of the following conditions: " + "1. Positive Value for Push in Troikan Toke | |
169 | + | 2. Must Staked ASIMI Token for a minimum of week ")) | |
170 | + | } | |
171 | + | else throw((("Can deposit only positive amounts of Troikan Token, or Check your Wallet balance in Troika, you should have more than " + toString(HighestPushValue)) + " to push")) | |
172 | + | else throw("You do not have enough Troikan Tokens in your Wallet Balance, Please Harvest if you have earned Troikan wallet or transfer to your wallet necessary Troikan amount !") | |
124 | 173 | } | |
125 | 174 | ||
126 | 175 | ||
127 | 176 | ||
128 | 177 | @Callable(i) | |
129 | 178 | func Stake () = { | |
130 | 179 | let StakedToken = base58'DEjmrvdViZH7trtuAqaKQFjNjfbK6D7yMHm18UQ8Hj21' | |
131 | 180 | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
132 | 181 | let pmt = extract(i.payment) | |
133 | 182 | if (if ((pmt.amount > 0)) | |
134 | 183 | then (pmt.assetId == StakedToken) | |
135 | 184 | else false) | |
136 | 185 | then { | |
137 | 186 | let GovernTokenSmartContractBalance = assetBalance(this, GovernToken) | |
138 | 187 | let UserAPY = (toBase58String(i.caller.bytes) + "_APY") | |
188 | + | let UserPush = (toBase58String(i.caller.bytes) + "_Push") | |
139 | 189 | let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Staking") | |
140 | 190 | let UserGovernTokenKey = (toBase58String(i.caller.bytes) + "_Earnings") | |
141 | 191 | let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock") | |
142 | 192 | let UserStakeTransactionsKey = (toBase58String(i.caller.bytes) + "_StakedTransactions") | |
143 | 193 | let AddressHeight = (toBase58String(i.caller.bytes) + "_PrizeHeight") | |
144 | 194 | let UserStakeTransactions = match getInteger(this, UserStakeTransactionsKey) { | |
145 | 195 | case a: Int => | |
146 | 196 | a | |
147 | 197 | case _ => | |
148 | 198 | 0 | |
149 | 199 | } | |
200 | + | let UserPushValue = match getInteger(this, UserPush) { | |
201 | + | case a: Int => | |
202 | + | a | |
203 | + | case _ => | |
204 | + | 0 | |
205 | + | } | |
206 | + | let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) { | |
207 | + | case a: Int => | |
208 | + | a | |
209 | + | case _ => | |
210 | + | 0 | |
211 | + | } | |
212 | + | let UserLastStakeBlockNewValue = if ((UserLastStakeBlockValue == 0)) | |
213 | + | then height | |
214 | + | else UserLastStakeBlockValue | |
150 | 215 | let NewUserStakeTransactions = (UserStakeTransactions + 1) | |
151 | 216 | let currentAmountStakedToken = match getInteger(this, UserStakedTokenKey) { | |
152 | 217 | case a: Int => | |
153 | 218 | a | |
154 | 219 | case _ => | |
155 | 220 | 0 | |
156 | 221 | } | |
157 | 222 | let newAmountStakedToken = (currentAmountStakedToken + pmt.amount) | |
158 | 223 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
159 | 224 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
160 | 225 | case a: Int => | |
161 | 226 | a | |
162 | 227 | case _ => | |
163 | 228 | 0 | |
164 | 229 | } | |
165 | 230 | let StakeBalanceAmount = (StakeBalance + pmt.amount) | |
166 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
231 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
232 | + | case a: Int => | |
233 | + | a | |
234 | + | case _ => | |
235 | + | 0 | |
236 | + | } | |
167 | 237 | let currentAmountGovernToken = match getInteger(this, UserGovernTokenKey) { | |
168 | 238 | case a: Int => | |
169 | 239 | a | |
170 | 240 | case _ => | |
171 | 241 | 0 | |
172 | 242 | } | |
173 | 243 | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
174 | 244 | case a: Int => | |
175 | 245 | a | |
176 | 246 | case _ => | |
177 | 247 | 0 | |
178 | 248 | } | |
179 | 249 | let PrizeHeightValue = if (if ((HeightTransactFundBox == 0)) | |
180 | 250 | then (PrizeAmount == 0) | |
181 | 251 | else false) | |
182 | 252 | then 0 | |
183 | 253 | else if (if ((HeightTransactFundBox == 0)) | |
184 | 254 | then (PrizeAmount != 0) | |
185 | 255 | else false) | |
186 | 256 | then height | |
187 | 257 | else if (if ((HeightTransactFundBox != 0)) | |
188 | 258 | then (PrizeAmount != 0) | |
189 | 259 | else false) | |
190 | 260 | then HeightTransactFundBox | |
191 | 261 | else 0 | |
192 | 262 | if ((100000000 > GovernTokenSmartContractBalance)) | |
193 | 263 | then throw("No enough GovernToken In Contract, Please deposit GovernTokens") | |
194 | 264 | else { | |
195 | 265 | let Reward = if ((StakeBalance == 0)) | |
196 | 266 | then 10000 | |
197 | 267 | else if ((NewUserStakeTransactions > 10)) | |
198 | 268 | then ((10000 * NewUserStakeTransactions) * (1 + (newAmountStakedToken / StakeBalance))) | |
199 | 269 | else (10000 * (1 + (newAmountStakedToken / StakeBalance))) | |
200 | 270 | let UserAPYValue = if ((currentAmountGovernToken > 0)) | |
201 | 271 | then ((100 * Reward) / currentAmountGovernToken) | |
202 | 272 | else 0 | |
203 | 273 | let newAmountGovernToken = (currentAmountGovernToken + Reward) | |
204 | - | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmountGovernToken), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry(" | |
274 | + | ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmountGovernToken), DataEntry(UserStakedTokenKey, newAmountStakedToken), DataEntry(UserStakeTransactionsKey, NewUserStakeTransactions), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry("PrizeHeight", PrizeHeightValue), DataEntry(UserAPY, UserAPYValue), DataEntry(UserLastStakeBlock, UserLastStakeBlockNewValue), DataEntry(UserPush, UserPushValue)]), TransferSet([ScriptTransfer(i.caller, Reward, GovernToken)])) | |
205 | 275 | } | |
206 | 276 | } | |
207 | 277 | else throw("Can deposit only StakeToken") | |
208 | 278 | } | |
209 | 279 | ||
210 | 280 | ||
211 | 281 | ||
212 | 282 | @Callable(i) | |
213 | 283 | func WithdrawStakedFunds (amount) = { | |
214 | 284 | let StakedToken = base58'DEjmrvdViZH7trtuAqaKQFjNjfbK6D7yMHm18UQ8Hj21' | |
215 | 285 | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
286 | + | let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock") | |
216 | 287 | let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Staking") | |
217 | 288 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
218 | 289 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
290 | + | let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) { | |
291 | + | case a: Int => | |
292 | + | a | |
293 | + | case _ => | |
294 | + | 0 | |
295 | + | } | |
219 | 296 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
220 | 297 | case a: Int => | |
221 | 298 | a | |
222 | 299 | case _ => | |
223 | 300 | 0 | |
224 | 301 | } | |
225 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
302 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
303 | + | case a: Int => | |
304 | + | a | |
305 | + | case _ => | |
306 | + | 0 | |
307 | + | } | |
226 | 308 | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
227 | 309 | case a: Int => | |
228 | 310 | a | |
229 | 311 | case _ => | |
230 | 312 | 0 | |
231 | 313 | } | |
232 | 314 | let PrizeHeightValue = if (if ((HeightTransactFundBox == 0)) | |
233 | 315 | then (PrizeAmount == 0) | |
234 | 316 | else false) | |
235 | 317 | then 0 | |
236 | 318 | else if (if ((HeightTransactFundBox == 0)) | |
237 | 319 | then (PrizeAmount != 0) | |
238 | 320 | else false) | |
239 | 321 | then height | |
240 | 322 | else if (if ((HeightTransactFundBox != 0)) | |
241 | 323 | then (PrizeAmount != 0) | |
242 | 324 | else false) | |
243 | 325 | then HeightTransactFundBox | |
244 | 326 | else 0 | |
245 | 327 | let currentKey = toBase58String(i.caller.bytes) | |
246 | 328 | let currentAmount = match getInteger(this, UserStakedTokenKey) { | |
247 | 329 | case a: Int => | |
248 | 330 | a | |
249 | 331 | case _ => | |
250 | 332 | 0 | |
251 | 333 | } | |
252 | 334 | let newAmount = (currentAmount - amount) | |
253 | 335 | let StakeBalanceAmount = (StakeBalance - amount) | |
336 | + | let UserLastStakeBlockNewValue = if ((StakeBalanceAmount == 0)) | |
337 | + | then 0 | |
338 | + | else UserLastStakeBlockValue | |
254 | 339 | if ((0 > amount)) | |
255 | 340 | then throw("Can't withdraw negative amount") | |
256 | 341 | else if ((0 > newAmount)) | |
257 | 342 | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString((currentAmount / 100000000)))) | |
258 | 343 | else if ((100000000 > assetBalance(this, GovernToken))) | |
259 | 344 | then throw(("Not enough Troika In Contract: " + toString((assetBalance(this, GovernToken) / 100000000)))) | |
260 | - | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, 100000000), DataEntry(UserStakedTokenKey, newAmount), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry(" | |
345 | + | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, 100000000), DataEntry(UserStakedTokenKey, newAmount), DataEntry("StakeBalance", StakeBalanceAmount), DataEntry("PrizeHeight", PrizeHeightValue), DataEntry(UserLastStakeBlock, UserLastStakeBlockNewValue)]), TransferSet([ScriptTransfer(i.caller, 100000000, GovernToken), ScriptTransfer(i.caller, amount, StakedToken)])) | |
261 | 346 | } | |
262 | 347 | ||
263 | 348 | ||
264 | 349 | ||
265 | 350 | @Callable(i) | |
266 | 351 | func HarvestGovernToiken (amount) = { | |
267 | 352 | let StakedToken = base58'DEjmrvdViZH7trtuAqaKQFjNjfbK6D7yMHm18UQ8Hj21' | |
268 | 353 | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
269 | 354 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
270 | 355 | let UserGovernTokenKey = (toBase58String(i.caller.bytes) + "_Earnings") | |
271 | 356 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
272 | 357 | case a: Int => | |
273 | 358 | a | |
274 | 359 | case _ => | |
275 | 360 | 0 | |
276 | 361 | } | |
277 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
362 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
363 | + | case a: Int => | |
364 | + | a | |
365 | + | case _ => | |
366 | + | 0 | |
367 | + | } | |
278 | 368 | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
279 | 369 | case a: Int => | |
280 | 370 | a | |
281 | 371 | case _ => | |
282 | 372 | 0 | |
283 | 373 | } | |
284 | 374 | let PrizeHeightValue = if (if ((HeightTransactFundBox == 0)) | |
285 | 375 | then (PrizeAmount == 0) | |
286 | 376 | else false) | |
287 | 377 | then 0 | |
288 | 378 | else if (if ((HeightTransactFundBox == 0)) | |
289 | 379 | then (PrizeAmount != 0) | |
290 | 380 | else false) | |
291 | 381 | then height | |
292 | 382 | else if (if ((HeightTransactFundBox != 0)) | |
293 | 383 | then (PrizeAmount != 0) | |
294 | 384 | else false) | |
295 | 385 | then HeightTransactFundBox | |
296 | 386 | else 0 | |
297 | 387 | let currentKey = toBase58String(i.caller.bytes) | |
298 | 388 | let currentAmount = match getInteger(this, UserGovernTokenKey) { | |
299 | 389 | case a: Int => | |
300 | 390 | a | |
301 | 391 | case _ => | |
302 | 392 | 0 | |
303 | 393 | } | |
304 | 394 | let newAmount = (currentAmount - amount) | |
305 | 395 | if ((0 > amount)) | |
306 | 396 | then throw("Can't withdraw negative amount") | |
307 | 397 | else if ((0 > newAmount)) | |
308 | 398 | then throw(("User cannot withdraw more than deposited funds, Your deposit is: " + toString((currentAmount / 100000000)))) | |
309 | - | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmount | |
399 | + | else ScriptResult(WriteSet([DataEntry(UserGovernTokenKey, newAmount), DataEntry("PrizeHeight", PrizeHeightValue)]), TransferSet([ScriptTransfer(i.caller, amount, GovernToken)])) | |
310 | 400 | } | |
311 | 401 | ||
312 | 402 | ||
313 | 403 | ||
314 | 404 | @Callable(i) | |
315 | 405 | func delayprize () = { | |
316 | 406 | let StakedToken = base58'DEjmrvdViZH7trtuAqaKQFjNjfbK6D7yMHm18UQ8Hj21' | |
317 | 407 | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
318 | 408 | let DelayDays = 1 | |
319 | 409 | let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken)) | |
320 | 410 | let UserWalletSGovernBalance = assetBalance(Address(i.caller.bytes), GovernToken) | |
321 | 411 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
322 | 412 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
323 | 413 | case a: Int => | |
324 | 414 | a | |
325 | 415 | case _ => | |
326 | 416 | 0 | |
327 | 417 | } | |
328 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
418 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
419 | + | case a: Int => | |
420 | + | a | |
421 | + | case _ => | |
422 | + | 0 | |
423 | + | } | |
329 | 424 | let HeightTransactFundBox = match getInteger(this, "PrizeHeight") { | |
330 | 425 | case a: Int => | |
331 | 426 | a | |
332 | 427 | case _ => | |
333 | 428 | 0 | |
334 | 429 | } | |
335 | 430 | let PrizeHeightValue = if (if ((HeightTransactFundBox == 0)) | |
336 | 431 | then (PrizeAmount == 0) | |
337 | 432 | else false) | |
338 | 433 | then 0 | |
339 | 434 | else if (if ((HeightTransactFundBox == 0)) | |
340 | 435 | then (PrizeAmount != 0) | |
341 | 436 | else false) | |
342 | 437 | then height | |
343 | 438 | else if (if ((HeightTransactFundBox != 0)) | |
344 | 439 | then (PrizeAmount != 0) | |
345 | 440 | else false) | |
346 | 441 | then HeightTransactFundBox | |
347 | 442 | else 0 | |
348 | 443 | let ActualDelay = match getInteger(this, "Delay") { | |
349 | 444 | case a: Int => | |
350 | 445 | a | |
351 | 446 | case _ => | |
352 | 447 | 0 | |
353 | 448 | } | |
354 | 449 | let ActualDelayCost = match getInteger(this, "DelayCost") { | |
355 | 450 | case a: Int => | |
356 | 451 | a | |
357 | 452 | case _ => | |
358 | 453 | 10 | |
359 | 454 | } | |
360 | 455 | let pmt = extract(i.payment) | |
456 | + | let DevBoxBalance = match getInteger(this, "DevBox") { | |
457 | + | case a: Int => | |
458 | + | a | |
459 | + | case _ => | |
460 | + | 0 | |
461 | + | } | |
361 | 462 | if (if (isDefined(pmt.assetId)) | |
362 | 463 | then (extract(pmt.assetId) == GovernToken) | |
363 | 464 | else false) | |
364 | - | then { | |
365 | - | let UserGovernTokenAmount = pmt.amount | |
366 | - | let NewDelayCost = if ((ActualDelayCost == 0)) | |
367 | - | then 1000000000 | |
368 | - | else (2 * ActualDelayCost) | |
369 | - | if ((UserGovernTokenAmount >= NewDelayCost)) | |
370 | - | then { | |
371 | - | let NewDelay = (ActualDelay + (1440 * DelayDays)) | |
372 | - | WriteSet([DataEntry("Delay", NewDelay), DataEntry("DelayCost", NewDelayCost), DataEntry("FundBox", PrizeAmount), DataEntry("PrizeHeight", height)]) | |
373 | - | } | |
374 | - | else throw((("To delay the release of the reward ONE DAY later than expected, you need " + toString(NewDelayCost)) + "TROIKAs")) | |
375 | - | } | |
465 | + | then if ((PrizeAmount > 0)) | |
466 | + | then { | |
467 | + | let UserGovernTokenAmount = pmt.amount | |
468 | + | let DevBoxAmount = (DevBoxBalance + ((pmt.amount * 5) / 1000)) | |
469 | + | let NewDelayCost = if ((ActualDelayCost == 0)) | |
470 | + | then 1000000000 | |
471 | + | else (2 * ActualDelayCost) | |
472 | + | if ((UserGovernTokenAmount >= NewDelayCost)) | |
473 | + | then { | |
474 | + | let NewDelay = (ActualDelay + (1440 * DelayDays)) | |
475 | + | WriteSet([DataEntry("Delay", NewDelay), DataEntry("DelayCost", NewDelayCost), DataEntry("PrizeHeight", PrizeHeightValue), DataEntry("DevBox", DevBoxAmount)]) | |
476 | + | } | |
477 | + | else throw((("To delay the release of the reward ONE DAY later than expected, you need " + toString(NewDelayCost)) + "TROIKAs")) | |
478 | + | } | |
479 | + | else throw("You cannot delay the reward before reward is received! Please wait until a reward is available") | |
376 | 480 | else throw("Can Use only Troika Token to Delay Reward") | |
377 | 481 | } | |
378 | 482 | ||
379 | 483 | ||
380 | 484 | ||
381 | 485 | @Callable(i) | |
382 | 486 | func ClaimPrize () = { | |
383 | 487 | let StakedToken = base58'DEjmrvdViZH7trtuAqaKQFjNjfbK6D7yMHm18UQ8Hj21' | |
384 | 488 | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
385 | 489 | let UserStakedTokenKey = (toBase58String(i.caller.bytes) + "_Staking") | |
386 | 490 | let UserPush = (toBase58String(i.caller.bytes) + "_Push") | |
387 | 491 | let UserLastStakeBlock = (toBase58String(i.caller.bytes) + "_UserLastStakeBlock") | |
388 | 492 | let minStakeBlock = 7 | |
493 | + | let minref = 0 | |
389 | 494 | let ContractGovTokenBalance = assetBalance(this, GovernToken) | |
390 | 495 | let ContractWalletStakeBalance = assetBalance(this, StakedToken) | |
391 | 496 | let StakeBalance = match getInteger(this, "StakeBalance") { | |
392 | 497 | case a: Int => | |
393 | 498 | a | |
394 | 499 | case _ => | |
395 | 500 | 0 | |
396 | 501 | } | |
397 | - | let PrizeAmount = (ContractWalletStakeBalance - StakeBalance) | |
502 | + | let PrizeAmount = match getInteger(this, "FundBox") { | |
503 | + | case a: Int => | |
504 | + | a | |
505 | + | case _ => | |
506 | + | 0 | |
507 | + | } | |
398 | 508 | let UserPushValue = match getInteger(this, UserPush) { | |
399 | 509 | case a: Int => | |
400 | 510 | a | |
401 | 511 | case _ => | |
402 | 512 | 0 | |
403 | 513 | } | |
404 | 514 | let UserLastStakeBlockValue = match getInteger(this, UserLastStakeBlock) { | |
405 | 515 | case a: Int => | |
406 | 516 | a | |
407 | 517 | case _ => | |
408 | 518 | 0 | |
409 | 519 | } | |
410 | 520 | let UserStakedTokenAmount = match getInteger(this, UserStakedTokenKey) { | |
411 | 521 | case a: Int => | |
412 | 522 | a | |
413 | 523 | case _ => | |
414 | 524 | 0 | |
415 | 525 | } | |
416 | 526 | let ActualDelay = match getInteger(this, "Delay") { | |
417 | 527 | case a: Int => | |
418 | 528 | a | |
419 | 529 | case _ => | |
420 | 530 | 0 | |
421 | 531 | } | |
422 | 532 | let PrizeWinner = getStringValue(this, "HighestPushAddress") | |
423 | 533 | let PrizeHeight = match getInteger(this, "PrizeHeight") { | |
424 | 534 | case a: Int => | |
425 | 535 | a | |
426 | 536 | case _ => | |
427 | 537 | 0 | |
428 | 538 | } | |
429 | 539 | let HighestPushValue = match getInteger(this, "HighestPush") { | |
430 | 540 | case a: Int => | |
431 | 541 | a | |
432 | 542 | case _ => | |
433 | 543 | 0 | |
434 | 544 | } | |
545 | + | let UserRefsNum = (toBase58String(i.caller.bytes) + "_refs") | |
546 | + | let UserRefsNumValue = match getInteger(this, UserRefsNum) { | |
547 | + | case a: Int => | |
548 | + | a | |
549 | + | case _ => | |
550 | + | 0 | |
551 | + | } | |
435 | 552 | if (if ((PrizeAmount == 0)) | |
436 | 553 | then true | |
437 | 554 | else (10000000000 > ContractGovTokenBalance)) | |
438 | 555 | then throw("No prize to Claim or Not enough Govern Token en Contract (Min 100 Troika)") | |
439 | 556 | else if ((toBase58String(i.caller.bytes) != PrizeWinner)) | |
440 | 557 | then throw("You are not the winner hence cannot claim the reward ") | |
441 | 558 | else if (if ((100000000 > UserStakedTokenAmount)) | |
442 | 559 | then ((1440 * minStakeBlock) > UserLastStakeBlockValue) | |
443 | 560 | else false) | |
444 | 561 | then throw("You have to Stake ASIMI Token to claim reward ") | |
445 | 562 | else if (if ((height > (PrizeHeight + ActualDelay))) | |
446 | 563 | then (UserPushValue >= HighestPushValue) | |
447 | 564 | else false) | |
448 | - | then ScriptResult(WriteSet([DataEntry(PrizeWinner, PrizeAmount), DataEntry("FundBox", 0), DataEntry("HighestPush", 0), DataEntry(UserPush, 0), DataEntry("HighestPushAddress", ""), DataEntry("PrizeHeight", 0), DataEntry("Delay", 0), DataEntry("DelayCost", 0), DataEntry("LastWinner", PrizeWinner), DataEntry("LastPrize", PrizeAmount)]), TransferSet([ScriptTransfer(i.caller, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 1000000000, GovernToken)])) | |
449 | - | else throw("You have to deposit 100 GovernToken to claim Reward and/or wait till countown is finished") | |
565 | + | then if ((UserRefsNumValue >= minref)) | |
566 | + | then ScriptResult(WriteSet([DataEntry(PrizeWinner, PrizeAmount), DataEntry("FundBox", 0), DataEntry("HighestPush", 0), DataEntry(UserPush, 0), DataEntry("HighestPushAddress", ""), DataEntry("PrizeHeight", 0), DataEntry("Delay", 0), DataEntry("DelayCost", 0), DataEntry("LastWinner", PrizeWinner), DataEntry("LastPrize", PrizeAmount)]), TransferSet([ScriptTransfer(i.caller, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 1000000000, GovernToken)])) | |
567 | + | else throw("You have to have 10 referrals already staking for a minimum of 10 days to Claim the prize") | |
568 | + | else throw("You have to be the user with the highest Push and wait till countown is finished, to claim Reward") | |
569 | + | } | |
570 | + | ||
571 | + | ||
572 | + | ||
573 | + | @Callable(i) | |
574 | + | func Addmentor (Mentor) = { | |
575 | + | let StakedToken = base58'DEjmrvdViZH7trtuAqaKQFjNjfbK6D7yMHm18UQ8Hj21' | |
576 | + | let GovernToken = base58'27RauQwTvdbcPqeFkzoTf5WPt3HtEAmRDVxprWUNp6bA' | |
577 | + | let UserMentorAddress = (toBase58String(i.caller.bytes) + "_Mentor") | |
578 | + | if ((Mentor != "")) | |
579 | + | then WriteSet([DataEntry(UserMentorAddress, Mentor)]) | |
580 | + | else throw("Mentor's Address cannot be empty") | |
450 | 581 | } | |
451 | 582 | ||
452 | 583 |
github/deemru/w8io/169f3d6 80.80 ms ◑