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+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAARLVVNEAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js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AAAAAAAAAZAUAAAAJQXNzZXRVc2VkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAC0FkZHJlc3NVc2VyCQAAaQAAAAIJAABoAAAAAgUAAAAGVG9Vc2VyBQAAAAZhbW91bnQAAAAAAAAAAGQFAAAACUFzc2V0VXNlZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAlkQXBwRnJlZXMJAABpAAAAAgkAAGgAAAACBQAAAAhBZG1pbkZlZQUAAAAGYW1vdW50AAAAAAAAAABkBQAAAAlBc3NldFVzZWQFAAAAA25pbAUAAAAJQXNzZXRVc2VkAAAAAFbMPX8=", "height": 2067355, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DjR6GxTsN1sWxnpFzBg4ns7bZTzAzedXWgQdxAuRjTtG Next: 6xL2s9q3MjmTvErTFRHvR3sx3bCi13BtoXgGu7Y8fxZW Diff:
OldNewDifferences
131131
132132
133133 @Callable(i)
134-func AdminTransfer (User,Freelancer,ToFreelancer) = if ((i.caller.bytes != AdmindApp))
134+func AdminTransfer (User,Freelancer,ToFreelancer,ToUser,AdminFee) = if ((i.caller.bytes != AdmindApp))
135135 then throw("Only Admin can do this")
136- else {
137- let FreeLancerPayment = (User + "_Payment")
138- let FreelancerAddress = (User + "_Freelancer")
139- let PaymentAsset = (toBase58String(i.caller.bytes) + "_Asset")
140- let amount = match getInteger(this, FreeLancerPayment) {
141- case a: Int =>
142- a
143- case _ =>
144- 0
145- }
146- let FreelancerAddressStr = getStringValue(this, FreelancerAddress)
147- let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr)
148- let PaymentAssetId = getStringValue(this, PaymentAsset)
149- let dAppFrees = Address(dAppFees)
150- let AddressUser = addressFromStringValue(User)
151- let AssetUsed = if ((PaymentAssetId == "Waves"))
152- then unit
153- else fromBase58String(PaymentAssetId)
154- if ((amount == 0))
155- then throw("User's balance is 0 BUsdc cannot realize any payment")
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- }
136+ else if ((((ToUser + ToFreelancer) + AdminFee) != 100))
137+ then throw("Total of Percentages cannot be different from 100%")
138+ else {
139+ let FreeLancerPayment = (User + "_Payment")
140+ let FreelancerAddress = (User + "_Freelancer")
141+ let PaymentAsset = (toBase58String(i.caller.bytes) + "_Asset")
142+ let amount = match getInteger(this, FreeLancerPayment) {
143+ case a: Int =>
144+ a
145+ case _ =>
146+ 0
147+ }
148+ let FreelancerAddressStr = getStringValue(this, FreelancerAddress)
149+ let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr)
150+ let PaymentAssetId = getStringValue(this, PaymentAsset)
151+ let dAppFrees = Address(dAppFees)
152+ let AddressUser = addressFromStringValue(User)
153+ let AssetUsed = if ((PaymentAssetId == "Waves"))
154+ then unit
155+ else fromBase58String(PaymentAssetId)
156+ if ((amount == 0))
157+ then throw("User's balance is 0 BUsdc cannot realize any payment")
158+ else $Tuple2([IntegerEntry((User + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((ToFreelancer * amount) / 100), AssetUsed), ScriptTransfer(AddressUser, ((ToUser * amount) / 100), AssetUsed), ScriptTransfer(dAppFrees, ((AdminFee * amount) / 100), AssetUsed)], AssetUsed)
159+ }
158160
159161
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BUsd = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
55
66 let USDT = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
77
88 let USDC = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
99
1010 let BTC = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
1111
1212 let ETH = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
1313
1414 let BNB = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
1515
1616 let USDN = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
1717
1818 let HASH = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
1919
2020 let KUSD = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
2121
2222 let dAppFees = base58'3N9Lfz79kZAEUupwESSboYFyygo1nQguVXo'
2323
2424 let AdmindApp = base58'3Mx3pn4yMcBccM59UrDGjbbAkVsRYBw38tB'
2525
2626 @Callable(i)
2727 func Reset () = [IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), 0), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), 0)]
2828
2929
3030
3131 @Callable(i)
3232 func DepositFunds (ScopeDesc,Deliverables,FreelancerAddress) = {
3333 let FreeLancerPayment = (toBase58String(i.caller.bytes) + "_Payment")
3434 let amount = match getInteger(this, FreeLancerPayment) {
3535 case a: Int =>
3636 a
3737 case _ =>
3838 0
3939 }
4040 if ((amount != 0))
4141 then throw("You have already deposited funds, deposits can only be done once")
4242 else {
4343 let pmt = if ((size(i.payments) == 1))
4444 then i.payments[0]
4545 else throw("Attached payment is required")
4646 if (if (if (if (if (if (if (if (if (if ((pmt.assetId != BUsd))
4747 then (pmt.assetId != USDT)
4848 else false)
4949 then (pmt.assetId != USDC)
5050 else false)
5151 then (pmt.assetId != BTC)
5252 else false)
5353 then (pmt.assetId != ETH)
5454 else false)
5555 then (pmt.assetId != BNB)
5656 else false)
5757 then (pmt.assetId != USDN)
5858 else false)
5959 then (pmt.assetId != HASH)
6060 else false)
6161 then (pmt.assetId != KUSD)
6262 else false)
6363 then isDefined(pmt.assetId)
6464 else false)
6565 then throw("Can only deposit accepted tokens")
6666 else if (if (if ((ScopeDesc == ""))
6767 then true
6868 else (Deliverables == ""))
6969 then true
7070 else (FreelancerAddress == ""))
7171 then throw("Job Scope, Deliverables desc and Freelancer Wallet Address cannot be empty")
7272 else {
7373 let AssetUsed = if (isDefined(pmt.assetId))
7474 then toBase58String(value(pmt.assetId))
7575 else "Waves"
7676 [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)]
7777 }
7878 }
7979 }
8080
8181
8282
8383 @Callable(i)
8484 func PayFreelancer (PayFreelancer) = {
8585 let FreeLancerPayment = (toBase58String(i.caller.bytes) + "_Payment")
8686 let FreelancerAddress = (toBase58String(i.caller.bytes) + "_Freelancer")
8787 let PaymentAsset = (toBase58String(i.caller.bytes) + "_Asset")
8888 let Paidtrx = (toBase58String(i.caller.bytes) + "_Paidtrx")
8989 let amount = match getInteger(this, FreeLancerPayment) {
9090 case a: Int =>
9191 a
9292 case _ =>
9393 0
9494 }
9595 let PaidtrxLast = match getInteger(this, Paidtrx) {
9696 case a: Int =>
9797 a
9898 case _ =>
9999 0
100100 }
101101 let FreelancerAddressStr = getStringValue(this, FreelancerAddress)
102102 let PaymentAssetId = getStringValue(this, PaymentAsset)
103103 let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr)
104104 let dAppFrees = Address(dAppFees)
105105 let AssetUsed = if ((PaymentAssetId == "Waves"))
106106 then unit
107107 else fromBase58String(PaymentAssetId)
108108 if ((0 >= (((95 * amount) / 100) - (PayFreelancer * 100000000))))
109109 then throw(("You do not have enough funds to make payment, your available funds are: " + toString((amount / 100000000))))
110110 else if (if ((PaidtrxLast >= 12))
111111 then (amount > 0)
112112 else false)
113113 then throw("You have already done 12 payments, you cannot make more payments")
114114 else {
115115 let UserAccount = if ((PaidtrxLast == 11))
116116 then 0
117117 else (amount - (PayFreelancer * 100000000))
118118 let Payment2Freelance = if ((PaidtrxLast == 11))
119119 then ((95 * amount) / 100)
120120 else ((95 * PayFreelancer) * 1000000)
121121 let FeePaid = if ((PaidtrxLast == 11))
122122 then ((5 * amount) / 100)
123123 else ((5 * PayFreelancer) * 1000000)
124124 let PaidtrxValue = if ((PaidtrxLast == 11))
125125 then 0
126126 else (PaidtrxLast + 1)
127127 $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), UserAccount), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), PaidtrxValue), ScriptTransfer(AddressFreeLancer, Payment2Freelance, AssetUsed), ScriptTransfer(dAppFrees, FeePaid, AssetUsed)], AssetUsed)
128128 }
129129 }
130130
131131
132132
133133 @Callable(i)
134-func AdminTransfer (User,Freelancer,ToFreelancer) = if ((i.caller.bytes != AdmindApp))
134+func AdminTransfer (User,Freelancer,ToFreelancer,ToUser,AdminFee) = if ((i.caller.bytes != AdmindApp))
135135 then throw("Only Admin can do this")
136- else {
137- let FreeLancerPayment = (User + "_Payment")
138- let FreelancerAddress = (User + "_Freelancer")
139- let PaymentAsset = (toBase58String(i.caller.bytes) + "_Asset")
140- let amount = match getInteger(this, FreeLancerPayment) {
141- case a: Int =>
142- a
143- case _ =>
144- 0
145- }
146- let FreelancerAddressStr = getStringValue(this, FreelancerAddress)
147- let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr)
148- let PaymentAssetId = getStringValue(this, PaymentAsset)
149- let dAppFrees = Address(dAppFees)
150- let AddressUser = addressFromStringValue(User)
151- let AssetUsed = if ((PaymentAssetId == "Waves"))
152- then unit
153- else fromBase58String(PaymentAssetId)
154- if ((amount == 0))
155- then throw("User's balance is 0 BUsdc cannot realize any payment")
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- }
136+ else if ((((ToUser + ToFreelancer) + AdminFee) != 100))
137+ then throw("Total of Percentages cannot be different from 100%")
138+ else {
139+ let FreeLancerPayment = (User + "_Payment")
140+ let FreelancerAddress = (User + "_Freelancer")
141+ let PaymentAsset = (toBase58String(i.caller.bytes) + "_Asset")
142+ let amount = match getInteger(this, FreeLancerPayment) {
143+ case a: Int =>
144+ a
145+ case _ =>
146+ 0
147+ }
148+ let FreelancerAddressStr = getStringValue(this, FreelancerAddress)
149+ let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr)
150+ let PaymentAssetId = getStringValue(this, PaymentAsset)
151+ let dAppFrees = Address(dAppFees)
152+ let AddressUser = addressFromStringValue(User)
153+ let AssetUsed = if ((PaymentAssetId == "Waves"))
154+ then unit
155+ else fromBase58String(PaymentAssetId)
156+ if ((amount == 0))
157+ then throw("User's balance is 0 BUsdc cannot realize any payment")
158+ else $Tuple2([IntegerEntry((User + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((ToFreelancer * amount) / 100), AssetUsed), ScriptTransfer(AddressUser, ((ToUser * amount) / 100), AssetUsed), ScriptTransfer(dAppFrees, ((AdminFee * amount) / 100), AssetUsed)], AssetUsed)
159+ }
158160
159161

github/deemru/w8io/026f985 
39.28 ms