tx · 22sgaiQtkrQPdFTxCE1rx6LugVtXu7HGrYv9hdbj4pBP

3Mu35ZY17eYKTNJDAt3waBLGKuC398ZK9ha:  -0.01990000 Waves

2020.10.17 10:41 [1224291] smart account 3Mu35ZY17eYKTNJDAt3waBLGKuC398ZK9ha > SELF 0.00000000 Waves

{ "type": 13, "id": "22sgaiQtkrQPdFTxCE1rx6LugVtXu7HGrYv9hdbj4pBP", "fee": 1990000, "feeAssetId": null, "timestamp": 1602920484820, "version": 2, "chainId": 84, "sender": "3Mu35ZY17eYKTNJDAt3waBLGKuC398ZK9ha", "senderPublicKey": "ex6ShQCmaXZr3wDm8wGbC3EMesy4a8hsg3hoF1gqDqJ", "proofs": [ "5YmwhcHcMsZC18Ha2toZw9ZNpDvDyi8hhGsExWqvqXaZYcomNvXdF136qSwgoDGULeZo1Ptjy2adNJJArskQmfcJ" ], "script": "base64:AAIDAAAAAAAAAA0IARIAEgASAwoBARIAAAAAAAAAAAQAAAABaQEAAAAIcGF5WWllbGQAAAAABAAAAAtHb3Zlcm5Ub2tlbgEAAAAgvAZyzUx++c2P/OaSk4N3DovQ0UYK2akT0ub7yzxoPM0EAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAADWN1cnJlbnRBbW91bnQAAAAAAAAAAAAEAAAABmFtb3VudAkAA+sAAAACBQAAAAR0aGlzBQAAAAtHb3Zlcm5Ub2tlbgMJAABmAAAAAgAAAAAAAAAAAQUAAAAGYW1vdW50CQAAAgAAAAECAAAAIU5vIGVub3VnaCBHb3Zlcm5Ub2tlbiBJbiBDb250cmFjdAkBAAAADFNjcmlwdF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ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAC3dpbm5lclByaXplBQAAAAtQcml6ZUFtb3VudAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAHRnVuZEJveAAAAAAAAAAAAAUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAACndpbkFkZHJlc3MFAAAAC1ByaXplQW1vdW50BQAAAA9Db2xsYXRlcmFsVG9rZW4FAAAAA25pbAkAAAIAAAABAgAAADhZb3UgbmVlZCB0byBoYXZlIGRlcG9zaXQgaW4gdGhlIENvbnRyYWN0IHRvIGNsYWltIHJld2FyZAAAAABZ5XHl", "height": 1224291, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: v8E3JJiaWBsTPnPrB3yg1ZSwGPEcvL4eFHj1GmZpvG3 Next: none Diff:
OldNewDifferences
7272 func ClaimPrize () = {
7373 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
7474 let winnerPrize = "3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA"
75+ let FundBox = "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD"
7576 let currentKey = toBase58String(i.caller.bytes)
7677 let winAddress = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA')
78+ let FundBoxAddress = Address(base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD')
7779 let CallerAmount = match getInteger(this, currentKey) {
7880 case a: Int =>
7981 a
9193 else if ((currentKey != winnerPrize))
9294 then throw("You are not the winner hence cannot claim the reward")
9395 else if ((CallerAmount > 0))
94- then throw(("Shit: " + toString(PrizeAmount)))
96+ then ScriptResult(WriteSet([DataEntry(winnerPrize, PrizeAmount), DataEntry(FundBox, 0)]), TransferSet([ScriptTransfer(winAddress, PrizeAmount, CollateralToken)]))
9597 else throw("You need to have deposit in the Contract to claim reward")
9698 }
9799
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func payYield () = {
88 let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
99 let currentKey = toBase58String(i.caller.bytes)
1010 let currentAmount = match getInteger(this, currentKey) {
1111 case a: Int =>
1212 a
1313 case _ =>
1414 0
1515 }
1616 if ((currentAmount > 0))
1717 then {
1818 let amount = assetBalance(this, GovernToken)
1919 if ((1 > amount))
2020 then throw("No enough GovernToken In Contract")
2121 else ScriptResult(WriteSet([DataEntry(currentKey, 10)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken)]))
2222 }
2323 else throw("You need to deposit Collateral Token to receive Govern Token")
2424 }
2525
2626
2727
2828 @Callable(i)
2929 func deposit () = {
3030 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
3131 let pmt = extract(i.payment)
3232 if (if (isDefined(pmt.assetId))
3333 then (extract(pmt.assetId) == CollateralToken)
3434 else false)
3535 then {
3636 let currentKey = toBase58String(i.caller.bytes)
3737 let currentAmount = match getInteger(this, currentKey) {
3838 case a: Int =>
3939 a
4040 case _ =>
4141 0
4242 }
4343 let newAmount = (currentAmount + pmt.amount)
4444 WriteSet([DataEntry(currentKey, newAmount)])
4545 }
4646 else throw("Can deposit only MyToken")
4747 }
4848
4949
5050
5151 @Callable(i)
5252 func withdrawFunds (amount) = {
5353 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
5454 let currentKey = toBase58String(i.caller.bytes)
5555 let currentAmount = match getInteger(this, currentKey) {
5656 case a: Int =>
5757 a
5858 case _ =>
5959 0
6060 }
6161 let newAmount = (currentAmount - amount)
6262 if ((0 > amount))
6363 then throw("Can't withdraw negative amount")
6464 else if ((0 > newAmount))
6565 then throw("User cannot withdraw more than deposited funds")
6666 else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, CollateralToken)]))
6767 }
6868
6969
7070
7171 @Callable(i)
7272 func ClaimPrize () = {
7373 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
7474 let winnerPrize = "3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA"
75+ let FundBox = "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD"
7576 let currentKey = toBase58String(i.caller.bytes)
7677 let winAddress = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA')
78+ let FundBoxAddress = Address(base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD')
7779 let CallerAmount = match getInteger(this, currentKey) {
7880 case a: Int =>
7981 a
8082 case _ =>
8183 0
8284 }
8385 let PrizeAmount = match getInteger(this, "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD") {
8486 case a: Int =>
8587 a
8688 case _ =>
8789 0
8890 }
8991 if ((PrizeAmount == 0))
9092 then throw("No prize to Claim")
9193 else if ((currentKey != winnerPrize))
9294 then throw("You are not the winner hence cannot claim the reward")
9395 else if ((CallerAmount > 0))
94- then throw(("Shit: " + toString(PrizeAmount)))
96+ then ScriptResult(WriteSet([DataEntry(winnerPrize, PrizeAmount), DataEntry(FundBox, 0)]), TransferSet([ScriptTransfer(winAddress, PrizeAmount, CollateralToken)]))
9597 else throw("You need to have deposit in the Contract to claim reward")
9698 }
9799
98100

github/deemru/w8io/169f3d6 
28.13 ms