tx · 32ShshiQwYL2F5Q8XLqoZoB618835GR8a5dRHrf4LR2u 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK: -0.01000000 Waves 2022.05.22 18:15 [2063048] smart account 3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK > SELF 0.00000000 Waves
{ "type": 13, "id": "32ShshiQwYL2F5Q8XLqoZoB618835GR8a5dRHrf4LR2u", "fee": 1000000, "feeAssetId": null, "timestamp": 1653232544696, "version": 2, "chainId": 84, "sender": "3NCLRHPm5VYMStKzvP2kkc5mxGSH9wtWAtK", "senderPublicKey": "2bV4VobJC5a6L6e7or9PFXQhQ1KtkZW1UYzjAvMzs6A8", "proofs": [ "K3ZPEcHydjjeJk1JogEEj2hRKrL1Rx9m5LNGpm8nvNfuGP5frvMJrvmH575RGmLDSagfrt34UwfNcxrbHpjVshE" ], "script": "base64:AAIFAAAAAAAAABMIAhIFCgMICAgSABIGCgQICAEBAAAAAwAAAAAEQlVzZAEAAAAgl0pBq34KfUugAqFVxnXIAChne47NFwAe2d/wiUR5CAEAAAAACGRBcHBGZWVzAQAAABoBVNUQ7h1eLZZYGV9rZWfEtki60lL+DdITGgAAAAAJQWRtaW5kQXBwAQAAABoBVFk30JKJxN2GegCDo4iqgw94whBiH+SxRAAAAAMAAAABaQEAAAAMRGVwb3NpdEZ1bmRzAAAAAwAAAAlTY29wZURlc2MAAAAMRGVsaXZlcmFibGVzAAAAEUZyZWVsYW5jZXJBZGRyZXNzBAAAAANwbXQDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAcQXR0YWNoZWQgcGF5bWVudCBpcyByZXF1aXJlZAMJAABmAAAAAgkAAGgAAAACAAAAAAAAAAAyAAAAAAAF9eEACQAD8AAAAAIIBQAAAAFpAAAABmNhbGxlcgUAAAAEQlVzZAkAAAIAAA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ZSBhbnkgcGF5bWVudAkABRQAAAACCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIFAAAABFVzZXICAAAACF9QYXltZW50AAAAAAAAAAAACQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMFAAAAEUFkZHJlc3NGcmVlTGFuY2VyCQAAaQAAAAIJAABoAAAAAgUAAAAMVG9GcmVlbGFuY2VyCQAAaAAAAAIAAAAAAAAAAF8FAAAABmFtb3VudAAAAAAAAAAnEAUAAAAEQlVzZAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAtBZGRyZXNzVXNlcgkAAGkAAAACCQAAaAAAAAIFAAAABlRvVXNlcgkAAGgAAAACAAAAAAAAAABfBQAAAAZhbW91bnQAAAAAAAAAJxAFAAAABEJVc2QJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAJZEFwcEZyZWVzCQAAaQAAAAIJAABoAAAAAgAAAAAAAAAABQUAAAAGYW1vdW50AAAAAAAAAABkBQAAAARCVXNkBQAAAANuaWwFAAAABEJVc2QAAAAAdCYjFQ==", "height": 2063048, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8UTKXV7P45C2gj3jNy4wHG4hgXxfsgRvN5mJ2eqJmrEC Next: E6DYAv1HPQEWyLdE85Z16MFUF5M1QoaPt7xTgMVvysNY Diff:
Old | New | Differences | |
---|---|---|---|
5 | 5 | ||
6 | 6 | let dAppFees = base58'3N9Lfz79kZAEUupwESSboYFyygo1nQguVXo' | |
7 | 7 | ||
8 | - | let AdmindApp = base58' | |
8 | + | let AdmindApp = base58'3Mx3pn4yMcBccM59UrDGjbbAkVsRYBw38tB' | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | 11 | func DepositFunds (ScopeDesc,Deliverables,FreelancerAddress) = { | |
39 | 39 | } | |
40 | 40 | let FreelancerAddressStr = getStringValue(this, FreelancerAddress) | |
41 | 41 | let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr) | |
42 | + | let dAppFrees = Address(dAppFees) | |
42 | 43 | if ((amount == 0)) | |
43 | 44 | then throw("Your balance is 0 BUsdc cannot realize any payment") | |
44 | - | else $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, amount, BUsd)], BUsd) | |
45 | + | else $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((95 * amount) / 100), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd) | |
45 | 46 | } | |
46 | 47 | ||
47 | 48 | ||
64 | 65 | let AddressUser = addressFromStringValue(User) | |
65 | 66 | if ((amount == 0)) | |
66 | 67 | then throw("User's balance is 0 BUsdc cannot realize any payment") | |
67 | - | else { | |
68 | - | let UserReturned = if ((0 > (ToUser - 5))) | |
69 | - | then 0 | |
70 | - | else (ToUser - 5) | |
71 | - | $Tuple2([IntegerEntry((User + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((ToFreelancer * amount) / 100), BUsd), ScriptTransfer(AddressUser, ((UserReturned * amount) / 100), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd) | |
72 | - | } | |
68 | + | 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) | |
73 | 69 | } | |
74 | 70 | ||
75 | 71 |
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 dAppFees = base58'3N9Lfz79kZAEUupwESSboYFyygo1nQguVXo' | |
7 | 7 | ||
8 | - | let AdmindApp = base58' | |
8 | + | let AdmindApp = base58'3Mx3pn4yMcBccM59UrDGjbbAkVsRYBw38tB' | |
9 | 9 | ||
10 | 10 | @Callable(i) | |
11 | 11 | func DepositFunds (ScopeDesc,Deliverables,FreelancerAddress) = { | |
12 | 12 | let pmt = if ((size(i.payments) == 1)) | |
13 | 13 | then i.payments[0] | |
14 | 14 | else throw("Attached payment is required") | |
15 | 15 | if (((50 * 100000000) > assetBalance(i.caller, BUsd))) | |
16 | 16 | then throw("You must have 50 BUsd at least to deposit") | |
17 | 17 | else if (((50 * 100000000) > pmt.amount)) | |
18 | 18 | then throw("Cannot deposit less than 50 Busd") | |
19 | 19 | else if (if (if ((ScopeDesc == "")) | |
20 | 20 | then true | |
21 | 21 | else (Deliverables == "")) | |
22 | 22 | then true | |
23 | 23 | else (FreelancerAddress == "")) | |
24 | 24 | then throw("Job Scope, Deliverables desc and Freelancer Wallet Address cannot be empty") | |
25 | 25 | 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)] | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | ||
30 | 30 | @Callable(i) | |
31 | 31 | func PayFreelancer () = { | |
32 | 32 | let FreeLancerPayment = (toBase58String(i.caller.bytes) + "_Payment") | |
33 | 33 | let FreelancerAddress = (toBase58String(i.caller.bytes) + "_Freelancer") | |
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 | let FreelancerAddressStr = getStringValue(this, FreelancerAddress) | |
41 | 41 | let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr) | |
42 | + | let dAppFrees = Address(dAppFees) | |
42 | 43 | if ((amount == 0)) | |
43 | 44 | then throw("Your balance is 0 BUsdc cannot realize any payment") | |
44 | - | else $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, amount, BUsd)], BUsd) | |
45 | + | else $Tuple2([IntegerEntry((toBase58String(i.caller.bytes) + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((95 * amount) / 100), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd) | |
45 | 46 | } | |
46 | 47 | ||
47 | 48 | ||
48 | 49 | ||
49 | 50 | @Callable(i) | |
50 | 51 | func AdminTransfer (User,Freelancer,ToUser,ToFreelancer) = if ((i.caller.bytes != AdmindApp)) | |
51 | 52 | then throw("Only Admin can do this") | |
52 | 53 | else { | |
53 | 54 | let FreeLancerPayment = (User + "_Payment") | |
54 | 55 | let FreelancerAddress = (User + "_Freelancer") | |
55 | 56 | let amount = match getInteger(this, FreeLancerPayment) { | |
56 | 57 | case a: Int => | |
57 | 58 | a | |
58 | 59 | case _ => | |
59 | 60 | 0 | |
60 | 61 | } | |
61 | 62 | let FreelancerAddressStr = getStringValue(this, FreelancerAddress) | |
62 | 63 | let AddressFreeLancer = addressFromStringValue(FreelancerAddressStr) | |
63 | 64 | let dAppFrees = Address(dAppFees) | |
64 | 65 | let AddressUser = addressFromStringValue(User) | |
65 | 66 | if ((amount == 0)) | |
66 | 67 | then throw("User's balance is 0 BUsdc cannot realize any payment") | |
67 | - | else { | |
68 | - | let UserReturned = if ((0 > (ToUser - 5))) | |
69 | - | then 0 | |
70 | - | else (ToUser - 5) | |
71 | - | $Tuple2([IntegerEntry((User + "_Payment"), 0), ScriptTransfer(AddressFreeLancer, ((ToFreelancer * amount) / 100), BUsd), ScriptTransfer(AddressUser, ((UserReturned * amount) / 100), BUsd), ScriptTransfer(dAppFrees, ((5 * amount) / 100), BUsd)], BUsd) | |
72 | - | } | |
68 | + | 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) | |
73 | 69 | } | |
74 | 70 | ||
75 | 71 |
github/deemru/w8io/169f3d6 62.62 ms ◑