tx · DogKWkJZ2U9s7rrUKWLvtdwWRygno1fbtD1BmHA1Nf3K 3N3en9HRhzbk3DDqeGd6DUKc1SG4rmpXguH: -0.09900000 Waves 2020.10.17 22:44 [1225009] smart account 3N3en9HRhzbk3DDqeGd6DUKc1SG4rmpXguH > SELF 0.00000000 Waves
{ "type": 13, "id": "DogKWkJZ2U9s7rrUKWLvtdwWRygno1fbtD1BmHA1Nf3K", "fee": 9900000, "feeAssetId": null, "timestamp": 1602963903145, "version": 2, "chainId": 84, "sender": "3N3en9HRhzbk3DDqeGd6DUKc1SG4rmpXguH", "senderPublicKey": "3UC2eCnSLx9fHcXvssZJZLNzMshb9NM6GchfmEhx6syQ", "proofs": [ "2tXJTA6ghMgTRyMf1AjCf8tBBNZBdEcANCDkkQBPnd3RBusHWD7mHa3nJL7MNMGbNJqEqcMGYdDkthbmqowvD4Ez" ], "script": "base64:AAIDAAAAAAAAAA0IARIAEgASAwoBARIAAAAAAAAAAAQAAAABaQEAAAAIcGF5WWllbGQAAAAABAAAAAtHb3Zlcm5Ub2tlbgEAAAAgvAZyzUx++c2P/OaSk4N3DovQ0UYK2akT0ub7yzxoPM0EAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAANY3VycmVudEFtb3VudAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAApjdXJyZW50S2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEAAAAAAAAAAAADCQAAZgAAAAIFAAAADWN1cnJlbnRBbW91bnQAAAAAAAAAAAAEAAAAEUdvdmVyblRva2VuQW1vdW50CQAD6wAAAAIFAAAABHRoaXMFAAAAC0dvdmVyblRva2VuAwkAAGYAAAACAAAAAAAAAAABBQAAABFHb3Zlcm5Ub2tlbkFtb3VudAkAAAIAAAABAgAAACFObyBlbm91Z2ggR292ZXJuVG9rZW4gSW4gQ29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RyeQAAAAIFAAAAB0Z1bmRCb3gAAAAAAAAAAAAJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACmN1cnJlbnRLZXkAAAAAAAAAAAEFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAp3aW5BZGRyZXNzBQAAAAtQcml6ZUFtb3VudAUAAAAPQ29sbGF0ZXJhbFRva2VuCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgAAAAAAAAAACgUAAAALR292ZXJuVG9rZW4FAAAAA25pbAkAAAIAAAABAgAAADhZb3UgbmVlZCB0byBoYXZlIGRlcG9zaXQgaW4gdGhlIENvbnRyYWN0IHRvIGNsYWltIHJld2FyZAAAAADJa7p1", "height": 1225009, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2dr36NNg3enjc7r9dj1x4jH3pFVR6Q7HpWnnCFKUnBPE Next: 5L9iM798B2SFnAozFV6qCf6fgBx8ytmvxFE3ovuXYVfv Diff:
Old | New | Differences | |
---|---|---|---|
90 | 90 | @Callable(a) | |
91 | 91 | func ClaimPrize () = { | |
92 | 92 | let h = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
93 | + | let b = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
93 | 94 | let l = "3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA" | |
94 | - | let m = "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD" | |
95 | + | let m = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA') | |
96 | + | let n = Address(base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD') | |
97 | + | let o = "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD" | |
95 | 98 | let c = toBase58String(a.caller.bytes) | |
96 | - | let n = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA') | |
97 | - | let o = Address(base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD') | |
98 | 99 | let p = { | |
99 | 100 | let e = getInteger(this, c) | |
100 | 101 | if ($isInstanceOf(e, "Int")) | |
105 | 106 | else 0 | |
106 | 107 | } | |
107 | 108 | let q = { | |
108 | - | let e = getInteger(this, | |
109 | + | let e = getInteger(this, o) | |
109 | 110 | if ($isInstanceOf(e, "Int")) | |
110 | 111 | then { | |
111 | 112 | let f = e | |
118 | 119 | else if ((c != l)) | |
119 | 120 | then throw("You are not the winner hence cannot claim the reward") | |
120 | 121 | else if ((p > 0)) | |
121 | - | then ScriptResult(WriteSet([DataEntry(l, q), DataEntry( | |
122 | + | then ScriptResult(WriteSet([DataEntry(l, q), DataEntry(o, 0), DataEntry(c, 1)]), TransferSet([ScriptTransfer(m, q, h), ScriptTransfer(a.caller, 10, b)])) | |
122 | 123 | else throw("You need to have deposit in the Contract to claim reward") | |
123 | 124 | } | |
124 | 125 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(a) | |
7 | 7 | func payYield () = { | |
8 | 8 | let b = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
9 | 9 | let c = toBase58String(a.caller.bytes) | |
10 | 10 | let d = { | |
11 | 11 | let e = getInteger(this, c) | |
12 | 12 | if ($isInstanceOf(e, "Int")) | |
13 | 13 | then { | |
14 | 14 | let f = e | |
15 | 15 | f | |
16 | 16 | } | |
17 | 17 | else 0 | |
18 | 18 | } | |
19 | 19 | if ((d > 0)) | |
20 | 20 | then { | |
21 | 21 | let g = assetBalance(this, b) | |
22 | 22 | if ((1 > g)) | |
23 | 23 | then throw("No enough GovernToken In Contract") | |
24 | 24 | else ScriptResult(WriteSet([DataEntry(c, 10)]), TransferSet([ScriptTransfer(a.caller, 1, b)])) | |
25 | 25 | } | |
26 | 26 | else throw("You need to deposit Collateral Token to receive Govern Token") | |
27 | 27 | } | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(a) | |
32 | 32 | func deposit () = { | |
33 | 33 | let h = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
34 | 34 | let b = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
35 | 35 | let i = extract(a.payment) | |
36 | 36 | if (if (isDefined(i.assetId)) | |
37 | 37 | then (extract(i.assetId) == h) | |
38 | 38 | else false) | |
39 | 39 | then { | |
40 | 40 | let c = toBase58String(a.caller.bytes) | |
41 | 41 | let d = { | |
42 | 42 | let e = getInteger(this, c) | |
43 | 43 | if ($isInstanceOf(e, "Int")) | |
44 | 44 | then { | |
45 | 45 | let f = e | |
46 | 46 | f | |
47 | 47 | } | |
48 | 48 | else 0 | |
49 | 49 | } | |
50 | 50 | let j = (d + i.amount) | |
51 | 51 | let g = assetBalance(this, b) | |
52 | 52 | if ((1 > g)) | |
53 | 53 | then throw("No enough GovernToken In Contract") | |
54 | 54 | else ScriptResult(WriteSet([DataEntry(c, 10), DataEntry(c, j)]), TransferSet([ScriptTransfer(a.caller, 10, b)])) | |
55 | 55 | } | |
56 | 56 | else throw("Can deposit only MyToken") | |
57 | 57 | } | |
58 | 58 | ||
59 | 59 | ||
60 | 60 | ||
61 | 61 | @Callable(a) | |
62 | 62 | func withdrawFunds (k) = { | |
63 | 63 | let h = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
64 | 64 | let b = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
65 | 65 | let c = toBase58String(a.caller.bytes) | |
66 | 66 | let d = { | |
67 | 67 | let e = getInteger(this, c) | |
68 | 68 | if ($isInstanceOf(e, "Int")) | |
69 | 69 | then { | |
70 | 70 | let f = e | |
71 | 71 | f | |
72 | 72 | } | |
73 | 73 | else 0 | |
74 | 74 | } | |
75 | 75 | let j = (d - k) | |
76 | 76 | if ((0 > k)) | |
77 | 77 | then throw("Can't withdraw negative amount") | |
78 | 78 | else if ((0 > j)) | |
79 | 79 | then throw("User cannot withdraw more than deposited funds") | |
80 | 80 | else { | |
81 | 81 | let g = assetBalance(this, b) | |
82 | 82 | if ((1 > g)) | |
83 | 83 | then throw("No enough GovernToken In Contract") | |
84 | 84 | else ScriptResult(WriteSet([DataEntry(c, 1), DataEntry(c, j)]), TransferSet([ScriptTransfer(a.caller, 1, b), ScriptTransfer(a.caller, k, h)])) | |
85 | 85 | } | |
86 | 86 | } | |
87 | 87 | ||
88 | 88 | ||
89 | 89 | ||
90 | 90 | @Callable(a) | |
91 | 91 | func ClaimPrize () = { | |
92 | 92 | let h = base58'5hHK64aujiyn7cNrTBwhe5yJQuxs119KTPbE9nFjLoUN' | |
93 | + | let b = base58'DeyMK8USWs9ijzAXNy2azA3soajfrXjUNiJBdSJJsvMJ' | |
93 | 94 | let l = "3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA" | |
94 | - | let m = "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD" | |
95 | + | let m = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA') | |
96 | + | let n = Address(base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD') | |
97 | + | let o = "3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD" | |
95 | 98 | let c = toBase58String(a.caller.bytes) | |
96 | - | let n = Address(base58'3N1QzUHdfyXmKVFAn9TPHG7iuW4uK53pfXA') | |
97 | - | let o = Address(base58'3NCMrhPAVqXgtLdpi2BhFWpJkMBUAFrozbD') | |
98 | 99 | let p = { | |
99 | 100 | let e = getInteger(this, c) | |
100 | 101 | if ($isInstanceOf(e, "Int")) | |
101 | 102 | then { | |
102 | 103 | let f = e | |
103 | 104 | f | |
104 | 105 | } | |
105 | 106 | else 0 | |
106 | 107 | } | |
107 | 108 | let q = { | |
108 | - | let e = getInteger(this, | |
109 | + | let e = getInteger(this, o) | |
109 | 110 | if ($isInstanceOf(e, "Int")) | |
110 | 111 | then { | |
111 | 112 | let f = e | |
112 | 113 | f | |
113 | 114 | } | |
114 | 115 | else 0 | |
115 | 116 | } | |
116 | 117 | if ((q == 0)) | |
117 | 118 | then throw("No prize to Claim") | |
118 | 119 | else if ((c != l)) | |
119 | 120 | then throw("You are not the winner hence cannot claim the reward") | |
120 | 121 | else if ((p > 0)) | |
121 | - | then ScriptResult(WriteSet([DataEntry(l, q), DataEntry( | |
122 | + | then ScriptResult(WriteSet([DataEntry(l, q), DataEntry(o, 0), DataEntry(c, 1)]), TransferSet([ScriptTransfer(m, q, h), ScriptTransfer(a.caller, 10, b)])) | |
122 | 123 | else throw("You need to have deposit in the Contract to claim reward") | |
123 | 124 | } | |
124 | 125 | ||
125 | 126 |
github/deemru/w8io/169f3d6 30.37 ms ◑