tx · DjR6GxTsN1sWxnpFzBg4ns7bZTzAzedXWgQdxAuRjTtG 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK: -0.01000000 Waves 2022.05.24 21:49 [2066150] smart account 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK > SELF 0.00000000 Waves
{ "type": 13, "id": "DjR6GxTsN1sWxnpFzBg4ns7bZTzAzedXWgQdxAuRjTtG", "fee": 1000000, "feeAssetId": null, "timestamp": 1653418157029, "version": 2, "chainId": 84, "sender": "3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK", "senderPublicKey": "2bV4VobJC5a6L6e7or9PFXQhQ1KtkZW1UYzjAvMzs6A8", "proofs": [ "4MXg5DK3c9ZzpYbwrY9RZiS515Lhe2pduvQDQ8PPSac8sUYzJEsSRMGNz9tmU1QEvuX1m9wvLGBKZybDv1VAnBVw" ], "script": "base64:AAIFAAAAAAAAABcIAhIAEgUKAwgICBIDCgEBEgUKAwgIAQAAAAsAAAAABEJVc2QBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAARVU0RUAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAAEVVNEQwEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAAA0JUQwEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAAA0VUSAEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAAA0JOQgEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAABFVTRE4BAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAARIQVNIAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAAES1VTRAEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/w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AAABmFtb3VudAAAAAAAAAAnEAUAAAAJQXNzZXRVc2VkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAACWRBcHBGcmVlcwkAAGkAAAACCQAAaAAAAAIAAAAAAAAAAAUFAAAABmFtb3VudAAAAAAAAAAAZAUAAAAJQXNzZXRVc2VkBQAAAANuaWwFAAAACUFzc2V0VXNlZAAAAACHPmJY", "height": 2066150, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F6xxpowR3N1B1kdumxuLJazgTXWggcUmoEQBfZbmpmhu Next: BDAQ6YPipKd5NqK7orBhz4A3rHAEB4nKY5eYTPyb1fRm Diff:
Old | New | Differences | |
---|---|---|---|
103 | 103 | let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr) | |
104 | 104 | let dAppFrees = Address(dAppFees) | |
105 | 105 | let AssetUsed = if ((PaymentAssetId == "Waves")) | |
106 | - | then | |
107 | - | else | |
106 | + | then unit | |
107 | + | else fromBase58String(PaymentAssetId) | |
108 | 108 | if ((0 >= (((95 * amount) / 100) - (PayFreelancer * 100000000)))) | |
109 | 109 | then throw(("You do not have enough funds to make payment, your available funds are: " + toString((amount / 100000000)))) | |
110 | 110 | else if (if ((PaidtrxLast >= 12)) | |
124 | 124 | let PaidtrxValue = if ((PaidtrxLast == 11)) | |
125 | 125 | then 0 | |
126 | 126 | else (PaidtrxLast + 1) | |
127 | - | $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), PaidtrxValue), ScriptTransfer(AddressFreeLancer, Payment2Freelance, | |
127 | + | $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), PaidtrxValue), ScriptTransfer(AddressFreeLancer, Payment2Freelance, AssetUsed), ScriptTransfer(dAppFrees, FeePaid, AssetUsed)], AssetUsed) | |
128 | 128 | } | |
129 | 129 | } | |
130 | 130 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let BUsd = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
5 | 5 | ||
6 | 6 | let USDT = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
7 | 7 | ||
8 | 8 | let USDC = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
9 | 9 | ||
10 | 10 | let BTC = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
11 | 11 | ||
12 | 12 | let ETH = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
13 | 13 | ||
14 | 14 | let BNB = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
15 | 15 | ||
16 | 16 | let USDN = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
17 | 17 | ||
18 | 18 | let HASH = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
19 | 19 | ||
20 | 20 | let KUSD = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k' | |
21 | 21 | ||
22 | 22 | let dAppFees = base58'3N9Lfz79kZAEUupwESSboYFyygo1nQguVXo' | |
23 | 23 | ||
24 | 24 | let AdmindApp = base58'3Mx3pn4yMcBccM59UrDGjbbAkVsRYBw38tB' | |
25 | 25 | ||
26 | 26 | @Callable(i) | |
27 | 27 | func Reset () = [IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), 0), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), 0)] | |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | 31 | @Callable(i) | |
32 | 32 | func DepositFunds (ScopeDesc,Deliverables,FreelancerAddress) = { | |
33 | 33 | let FreeLancerPayment = (toBase58String(i.caller.bytes) + "_Payment") | |
34 | 34 | let amount = match getInteger(this, FreeLancerPayment) { | |
35 | 35 | case a: Int => | |
36 | 36 | a | |
37 | 37 | case _ => | |
38 | 38 | 0 | |
39 | 39 | } | |
40 | 40 | if ((amount != 0)) | |
41 | 41 | then throw("You have already deposited funds, deposits can only be done once") | |
42 | 42 | else { | |
43 | 43 | let pmt = if ((size(i.payments) == 1)) | |
44 | 44 | then i.payments[0] | |
45 | 45 | else throw("Attached payment is required") | |
46 | 46 | if (if (if (if (if (if (if (if (if (if ((pmt.assetId != BUsd)) | |
47 | 47 | then (pmt.assetId != USDT) | |
48 | 48 | else false) | |
49 | 49 | then (pmt.assetId != USDC) | |
50 | 50 | else false) | |
51 | 51 | then (pmt.assetId != BTC) | |
52 | 52 | else false) | |
53 | 53 | then (pmt.assetId != ETH) | |
54 | 54 | else false) | |
55 | 55 | then (pmt.assetId != BNB) | |
56 | 56 | else false) | |
57 | 57 | then (pmt.assetId != USDN) | |
58 | 58 | else false) | |
59 | 59 | then (pmt.assetId != HASH) | |
60 | 60 | else false) | |
61 | 61 | then (pmt.assetId != KUSD) | |
62 | 62 | else false) | |
63 | 63 | then isDefined(pmt.assetId) | |
64 | 64 | else false) | |
65 | 65 | then throw("Can only deposit accepted tokens") | |
66 | 66 | else if (if (if ((ScopeDesc == "")) | |
67 | 67 | then true | |
68 | 68 | else (Deliverables == "")) | |
69 | 69 | then true | |
70 | 70 | else (FreelancerAddress == "")) | |
71 | 71 | then throw("Job Scope, Deliverables desc and Freelancer Wallet Address cannot be empty") | |
72 | 72 | else { | |
73 | 73 | let AssetUsed = if (isDefined(pmt.assetId)) | |
74 | 74 | then toBase58String(value(pmt.assetId)) | |
75 | 75 | else "Waves" | |
76 | 76 | [StringEntry((toBase58String(i.caller.bytes) + "_Scope"), ScopeDesc), StringEntry((toBase58String(i.caller.bytes) + "_Deliv"), Deliverables), StringEntry((toBase58String(i.caller.bytes) + "_Asset"), AssetUsed), StringEntry((toBase58String(i.caller.bytes) + "_Freelancer"), FreelancerAddress), IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), pmt.amount)] | |
77 | 77 | } | |
78 | 78 | } | |
79 | 79 | } | |
80 | 80 | ||
81 | 81 | ||
82 | 82 | ||
83 | 83 | @Callable(i) | |
84 | 84 | func PayFreelancer (PayFreelancer) = { | |
85 | 85 | let FreeLancerPayment = (toBase58String(i.caller.bytes) + "_Payment") | |
86 | 86 | let FreelancerAddress = (toBase58String(i.caller.bytes) + "_Freelancer") | |
87 | 87 | let PaymentAsset = (toBase58String(i.caller.bytes) + "_Asset") | |
88 | 88 | let Paidtrx = (toBase58String(i.caller.bytes) + "_Paidtrx") | |
89 | 89 | let amount = match getInteger(this, FreeLancerPayment) { | |
90 | 90 | case a: Int => | |
91 | 91 | a | |
92 | 92 | case _ => | |
93 | 93 | 0 | |
94 | 94 | } | |
95 | 95 | let PaidtrxLast = match getInteger(this, Paidtrx) { | |
96 | 96 | case a: Int => | |
97 | 97 | a | |
98 | 98 | case _ => | |
99 | 99 | 0 | |
100 | 100 | } | |
101 | 101 | let FreelancerAddressStr = getStringValue(this, FreelancerAddress) | |
102 | 102 | let PaymentAssetId = getStringValue(this, PaymentAsset) | |
103 | 103 | let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr) | |
104 | 104 | let dAppFrees = Address(dAppFees) | |
105 | 105 | let AssetUsed = if ((PaymentAssetId == "Waves")) | |
106 | - | then | |
107 | - | else | |
106 | + | then unit | |
107 | + | else fromBase58String(PaymentAssetId) | |
108 | 108 | if ((0 >= (((95 * amount) / 100) - (PayFreelancer * 100000000)))) | |
109 | 109 | then throw(("You do not have enough funds to make payment, your available funds are: " + toString((amount / 100000000)))) | |
110 | 110 | else if (if ((PaidtrxLast >= 12)) | |
111 | 111 | then (amount > 0) | |
112 | 112 | else false) | |
113 | 113 | then throw("You have already done 12 payments, you cannot make more payments") | |
114 | 114 | else { | |
115 | 115 | let UserAccount = if ((PaidtrxLast == 11)) | |
116 | 116 | then 0 | |
117 | 117 | else (amount - (PayFreelancer * 100000000)) | |
118 | 118 | let Payment2Freelance = if ((PaidtrxLast == 11)) | |
119 | 119 | then ((95 * amount) / 100) | |
120 | 120 | else ((95 * PayFreelancer) * 1000000) | |
121 | 121 | let FeePaid = if ((PaidtrxLast == 11)) | |
122 | 122 | then ((5 * amount) / 100) | |
123 | 123 | else ((5 * PayFreelancer) * 1000000) | |
124 | 124 | let PaidtrxValue = if ((PaidtrxLast == 11)) | |
125 | 125 | then 0 | |
126 | 126 | else (PaidtrxLast + 1) | |
127 | - | $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), PaidtrxValue), ScriptTransfer(AddressFreeLancer, Payment2Freelance, | |
127 | + | $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), PaidtrxValue), ScriptTransfer(AddressFreeLancer, Payment2Freelance, AssetUsed), ScriptTransfer(dAppFrees, FeePaid, AssetUsed)], AssetUsed) | |
128 | 128 | } | |
129 | 129 | } | |
130 | 130 | ||
131 | 131 | ||
132 | 132 | ||
133 | 133 | @Callable(i) | |
134 | 134 | func AdminTransfer (User,Freelancer,ToFreelancer) = if ((i.caller.bytes != AdmindApp)) | |
135 | 135 | then throw("Only Admin can do this") | |
136 | 136 | else { | |
137 | 137 | let FreeLancerPayment = (User + "_Payment") | |
138 | 138 | let FreelancerAddress = (User + "_Freelancer") | |
139 | 139 | let PaymentAsset = (toBase58String(i.caller.bytes) + "_Asset") | |
140 | 140 | let amount = match getInteger(this, FreeLancerPayment) { | |
141 | 141 | case a: Int => | |
142 | 142 | a | |
143 | 143 | case _ => | |
144 | 144 | 0 | |
145 | 145 | } | |
146 | 146 | let FreelancerAddressStr = getStringValue(this, FreelancerAddress) | |
147 | 147 | let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr) | |
148 | 148 | let PaymentAssetId = getStringValue(this, PaymentAsset) | |
149 | 149 | let dAppFrees = Address(dAppFees) | |
150 | 150 | let AddressUser = addressFromStringValue(User) | |
151 | 151 | let AssetUsed = if ((PaymentAssetId == "Waves")) | |
152 | 152 | then unit | |
153 | 153 | else fromBase58String(PaymentAssetId) | |
154 | 154 | if ((amount == 0)) | |
155 | 155 | then throw("User's balance is 0 BUsdc cannot realize any payment") | |
156 | 156 | else $Tuple2([IntegerEntry((User + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((ToFreelancer * (95 * amount)) / 10000), AssetUsed), ScriptTransfer(AddressUser, (((100 - ToFreelancer) * (95 * amount)) / 10000), AssetUsed), ScriptTransfer(dAppFrees, ((5 * amount) / 100), AssetUsed)], AssetUsed) | |
157 | 157 | } | |
158 | 158 | ||
159 | 159 |
github/deemru/w8io/026f985 57.05 ms ◑