tx · HXhCWcTPfxBjG9SJEiqG3XwWDgfubBxrWKxoe55NwkKR

3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu:  -0.05000000 Waves

2020.11.18 09:59 [1270466] smart account 3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu > SELF 0.00000000 Waves

{ "type": 13, "id": "HXhCWcTPfxBjG9SJEiqG3XwWDgfubBxrWKxoe55NwkKR", "fee": 5000000, "feeAssetId": null, "timestamp": 1605682819142, "version": 2, "chainId": 84, "sender": "3N5rNyYSAsaP9QL2eQq286RhevB8msHFffu", "senderPublicKey": "CBTEuFN6ku1LNaPuGHHTMh2CBb3kPa5D73XXTJvKydun", "proofs": [ "4KSva7rSG7962k1VFizNgUgHVLKJ4hjfYm5seypGGaTWQJud4P7v2nS9xYFUjXk5iyZ3JircbxN6nMNZ6d2x3jfd" ], "script": "base64:AAIDAAAAAAAAACcIARIHCgUICAgICBIECgIICBIDCgEIEgMKAQgSABIDCgEBEgMKAQEAAAAQAAAAAAZ1cFZvdGUCAAAABnVwdm90ZQAAAAAMYWRtaW5BZGRyZXNzAQAAABoBVDi2IViANlgIPSCUAVQpoGSXhJ2Tw/Y0iwAAAAAFZHl6SWQBAAAAIH6rQdnOUsq3YY00nk9jVDL2OOQ/e846gXAImq8xTxZrAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAAAgAAAApzdGFrZV9wb29sAQAAAAxnZXRTdGFrZVBvb2wAAAAABAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMJAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAAAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAABAAAADGdldFN0YWtlcktleQAAAAEAAAAGc3Rha2VyCQABLAAAAAIFAAAABnN0YWtlcgIAAAAGX3N0YWtlAQAAAA9nZXRDdXJyZW50U3Rha2UAAAABAAAABnN0YWtlcgQAAAAHJG1hdGNoMAkAB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WdhaW4gbGF0ZXIDCQAAZgAAAAIFAAAABnJld2FyZAUAAAAJc3Rha2VQb29sCQAAAgAAAAECAAAAF05vIHJld2FyZHMgYXQgdGhpcyB0aW1lBAAAAAxuZXdTdGFrZVBvb2wJAABlAAAAAgUAAAAJc3Rha2VQb29sBQAAAAZyZXdhcmQEAAAADm5ld1N0YWtlQW1vdW50CQAAZQAAAAIFAAAADGN1cnJlbnRTdGFrZQUAAAAGcmV3YXJkCQEAAAAMU2NyaXB0UmVzdWx0AAAAAgkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkBAAAADGdldFN0YWtlcktleQAAAAEFAAAABnN0YWtlcgUAAAAObmV3U3Rha2VBbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAA9nZXRTdGFrZVBvb2xLZXkAAAAABQAAAAxuZXdTdGFrZVBvb2wFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAABnJld2FyZAUAAAAFZHl6SWQFAAAAA25pbAAAAACRSpmW", "height": 1270466, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HiW16mYq6KyiLmdMS3vLGTRWu8widLEP9dKFYCw9kpxg Next: 6XH57mNapFhK5QeFe4fpMET2nkXmFf9d3z95KVKQVR9D Diff:
OldNewDifferences
145145 then throw("You can only stake with DYZRUPT token")
146146 else {
147147 let currentStake = getCurrentStake(staker)
148- let stakeableAmount = fraction(pmt.amount, 10, 100)
148+ let stakeableAmount = fraction(pmt.amount, 5, 100)
149149 let amountToStake = (pmt.amount - stakeableAmount)
150150 let newStakedAmount = (currentStake + amountToStake)
151151 let stakePool = getStakePool()
165165 else if ((amount > currentStake))
166166 then throw("You can't withdraw an amount higher than you staked")
167167 else {
168- let unstakeableAmount = fraction(amount, 20, 100)
168+ let unstakeableAmount = fraction(amount, 10, 100)
169169 let amountToUnstake = (amount - unstakeableAmount)
170170 let newUnstakedAmount = (currentStake - amount)
171171 let stakePool = getStakePool()
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let upVote = "upvote"
55
66 let adminAddress = base58'3Mu5woJ54s7vHJgaeNcJ4C9ByfdmMF2jpjC'
77
88 let dyzId = base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'
99
1010 func getStakePoolKey () = "stake_pool"
1111
1212
1313 func getStakePool () = match getInteger(this, getStakePoolKey()) {
1414 case a: Int =>
1515 a
1616 case _ =>
1717 0
1818 }
1919
2020
2121 func getStakerKey (staker) = (staker + "_stake")
2222
2323
2424 func getCurrentStake (staker) = match getInteger(this, getStakerKey(staker)) {
2525 case a: Int =>
2626 a
2727 case _ =>
2828 0
2929 }
3030
3131
3232 func getProfileKey (id) = (id + "_entrepreneurProfile")
3333
3434
3535 func getStatusKey (id) = (id + "_status")
3636
3737
3838 func getVoteKey (id,type) = if ((type == "upvote"))
3939 then (id + "_upvote")
4040 else throw("Invalid vote type")
4141
4242
4343 func profileExist (id) = match getString(this, getProfileKey(id)) {
4444 case a: String =>
4545 true
4646 case _ =>
4747 false
4848 }
4949
5050
5151 func getVoteStatus (voteId) = match getString(this, getStatusKey(voteId)) {
5252 case a: String =>
5353 a
5454 case _ =>
5555 false
5656 }
5757
5858
5959 func getVoteCount (voteId,vote) = match getInteger(this, getVoteKey(voteId, vote)) {
6060 case a: Int =>
6161 a
6262 case _ =>
6363 throw("Not a valid vote ID")
6464 }
6565
6666
6767 func getVoterKey (address,voteId) = ((((address + "_") + voteId) + "_") + "vote")
6868
6969
7070 func getVoter (address,voteId) = match getString(this, getVoterKey(address, voteId)) {
7171 case a: String =>
7272 a
7373 case _ =>
7474 ""
7575 }
7676
7777
7878 func canVote (address,voteId) = {
7979 let voter = getVoter(address, voteId)
8080 if ((voter == ""))
8181 then true
8282 else false
8383 }
8484
8585
8686 @Callable(i)
8787 func addEntrepreneurProfile (name,avatar,bio,gender,location) = if ((i.caller.bytes != adminAddress))
8888 then throw("Only Dyzrupt Admin can call this dApp function")
8989 else {
9090 let transactionId = toBase58String(i.transactionId)
9191 WriteSet([DataEntry(getProfileKey(transactionId), ((((((((name + "_") + avatar) + "_") + bio) + "_") + gender) + "_") + location)), DataEntry(getVoteKey(transactionId, "upvote"), 0), DataEntry(getStatusKey(transactionId), "open")])
9292 }
9393
9494
9595
9696 @Callable(i)
9797 func vote (voteId,vote) = {
9898 let pmt = extract(i.payment)
9999 if ((pmt.amount == 0))
100100 then throw("You cannot vote without paying voting fee")
101101 else if ((pmt.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'))
102102 then throw("You can only vote with DYZRUPT token")
103103 else if (canVote(toBase58String(i.caller.bytes), voteId))
104104 then if (profileExist(voteId))
105105 then if ((getVoteStatus(voteId) == "open"))
106106 then if ((vote == upVote))
107107 then {
108108 let voteCount = getVoteCount(voteId, vote)
109109 let newVoteCount = (voteCount + 1)
110110 ScriptResult(WriteSet([DataEntry(getVoteKey(voteId, vote), newVoteCount), DataEntry(getVoterKey(toBase58String(i.caller.bytes), voteId), voteId)]), TransferSet([ScriptTransfer(this, pmt.amount, dyzId)]))
111111 }
112112 else throw("Not a valid vote value")
113113 else throw("This profile is not open for voting")
114114 else throw("Invalid Profile")
115115 else throw("You can't vote twice")
116116 }
117117
118118
119119
120120 @Callable(i)
121121 func openVote (voteId) = if ((i.caller.bytes != adminAddress))
122122 then throw("Only Dyzrupt Admin can call this dApp function")
123123 else if (profileExist(voteId))
124124 then WriteSet([DataEntry(getStatusKey(voteId), "open")])
125125 else throw("Invalid ID")
126126
127127
128128
129129 @Callable(i)
130130 func closeVote (voteId) = if ((i.caller.bytes != adminAddress))
131131 then throw("Only Dyzrupt Admin can call this dApp function")
132132 else if (profileExist(voteId))
133133 then WriteSet([DataEntry(getStatusKey(voteId), "closed")])
134134 else throw("Invalid ID")
135135
136136
137137
138138 @Callable(i)
139139 func stake () = {
140140 let staker = toBase58String(i.caller.bytes)
141141 let pmt = extract(i.payment)
142142 if ((pmt.amount == 0))
143143 then throw("Stake amount too low")
144144 else if ((pmt.assetId != base58'9XTqBQeJvdMs8VNHv6rXiJLJichg2acG7wCfYcTajQ1G'))
145145 then throw("You can only stake with DYZRUPT token")
146146 else {
147147 let currentStake = getCurrentStake(staker)
148- let stakeableAmount = fraction(pmt.amount, 10, 100)
148+ let stakeableAmount = fraction(pmt.amount, 5, 100)
149149 let amountToStake = (pmt.amount - stakeableAmount)
150150 let newStakedAmount = (currentStake + amountToStake)
151151 let stakePool = getStakePool()
152152 let newStakePool = (stakePool + stakeableAmount)
153153 ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newStakedAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet(nil))
154154 }
155155 }
156156
157157
158158
159159 @Callable(i)
160160 func unstake (amount) = {
161161 let staker = toBase58String(i.caller.bytes)
162162 let currentStake = getCurrentStake(staker)
163163 if ((currentStake == 0))
164164 then throw("You don't have any stakes")
165165 else if ((amount > currentStake))
166166 then throw("You can't withdraw an amount higher than you staked")
167167 else {
168- let unstakeableAmount = fraction(amount, 20, 100)
168+ let unstakeableAmount = fraction(amount, 10, 100)
169169 let amountToUnstake = (amount - unstakeableAmount)
170170 let newUnstakedAmount = (currentStake - amount)
171171 let stakePool = getStakePool()
172172 let newStakePool = (stakePool + unstakeableAmount)
173173 ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newUnstakedAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet([ScriptTransfer(i.caller, amountToUnstake, dyzId)]))
174174 }
175175 }
176176
177177
178178
179179 @Callable(i)
180180 func claimDailyStakeReward (reward) = {
181181 let staker = toBase58String(i.caller.bytes)
182182 let currentStake = getCurrentStake(staker)
183183 let stakePool = getStakePool()
184184 if ((currentStake == 0))
185185 then throw("You don't have any stakes")
186186 else if ((stakePool == 0))
187187 then throw("Nothing in Stake pool at this time. Try again later")
188188 else if ((reward > stakePool))
189189 then throw("No rewards at this time")
190190 else {
191191 let newStakePool = (stakePool - reward)
192192 let newStakeAmount = (currentStake - reward)
193193 ScriptResult(WriteSet([DataEntry(getStakerKey(staker), newStakeAmount), DataEntry(getStakePoolKey(), newStakePool)]), TransferSet([ScriptTransfer(i.caller, reward, dyzId)]))
194194 }
195195 }
196196
197197

github/deemru/w8io/169f3d6 
43.73 ms