tx · 7UQxc8Qq9mdSyiTfmVcRpsfRUB1TkKDT3etK5Gr8MFip

3N3y7DVmszkgFYMGoDtNnPjrNmLTf1rRUKJ:  -0.01990000 Waves

2020.10.20 19:03 [1229103] smart account 3N3y7DVmszkgFYMGoDtNnPjrNmLTf1rRUKJ > SELF 0.00000000 Waves

{ "type": 13, "id": "7UQxc8Qq9mdSyiTfmVcRpsfRUB1TkKDT3etK5Gr8MFip", "fee": 1990000, "feeAssetId": null, "timestamp": 1603209840884, "version": 2, "chainId": 84, "sender": "3N3y7DVmszkgFYMGoDtNnPjrNmLTf1rRUKJ", "senderPublicKey": "EPmZCX2H4AC1hUmAFRUfWrhzXrNjf3wPaybY6jHZQphj", "proofs": [ "RmZMSjtC9eAg38DtBoJDdX4QMop6G2BedgTvRnZGeFUVAsR5pV55W1QvHiyppwbT6b47XGWumE4Q7paWpwehASD" ], "script": "base64:AAIDAAAAAAAAABEIARIAEgASABIAEgMKAQESAAAAAAAAAAAGAAAAAWkBAAAAFFJlYWRNYXhHb3Zlcm5EZXBvc2l0AAAAAAQAAAAOR292ZXJuVG9rZW5LZXkCAAAAFUdvdmVyblRva2VuTWF4RGVwb3NpdAQAAAAaTWF4R292ZXJuVG9rZW5EZXBvc2l0ZXJLZXkCAAAAGk1heEdvdmVyblRva2VuRGVwb3NpdGVyS2V5BAAAAAZXaW5uZXIJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMFAAAAGk1heEdvdmVyblRva2VuRGVwb3NpdGVyS2V5BAAAABVNYXhHb3Zlcm5Ub2tlbkRlcG9zaXQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAAOR292ZXJuVG9rZW5LZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAkAAAIAAAABCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAABJXaW5uZXIgaXMuLi4uL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jcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAC3dpbm5lclByaXplBQAAAAtQcml6ZUFtb3VudAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAASRnVuZEJveFN0YWtlZFRva2VuAAAAAAAAAAAACQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAABJVc2VyR292ZXJuVG9rZW5LZXkAAAAAAAAAAGQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAp3aW5BZGRyZXNzBQAAAAtQcml6ZUFtb3VudAUAAAALU3Rha2VkVG9rZW4JAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyAAAAAAAAAABkBQAAAAtHb3Zlcm5Ub2tlbgUAAAADbmlsCQAAAgAAAAEJAAEsAAAAAgIAAABHWW91IGhhdmUgdG8gZGVwb3NpdCAxMDAgR292ZXJuVG9rZW4gdG8gY2xhaW0gUmV3YXJkIAogWW91ciBCYWxhbmNlIGlzOiAJAAGkAAAAAQUAAAAVVXNlckdvdmVyblRva2VuQW1vdW50AAAAAA1p8TI=", "height": 1229103, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 3tvWeAcXNRXowQBcgH9BYi4QyhmqaVEJaY2LvapWidG7 Next: Ca1iEJr8YzvRHkuLtYZgUMzDtp2RJH64mx86HfdtEzH7 Diff:
OldNewDifferences
66 @Callable(i)
77 func ReadMaxGovernDeposit () = {
88 let GovernTokenKey = "GovernTokenMaxDeposit"
9+ let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey"
10+ let Winner = getStringValue(this, MaxGovernTokenDepositerKey)
911 let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) {
1012 case a: Int =>
1113 a
1214 case _ =>
1315 0
1416 }
15- throw(("Reading.....: " + toString(MaxGovernTokenDeposit)))
17+ throw(((("Winner is.....: " + Winner) + " ") + toString(MaxGovernTokenDeposit)))
1618 }
1719
1820
8486 }
8587 let CurrrentGovernTokenDeposit = (currentAmount + pmt.amount)
8688 let GovernTokenKey = "GovernTokenMaxDeposit"
89+ let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey"
8790 let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) {
8891 case a: Int =>
8992 a
9396 if (if ((CurrrentGovernTokenDeposit > MaxGovernTokenDeposit))
9497 then true
9598 else (MaxGovernTokenDeposit == 0))
96- then WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit), DataEntry(GovernTokenKey, CurrrentGovernTokenDeposit)])
99+ then WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit), DataEntry(GovernTokenKey, CurrrentGovernTokenDeposit), DataEntry(MaxGovernTokenDepositerKey, currentKey)])
97100 else WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit)])
98101 }
99102 else throw("Can deposit only Govern Token")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func ReadMaxGovernDeposit () = {
88 let GovernTokenKey = "GovernTokenMaxDeposit"
9+ let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey"
10+ let Winner = getStringValue(this, MaxGovernTokenDepositerKey)
911 let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) {
1012 case a: Int =>
1113 a
1214 case _ =>
1315 0
1416 }
15- throw(("Reading.....: " + toString(MaxGovernTokenDeposit)))
17+ throw(((("Winner is.....: " + Winner) + " ") + toString(MaxGovernTokenDeposit)))
1618 }
1719
1820
1921
2022 @Callable(i)
2123 func payYield () = {
2224 let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
2325 let currentKey = toBase58String(i.caller.bytes)
2426 let currentAmount = match getInteger(this, currentKey) {
2527 case a: Int =>
2628 a
2729 case _ =>
2830 0
2931 }
3032 if ((currentAmount > 0))
3133 then {
3234 let GovernTokenAmount = assetBalance(this, GovernToken)
3335 if ((1 > GovernTokenAmount))
3436 then throw("No enough GovernToken In Contract")
3537 else ScriptResult(WriteSet([DataEntry(currentKey, 10)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken)]))
3638 }
3739 else throw("You need to deposit Collateral Token to receive Govern Token")
3840 }
3941
4042
4143
4244 @Callable(i)
4345 func Stake () = {
4446 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
4547 let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
4648 let pmt = extract(i.payment)
4749 if (if (isDefined(pmt.assetId))
4850 then (extract(pmt.assetId) == CollateralToken)
4951 else false)
5052 then {
5153 let currentKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(CollateralToken))
5254 let currentAmount = match getInteger(this, currentKey) {
5355 case a: Int =>
5456 a
5557 case _ =>
5658 0
5759 }
5860 let newAmount = (currentAmount + pmt.amount)
5961 let GovernTokenAmount = assetBalance(this, GovernToken)
6062 if ((1 > GovernTokenAmount))
6163 then throw("No enough GovernToken In Contract")
6264 else ScriptResult(WriteSet([DataEntry(currentKey, 10), DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, 10, GovernToken)]))
6365 }
6466 else throw("Can deposit only StakeToken")
6567 }
6668
6769
6870
6971 @Callable(i)
7072 func DepositGovernToken () = {
7173 let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
7274 let GovernTokenMaxDeposit = toBase58String(GovernToken)
7375 let pmt = extract(i.payment)
7476 if (if (isDefined(pmt.assetId))
7577 then (extract(pmt.assetId) == GovernToken)
7678 else false)
7779 then {
7880 let currentKey = toBase58String(i.caller.bytes)
7981 let currentAmount = match getInteger(this, currentKey) {
8082 case a: Int =>
8183 a
8284 case _ =>
8385 0
8486 }
8587 let CurrrentGovernTokenDeposit = (currentAmount + pmt.amount)
8688 let GovernTokenKey = "GovernTokenMaxDeposit"
89+ let MaxGovernTokenDepositerKey = "MaxGovernTokenDepositerKey"
8790 let MaxGovernTokenDeposit = match getInteger(this, GovernTokenKey) {
8891 case a: Int =>
8992 a
9093 case _ =>
9194 0
9295 }
9396 if (if ((CurrrentGovernTokenDeposit > MaxGovernTokenDeposit))
9497 then true
9598 else (MaxGovernTokenDeposit == 0))
96- then WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit), DataEntry(GovernTokenKey, CurrrentGovernTokenDeposit)])
99+ then WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit), DataEntry(GovernTokenKey, CurrrentGovernTokenDeposit), DataEntry(MaxGovernTokenDepositerKey, currentKey)])
97100 else WriteSet([DataEntry(currentKey, CurrrentGovernTokenDeposit)])
98101 }
99102 else throw("Can deposit only Govern Token")
100103 }
101104
102105
103106
104107 @Callable(i)
105108 func WithdrawStakedFunds (amount) = {
106109 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
107110 let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
108111 let currentKey = toBase58String(i.caller.bytes)
109112 let currentAmount = match getInteger(this, currentKey) {
110113 case a: Int =>
111114 a
112115 case _ =>
113116 0
114117 }
115118 let newAmount = (currentAmount - amount)
116119 if ((0 > amount))
117120 then throw("Can't withdraw negative amount")
118121 else if ((0 > newAmount))
119122 then throw("User cannot withdraw more than deposited funds")
120123 else {
121124 let GovernTokenAmount = assetBalance(this, GovernToken)
122125 if ((1 > GovernTokenAmount))
123126 then throw("No enough GovernToken In Contract")
124127 else ScriptResult(WriteSet([DataEntry(currentKey, 1), DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken), ScriptTransfer(i.caller, amount, CollateralToken)]))
125128 }
126129 }
127130
128131
129132
130133 @Callable(i)
131134 func ClaimPrize () = {
132135 let StakedToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
133136 let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
134137 let FundBoxAddress58 = base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD'
135138 let winnerPrize = (("3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA" + "_") + toBase58String(StakedToken))
136139 let winAddress = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA')
137140 let FundBoxAddress = Address(base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD')
138141 let FundBox = "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD"
139142 let UserGovernTokenKey = ((toBase58String(i.caller.bytes) + "_") + toBase58String(GovernToken))
140143 let UserStakedToken = ((toBase58String(i.caller.bytes) + "_") + toBase58String(StakedToken))
141144 let FundBoxStakedToken = ((toBase58String(FundBoxAddress58) + "_") + toBase58String(StakedToken))
142145 let UserGovernTokenAmount = match getInteger(this, UserGovernTokenKey) {
143146 case a: Int =>
144147 a
145148 case _ =>
146149 0
147150 }
148151 let UserStakedTokenAmount = match getInteger(this, UserStakedToken) {
149152 case a: Int =>
150153 a
151154 case _ =>
152155 0
153156 }
154157 let PrizeAmount = match getInteger(this, FundBoxStakedToken) {
155158 case a: Int =>
156159 a
157160 case _ =>
158161 0
159162 }
160163 if ((PrizeAmount == 0))
161164 then throw("No prize to Claim")
162165 else if ((UserStakedToken != winnerPrize))
163166 then throw("You are not the winner hence cannot claim the reward ")
164167 else if ((1 > UserStakedTokenAmount))
165168 then throw(("You have to Stake StakedToken to claim reward
166169 Your Balance of Staked Tokens is: " + toString(UserStakedTokenAmount)))
167170 else if ((UserGovernTokenAmount > 100))
168171 then ScriptResult(WriteSet([DataEntry(winnerPrize, PrizeAmount), DataEntry(FundBoxStakedToken, 0), DataEntry(UserGovernTokenKey, 100)]), TransferSet([ScriptTransfer(winAddress, PrizeAmount, StakedToken), ScriptTransfer(i.caller, 100, GovernToken)]))
169172 else throw(("You have to deposit 100 GovernToken to claim Reward
170173 Your Balance is: " + toString(UserGovernTokenAmount)))
171174 }
172175
173176

github/deemru/w8io/169f3d6 
39.16 ms