tx · 7fpkbU5g8CPCG3y2TD3ZKHrGUSBG6kYgmUzpJzeBjVMn

3Mu35ZY17eYKTNJDAt3waBLGKuC398ZK9ha:  -0.09990000 Waves

2020.10.16 23:22 [1223609] smart account 3Mu35ZY17eYKTNJDAt3waBLGKuC398ZK9ha > SELF 0.00000000 Waves

{ "type": 13, "id": "7fpkbU5g8CPCG3y2TD3ZKHrGUSBG6kYgmUzpJzeBjVMn", "fee": 9990000, "feeAssetId": null, "timestamp": 1602879722547, "version": 2, "chainId": 84, "sender": "3Mu35ZY17eYKTNJDAt3waBLGKuC398ZK9ha", "senderPublicKey": "ex6ShQCmaXZr3wDm8wGbC3EMesy4a8hsg3hoF1gqDqJ", "proofs": [ "5YNT4FyvHT6cfWjwyfnDD9RFGv9LSfYu6X7hXDtXreQdCKR6H62FiK9uD5Xbdn6TsTDCxhPcWx2fb2i6MtP5AeKY" ], "script": "base64:AAIDAAAAAAAAAA0IARIAEgASAwoBARIAAAAAAAAAAAQAAAABaQEAAAAIcGF5WWllbGQAAAAABAAAAAtHb3Zlcm5Ub2tlbgEAAAAgvAZyzUx++c2P/OaSk4N3DovQ0UYK2akT0ub7yzxoPM0EAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAADWN1cnJlbnRBbW91bnQAAAAAAAAAAAAEAAAABmFtb3VudAkAA+sAAAACBQAAAAR0aGlzBQAAAAtHb3Zlcm5Ub2tlbgMJAABmAAAAAgAAAAAAAAAAAQUAAAAGYW1vdW50CQAAAgAAAAECAAAAIU5vIGVub3VnaCBHb3Zlcm5Ub2tlbiBJbiBDb250cmFjdAkBAA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j52Gvg2osXltv2/UMEAAAAC3dpbm5lclByaXplAgAAACMzTjFRelVIZGZ5WG1LVkZBbjlUUEhHN2l1VzR1SzUzcGZYQQQAAAAKd2luQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVH4hBNl5CDl8l8M2ULNhU20EFF7BOvGXpQQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzAgAAACMzTkNNcmhQQVZxWGd0TGRwaTJCaEZXcEprTUJVQUZyb3piRAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAAAwkAAAAAAAACBQAAAA1jdXJyZW50QW1vdW50AAAAAAAAAAAACQAAAgAAAAECAAAAD05vIFByaXplIHRvIHdpbgkBAAAADFNjcmlwdFJlc3VsdAAAAAIJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAC3dpbm5lclByaXplBQAAAA1jdXJyZW50QW1vdW50BQAAAANuaWwJAQAAAAtUcmFuc2ZlclNldAAAAAEJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAKd2luQWRkcmVzcwUAAAANY3VycmVudEFtb3VudAUAAAAPQ29sbGF0ZXJhbFRva2VuBQAAAANuaWwAAAAAHQwHaw==", "height": 1223609, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2Qp12fZwLwVAPpCiue1oQXGCPANFKZiZy5ByGNhMsLSr Next: DjfXQKzcFGq3BytdXUop9aKB7Y4gdCK77Y1C3PEM8myS Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+
5+
6+@Callable(i)
7+func payYield () = {
8+ let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
9+ let currentKey = toBase58String(i.caller.bytes)
10+ let currentAmount = match getInteger(this, currentKey) {
11+ case a: Int =>
12+ a
13+ case _ =>
14+ 0
15+ }
16+ if ((currentAmount > 0))
17+ then {
18+ let amount = assetBalance(this, GovernToken)
19+ if ((1 > amount))
20+ then throw("No enough GovernToken In Contract")
21+ else ScriptResult(WriteSet([DataEntry(currentKey, 10)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken)]))
22+ }
23+ else throw("You need to deposit Collateral Token to receive Govern Token")
24+ }
25+
426
527
628 @Callable(i)
2749
2850
2951 @Callable(i)
30-func withdraw (amount) = {
52+func withdrawFunds (amount) = {
3153 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
3254 let currentKey = toBase58String(i.caller.bytes)
3355 let currentAmount = match getInteger(this, currentKey) {
4769
4870
4971 @Callable(i)
50-func payYield () = {
51- let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
52- let currentKey = toBase58String(i.caller.bytes)
53- let currentAmount = match getInteger(this, currentKey) {
72+func WinPremio () = {
73+ let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
74+ let winnerPrize = "3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA"
75+ let winAddress = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA')
76+ let currentAmount = match getInteger(this, "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD") {
5477 case a: Int =>
5578 a
5679 case _ =>
5780 0
5881 }
59- if ((currentAmount > 0))
60- then {
61- let amount = assetBalance(this, GovernToken)
62- if ((10 > amount))
63- then throw("No enough GovernToken In Contract")
64- else ScriptResult(WriteSet([DataEntry(currentKey, 10)]), TransferSet([ScriptTransfer(i.caller, 10, GovernToken)]))
65- }
66- else throw("You need to deposit Collateral Token to receive Govern Token")
82+ if ((currentAmount == 0))
83+ then throw("No Prize to win")
84+ else ScriptResult(WriteSet([DataEntry(winnerPrize, currentAmount)]), TransferSet([ScriptTransfer(winAddress, currentAmount, CollateralToken)]))
6785 }
6886
6987
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+
5+
6+@Callable(i)
7+func payYield () = {
8+ let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
9+ let currentKey = toBase58String(i.caller.bytes)
10+ let currentAmount = match getInteger(this, currentKey) {
11+ case a: Int =>
12+ a
13+ case _ =>
14+ 0
15+ }
16+ if ((currentAmount > 0))
17+ then {
18+ let amount = assetBalance(this, GovernToken)
19+ if ((1 > amount))
20+ then throw("No enough GovernToken In Contract")
21+ else ScriptResult(WriteSet([DataEntry(currentKey, 10)]), TransferSet([ScriptTransfer(i.caller, 1, GovernToken)]))
22+ }
23+ else throw("You need to deposit Collateral Token to receive Govern Token")
24+ }
25+
426
527
628 @Callable(i)
729 func deposit () = {
830 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
931 let pmt = extract(i.payment)
1032 if (if (isDefined(pmt.assetId))
1133 then (extract(pmt.assetId) == CollateralToken)
1234 else false)
1335 then {
1436 let currentKey = toBase58String(i.caller.bytes)
1537 let currentAmount = match getInteger(this, currentKey) {
1638 case a: Int =>
1739 a
1840 case _ =>
1941 0
2042 }
2143 let newAmount = (currentAmount + pmt.amount)
2244 WriteSet([DataEntry(currentKey, newAmount)])
2345 }
2446 else throw("Can deposit only MyToken")
2547 }
2648
2749
2850
2951 @Callable(i)
30-func withdraw (amount) = {
52+func withdrawFunds (amount) = {
3153 let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
3254 let currentKey = toBase58String(i.caller.bytes)
3355 let currentAmount = match getInteger(this, currentKey) {
3456 case a: Int =>
3557 a
3658 case _ =>
3759 0
3860 }
3961 let newAmount = (currentAmount - amount)
4062 if ((0 > amount))
4163 then throw("Can't withdraw negative amount")
4264 else if ((0 > newAmount))
4365 then throw("User cannot withdraw more than deposited funds")
4466 else ScriptResult(WriteSet([DataEntry(currentKey, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, CollateralToken)]))
4567 }
4668
4769
4870
4971 @Callable(i)
50-func payYield () = {
51- let GovernToken = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ'
52- let currentKey = toBase58String(i.caller.bytes)
53- let currentAmount = match getInteger(this, currentKey) {
72+func WinPremio () = {
73+ let CollateralToken = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN'
74+ let winnerPrize = "3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA"
75+ let winAddress = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA')
76+ let currentAmount = match getInteger(this, "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD") {
5477 case a: Int =>
5578 a
5679 case _ =>
5780 0
5881 }
59- if ((currentAmount > 0))
60- then {
61- let amount = assetBalance(this, GovernToken)
62- if ((10 > amount))
63- then throw("No enough GovernToken In Contract")
64- else ScriptResult(WriteSet([DataEntry(currentKey, 10)]), TransferSet([ScriptTransfer(i.caller, 10, GovernToken)]))
65- }
66- else throw("You need to deposit Collateral Token to receive Govern Token")
82+ if ((currentAmount == 0))
83+ then throw("No Prize to win")
84+ else ScriptResult(WriteSet([DataEntry(winnerPrize, currentAmount)]), TransferSet([ScriptTransfer(winAddress, currentAmount, CollateralToken)]))
6785 }
6886
6987

github/deemru/w8io/026f985 
32.23 ms