tx · 6DNnaqieHPLeir7g1ceYW4jaDNxATmyNbHe8rs6tmojr 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK: -0.01000000 Waves 2022.05.24 00:44 [2064892] smart account 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK > SELF 0.00000000 Waves
{ "type": 13, "id": "6DNnaqieHPLeir7g1ceYW4jaDNxATmyNbHe8rs6tmojr", "fee": 1000000, "feeAssetId": null, "timestamp": 1653342359845, "version": 2, "chainId": 84, "sender": "3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK", "senderPublicKey": "2bV4VobJC5a6L6e7or9PFXQhQ1KtkZW1UYzjAvMzs6A8", "proofs": [ "5mmArFDYuQN5x2LBfdJHGhMZVvCqTr3GvinAyKXfNuH2DqFNWfuv8UgHHYvgQLpMZrRtz5ozUVfrtx2huaeD1abD" ], "script": "base64:AAIFAAAAAAAAABcIAhIAEgUKAwgICBIDCgEBEgUKAwgIAQAAAAsAAAAABEJVc2QBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAARVU0RUAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAAEVVNEQwEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAAA0JUQwEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAAA0VUSAEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAAA0JOQgEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAABFVTRE4BAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAARIQVNIAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAAES1VTRAEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAE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AAAAAAF8FAAAABmFtb3VudAAAAAAAAAAnEAkAAZsAAAABBQAAAA5QYXltZW50QXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAtBZGRyZXNzVXNlcgkAAGkAAAACCQAAaAAAAAIJAABlAAAAAgAAAAAAAAAAZAUAAAAMVG9GcmVlbGFuY2VyCQAAaAAAAAIAAAAAAAAAAF8FAAAABmFtb3VudAAAAAAAAAAnEAkAAZsAAAABBQAAAA5QYXltZW50QXNzZXRJZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAlkQXBwRnJlZXMJAABpAAAAAgkAAGgAAAACAAAAAAAAAAAFBQAAAAZhbW91bnQAAAAAAAAAAGQJAAGbAAAAAQUAAAAOUGF5bWVudEFzc2V0SWQFAAAAA25pbAkAAZsAAAABBQAAAA5QYXltZW50QXNzZXRJZAAAAAAeOi3h", "height": 2064892, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FxeaoQ1Z4iBNpqrb9MvbitGBnSeKkcTHKGEYAVhtDCj5 Next: ExFcLMyDTxBZHKathyygwGih6WKohBVeCmrQGHysueAx Diff:
Old | New | Differences | |
---|---|---|---|
102 | 102 | else if ((PaidtrxValue >= 12)) | |
103 | 103 | then throw("You have already done 12 payments, you cannot make more payments") | |
104 | 104 | else { | |
105 | - | let Payment2Freelance = if ((PaidtrxValue == 11)) | |
106 | - | then ((95 * amount) / 100) | |
107 | - | else (((95 * amount) / 100) - (PayFreelancer * 100000000)) | |
105 | + | let Payment2Freelance = ((95 * PayFreelancer) * 1000000) | |
108 | 106 | let UserAccount = if ((PaidtrxValue == 11)) | |
109 | 107 | then 0 | |
110 | - | else ( | |
111 | - | $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), (PaidtrxValue + 1)), ScriptTransfer(AddressFreeLancer, | |
108 | + | else (amount - (PayFreelancer * 100000000)) | |
109 | + | $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), (PaidtrxValue + 1)), ScriptTransfer(AddressFreeLancer, Payment2Freelance, fromBase58String(PaymentAssetId)), ScriptTransfer(dAppFrees, ((5 * PayFreelancer) * 1000000), fromBase58String(PaymentAssetId))], BUsd) | |
112 | 110 | } | |
113 | 111 | } | |
114 | 112 |
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)] | |
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 [StringEntry((toBase58String(i.caller.bytes) + "_Scope"), ScopeDesc), StringEntry((toBase58String(i.caller.bytes) + "_Deliv"), Deliverables), StringEntry((toBase58String(i.caller.bytes) + "_Asset"), toBase58String(value(pmt.assetId))), StringEntry((toBase58String(i.caller.bytes) + "_Freelancer"), FreelancerAddress), IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), pmt.amount)] | |
73 | 73 | } | |
74 | 74 | } | |
75 | 75 | ||
76 | 76 | ||
77 | 77 | ||
78 | 78 | @Callable(i) | |
79 | 79 | func PayFreelancer (PayFreelancer) = { | |
80 | 80 | let FreeLancerPayment = (toBase58String(i.caller.bytes) + "_Payment") | |
81 | 81 | let FreelancerAddress = (toBase58String(i.caller.bytes) + "_Freelancer") | |
82 | 82 | let PaymentAsset = (toBase58String(i.caller.bytes) + "_Asset") | |
83 | 83 | let Paidtrx = (toBase58String(i.caller.bytes) + "_Paidtrx") | |
84 | 84 | let amount = match getInteger(this, FreeLancerPayment) { | |
85 | 85 | case a: Int => | |
86 | 86 | a | |
87 | 87 | case _ => | |
88 | 88 | 0 | |
89 | 89 | } | |
90 | 90 | let PaidtrxValue = match getInteger(this, Paidtrx) { | |
91 | 91 | case a: Int => | |
92 | 92 | a | |
93 | 93 | case _ => | |
94 | 94 | 0 | |
95 | 95 | } | |
96 | 96 | let FreelancerAddressStr = getStringValue(this, FreelancerAddress) | |
97 | 97 | let PaymentAssetId = getStringValue(this, PaymentAsset) | |
98 | 98 | let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr) | |
99 | 99 | let dAppFrees = Address(dAppFees) | |
100 | 100 | if ((0 >= (((95 * amount) / 100) - (PayFreelancer * 100000000)))) | |
101 | 101 | then throw(("You do not have enough funds to make payment, your available funds are: " + toString((amount / 100000000)))) | |
102 | 102 | else if ((PaidtrxValue >= 12)) | |
103 | 103 | then throw("You have already done 12 payments, you cannot make more payments") | |
104 | 104 | else { | |
105 | - | let Payment2Freelance = if ((PaidtrxValue == 11)) | |
106 | - | then ((95 * amount) / 100) | |
107 | - | else (((95 * amount) / 100) - (PayFreelancer * 100000000)) | |
105 | + | let Payment2Freelance = ((95 * PayFreelancer) * 1000000) | |
108 | 106 | let UserAccount = if ((PaidtrxValue == 11)) | |
109 | 107 | then 0 | |
110 | - | else ( | |
111 | - | $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), (PaidtrxValue + 1)), ScriptTransfer(AddressFreeLancer, | |
108 | + | else (amount - (PayFreelancer * 100000000)) | |
109 | + | $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), (PaidtrxValue + 1)), ScriptTransfer(AddressFreeLancer, Payment2Freelance, fromBase58String(PaymentAssetId)), ScriptTransfer(dAppFrees, ((5 * PayFreelancer) * 1000000), fromBase58String(PaymentAssetId))], BUsd) | |
112 | 110 | } | |
113 | 111 | } | |
114 | 112 | ||
115 | 113 | ||
116 | 114 | ||
117 | 115 | @Callable(i) | |
118 | 116 | func AdminTransfer (User,Freelancer,ToFreelancer) = if ((i.caller.bytes != AdmindApp)) | |
119 | 117 | then throw("Only Admin can do this") | |
120 | 118 | else { | |
121 | 119 | let FreeLancerPayment = (User + "_Payment") | |
122 | 120 | let FreelancerAddress = (User + "_Freelancer") | |
123 | 121 | let PaymentAsset = (toBase58String(i.caller.bytes) + "_Asset") | |
124 | 122 | let amount = match getInteger(this, FreeLancerPayment) { | |
125 | 123 | case a: Int => | |
126 | 124 | a | |
127 | 125 | case _ => | |
128 | 126 | 0 | |
129 | 127 | } | |
130 | 128 | let FreelancerAddressStr = getStringValue(this, FreelancerAddress) | |
131 | 129 | let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr) | |
132 | 130 | let PaymentAssetId = getStringValue(this, PaymentAsset) | |
133 | 131 | let dAppFrees = Address(dAppFees) | |
134 | 132 | let AddressUser = addressFromStringValue(User) | |
135 | 133 | if ((amount == 0)) | |
136 | 134 | then throw("User's balance is 0 BUsdc cannot realize any payment") | |
137 | 135 | else $Tuple2([IntegerEntry((User + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((ToFreelancer * (95 * amount)) / 10000), toBytes(PaymentAssetId)), ScriptTransfer(AddressUser, (((100 - ToFreelancer) * (95 * amount)) / 10000), toBytes(PaymentAssetId)), ScriptTransfer(dAppFrees, ((5 * amount) / 100), toBytes(PaymentAssetId))], toBytes(PaymentAssetId)) | |
138 | 136 | } | |
139 | 137 | ||
140 | 138 |
github/deemru/w8io/169f3d6 39.53 ms ◑