tx · 3CHyyt5jbdWJLwefWPdFLsoULr7esVBNzRjDoaREYCPy

3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu:  -0.05000000 Waves

2020.11.25 18:22 [1281111] smart account 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu > SELF 0.00000000 Waves

{ "type": 13, "id": "3CHyyt5jbdWJLwefWPdFLsoULr7esVBNzRjDoaREYCPy", "fee": 5000000, "feeAssetId": null, "timestamp": 1606317806440, "version": 2, "chainId": 84, "sender": "3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu", "senderPublicKey": "CBTEuFN6ku1LNaPuGHHTMh2CBb3kPa5D73XXTJvKydun", "proofs": [ "2e1EsmAuAg28NDnoRwUyzPrcyZqdzAb3WyiLZTQGMHncpJQfGAe48Ci47tg5FvL9FcGCjb4Yj8WqWT7KVvvV97db" ], "script": "base64:AAIDAAAAAAAAACcIARIHCgUICAgICBIECgIICBIDCgEIEgMKAQgSABIDCgEBEgMKAQEAAAARAAAAAAZ1cFZvdGUCAAAABnVwdm90ZQAAAAAMYWRtaW5BZGRyZXNzAQAAABoBVKwsfOull8+XvAKI3oesQVhDOp0+0MrSkgAAAAAFZHl6SWQBAAAAIH6rQdnOUsq3YY00nk9jVDL2OOQ/e846gXAImq8xTxZrAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAAAgAAAApzdGFrZV9wb29sAQAAAAxnZXRTdGFrZVBvb2wAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADGdldFN0YWtlcktleQAAAAEAAAAGc3Rha2VyCQABLAAAAAIFAAAABnN0YWtlcgIAAAAGX3N0YWtlAQAAAA9nZXRDdXJyZW50U3Rha2UAAAABAAAABnN0YWtlcgQAAAAHJG1hdGNoMAkABBoAAAAC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FN0YWtlUG9vbEtleQAAAAAFAAAADG5ld1N0YWtlUG9vbAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGcmV3YXJkBQAAAAVkeXpJZAUAAAADbmlsAAAAAE3lltY=", "height": 1281111, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GXakgudwXb6iNeXLgPb2CrJxYW48UHHTSKQDJCuZNP26 Next: none Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let upVote = "upvote"
55
6-let adminAddress1 = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC'
7-
8-let adminAddress2 = base58'3NAqtCScgFynCuRLUoXm2BHTdu8suatCe7b'
9-
10-let adminAddress3 = base58'3Mucpi1K4FMVrZKnYEgjxQf5DkkBX7QrHoJ'
6+let adminAddress = base58'3N5cTHzbHc9dyQuBfKMjFKaxcrmRq54XDLu'
117
128 let dyzId = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'
9+
10+func getStakePoolKey () = "stake_pool"
11+
12+
13+func getStakePool () = match getInteger(this, getStakePoolKey()) {
14+ case a: Int =>
15+ a
16+ case _ =>
17+ 0
18+}
19+
20+
21+func getStakerKey (staker) = (staker + "_stake")
22+
23+
24+func getCurrentStake (staker) = match getInteger(this, getStakerKey(staker)) {
25+ case a: Int =>
26+ a
27+ case _ =>
28+ 0
29+}
30+
1331
1432 func getProfileKey (id) = (id + "_entrepreneurProfile")
1533
1735 func getStatusKey (id) = (id + "_status")
1836
1937
20-func getVoterAmountKey (id,voteId) = (((id + "_") + voteId) + "_amount")
21-
22-
2338 func getVoteKey (id,type) = if ((type == "upvote"))
2439 then (id + "_upvote")
25- else throw("Invalid vote type")
26-
27-
28-func getVoteAmountKey (id,type) = if ((type == "upvote"))
29- then (((id + "_") + type) + "_amount")
3040 else throw("Invalid vote type")
3141
3242
4656 }
4757
4858
59+func getLastClaimHeight (pubKey) = match getInteger(this, ("last_claim_" + pubKey)) {
60+ case a: Int =>
61+ a
62+ case _ =>
63+ 0
64+}
65+
66+
4967 func getVoteCount (voteId,vote) = match getInteger(this, getVoteKey(voteId, vote)) {
5068 case a: Int =>
5169 a
5270 case _ =>
5371 throw("Not a valid vote ID")
54-}
55-
56-
57-func getVoteAmountCount (voteId,vote) = match getInteger(this, getVoteAmountKey(voteId, vote)) {
58- case a: Int =>
59- a
60- case _ =>
61- 0
6272 }
6373
6474
8191 }
8292
8393
84-func getStakerKey (staker) = (staker + "_stake")
85-
86-
87-func getCurrentStake (staker) = match getInteger(this, getStakerKey(staker)) {
88- case a: Int =>
89- a
90- case _ =>
91- 0
92-}
93-
94-
95-func getStakePoolKey () = "stake_pool"
96-
97-
98-func getStakePool () = match getInteger(this, getStakePoolKey()) {
99- case a: Int =>
100- a
101- case _ =>
102- 0
103-}
104-
105-
10694 @Callable(i)
107-func addEntrepreneurProfile (name,avatar,bio,gender,location) = if (if (if ((i.caller.bytes == adminAddress1))
108- then true
109- else (i.caller.bytes == adminAddress2))
110- then true
111- else (i.caller.bytes == adminAddress3))
112- then {
95+func addEntrepreneurProfile (name,avatar,bio,gender,location) = if ((i.caller.bytes != adminAddress))
96+ then throw("Only Dyzrupt Admin can call this dApp function")
97+ else {
11398 let transactionId = toBase58String(i.transactionId)
114- WriteSet([DataEntry(getProfileKey(transactionId), ((((((((name + "_") + avatar) + "_") + bio) + "_") + gender) + "_") + location)), DataEntry(getVoteKey(transactionId, "upvote"), 0), DataEntry(getVoteAmountKey(transactionId, "upvote"), 0), DataEntry(getStatusKey(transactionId), "open")])
99+ WriteSet([DataEntry(getProfileKey(transactionId), ((((((((name + "_") + avatar) + "_") + bio) + "_") + gender) + "_") + location)), DataEntry(getVoteKey(transactionId, "upvote"), 0), DataEntry(getStatusKey(transactionId), "open")])
115100 }
116- else throw("Only Dyzrupt Admin can call this dApp function")
117101
118102
119103
120104 @Callable(i)
121105 func vote (voteId,vote) = {
122106 let pmt = extract(i.payment)
123- let voter = toBase58String(i.caller.bytes)
124107 if ((pmt.amount == 0))
125108 then throw("You cannot vote without paying voting fee")
126109 else if ((pmt.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'))
127110 then throw("You can only vote with DYZRUPT token")
128- else if (canVote(voter, voteId))
111+ else if (canVote(toBase58String(i.caller.bytes), voteId))
129112 then if (profileExist(voteId))
130113 then if ((getVoteStatus(voteId) == "open"))
131114 then if ((vote == upVote))
132115 then {
133116 let voteCount = getVoteCount(voteId, vote)
134- let voteAmountCount = getVoteAmountCount(voteId, vote)
135117 let newVoteCount = (voteCount + 1)
136- let newVoteAmountCount = (voteAmountCount + pmt.amount)
137- ScriptResult(WriteSet([DataEntry(getVoteKey(voteId, vote), newVoteCount), DataEntry(getVoterKey(voter, voteId), voteId), DataEntry(getVoterAmountKey(voter, voteId), pmt.amount), DataEntry(getVoteAmountKey(voteId, vote), newVoteAmountCount)]), TransferSet([ScriptTransfer(this, pmt.amount, dyzId)]))
118+ ScriptResult(WriteSet([DataEntry(getVoteKey(voteId, vote), newVoteCount), DataEntry(getVoterKey(toBase58String(i.caller.bytes), voteId), voteId)]), TransferSet([ScriptTransfer(this, pmt.amount, dyzId)]))
138119 }
139120 else throw("Not a valid vote value")
140121 else throw("This profile is not open for voting")
145126
146127
147128 @Callable(i)
148-func openVote (voteId) = if (if (if ((i.caller.bytes == adminAddress1))
149- then true
150- else (i.caller.bytes == adminAddress2))
151- then true
152- else (i.caller.bytes == adminAddress3))
153- then if (profileExist(voteId))
129+func openVote (voteId) = if ((i.caller.bytes != adminAddress))
130+ then throw("Only Dyzrupt Admin can call this dApp function")
131+ else if (profileExist(voteId))
154132 then WriteSet([DataEntry(getStatusKey(voteId), "open")])
155133 else throw("Invalid ID")
156- else throw("Only Dyzrupt Admin can call this dApp function")
157134
158135
159136
160137 @Callable(i)
161-func closeVote (voteId) = if (if (if ((i.caller.bytes == adminAddress1))
162- then true
163- else (i.caller.bytes == adminAddress2))
164- then true
165- else (i.caller.bytes == adminAddress3))
166- then if (profileExist(voteId))
138+func closeVote (voteId) = if ((i.caller.bytes != adminAddress))
139+ then throw("Only Dyzrupt Admin can call this dApp function")
140+ else if (profileExist(voteId))
167141 then WriteSet([DataEntry(getStatusKey(voteId), "closed")])
168142 else throw("Invalid ID")
169- else throw("Only Dyzrupt Admin can call this dApp function")
170-
171-
172-
173-@Callable(i)
174-func withdraw (voteId) = {
175- let voter = toBase58String(i.caller.bytes)
176- if ((getVoter(voter, voteId) != ""))
177- then if ((getVoteStatus(voteId) == "closed"))
178- then {
179- let currentKey = getVoterAmountKey(voter, voteId)
180- let currentAmount = match getInteger(this, currentKey) {
181- case a: Int =>
182- a
183- case _ =>
184- throw("You didn't vote for this entrepreneur")
185- }
186- if ((currentAmount == 0))
187- then throw("Seems you have previously withdrawn.")
188- else ScriptResult(WriteSet([DataEntry(currentKey, 0)]), TransferSet([ScriptTransfer(i.caller, currentAmount, dyzId)]))
189- }
190- else throw("Can't withdraw vote amount while voting is still open.")
191- else throw("You didn't vote for this entrepreneur")
192- }
193143
194144
195145
203153 then throw("You can only stake with DYZRUPT token")
204154 else {
205155 let currentStake = getCurrentStake(staker)
206- let stakePercent = (20 / 100)
207- let stakeableAmount = (pmt.amount * stakePercent)
156+ let stakeableAmount = fraction(pmt.amount, 5, 100)
208157 let amountToStake = (pmt.amount - stakeableAmount)
209158 let newStakedAmount = (currentStake + amountToStake)
210- ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newStakedAmount)]), TransferSet([ScriptTransfer(this, pmt.amount, dyzId)]))
159+ let stakePool = getStakePool()
160+ let newStakePool = (stakePool + stakeableAmount)
161+ ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newStakedAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet(nil))
211162 }
212163 }
213164
222173 else if ((amount > currentStake))
223174 then throw("You can't withdraw an amount higher than you staked")
224175 else {
225- let newStakedAmount = (currentStake - amount)
226- ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newStakedAmount)]), TransferSet([ScriptTransfer(i.caller, amount, dyzId)]))
176+ let unstakeableAmount = fraction(amount, 10, 100)
177+ let amountToUnstake = (amount - unstakeableAmount)
178+ let newUnstakedAmount = (currentStake - amount)
179+ let stakePool = getStakePool()
180+ let newStakePool = (stakePool + unstakeableAmount)
181+ ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newUnstakedAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet([ScriptTransfer(i.caller, amountToUnstake, dyzId)]))
227182 }
228183 }
229184
234189 let staker = toBase58String(i.caller.bytes)
235190 let currentStake = getCurrentStake(staker)
236191 let stakePool = getStakePool()
192+ let currentHeight = height
193+ let lastClaimHeight = getLastClaimHeight(staker)
237194 if ((currentStake == 0))
238195 then throw("You don't have any stakes")
239196 else if ((stakePool == 0))
240197 then throw("Nothing in Stake pool at this time. Try again later")
241198 else if ((reward > stakePool))
242199 then throw("No rewards at this time")
243- else {
244- let newStakePool = (stakePool - reward)
245- let newStakeAmount = (currentStake - reward)
246- ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newStakeAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet([ScriptTransfer(i.caller, reward, dyzId)]))
247- }
200+ else if (((lastClaimHeight + 1440) > currentHeight))
201+ then throw("You can only claim once a day")
202+ else {
203+ let newStakePool = (stakePool - reward)
204+ let newStakeAmount = (currentStake - reward)
205+ ScriptResult(WriteSet([DataEntry(("last_claim_" + staker), currentHeight), DataEntry(getStakerKey(staker), newStakeAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet([ScriptTransfer(i.caller, reward, dyzId)]))
206+ }
248207 }
249208
250209
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let upVote = "upvote"
55
6-let adminAddress1 = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC'
7-
8-let adminAddress2 = base58'3NAqtCScgFynCuRLUoXm2BHTdu8suatCe7b'
9-
10-let adminAddress3 = base58'3Mucpi1K4FMVrZKnYEgjxQf5DkkBX7QrHoJ'
6+let adminAddress = base58'3N5cTHzbHc9dyQuBfKMjFKaxcrmRq54XDLu'
117
128 let dyzId = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'
9+
10+func getStakePoolKey () = "stake_pool"
11+
12+
13+func getStakePool () = match getInteger(this, getStakePoolKey()) {
14+ case a: Int =>
15+ a
16+ case _ =>
17+ 0
18+}
19+
20+
21+func getStakerKey (staker) = (staker + "_stake")
22+
23+
24+func getCurrentStake (staker) = match getInteger(this, getStakerKey(staker)) {
25+ case a: Int =>
26+ a
27+ case _ =>
28+ 0
29+}
30+
1331
1432 func getProfileKey (id) = (id + "_entrepreneurProfile")
1533
1634
1735 func getStatusKey (id) = (id + "_status")
1836
1937
20-func getVoterAmountKey (id,voteId) = (((id + "_") + voteId) + "_amount")
21-
22-
2338 func getVoteKey (id,type) = if ((type == "upvote"))
2439 then (id + "_upvote")
25- else throw("Invalid vote type")
26-
27-
28-func getVoteAmountKey (id,type) = if ((type == "upvote"))
29- then (((id + "_") + type) + "_amount")
3040 else throw("Invalid vote type")
3141
3242
3343 func profileExist (id) = match getString(this, getProfileKey(id)) {
3444 case a: String =>
3545 true
3646 case _ =>
3747 false
3848 }
3949
4050
4151 func getVoteStatus (voteId) = match getString(this, getStatusKey(voteId)) {
4252 case a: String =>
4353 a
4454 case _ =>
4555 false
4656 }
4757
4858
59+func getLastClaimHeight (pubKey) = match getInteger(this, ("last_claim_" + pubKey)) {
60+ case a: Int =>
61+ a
62+ case _ =>
63+ 0
64+}
65+
66+
4967 func getVoteCount (voteId,vote) = match getInteger(this, getVoteKey(voteId, vote)) {
5068 case a: Int =>
5169 a
5270 case _ =>
5371 throw("Not a valid vote ID")
54-}
55-
56-
57-func getVoteAmountCount (voteId,vote) = match getInteger(this, getVoteAmountKey(voteId, vote)) {
58- case a: Int =>
59- a
60- case _ =>
61- 0
6272 }
6373
6474
6575 func getVoterKey (address,voteId) = ((((address + "_") + voteId) + "_") + "vote")
6676
6777
6878 func getVoter (address,voteId) = match getString(this, getVoterKey(address, voteId)) {
6979 case a: String =>
7080 a
7181 case _ =>
7282 ""
7383 }
7484
7585
7686 func canVote (address,voteId) = {
7787 let voter = getVoter(address, voteId)
7888 if ((voter == ""))
7989 then true
8090 else false
8191 }
8292
8393
84-func getStakerKey (staker) = (staker + "_stake")
85-
86-
87-func getCurrentStake (staker) = match getInteger(this, getStakerKey(staker)) {
88- case a: Int =>
89- a
90- case _ =>
91- 0
92-}
93-
94-
95-func getStakePoolKey () = "stake_pool"
96-
97-
98-func getStakePool () = match getInteger(this, getStakePoolKey()) {
99- case a: Int =>
100- a
101- case _ =>
102- 0
103-}
104-
105-
10694 @Callable(i)
107-func addEntrepreneurProfile (name,avatar,bio,gender,location) = if (if (if ((i.caller.bytes == adminAddress1))
108- then true
109- else (i.caller.bytes == adminAddress2))
110- then true
111- else (i.caller.bytes == adminAddress3))
112- then {
95+func addEntrepreneurProfile (name,avatar,bio,gender,location) = if ((i.caller.bytes != adminAddress))
96+ then throw("Only Dyzrupt Admin can call this dApp function")
97+ else {
11398 let transactionId = toBase58String(i.transactionId)
114- WriteSet([DataEntry(getProfileKey(transactionId), ((((((((name + "_") + avatar) + "_") + bio) + "_") + gender) + "_") + location)), DataEntry(getVoteKey(transactionId, "upvote"), 0), DataEntry(getVoteAmountKey(transactionId, "upvote"), 0), DataEntry(getStatusKey(transactionId), "open")])
99+ WriteSet([DataEntry(getProfileKey(transactionId), ((((((((name + "_") + avatar) + "_") + bio) + "_") + gender) + "_") + location)), DataEntry(getVoteKey(transactionId, "upvote"), 0), DataEntry(getStatusKey(transactionId), "open")])
115100 }
116- else throw("Only Dyzrupt Admin can call this dApp function")
117101
118102
119103
120104 @Callable(i)
121105 func vote (voteId,vote) = {
122106 let pmt = extract(i.payment)
123- let voter = toBase58String(i.caller.bytes)
124107 if ((pmt.amount == 0))
125108 then throw("You cannot vote without paying voting fee")
126109 else if ((pmt.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'))
127110 then throw("You can only vote with DYZRUPT token")
128- else if (canVote(voter, voteId))
111+ else if (canVote(toBase58String(i.caller.bytes), voteId))
129112 then if (profileExist(voteId))
130113 then if ((getVoteStatus(voteId) == "open"))
131114 then if ((vote == upVote))
132115 then {
133116 let voteCount = getVoteCount(voteId, vote)
134- let voteAmountCount = getVoteAmountCount(voteId, vote)
135117 let newVoteCount = (voteCount + 1)
136- let newVoteAmountCount = (voteAmountCount + pmt.amount)
137- ScriptResult(WriteSet([DataEntry(getVoteKey(voteId, vote), newVoteCount), DataEntry(getVoterKey(voter, voteId), voteId), DataEntry(getVoterAmountKey(voter, voteId), pmt.amount), DataEntry(getVoteAmountKey(voteId, vote), newVoteAmountCount)]), TransferSet([ScriptTransfer(this, pmt.amount, dyzId)]))
118+ ScriptResult(WriteSet([DataEntry(getVoteKey(voteId, vote), newVoteCount), DataEntry(getVoterKey(toBase58String(i.caller.bytes), voteId), voteId)]), TransferSet([ScriptTransfer(this, pmt.amount, dyzId)]))
138119 }
139120 else throw("Not a valid vote value")
140121 else throw("This profile is not open for voting")
141122 else throw("Invalid Profile")
142123 else throw("You can't vote twice")
143124 }
144125
145126
146127
147128 @Callable(i)
148-func openVote (voteId) = if (if (if ((i.caller.bytes == adminAddress1))
149- then true
150- else (i.caller.bytes == adminAddress2))
151- then true
152- else (i.caller.bytes == adminAddress3))
153- then if (profileExist(voteId))
129+func openVote (voteId) = if ((i.caller.bytes != adminAddress))
130+ then throw("Only Dyzrupt Admin can call this dApp function")
131+ else if (profileExist(voteId))
154132 then WriteSet([DataEntry(getStatusKey(voteId), "open")])
155133 else throw("Invalid ID")
156- else throw("Only Dyzrupt Admin can call this dApp function")
157134
158135
159136
160137 @Callable(i)
161-func closeVote (voteId) = if (if (if ((i.caller.bytes == adminAddress1))
162- then true
163- else (i.caller.bytes == adminAddress2))
164- then true
165- else (i.caller.bytes == adminAddress3))
166- then if (profileExist(voteId))
138+func closeVote (voteId) = if ((i.caller.bytes != adminAddress))
139+ then throw("Only Dyzrupt Admin can call this dApp function")
140+ else if (profileExist(voteId))
167141 then WriteSet([DataEntry(getStatusKey(voteId), "closed")])
168142 else throw("Invalid ID")
169- else throw("Only Dyzrupt Admin can call this dApp function")
170-
171-
172-
173-@Callable(i)
174-func withdraw (voteId) = {
175- let voter = toBase58String(i.caller.bytes)
176- if ((getVoter(voter, voteId) != ""))
177- then if ((getVoteStatus(voteId) == "closed"))
178- then {
179- let currentKey = getVoterAmountKey(voter, voteId)
180- let currentAmount = match getInteger(this, currentKey) {
181- case a: Int =>
182- a
183- case _ =>
184- throw("You didn't vote for this entrepreneur")
185- }
186- if ((currentAmount == 0))
187- then throw("Seems you have previously withdrawn.")
188- else ScriptResult(WriteSet([DataEntry(currentKey, 0)]), TransferSet([ScriptTransfer(i.caller, currentAmount, dyzId)]))
189- }
190- else throw("Can't withdraw vote amount while voting is still open.")
191- else throw("You didn't vote for this entrepreneur")
192- }
193143
194144
195145
196146 @Callable(i)
197147 func stake () = {
198148 let staker = toBase58String(i.caller.bytes)
199149 let pmt = extract(i.payment)
200150 if ((pmt.amount == 0))
201151 then throw("Stake amount too low")
202152 else if ((pmt.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'))
203153 then throw("You can only stake with DYZRUPT token")
204154 else {
205155 let currentStake = getCurrentStake(staker)
206- let stakePercent = (20 / 100)
207- let stakeableAmount = (pmt.amount * stakePercent)
156+ let stakeableAmount = fraction(pmt.amount, 5, 100)
208157 let amountToStake = (pmt.amount - stakeableAmount)
209158 let newStakedAmount = (currentStake + amountToStake)
210- ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newStakedAmount)]), TransferSet([ScriptTransfer(this, pmt.amount, dyzId)]))
159+ let stakePool = getStakePool()
160+ let newStakePool = (stakePool + stakeableAmount)
161+ ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newStakedAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet(nil))
211162 }
212163 }
213164
214165
215166
216167 @Callable(i)
217168 func unstake (amount) = {
218169 let staker = toBase58String(i.caller.bytes)
219170 let currentStake = getCurrentStake(staker)
220171 if ((currentStake == 0))
221172 then throw("You don't have any stakes")
222173 else if ((amount > currentStake))
223174 then throw("You can't withdraw an amount higher than you staked")
224175 else {
225- let newStakedAmount = (currentStake - amount)
226- ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newStakedAmount)]), TransferSet([ScriptTransfer(i.caller, amount, dyzId)]))
176+ let unstakeableAmount = fraction(amount, 10, 100)
177+ let amountToUnstake = (amount - unstakeableAmount)
178+ let newUnstakedAmount = (currentStake - amount)
179+ let stakePool = getStakePool()
180+ let newStakePool = (stakePool + unstakeableAmount)
181+ ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newUnstakedAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet([ScriptTransfer(i.caller, amountToUnstake, dyzId)]))
227182 }
228183 }
229184
230185
231186
232187 @Callable(i)
233188 func claimDailyStakeReward (reward) = {
234189 let staker = toBase58String(i.caller.bytes)
235190 let currentStake = getCurrentStake(staker)
236191 let stakePool = getStakePool()
192+ let currentHeight = height
193+ let lastClaimHeight = getLastClaimHeight(staker)
237194 if ((currentStake == 0))
238195 then throw("You don't have any stakes")
239196 else if ((stakePool == 0))
240197 then throw("Nothing in Stake pool at this time. Try again later")
241198 else if ((reward > stakePool))
242199 then throw("No rewards at this time")
243- else {
244- let newStakePool = (stakePool - reward)
245- let newStakeAmount = (currentStake - reward)
246- ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newStakeAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet([ScriptTransfer(i.caller, reward, dyzId)]))
247- }
200+ else if (((lastClaimHeight + 1440) > currentHeight))
201+ then throw("You can only claim once a day")
202+ else {
203+ let newStakePool = (stakePool - reward)
204+ let newStakeAmount = (currentStake - reward)
205+ ScriptResult(WriteSet([DataEntry(("last_claim_" + staker), currentHeight), DataEntry(getStakerKey(staker), newStakeAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet([ScriptTransfer(i.caller, reward, dyzId)]))
206+ }
248207 }
249208
250209

github/deemru/w8io/169f3d6 
44.38 ms