tx · 2snY9xfwD3bJME647kqDUQgquex6pbmBRegfCE8mSCcj

3N9hj5xjfQdmxFKgztzxsQY9FSGSRM2RNTr:  -0.05000000 Waves

2019.10.18 23:48 [725961] smart account 3N9hj5xjfQdmxFKgztzxsQY9FSGSRM2RNTr > SELF 0.00000000 Waves

{ "type": 13, "id": "2snY9xfwD3bJME647kqDUQgquex6pbmBRegfCE8mSCcj", "fee": 5000000, "feeAssetId": null, "timestamp": 1571431364876, "version": 1, "sender": "3N9hj5xjfQdmxFKgztzxsQY9FSGSRM2RNTr", "senderPublicKey": "456duGZMs5yvsHurjiNQi2JtHjKtMj4WyRRRcVHzKWrb", "proofs": [ "3t4N2KvMqmUZaGkPAuXEujHkPCX5XhXxvhojnRarD8C8hKyugBL1sqHf1E6cwwHLXnPWKfsaosy6JyKWSzfvuMDB" ], "script": "base64:AAIDAAAAAAAAAA0IARIDCgEIEgQKAggIAAAAEgAAAAAEWUVBUgAAAAAHWPDfwAAAAAAFTU9OVEgJAABpAAAAAgUAAAAEWUVBUgAAAAAAAAAADAAAAAAFQURNSU4CAAAAIzNOQkRnUjhoVTZXODZTc3RuM0VHaWQ4azl1eGtxaUpqeFQ2AAAAAAVUT0tFTgEAAAAgxYrQlOWMQVAQFV8+63OMRt4C+0j9Xrs6Q7YHkRdAWuYAAAAABHdFVVIBAAAAIOwWYQRfe5EhQQY7N/Pn19T489PGDqqAl/OQv9D6FbqZAAAAAANXVlMAAAAAAAX14QAAAAAAC1BSSUNFeEJBU0lDAAAAAAAAAAA8AAAAAA5QUklDRXhBRFZBTkNFRAAAAAAAAAAAMgAAAAAFQkFTSUMCAAAABWJhc2ljAAAAAAhBRFZBTkNFRAIAAAAIYWR2YW5jZWQAAAAABE5PTkUCAAAABG5vbmUBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQE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AAABHBsYW4FAAAACWlzUmVuZXdhbAAAAAD/6CdP", "chainId": 84, "height": 725961, "spentComplexity": 0 } View: original | compacted Prev: 9WJkscDuER8wciaSGwAzS1qW1Qpz9zDbKZPQFwvVjW4e Next: 4YXsjdkUxU8EwYweskZ2ZMEFVW5ED2hTGsPdPfpZ1ey9 Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = 100000000
4+let a = 31556952000
55
6-let b = (1 * a)
6+let b = (a / 12)
77
8-let c = 31556952000
8+let c = "3NBDgR8hU6W86Sstn3EGid8k9uxkqiJjxT6"
99
1010 let d = base58'EJ85vmBXWEtV4yHLPRTxex4q4s9mC8jKUhheyjZxwnPw'
1111
12-let e = "none"
12+let e = base58'Gtb1WRznfchDnTh37ezoDTJ4wcoKaRsKqKjJjy7nm2zU'
1313
14-func f (g) = {
15- let h = getInteger(this, g)
16- if ($isInstanceOf(h, "Int"))
14+let f = 100000000
15+
16+let g = 60
17+
18+let h = 50
19+
20+let i = "basic"
21+
22+let j = "advanced"
23+
24+let k = "none"
25+
26+func l (m) = {
27+ let n = getInteger(this, m)
28+ if ($isInstanceOf(n, "Int"))
1729 then {
18- let i = h
19- i
30+ let o = n
31+ o
2032 }
2133 else 0
2234 }
2335
2436
25-func j (g) = {
26- let h = getString(this, g)
27- if ($isInstanceOf(h, "String"))
37+func p (m) = {
38+ let n = getString(this, m)
39+ if ($isInstanceOf(n, "String"))
2840 then {
29- let k = h
30- k
41+ let q = n
42+ q
3143 }
32- else e
44+ else k
3345 }
3446
3547
36-func l (m) = (("member_" + m) + "subscription_ts")
48+func r (s) = (("member_" + s) + "_subscription_end")
3749
3850
39-func n (m) = (("member_" + m) + "_fee")
51+func t (s) = (("member_" + s) + "_plan")
4052
4153
42-func o (m) = (("member_" + m) + "_group")
54+func u (v) = TransferSet([ScriptTransfer(v, 1, d)])
4355
4456
45-func p (m) = (("member_" + m) + "_balance")
57+func w (v,x,y) = WriteSet([DataEntry(r(v), (lastBlock.timestamp + x)), DataEntry(t(v), y)])
4658
4759
48-@Callable(q)
49-func subscribe () = {
50- let r = extract(q.payment)
51- if (isDefined(r.assetId))
52- then throw("can use only WAVES token at the moment")
60+func z (A,x,y,B) = {
61+ let v = toBase58String(A.bytes)
62+ if (B)
63+ then w(v, a, y)
64+ else ScriptResult(w(v, a, y), u(A))
65+ }
66+
67+
68+@Callable(C)
69+func subscribe (y) = {
70+ let D = extract(C.payment)
71+ if ((D.assetId != e))
72+ then throw("can use only wEUR token at the moment")
5373 else {
54- let s = toBase58String(q.caller.bytes)
55- let t = f(l(s))
56- if ((b > r.amount))
57- then throw("payment amount cannot be lowher then subscription fee")
58- else if ((t != 0))
59- then throw("Already subscribed")
60- else ScriptResult(WriteSet([DataEntry(l(s), lastBlock.timestamp), DataEntry(n(s), b), DataEntry(p(s), 0)]), TransferSet([ScriptTransfer(q.caller, 1, d)]))
74+ let v = toBase58String(C.caller.bytes)
75+ let E = l(r(v))
76+ let B = (E == 0)
77+ if ((y == i))
78+ then if ((g > D.amount))
79+ then throw("unsufficient payment amount for basic plan")
80+ else z(C.caller, a, y, B)
81+ else if ((y == j))
82+ then if ((h > D.amount))
83+ then throw("unsufficient payment amount for advanced plan")
84+ else z(C.caller, b, y, B)
85+ else throw(("subscription to an unknown plan: " + y))
6186 }
6287 }
6388
6489
6590
66-@Callable(q)
67-func renew () = {
68- let r = extract(q.payment)
69- if (isDefined(r.assetId))
70- then throw("can use only WAVES token at the moment")
91+@Callable(C)
92+func subscribeUser (F,y) = {
93+ let v = toBase58String(C.caller.bytes)
94+ let G = toBase58String(this.bytes)
95+ if (if ((v != c))
96+ then (v != G)
97+ else false)
98+ then throw("only admins can do that")
7199 else {
72- let s = toBase58String(q.caller.bytes)
73- let t = f(l(s))
74- let u = f(n(s))
75- if ((t == 0))
76- then throw("subscribe first")
77- else if ((u > r.amount))
78- then throw("payment amount cannot be lower then renewal fee")
79- else ScriptResult(WriteSet([DataEntry(l(s), (t + c))]), TransferSet([ScriptTransfer(q.caller, 1, d)]))
100+ let E = l(r(F))
101+ let B = (E == 0)
102+ let x = if ((y == i))
103+ then a
104+ else if ((y == j))
105+ then b
106+ else throw(("subscription to an unknown plan: " + y))
107+ z(C.caller, x, y, B)
80108 }
81109 }
82110
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let a = 100000000
4+let a = 31556952000
55
6-let b = (1 * a)
6+let b = (a / 12)
77
8-let c = 31556952000
8+let c = "3NBDgR8hU6W86Sstn3EGid8k9uxkqiJjxT6"
99
1010 let d = base58'EJ85vmBXWEtV4yHLPRTxex4q4s9mC8jKUhheyjZxwnPw'
1111
12-let e = "none"
12+let e = base58'Gtb1WRznfchDnTh37ezoDTJ4wcoKaRsKqKjJjy7nm2zU'
1313
14-func f (g) = {
15- let h = getInteger(this, g)
16- if ($isInstanceOf(h, "Int"))
14+let f = 100000000
15+
16+let g = 60
17+
18+let h = 50
19+
20+let i = "basic"
21+
22+let j = "advanced"
23+
24+let k = "none"
25+
26+func l (m) = {
27+ let n = getInteger(this, m)
28+ if ($isInstanceOf(n, "Int"))
1729 then {
18- let i = h
19- i
30+ let o = n
31+ o
2032 }
2133 else 0
2234 }
2335
2436
25-func j (g) = {
26- let h = getString(this, g)
27- if ($isInstanceOf(h, "String"))
37+func p (m) = {
38+ let n = getString(this, m)
39+ if ($isInstanceOf(n, "String"))
2840 then {
29- let k = h
30- k
41+ let q = n
42+ q
3143 }
32- else e
44+ else k
3345 }
3446
3547
36-func l (m) = (("member_" + m) + "subscription_ts")
48+func r (s) = (("member_" + s) + "_subscription_end")
3749
3850
39-func n (m) = (("member_" + m) + "_fee")
51+func t (s) = (("member_" + s) + "_plan")
4052
4153
42-func o (m) = (("member_" + m) + "_group")
54+func u (v) = TransferSet([ScriptTransfer(v, 1, d)])
4355
4456
45-func p (m) = (("member_" + m) + "_balance")
57+func w (v,x,y) = WriteSet([DataEntry(r(v), (lastBlock.timestamp + x)), DataEntry(t(v), y)])
4658
4759
48-@Callable(q)
49-func subscribe () = {
50- let r = extract(q.payment)
51- if (isDefined(r.assetId))
52- then throw("can use only WAVES token at the moment")
60+func z (A,x,y,B) = {
61+ let v = toBase58String(A.bytes)
62+ if (B)
63+ then w(v, a, y)
64+ else ScriptResult(w(v, a, y), u(A))
65+ }
66+
67+
68+@Callable(C)
69+func subscribe (y) = {
70+ let D = extract(C.payment)
71+ if ((D.assetId != e))
72+ then throw("can use only wEUR token at the moment")
5373 else {
54- let s = toBase58String(q.caller.bytes)
55- let t = f(l(s))
56- if ((b > r.amount))
57- then throw("payment amount cannot be lowher then subscription fee")
58- else if ((t != 0))
59- then throw("Already subscribed")
60- else ScriptResult(WriteSet([DataEntry(l(s), lastBlock.timestamp), DataEntry(n(s), b), DataEntry(p(s), 0)]), TransferSet([ScriptTransfer(q.caller, 1, d)]))
74+ let v = toBase58String(C.caller.bytes)
75+ let E = l(r(v))
76+ let B = (E == 0)
77+ if ((y == i))
78+ then if ((g > D.amount))
79+ then throw("unsufficient payment amount for basic plan")
80+ else z(C.caller, a, y, B)
81+ else if ((y == j))
82+ then if ((h > D.amount))
83+ then throw("unsufficient payment amount for advanced plan")
84+ else z(C.caller, b, y, B)
85+ else throw(("subscription to an unknown plan: " + y))
6186 }
6287 }
6388
6489
6590
66-@Callable(q)
67-func renew () = {
68- let r = extract(q.payment)
69- if (isDefined(r.assetId))
70- then throw("can use only WAVES token at the moment")
91+@Callable(C)
92+func subscribeUser (F,y) = {
93+ let v = toBase58String(C.caller.bytes)
94+ let G = toBase58String(this.bytes)
95+ if (if ((v != c))
96+ then (v != G)
97+ else false)
98+ then throw("only admins can do that")
7199 else {
72- let s = toBase58String(q.caller.bytes)
73- let t = f(l(s))
74- let u = f(n(s))
75- if ((t == 0))
76- then throw("subscribe first")
77- else if ((u > r.amount))
78- then throw("payment amount cannot be lower then renewal fee")
79- else ScriptResult(WriteSet([DataEntry(l(s), (t + c))]), TransferSet([ScriptTransfer(q.caller, 1, d)]))
100+ let E = l(r(F))
101+ let B = (E == 0)
102+ let x = if ((y == i))
103+ then a
104+ else if ((y == j))
105+ then b
106+ else throw(("subscription to an unknown plan: " + y))
107+ z(C.caller, x, y, B)
80108 }
81109 }
82110
83111

github/deemru/w8io/169f3d6 
40.24 ms