tx · BDAQ6YPipKd5NqK7orBhz4A3rHAEB4nKY5eYTPyb1fRm 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK: -0.01000000 Waves 2022.05.25 18:03 [2067355] smart account 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK > SELF 0.00000000 Waves
{ "type": 13, "id": "BDAQ6YPipKd5NqK7orBhz4A3rHAEB4nKY5eYTPyb1fRm", "fee": 1000000, "feeAssetId": null, "timestamp": 1653491018745, "version": 2, "chainId": 84, "sender": "3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK", "senderPublicKey": "2bV4VobJC5a6L6e7or9PFXQhQ1KtkZW1UYzjAvMzs6A8", "proofs": [ "4EyGCjdXmyHA7CspchvSJBcLRptrEEkN9MrzMXhQhT77eFLDPfqTHdqTUWrkpbzXPxcMTRKGFRXBKm3nHNdzuvWS" ], "script": "base64:AAIFAAAAAAAAABkIAhIAEgUKAwgICBIDCgEBEgcKBQgIAQEBAAAACwAAAAAEQlVzZAEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAABFVTRFQBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAARVU0RDAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAADQlRDAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAADRVRIAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAADQk5CAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAAEVVNETgEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAABEhBU0gBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAARLVVNEAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0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AAAAAAAAZAUAAAAJQXNzZXRVc2VkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAC0FkZHJlc3NVc2VyCQAAaQAAAAIJAABoAAAAAgUAAAAGVG9Vc2VyBQAAAAZhbW91bnQAAAAAAAAAAGQFAAAACUFzc2V0VXNlZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAlkQXBwRnJlZXMJAABpAAAAAgkAAGgAAAACBQAAAAhBZG1pbkZlZQUAAAAGYW1vdW50AAAAAAAAAABkBQAAAAlBc3NldFVzZWQFAAAAA25pbAUAAAAJQXNzZXRVc2VkAAAAAFbMPX8=", "height": 2067355, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DjR6GxTsN1sWxnpFzBg4ns7bZTzAzedXWgQdxAuRjTtG Next: 6xL2s9q3MjmTvErTFRHvR3sx3bCi13BtoXgGu7Y8fxZW Diff:
Old | New | Differences | |
---|---|---|---|
140 | 140 | ||
141 | 141 | ||
142 | 142 | @Callable(l) | |
143 | - | func AdminTransfer (H,I,J) = if ((l.caller.bytes != k)) | |
143 | + | func AdminTransfer (H,I,J,K,L) = if ((l.caller.bytes != k)) | |
144 | 144 | then throw("Only Admin can do this") | |
145 | - | else { | |
146 | - | let p = (H + "_Payment") | |
147 | - | let o = (H + "_Freelancer") | |
148 | - | let w = (toBase58String(l.caller.bytes) + "_Asset") | |
149 | - | let q = { | |
150 | - | let r = getInteger(this, p) | |
151 | - | if ($isInstanceOf(r, "Int")) | |
152 | - | then { | |
153 | - | let s = r | |
154 | - | s | |
155 | - | } | |
156 | - | else 0 | |
145 | + | else if ((((K + J) + L) != 100)) | |
146 | + | then throw("Total of Percentages cannot be different from 100%") | |
147 | + | else { | |
148 | + | let p = (H + "_Payment") | |
149 | + | let o = (H + "_Freelancer") | |
150 | + | let w = (toBase58String(l.caller.bytes) + "_Asset") | |
151 | + | let q = { | |
152 | + | let r = getInteger(this, p) | |
153 | + | if ($isInstanceOf(r, "Int")) | |
154 | + | then { | |
155 | + | let s = r | |
156 | + | s | |
157 | + | } | |
158 | + | else 0 | |
159 | + | } | |
160 | + | let z = getStringValue(this, o) | |
161 | + | let B = addressFromStringValue(z) | |
162 | + | let A = getStringValue(this, w) | |
163 | + | let C = Address(j) | |
164 | + | let M = addressFromStringValue(H) | |
165 | + | let u = if ((A == "Waves")) | |
166 | + | then unit | |
167 | + | else fromBase58String(A) | |
168 | + | if ((q == 0)) | |
169 | + | then throw("User's balance is 0 BUsdc cannot realize any payment") | |
170 | + | else $Tuple2([IntegerEntry((H + "_Payment"), 0), ScriptTransfer(B, ((J * q) / 100), u), ScriptTransfer(M, ((K * q) / 100), u), ScriptTransfer(C, ((L * q) / 100), u)], u) | |
157 | 171 | } | |
158 | - | let z = getStringValue(this, o) | |
159 | - | let B = addressFromStringValue(z) | |
160 | - | let A = getStringValue(this, w) | |
161 | - | let C = Address(j) | |
162 | - | let K = addressFromStringValue(H) | |
163 | - | let u = if ((A == "Waves")) | |
164 | - | then unit | |
165 | - | else fromBase58String(A) | |
166 | - | if ((q == 0)) | |
167 | - | then throw("User's balance is 0 BUsdc cannot realize any payment") | |
168 | - | else $Tuple2([IntegerEntry((H + "_Payment"), 0), ScriptTransfer(B, ((J * (95 * q)) / 10000), u), ScriptTransfer(K, (((100 - J) * (95 * q)) / 10000), u), ScriptTransfer(C, ((5 * q) / 100), u)], u) | |
169 | - | } | |
170 | 172 | ||
171 | 173 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
5 | 5 | ||
6 | 6 | let b = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
7 | 7 | ||
8 | 8 | let c = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
9 | 9 | ||
10 | 10 | let d = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
11 | 11 | ||
12 | 12 | let e = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
13 | 13 | ||
14 | 14 | let f = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
15 | 15 | ||
16 | 16 | let g = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
17 | 17 | ||
18 | 18 | let h = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
19 | 19 | ||
20 | 20 | let i = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
21 | 21 | ||
22 | 22 | let j = base58'3N9Lfz79kZAEUupwESSboYFyygo1nQguVXo' | |
23 | 23 | ||
24 | 24 | let k = base58'3Mx3pn4yMcBccM59UrDGjbbAkVsRYBw38tB' | |
25 | 25 | ||
26 | 26 | @Callable(l) | |
27 | 27 | func Reset () = [IntegerEntry((toBase58String(l.caller.bytes) + "_Payment"), 0), IntegerEntry((toBase58String(l.caller.bytes) + "_Paidtrx"), 0)] | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(l) | |
32 | 32 | func DepositFunds (m,n,o) = { | |
33 | 33 | let p = (toBase58String(l.caller.bytes) + "_Payment") | |
34 | 34 | let q = { | |
35 | 35 | let r = getInteger(this, p) | |
36 | 36 | if ($isInstanceOf(r, "Int")) | |
37 | 37 | then { | |
38 | 38 | let s = r | |
39 | 39 | s | |
40 | 40 | } | |
41 | 41 | else 0 | |
42 | 42 | } | |
43 | 43 | if ((q != 0)) | |
44 | 44 | then throw("You have already deposited funds, deposits can only be done once") | |
45 | 45 | else { | |
46 | 46 | let t = if ((size(l.payments) == 1)) | |
47 | 47 | then l.payments[0] | |
48 | 48 | else throw("Attached payment is required") | |
49 | 49 | if (if (if (if (if (if (if (if (if (if ((t.assetId != a)) | |
50 | 50 | then (t.assetId != b) | |
51 | 51 | else false) | |
52 | 52 | then (t.assetId != c) | |
53 | 53 | else false) | |
54 | 54 | then (t.assetId != d) | |
55 | 55 | else false) | |
56 | 56 | then (t.assetId != e) | |
57 | 57 | else false) | |
58 | 58 | then (t.assetId != f) | |
59 | 59 | else false) | |
60 | 60 | then (t.assetId != g) | |
61 | 61 | else false) | |
62 | 62 | then (t.assetId != h) | |
63 | 63 | else false) | |
64 | 64 | then (t.assetId != i) | |
65 | 65 | else false) | |
66 | 66 | then isDefined(t.assetId) | |
67 | 67 | else false) | |
68 | 68 | then throw("Can only deposit accepted tokens") | |
69 | 69 | else if (if (if ((m == "")) | |
70 | 70 | then true | |
71 | 71 | else (n == "")) | |
72 | 72 | then true | |
73 | 73 | else (o == "")) | |
74 | 74 | then throw("Job Scope, Deliverables desc and Freelancer Wallet Address cannot be empty") | |
75 | 75 | else { | |
76 | 76 | let u = if (isDefined(t.assetId)) | |
77 | 77 | then toBase58String(value(t.assetId)) | |
78 | 78 | else "Waves" | |
79 | 79 | [StringEntry((toBase58String(l.caller.bytes) + "_Scope"), m), StringEntry((toBase58String(l.caller.bytes) + "_Deliv"), n), StringEntry((toBase58String(l.caller.bytes) + "_Asset"), u), StringEntry((toBase58String(l.caller.bytes) + "_Freelancer"), o), IntegerEntry((toBase58String(l.caller.bytes) + "_Payment"), t.amount)] | |
80 | 80 | } | |
81 | 81 | } | |
82 | 82 | } | |
83 | 83 | ||
84 | 84 | ||
85 | 85 | ||
86 | 86 | @Callable(l) | |
87 | 87 | func PayFreelancer (v) = { | |
88 | 88 | let p = (toBase58String(l.caller.bytes) + "_Payment") | |
89 | 89 | let o = (toBase58String(l.caller.bytes) + "_Freelancer") | |
90 | 90 | let w = (toBase58String(l.caller.bytes) + "_Asset") | |
91 | 91 | let x = (toBase58String(l.caller.bytes) + "_Paidtrx") | |
92 | 92 | let q = { | |
93 | 93 | let r = getInteger(this, p) | |
94 | 94 | if ($isInstanceOf(r, "Int")) | |
95 | 95 | then { | |
96 | 96 | let s = r | |
97 | 97 | s | |
98 | 98 | } | |
99 | 99 | else 0 | |
100 | 100 | } | |
101 | 101 | let y = { | |
102 | 102 | let r = getInteger(this, x) | |
103 | 103 | if ($isInstanceOf(r, "Int")) | |
104 | 104 | then { | |
105 | 105 | let s = r | |
106 | 106 | s | |
107 | 107 | } | |
108 | 108 | else 0 | |
109 | 109 | } | |
110 | 110 | let z = getStringValue(this, o) | |
111 | 111 | let A = getStringValue(this, w) | |
112 | 112 | let B = addressFromStringValue(z) | |
113 | 113 | let C = Address(j) | |
114 | 114 | let u = if ((A == "Waves")) | |
115 | 115 | then unit | |
116 | 116 | else fromBase58String(A) | |
117 | 117 | if ((0 >= (((95 * q) / 100) - (v * 100000000)))) | |
118 | 118 | then throw(("You do not have enough funds to make payment, your available funds are: " + toString((q / 100000000)))) | |
119 | 119 | else if (if ((y >= 12)) | |
120 | 120 | then (q > 0) | |
121 | 121 | else false) | |
122 | 122 | then throw("You have already done 12 payments, you cannot make more payments") | |
123 | 123 | else { | |
124 | 124 | let D = if ((y == 11)) | |
125 | 125 | then 0 | |
126 | 126 | else (q - (v * 100000000)) | |
127 | 127 | let E = if ((y == 11)) | |
128 | 128 | then ((95 * q) / 100) | |
129 | 129 | else ((95 * v) * 1000000) | |
130 | 130 | let F = if ((y == 11)) | |
131 | 131 | then ((5 * q) / 100) | |
132 | 132 | else ((5 * v) * 1000000) | |
133 | 133 | let G = if ((y == 11)) | |
134 | 134 | then 0 | |
135 | 135 | else (y + 1) | |
136 | 136 | $Tuple2([IntegerEntry((toBase58String(l.caller.bytes) + "_Payment"), D), IntegerEntry((toBase58String(l.caller.bytes) + "_Paidtrx"), G), ScriptTransfer(B, E, u), ScriptTransfer(C, F, u)], u) | |
137 | 137 | } | |
138 | 138 | } | |
139 | 139 | ||
140 | 140 | ||
141 | 141 | ||
142 | 142 | @Callable(l) | |
143 | - | func AdminTransfer (H,I,J) = if ((l.caller.bytes != k)) | |
143 | + | func AdminTransfer (H,I,J,K,L) = if ((l.caller.bytes != k)) | |
144 | 144 | then throw("Only Admin can do this") | |
145 | - | else { | |
146 | - | let p = (H + "_Payment") | |
147 | - | let o = (H + "_Freelancer") | |
148 | - | let w = (toBase58String(l.caller.bytes) + "_Asset") | |
149 | - | let q = { | |
150 | - | let r = getInteger(this, p) | |
151 | - | if ($isInstanceOf(r, "Int")) | |
152 | - | then { | |
153 | - | let s = r | |
154 | - | s | |
155 | - | } | |
156 | - | else 0 | |
145 | + | else if ((((K + J) + L) != 100)) | |
146 | + | then throw("Total of Percentages cannot be different from 100%") | |
147 | + | else { | |
148 | + | let p = (H + "_Payment") | |
149 | + | let o = (H + "_Freelancer") | |
150 | + | let w = (toBase58String(l.caller.bytes) + "_Asset") | |
151 | + | let q = { | |
152 | + | let r = getInteger(this, p) | |
153 | + | if ($isInstanceOf(r, "Int")) | |
154 | + | then { | |
155 | + | let s = r | |
156 | + | s | |
157 | + | } | |
158 | + | else 0 | |
159 | + | } | |
160 | + | let z = getStringValue(this, o) | |
161 | + | let B = addressFromStringValue(z) | |
162 | + | let A = getStringValue(this, w) | |
163 | + | let C = Address(j) | |
164 | + | let M = addressFromStringValue(H) | |
165 | + | let u = if ((A == "Waves")) | |
166 | + | then unit | |
167 | + | else fromBase58String(A) | |
168 | + | if ((q == 0)) | |
169 | + | then throw("User's balance is 0 BUsdc cannot realize any payment") | |
170 | + | else $Tuple2([IntegerEntry((H + "_Payment"), 0), ScriptTransfer(B, ((J * q) / 100), u), ScriptTransfer(M, ((K * q) / 100), u), ScriptTransfer(C, ((L * q) / 100), u)], u) | |
157 | 171 | } | |
158 | - | let z = getStringValue(this, o) | |
159 | - | let B = addressFromStringValue(z) | |
160 | - | let A = getStringValue(this, w) | |
161 | - | let C = Address(j) | |
162 | - | let K = addressFromStringValue(H) | |
163 | - | let u = if ((A == "Waves")) | |
164 | - | then unit | |
165 | - | else fromBase58String(A) | |
166 | - | if ((q == 0)) | |
167 | - | then throw("User's balance is 0 BUsdc cannot realize any payment") | |
168 | - | else $Tuple2([IntegerEntry((H + "_Payment"), 0), ScriptTransfer(B, ((J * (95 * q)) / 10000), u), ScriptTransfer(K, (((100 - J) * (95 * q)) / 10000), u), ScriptTransfer(C, ((5 * q) / 100), u)], u) | |
169 | - | } | |
170 | 172 | ||
171 | 173 |
github/deemru/w8io/026f985 29.61 ms ◑