tx · ACL7zfMx1Rt4jE3KTg78Ka7DnuLv8fCsKn945aduttiK

3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK:  -0.01000000 Waves

2022.05.23 18:28 [2064509] smart account 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK > SELF 0.00000000 Waves

{ "type": 13, "id": "ACL7zfMx1Rt4jE3KTg78Ka7DnuLv8fCsKn945aduttiK", "fee": 1000000, "feeAssetId": null, "timestamp": 1653319737766, "version": 2, "chainId": 84, "sender": "3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK", "senderPublicKey": "2bV4VobJC5a6L6e7or9PFXQhQ1KtkZW1UYzjAvMzs6A8", "proofs": [ "5PrkEJmUENf1x98S4WdPUmCLt18TcAksxucK7cGkC1X5UfkSUW1uptykMuPoQXL9BqNpsJ5GBFjiVsTxQCWFsx4E" ], "script": "base64:AAIFAAAAAAAAABUIAhIFCgMICAgSAwoBARIFCgMICAEAAAALAAAAAARCVXNkAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAAEVVNEVAEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAABFVTREMBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAANCVEMBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAANFVEgBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAANCTkIBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAHtnf8IlEeQgBAAAAAARVU0ROAQAAACCXSkGrfgp9S6ACoVXGdcgAKGd7js0XAB7Z3/CJRHkIAQAAAAAESEFTSAEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAABEtVU0QBAAAAIJdKQat+Cn1LoAKhVcZ1yAAoZ3uOzRcAH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xhbmNlcgkAAGgAAAACAAAAAAAAAABfBQAAAAZhbW91bnQAAAAAAAAAJxAFAAAABEJVc2QJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAJZEFwcEZyZWVzCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQUAAAAGYW1vdW50AAAAAAAAAABkBQAAAARCVXNkBQAAAANuaWwFAAAABEJVc2QAAAAA/QNRZg==", "height": 2064509, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: HEpVmocfZCTauc2XaS3QM5yE6oxffu49s5P7LmjwjMgm Next: D64mwGZYvsCec1pJY3aMMGbmCqa93Af9hHYfp1L2UDoj Diff:
OldNewDifferences
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BUsd = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
5+
6+let USDT = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
7+
8+let USDC = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
9+
10+let BTC = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
11+
12+let ETH = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
13+
14+let BNB = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
15+
16+let USDN = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
17+
18+let HASH = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
19+
20+let KUSD = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
521
622 let dAppFees = base58'3N9Lfz79kZAEUupwESSboYFyygo1nQguVXo'
723
1228 let pmt = if ((size(i.payments) == 1))
1329 then i.payments[0]
1430 else throw("Attached payment is required")
15- if (if (if ((ScopeDesc == ""))
16- then true
17- else (Deliverables == ""))
18- then true
19- else (FreelancerAddress == ""))
20- then throw("Job Scope, Deliverables desc and Freelancer Wallet Address cannot be empty")
21- 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)]
31+ if (if (if (if (if (if (if (if (if (if ((pmt.assetId != BUsd))
32+ then (pmt.assetId != USDT)
33+ else false)
34+ then (pmt.assetId != USDC)
35+ else false)
36+ then (pmt.assetId != BTC)
37+ else false)
38+ then (pmt.assetId != ETH)
39+ else false)
40+ then (pmt.assetId != BNB)
41+ else false)
42+ then (pmt.assetId != USDN)
43+ else false)
44+ then (pmt.assetId != HASH)
45+ else false)
46+ then (pmt.assetId != KUSD)
47+ else false)
48+ then isDefined(pmt.assetId)
49+ else false)
50+ then if (if (if ((ScopeDesc == ""))
51+ then true
52+ else (Deliverables == ""))
53+ then true
54+ else (FreelancerAddress == ""))
55+ then throw("Job Scope, Deliverables desc and Freelancer Wallet Address cannot be empty")
56+ 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+ else throw("Can only deposit accepted tokens")
2258 }
2359
2460
2561
2662 @Callable(i)
27-func PayFreelancer () = {
63+func PayFreelancer (PayFreelancer) = {
2864 let FreeLancerPayment = (toBase58String(i.caller.bytes) + "_Payment")
2965 let FreelancerAddress = (toBase58String(i.caller.bytes) + "_Freelancer")
66+ let Paidtrx = (toBase58String(i.caller.bytes) + "_Paidtrx")
3067 let amount = match getInteger(this, FreeLancerPayment) {
3168 case a: Int =>
3269 a
3370 case _ =>
3471 0
3572 }
73+ let PaidtrxValue = match getInteger(this, Paidtrx) {
74+ case a: Int =>
75+ a
76+ case _ =>
77+ 0
78+ }
79+ let NewPaidtrxValue = (PaidtrxValue + 1)
3680 let FreelancerAddressStr = getStringValue(this, FreelancerAddress)
3781 let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr)
3882 let dAppFrees = Address(dAppFees)
39- if ((amount == 0))
40- then throw("Your balance is 0 BUsdc cannot realize any payment")
41- else $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((95 * amount) / 100), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd)
83+ if ((0 >= (amount - PayFreelancer)))
84+ then throw(("You do not have enough funds to make payment, your available funds are: " + toString((amount / 100000000))))
85+ else if ((NewPaidtrxValue > 12))
86+ then throw("You have already done 12 payments, you cannot make more payments")
87+ else {
88+ let Payment2Freelance = if ((NewPaidtrxValue == 12))
89+ then amount
90+ else (amount - PayFreelancer)
91+ $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), Payment2Freelance), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), NewPaidtrxValue), ScriptTransfer(AddressFreeLancer, ((95 * amount) / 100), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd)
92+ }
4293 }
4394
4495
4596
4697 @Callable(i)
47-func AdminTransfer (User,Freelancer,ToUser,ToFreelancer) = if ((i.caller.bytes != AdmindApp))
98+func AdminTransfer (User,Freelancer,ToFreelancer) = if ((i.caller.bytes != AdmindApp))
4899 then throw("Only Admin can do this")
49100 else {
50101 let FreeLancerPayment = (User + "_Payment")
61112 let AddressUser = addressFromStringValue(User)
62113 if ((amount == 0))
63114 then throw("User's balance is 0 BUsdc cannot realize any payment")
64- else $Tuple2([IntegerEntry((User + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((ToFreelancer * (95 * amount)) / 10000), BUsd), ScriptTransfer(AddressUser, ((ToUser * (95 * amount)) / 10000), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd)
115+ 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)
65116 }
66117
67118
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let BUsd = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
5+
6+let USDT = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
7+
8+let USDC = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
9+
10+let BTC = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
11+
12+let ETH = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
13+
14+let BNB = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
15+
16+let USDN = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
17+
18+let HASH = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
19+
20+let KUSD = base58'BBaEeEmuA6qPNowGcB8BXozC2PmAAG48G5zzSWw8qt2k'
521
622 let dAppFees = base58'3N9Lfz79kZAEUupwESSboYFyygo1nQguVXo'
723
824 let AdmindApp = base58'3Mx3pn4yMcBccM59UrDGjbbAkVsRYBw38tB'
925
1026 @Callable(i)
1127 func DepositFunds (ScopeDesc,Deliverables,FreelancerAddress) = {
1228 let pmt = if ((size(i.payments) == 1))
1329 then i.payments[0]
1430 else throw("Attached payment is required")
15- if (if (if ((ScopeDesc == ""))
16- then true
17- else (Deliverables == ""))
18- then true
19- else (FreelancerAddress == ""))
20- then throw("Job Scope, Deliverables desc and Freelancer Wallet Address cannot be empty")
21- 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)]
31+ if (if (if (if (if (if (if (if (if (if ((pmt.assetId != BUsd))
32+ then (pmt.assetId != USDT)
33+ else false)
34+ then (pmt.assetId != USDC)
35+ else false)
36+ then (pmt.assetId != BTC)
37+ else false)
38+ then (pmt.assetId != ETH)
39+ else false)
40+ then (pmt.assetId != BNB)
41+ else false)
42+ then (pmt.assetId != USDN)
43+ else false)
44+ then (pmt.assetId != HASH)
45+ else false)
46+ then (pmt.assetId != KUSD)
47+ else false)
48+ then isDefined(pmt.assetId)
49+ else false)
50+ then if (if (if ((ScopeDesc == ""))
51+ then true
52+ else (Deliverables == ""))
53+ then true
54+ else (FreelancerAddress == ""))
55+ then throw("Job Scope, Deliverables desc and Freelancer Wallet Address cannot be empty")
56+ 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+ else throw("Can only deposit accepted tokens")
2258 }
2359
2460
2561
2662 @Callable(i)
27-func PayFreelancer () = {
63+func PayFreelancer (PayFreelancer) = {
2864 let FreeLancerPayment = (toBase58String(i.caller.bytes) + "_Payment")
2965 let FreelancerAddress = (toBase58String(i.caller.bytes) + "_Freelancer")
66+ let Paidtrx = (toBase58String(i.caller.bytes) + "_Paidtrx")
3067 let amount = match getInteger(this, FreeLancerPayment) {
3168 case a: Int =>
3269 a
3370 case _ =>
3471 0
3572 }
73+ let PaidtrxValue = match getInteger(this, Paidtrx) {
74+ case a: Int =>
75+ a
76+ case _ =>
77+ 0
78+ }
79+ let NewPaidtrxValue = (PaidtrxValue + 1)
3680 let FreelancerAddressStr = getStringValue(this, FreelancerAddress)
3781 let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr)
3882 let dAppFrees = Address(dAppFees)
39- if ((amount == 0))
40- then throw("Your balance is 0 BUsdc cannot realize any payment")
41- else $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((95 * amount) / 100), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd)
83+ if ((0 >= (amount - PayFreelancer)))
84+ then throw(("You do not have enough funds to make payment, your available funds are: " + toString((amount / 100000000))))
85+ else if ((NewPaidtrxValue > 12))
86+ then throw("You have already done 12 payments, you cannot make more payments")
87+ else {
88+ let Payment2Freelance = if ((NewPaidtrxValue == 12))
89+ then amount
90+ else (amount - PayFreelancer)
91+ $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), Payment2Freelance), IntegerEntry((toBase58String(i.caller.bytes) + "_Paidtrx"), NewPaidtrxValue), ScriptTransfer(AddressFreeLancer, ((95 * amount) / 100), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd)
92+ }
4293 }
4394
4495
4596
4697 @Callable(i)
47-func AdminTransfer (User,Freelancer,ToUser,ToFreelancer) = if ((i.caller.bytes != AdmindApp))
98+func AdminTransfer (User,Freelancer,ToFreelancer) = if ((i.caller.bytes != AdmindApp))
4899 then throw("Only Admin can do this")
49100 else {
50101 let FreeLancerPayment = (User + "_Payment")
51102 let FreelancerAddress = (User + "_Freelancer")
52103 let amount = match getInteger(this, FreeLancerPayment) {
53104 case a: Int =>
54105 a
55106 case _ =>
56107 0
57108 }
58109 let FreelancerAddressStr = getStringValue(this, FreelancerAddress)
59110 let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr)
60111 let dAppFrees = Address(dAppFees)
61112 let AddressUser = addressFromStringValue(User)
62113 if ((amount == 0))
63114 then throw("User's balance is 0 BUsdc cannot realize any payment")
64- else $Tuple2([IntegerEntry((User + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((ToFreelancer * (95 * amount)) / 10000), BUsd), ScriptTransfer(AddressUser, ((ToUser * (95 * amount)) / 10000), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd)
115+ 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)
65116 }
66117
67118

github/deemru/w8io/169f3d6 
52.98 ms