tx · H3BUf9BdPBDgD5G1ExH3jt4kCCE7MRh4j8oTBmAZxWEM 3NA1zc7miK3bRpabCkfdAy3ugT1abEH4XvC: -0.01400000 Waves 2021.02.01 13:08 [1378964] smart account 3NA1zc7miK3bRpabCkfdAy3ugT1abEH4XvC > SELF 0.00000000 Waves
{ "type": 13, "id": "H3BUf9BdPBDgD5G1ExH3jt4kCCE7MRh4j8oTBmAZxWEM", "fee": 1400000, "feeAssetId": null, "timestamp": 1612174124614, "version": 2, "chainId": 84, "sender": "3NA1zc7miK3bRpabCkfdAy3ugT1abEH4XvC", "senderPublicKey": "FGEpfdbsnGgv2u4E4kJ7aJdEoww9djxfupn8jGYjrxYu", "proofs": [ "5XjMVPUkbVC6i7SMx6ZF2e5tbG4ygQQf52YTArocFD4BJXMZKMfnvUQb7VfKF4uQ7rzLb1XJuSpAiDxMCXownvic", "V8CWYKofiNcBXDeLtbzHHPRzWiwLC8LfVSWGAbjLy7hcbms7Mf7rLmh2w5WCSY8pmJqQcAgixrP5p5PSP57Urgx" ], "script": "base64:BAQAAAALZGlnaWxpcmFQYXkBAAAAID0HOFHYXYpCB2C8RjDY8m3ndBlb8WihoYLw1tvHVwgrBAAAAAdnYXRld2F5AQAAACA9BzhR2F2KQgdgvEYw2PJt53QZW/FooaGC8Nbbx1cIKwQAAAAMc3BvbnNvclRva2VuAQAAACBdMQvtJ8LandQsV/WP/p1LGsITDG9E0fNlo+TMuhD4PgQAAAAMcGF5bWVudFRva2VuAQAAACDVGtVycuVAveqx7rkVfKA7PZohin1VCKHosAamGXf54gQAAAANcmVjb3ZlcnlUb2tlbgEAAAAg1RrVcnLlQL3qse65FXygOz2aIYp9VQih6LAGphl3+eIEAAAACnByb3h5V2F2ZXMBAAAABBOr2TMEAAAACXJlY292ZXJ5MQEAAAAgPQc4UdhdikIHYLxGMNjybed0GVvxaKGhgvDW28dXCCsEAAAACXJlY292ZXJ5MgEAAAAgPQc4UdhdikIHYLxGMNjybed0GVvxaKGhgvDW28dXC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9uBAAAAAF0BQAAAAckbWF0Y2gwBAAAAAJzMQMJAAH0AAAAAwgFAAAAAXQAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAF0AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAXQAAAAPc2VuZGVyUHVibGljS2V5AAAAAAAAAAABAAAAAAAAAAAABAAAAAJzMgMJAAH0AAAAAwgFAAAAAXQAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAF0AAAABnByb29mcwAAAAAAAAAAAQUAAAALZGlnaWxpcmFQYXkAAAAAAAAAAAEAAAAAAAAAAAADCQAAAAAAAAIJAABkAAAAAgUAAAACczEFAAAAAnMyAAAAAAAAAAACBgkAAAIAAAABAgAAAAxVbmF1dGhvcml6ZWQJAQAAAAhyZWNvdmVyeQAAAAC5zE8q", "height": 1378964, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9mnGnSeyVCpPBest2zRM2Scz9jcmFPAQ2wz7AeJtiHF9 Next: DRqNbBA6C9nrbV7fukuLUU2CxVMwrzUHwzaRyfnLgqn4 Diff:
Old | New | Differences | |
---|---|---|---|
70 | 70 | let myStatusBanned = (myStatus == banned) | |
71 | 71 | let recipientStatusBanned = (recipientStatus == banned) | |
72 | 72 | let assetStatusBanned = (assetStatus == banned) | |
73 | + | let somethingBanned = if (if (myStatusBanned) | |
74 | + | then true | |
75 | + | else recipientStatusBanned) | |
76 | + | then true | |
77 | + | else assetStatusBanned | |
73 | 78 | let isFeeRecoveryToken = (w.feeAssetId == recoveryToken) | |
74 | 79 | let isRecipientGateway = (w.recipient == addressFromPublicKey(gateway)) | |
75 | 80 | let isFeePaymentToken = (w.feeAssetId == paymentToken) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let digiliraPay = base58'57EFni8M1XesEurFh3c4jnpLExP2PCPd5TRrwMjePAT4' | |
4 | 4 | let gateway = base58'57EFni8M1XesEurFh3c4jnpLExP2PCPd5TRrwMjePAT4' | |
5 | 5 | let sponsorToken = base58'7GnHzTaDe3YbDiCD9rueHiSfPB7hdanPpN4Ab79fJGtD' | |
6 | 6 | let paymentToken = base58'FLsa9hfu1jvXC6jhDP2x6DHHQHK2qiKPtS7D74ZFNsE1' | |
7 | 7 | let recoveryToken = base58'FLsa9hfu1jvXC6jhDP2x6DHHQHK2qiKPtS7D74ZFNsE1' | |
8 | 8 | let proxyWaves = base58'WAVES' | |
9 | 9 | let recovery1 = base58'57EFni8M1XesEurFh3c4jnpLExP2PCPd5TRrwMjePAT4' | |
10 | 10 | let recovery2 = base58'57EFni8M1XesEurFh3c4jnpLExP2PCPd5TRrwMjePAT4' | |
11 | 11 | let recovery3 = base58'57EFni8M1XesEurFh3c4jnpLExP2PCPd5TRrwMjePAT4' | |
12 | 12 | let banned = 403000 | |
13 | 13 | let digiliraPayOnly = 99 | |
14 | 14 | let transferBlock = 100 | |
15 | 15 | let paymentBlock = 200 | |
16 | 16 | let paymentFundBlock = 300 | |
17 | 17 | let fundBlock = 400 | |
18 | 18 | func recovery () = { | |
19 | 19 | let s1 = if (sigVerify(tx.bodyBytes, tx.proofs[0], recovery1)) | |
20 | 20 | then 1 | |
21 | 21 | else 0 | |
22 | 22 | let s2 = if (sigVerify(tx.bodyBytes, tx.proofs[1], recovery2)) | |
23 | 23 | then 1 | |
24 | 24 | else 0 | |
25 | 25 | let s3 = if (sigVerify(tx.bodyBytes, tx.proofs[2], recovery3)) | |
26 | 26 | then 1 | |
27 | 27 | else 0 | |
28 | 28 | if ((((s1 + s2) + s3) >= 2)) | |
29 | 29 | then true | |
30 | 30 | else throw("Unauthorized") | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | func checkFee (w) = { | |
34 | 34 | let fee = w.fee | |
35 | 35 | let isFeePaymentToken = (w.feeAssetId == paymentToken) | |
36 | 36 | let isFeeSponsorToken = (w.feeAssetId == sponsorToken) | |
37 | 37 | let unScriptedFee = 5 | |
38 | 38 | let scriptedFee = 9 | |
39 | 39 | let isScripted = match assetInfo(valueOrElse(w.assetId, proxyWaves)) { | |
40 | 40 | case asset: Asset => | |
41 | 41 | if (asset.scripted) | |
42 | 42 | then true | |
43 | 43 | else false | |
44 | 44 | case _ => | |
45 | 45 | false | |
46 | 46 | } | |
47 | 47 | if (if (!(isFeePaymentToken)) | |
48 | 48 | then !(isFeeSponsorToken) | |
49 | 49 | else false) | |
50 | 50 | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
51 | 51 | else if (if (if (isScripted) | |
52 | 52 | then (fee == scriptedFee) | |
53 | 53 | else false) | |
54 | 54 | then true | |
55 | 55 | else if (!(isScripted)) | |
56 | 56 | then (fee == unScriptedFee) | |
57 | 57 | else false) | |
58 | 58 | then sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
59 | 59 | else throw((toString(fee) + " feeAmount is wrong")) | |
60 | 60 | } | |
61 | 61 | ||
62 | 62 | func getStatus (key) = valueOrElse(getInteger(addressFromPublicKey(digiliraPay), toBase58String(key)), 0) | |
63 | 63 | ||
64 | 64 | match tx { | |
65 | 65 | case w: TransferTransaction => | |
66 | 66 | let myStatus = getStatus(w.sender.bytes) | |
67 | 67 | let recipientStatus = getStatus(addressFromRecipient(w.recipient).bytes) | |
68 | 68 | let assetStatus = getStatus(valueOrElse(w.assetId, proxyWaves)) | |
69 | 69 | let digiliraRecipient = (recipientStatus > 0) | |
70 | 70 | let myStatusBanned = (myStatus == banned) | |
71 | 71 | let recipientStatusBanned = (recipientStatus == banned) | |
72 | 72 | let assetStatusBanned = (assetStatus == banned) | |
73 | + | let somethingBanned = if (if (myStatusBanned) | |
74 | + | then true | |
75 | + | else recipientStatusBanned) | |
76 | + | then true | |
77 | + | else assetStatusBanned | |
73 | 78 | let isFeeRecoveryToken = (w.feeAssetId == recoveryToken) | |
74 | 79 | let isRecipientGateway = (w.recipient == addressFromPublicKey(gateway)) | |
75 | 80 | let isFeePaymentToken = (w.feeAssetId == paymentToken) | |
76 | 81 | let isFeeSponsorToken = (w.feeAssetId == sponsorToken) | |
77 | 82 | let isExclusiveToken = (digiliraPayOnly == valueOrElse(assetStatus, 0)) | |
78 | 83 | let isDigiliraPayExclusive = (digiliraPayOnly > valueOrElse(assetStatus, 0)) | |
79 | 84 | let permissionTransferToDP = if ((valueOrElse(assetStatus, banned) > valueOrElse(recipientStatus, 0))) | |
80 | 85 | then true | |
81 | 86 | else (valueOrElse(assetStatus, banned) > valueOrElse(myStatus, 0)) | |
82 | 87 | let permissionPayment = if ((fundBlock > valueOrElse(assetStatus, 0))) | |
83 | 88 | then (valueOrElse(assetStatus, 0) >= paymentBlock) | |
84 | 89 | else false | |
85 | 90 | let permissionTransferNotDP = if ((transferBlock > valueOrElse(assetStatus, 0))) | |
86 | 91 | then true | |
87 | 92 | else (valueOrElse(assetStatus, 0) >= paymentFundBlock) | |
88 | 93 | let isRecovery = if (if (if (digiliraRecipient) | |
89 | 94 | then isFeeRecoveryToken | |
90 | 95 | else false) | |
91 | 96 | then isRecipientGateway | |
92 | 97 | else false) | |
93 | 98 | then myStatusBanned | |
94 | 99 | else false | |
95 | 100 | if (if (isRecovery) | |
96 | 101 | then recovery() | |
97 | 102 | else false) | |
98 | 103 | then true | |
99 | 104 | else if (digiliraRecipient) | |
100 | 105 | then { | |
101 | 106 | let prolog = "Transfer to DigiliraPay recipient: " | |
102 | 107 | if (myStatusBanned) | |
103 | 108 | then throw((prolog + "This account has been suspended.")) | |
104 | 109 | else if (recipientStatusBanned) | |
105 | 110 | then throw((prolog + "Recipient's account has been suspended.")) | |
106 | 111 | else if (assetStatusBanned) | |
107 | 112 | then throw((prolog + "Asset cannot be transfered.")) | |
108 | 113 | else if (permissionTransferToDP) | |
109 | 114 | then throw((prolog + "Asset cannot be transfered. Recipient/Sender is not eligible.")) | |
110 | 115 | else if (isDigiliraPayExclusive) | |
111 | 116 | then throw((prolog + "Non-Transferable Token.")) | |
112 | 117 | else if (isRecipientGateway) | |
113 | 118 | then if (if (permissionPayment) | |
114 | 119 | then true | |
115 | 120 | else isExclusiveToken) | |
116 | 121 | then checkFee(w) | |
117 | 122 | else throw((prolog + "Asset cannot be used on payments.")) | |
118 | 123 | else if (isFeePaymentToken) | |
119 | 124 | then throw((prolog + "Payment Token cannot be used.")) | |
120 | 125 | else checkFee(w) | |
121 | 126 | } | |
122 | 127 | else { | |
123 | 128 | let prolog = "Transfer to not DigiliraPay recipient: " | |
124 | 129 | if (isFeeSponsorToken) | |
125 | 130 | then throw((prolog + "Sponsor Token cannot be used.")) | |
126 | 131 | else if (isFeePaymentToken) | |
127 | 132 | then throw((prolog + "Payment Token cannot be used.")) | |
128 | 133 | else if (myStatusBanned) | |
129 | 134 | then throw((prolog + "This account has been suspended.")) | |
130 | 135 | else if (permissionTransferNotDP) | |
131 | 136 | then throw((prolog + "This asset cannot be transfered.")) | |
132 | 137 | else sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
133 | 138 | } | |
134 | 139 | case t: DataTransaction|SetScriptTransaction => | |
135 | 140 | let s1 = if (sigVerify(t.bodyBytes, t.proofs[0], t.senderPublicKey)) | |
136 | 141 | then 1 | |
137 | 142 | else 0 | |
138 | 143 | let s2 = if (sigVerify(t.bodyBytes, t.proofs[1], digiliraPay)) | |
139 | 144 | then 1 | |
140 | 145 | else 0 | |
141 | 146 | if (((s1 + s2) == 2)) | |
142 | 147 | then true | |
143 | 148 | else throw("Unauthorized") | |
144 | 149 | case _ => | |
145 | 150 | recovery() | |
146 | 151 | } |
github/deemru/w8io/026f985 34.69 ms ◑