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