tx · HwW2NWCQKXQyZQ5C7ULZVk4SBW1932oc9D6q8cxKLCAU 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK: -0.01000000 Waves 2022.05.23 19:06 [2064550] smart account 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK > SELF 0.00000000 Waves
{ "type": 13, "id": "HwW2NWCQKXQyZQ5C7ULZVk4SBW1932oc9D6q8cxKLCAU", "fee": 1000000, "feeAssetId": null, "timestamp": 1653321971227, "version": 2, "chainId": 84, "sender": "3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK", "senderPublicKey": "2bV4VobJC5a6L6e7or9PFXQhQ1KtkZW1UYzjAvMzs6A8", "proofs": [ "ZFYFSXxbKtMMtoB2sjrwz36aWNRZgp7g2W8DqgHB6Eka6usZi8siYsUuBJaVgUMH4ZgVdVqjBgAWDuZt9i9ktv6" ], "script": "base64:AAIFAAAAAAAAABUIAhIFCgMICAgSAwoBARIFCgMICAEAAAALAAAAAARCVXNkAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAAEVVNEVAEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAABFVTREMBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAANCVEMBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAANFVEgBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAANCTkIBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAARVU0ROAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAAESEFTSAEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAABEtVU0QBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3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zZmVyAAAAAwUAAAAJZEFwcEZyZWVzCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQUAAAAGYW1vdW50AAAAAAAAAABkBQAAAARCVXNkBQAAAANuaWwFAAAABEJVc2QAAAAAb7QgVQ==", "height": 2064550, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5EvwzSL3Mw6aZNm7SzXGx1nLLSXB5dE6kNJo8E9RpdU4 Next: Gn7frxoYTVgijfn9n2MkD4HmnzA5R5exDpwvXttFE3sP Diff:
Old | New | Differences | |
---|---|---|---|
28 | 28 | let pmt = if ((size(i.payments) == 1)) | |
29 | 29 | then i.payments[0] | |
30 | 30 | else throw("Attached payment is required") | |
31 | - | | |
31 | + | if (if (if (if (if (if (if (if (if ((pmt.assetId != BUsd)) | |
32 | 32 | then (pmt.assetId != USDT) | |
33 | 33 | else false) | |
34 | 34 | then (pmt.assetId != USDC) | |
44 | 44 | then (pmt.assetId != HASH) | |
45 | 45 | else false) | |
46 | 46 | then (pmt.assetId != KUSD) | |
47 | - | else false) | |
48 | - | then isDefined(pmt.assetId) | |
49 | 47 | else false) | |
50 | 48 | then if (if (if ((ScopeDesc == "")) | |
51 | 49 | then true |
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 DepositFunds (ScopeDesc,Deliverables,FreelancerAddress) = { | |
28 | 28 | let pmt = if ((size(i.payments) == 1)) | |
29 | 29 | then i.payments[0] | |
30 | 30 | else throw("Attached payment is required") | |
31 | - | | |
31 | + | if (if (if (if (if (if (if (if (if ((pmt.assetId != BUsd)) | |
32 | 32 | then (pmt.assetId != USDT) | |
33 | 33 | else false) | |
34 | 34 | then (pmt.assetId != USDC) | |
35 | 35 | else false) | |
36 | 36 | then (pmt.assetId != BTC) | |
37 | 37 | else false) | |
38 | 38 | then (pmt.assetId != ETH) | |
39 | 39 | else false) | |
40 | 40 | then (pmt.assetId != BNB) | |
41 | 41 | else false) | |
42 | 42 | then (pmt.assetId != USDN) | |
43 | 43 | else false) | |
44 | 44 | then (pmt.assetId != HASH) | |
45 | 45 | else false) | |
46 | 46 | then (pmt.assetId != KUSD) | |
47 | - | else false) | |
48 | - | then isDefined(pmt.assetId) | |
49 | 47 | else false) | |
50 | 48 | then if (if (if ((ScopeDesc == "")) | |
51 | 49 | then true | |
52 | 50 | else (Deliverables == "")) | |
53 | 51 | then true | |
54 | 52 | else (FreelancerAddress == "")) | |
55 | 53 | then throw("Job Scope, Deliverables desc and Freelancer Wallet Address cannot be empty") | |
56 | 54 | else [StringEntry((toBase58String(i.caller.bytes) + "_Scope"), ScopeDesc), StringEntry((toBase58String(i.caller.bytes) + "_Deliv"), Deliverables), StringEntry((toBase58String(i.caller.bytes) + "_Freelancer"), FreelancerAddress), IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), pmt.amount)] | |
57 | 55 | else throw("Can only deposit accepted tokens") | |
58 | 56 | } | |
59 | 57 | ||
60 | 58 | ||
61 | 59 | ||
62 | 60 | @Callable(i) | |
63 | 61 | func PayFreelancer (PayFreelancer) = { | |
64 | 62 | let FreeLancerPayment = (toBase58String(i.caller.bytes) + "_Payment") | |
65 | 63 | let FreelancerAddress = (toBase58String(i.caller.bytes) + "_Freelancer") | |
66 | 64 | let Paidtrx = (toBase58String(i.caller.bytes) + "_Paidtrx") | |
67 | 65 | let amount = match getInteger(this, FreeLancerPayment) { | |
68 | 66 | case a: Int => | |
69 | 67 | a | |
70 | 68 | case _ => | |
71 | 69 | 0 | |
72 | 70 | } | |
73 | 71 | let PaidtrxValue = match getInteger(this, Paidtrx) { | |
74 | 72 | case a: Int => | |
75 | 73 | a | |
76 | 74 | case _ => | |
77 | 75 | 0 | |
78 | 76 | } | |
79 | 77 | let FreelancerAddressStr = getStringValue(this, FreelancerAddress) | |
80 | 78 | let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr) | |
81 | 79 | let dAppFrees = Address(dAppFees) | |
82 | 80 | if ((0 >= (amount - PayFreelancer))) | |
83 | 81 | then throw(("You do not have enough funds to make payment, your available funds are: " + toString((amount / 100000000)))) | |
84 | 82 | else if ((PaidtrxValue > 12)) | |
85 | 83 | then throw("You have already done 12 payments, you cannot make more payments") | |
86 | 84 | else { | |
87 | 85 | let Payment2Freelance = if ((PaidtrxValue == 11)) | |
88 | 86 | then amount | |
89 | 87 | else (amount - PayFreelancer) | |
90 | 88 | $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), Payment2Freelance), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), (PaidtrxValue + 1)), ScriptTransfer(AddressFreeLancer, ((95 * amount) / 100), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd) | |
91 | 89 | } | |
92 | 90 | } | |
93 | 91 | ||
94 | 92 | ||
95 | 93 | ||
96 | 94 | @Callable(i) | |
97 | 95 | func AdminTransfer (User,Freelancer,ToFreelancer) = if ((i.caller.bytes != AdmindApp)) | |
98 | 96 | then throw("Only Admin can do this") | |
99 | 97 | else { | |
100 | 98 | let FreeLancerPayment = (User + "_Payment") | |
101 | 99 | let FreelancerAddress = (User + "_Freelancer") | |
102 | 100 | let amount = match getInteger(this, FreeLancerPayment) { | |
103 | 101 | case a: Int => | |
104 | 102 | a | |
105 | 103 | case _ => | |
106 | 104 | 0 | |
107 | 105 | } | |
108 | 106 | let FreelancerAddressStr = getStringValue(this, FreelancerAddress) | |
109 | 107 | let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr) | |
110 | 108 | let dAppFrees = Address(dAppFees) | |
111 | 109 | let AddressUser = addressFromStringValue(User) | |
112 | 110 | if ((amount == 0)) | |
113 | 111 | then throw("User's balance is 0 BUsdc cannot realize any payment") | |
114 | 112 | else $Tuple2([IntegerEntry((User + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((ToFreelancer * (95 * amount)) / 10000), BUsd), ScriptTransfer(AddressUser, (((100 - ToFreelancer) * (95 * amount)) / 10000), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd) | |
115 | 113 | } | |
116 | 114 | ||
117 | 115 |
github/deemru/w8io/169f3d6 31.97 ms ◑