tx · DLtyqPVWBFNX4mnBLyVikGbqRXS4pTieynBB2WifcGLm 3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy: -1.40000000 Waves 2020.10.16 11:31 [1222900] smart asset 3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy > SELF 0.00000000 D-Aid
{ "type": 15, "id": "DLtyqPVWBFNX4mnBLyVikGbqRXS4pTieynBB2WifcGLm", "fee": 140000000, "feeAssetId": null, "timestamp": 1602837129450, "version": 2, "chainId": 84, "sender": "3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy", "senderPublicKey": "57EFni8M1XesEurFh3c4jnpLExP2PCPd5TRrwMjePAT4", "proofs": [ "3YqgJCVFzkggUGPatZqUms4CxNgYcyvKipKYx7omxQFhYsp7kHDgNQGKwsphvVwkLiT6YhpyxC2Uy9aQzDbYKGBa" ], "assetId": "2CrDXATWpvrriHHr1cVpQM65CaP3m7MJ425xz3tn9zMr", "script": "base64:AgQAAAAFYWRtaW4JAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVT7U3zgWylABs9zUfyaAS1l4Zzgbt82QMAEAAAAB2dhdGV3YXkJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVT7U3zgWylABs9zUfyaAS1l4Zzgbt82QMAEAAAABmJhbm5lZAAAAAAAAAABkwQAAAAHS1lDVmVyMQAAAAAAAAAAAQQAAAAHS1lDVmVyMgAAAAAAAAAAAgQAAAAKaXNNZXJjaGFudAAAAAAAAAAABQQAAAAKS1lDUGVuZGluZwAAAAAAAAAAAAQAAAAJbWF4QW1vdW50AAAAAAAF9eEABAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAQAAAAEZGF0YQkABBoAAAACBQAAAAVhZG1pbgkAAlgAAAABCAgFAAAAAXQAAAAGc2VuZGVyAAAABWJ5dGVzBAAAAAZhbW91bnQIBQAAA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wZXJhdGlvbiBvbmx5Li4GJwgAtg==", "height": 1222900, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F51RDeyjzXmMk2CNTTMUFJG9XFKfMLQVUt3fA3csBGeY Next: 4Ta1aHRXWkUHKX29zeMwemckV3U1dH2RsMB98PSPGdRv Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 2 #-} | |
2 | 2 | {-# CONTENT_TYPE EXPRESSION #-} | |
3 | 3 | let admin = Address(base58'3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy') | |
4 | 4 | let gateway = Address(base58'3NCpyPuNzUaB7LFS4KBzwzWVnXmjur582oy') | |
5 | 5 | let banned = 403 | |
6 | 6 | let KYCVer1 = 1 | |
7 | 7 | let KYCVer2 = 2 | |
8 | 8 | let isMerchant = 5 | |
9 | 9 | let KYCPending = 0 | |
10 | 10 | let maxAmount = 100000000 | |
11 | 11 | match tx { | |
12 | 12 | case t: TransferTransaction => | |
13 | 13 | let data = getInteger(admin, toBase58String(t.sender.bytes)) | |
14 | 14 | let amount = t.amount | |
15 | 15 | let assetId = extract(t.assetId) | |
16 | 16 | let isUser = getInteger(admin, toBase58String(addressFromRecipient(t.recipient).bytes)) | |
17 | 17 | if (!(isDefined(data))) | |
18 | 18 | then throw("You are not a registered member. You cannot transfer this SmartAsset!") | |
19 | 19 | else if ((data == KYCPending)) | |
20 | 20 | then throw("KYC Pending. You cannot transfer this SmartAsset") | |
21 | 21 | else if ((data == KYCVer1)) | |
22 | 22 | then if ((t.recipient == gateway)) | |
23 | 23 | then true | |
24 | 24 | else if (if (if ((isUser == KYCVer1)) | |
25 | 25 | then true | |
26 | 26 | else (isUser == KYCVer2)) | |
27 | 27 | then true | |
28 | 28 | else (isUser == isMerchant)) | |
29 | 29 | then if ((maxAmount >= amount)) | |
30 | 30 | then true | |
31 | 31 | else throw("Cannot transfer please verify your acount. Amount is too much!") | |
32 | 32 | else if ((isUser == KYCPending)) | |
33 | 33 | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") | |
34 | 34 | else if ((isUser == banned)) | |
35 | 35 | then throw("The recipient is banned. You cannot transfer this SmartAsset") | |
36 | 36 | else throw("Undefined situation!") | |
37 | 37 | else if ((data == KYCVer2)) | |
38 | 38 | then if (isDefined(isUser)) | |
39 | 39 | then if ((isUser == KYCVer1)) | |
40 | 40 | then if ((maxAmount >= amount)) | |
41 | 41 | then true | |
42 | 42 | else throw("Cannot transfer please verify your acount. Amount is too much!") | |
43 | 43 | else if ((isUser == KYCPending)) | |
44 | 44 | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") | |
45 | 45 | else if (if ((isUser == KYCVer2)) | |
46 | 46 | then true | |
47 | 47 | else (isUser == isMerchant)) | |
48 | 48 | then true | |
49 | 49 | else if ((isUser == banned)) | |
50 | 50 | then throw("The recipient is banned. You cannot transfer this SmartAsset") | |
51 | 51 | else throw("Undefined situation!") | |
52 | 52 | else throw("The recipient is not authorized to possess this SmartAsset!") | |
53 | 53 | else if ((data == banned)) | |
54 | 54 | then throw("Your acount has been suspended!") | |
55 | 55 | else if ((data == isMerchant)) | |
56 | 56 | then if ((t.recipient == gateway)) | |
57 | 57 | then true | |
58 | 58 | else throw("Cannot transfer this asset to another account.") | |
59 | 59 | else throw("Undefined situation!") | |
60 | 60 | case mtt: MassTransferTransaction => | |
61 | 61 | let data = getInteger(admin, toBase58String(mtt.sender.bytes)) | |
62 | 62 | let amount = mtt.totalAmount | |
63 | 63 | let assetId = extract(mtt.assetId) | |
64 | 64 | let transferCount = mtt.transferCount | |
65 | 65 | let firstRecipient = mtt.transfers[0].recipient | |
66 | 66 | let secondRecipient = mtt.transfers[1].recipient | |
67 | 67 | let firstAmount = mtt.transfers[0].amount | |
68 | 68 | let secondAmount = mtt.transfers[1].amount | |
69 | 69 | let issueTransaction = transactionById(assetId) | |
70 | 70 | let isUser = getInteger(admin, toBase58String(addressFromRecipient(secondRecipient).bytes)) | |
71 | 71 | if (!(isDefined(isUser))) | |
72 | 72 | then false | |
73 | 73 | else if ((transferCount > 2)) | |
74 | 74 | then throw("not allowed") | |
75 | 75 | else if (!(isDefined(data))) | |
76 | 76 | then throw("You are not a registered member. You cannot transfer this SmartAsset!") | |
77 | 77 | else if ((data == KYCPending)) | |
78 | 78 | then throw("KYC Pending. You cannot transfer this SmartAsset") | |
79 | 79 | else if ((data == KYCVer1)) | |
80 | 80 | then if ((firstRecipient != gateway)) | |
81 | 81 | then throw("First recipient must be the issuer") | |
82 | 82 | else if (if ((isUser == KYCVer1)) | |
83 | 83 | then true | |
84 | 84 | else (isUser == KYCVer2)) | |
85 | 85 | then if ((maxAmount >= amount)) | |
86 | 86 | then match issueTransaction { | |
87 | 87 | case issueTx: IssueTransaction => | |
88 | 88 | let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey) | |
89 | 89 | let taxSize = extract(getInteger(issuerAddress, toBase58String(assetId))) | |
90 | 90 | if ((firstRecipient == issuerAddress)) | |
91 | 91 | then (firstAmount >= ((secondAmount / 1000) * taxSize)) | |
92 | 92 | else false | |
93 | 93 | case _ => | |
94 | 94 | false | |
95 | 95 | } | |
96 | 96 | else throw("Cannot transfer please verify your acount. Amount is too much!") | |
97 | 97 | else if ((isUser == KYCPending)) | |
98 | 98 | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") | |
99 | 99 | else if ((isUser == banned)) | |
100 | 100 | then throw("The recipient is banned. You cannot transfer this SmartAsset") | |
101 | 101 | else if ((isUser == isMerchant)) | |
102 | 102 | then throw("Merchants cannot recieve mass payments") | |
103 | 103 | else throw("Undefined situation!") | |
104 | 104 | else if ((data == KYCVer2)) | |
105 | 105 | then if (isDefined(isUser)) | |
106 | 106 | then if ((isUser == KYCVer1)) | |
107 | 107 | then if ((maxAmount >= amount)) | |
108 | 108 | then match issueTransaction { | |
109 | 109 | case issueTx: IssueTransaction => | |
110 | 110 | let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey) | |
111 | 111 | let taxSize = extract(getInteger(issuerAddress, toBase58String(assetId))) | |
112 | 112 | if ((firstRecipient == issuerAddress)) | |
113 | 113 | then (firstAmount >= ((secondAmount / 1000) * taxSize)) | |
114 | 114 | else false | |
115 | 115 | case _ => | |
116 | 116 | false | |
117 | 117 | } | |
118 | 118 | else throw("Cannot transfer please verify your acount. Amount is too much!") | |
119 | 119 | else if ((isUser == KYCVer1)) | |
120 | 120 | then throw("The recipient is in KYC pending status. You cannot transfer this SmartAsset") | |
121 | 121 | else if ((isUser == KYCVer2)) | |
122 | 122 | then match issueTransaction { | |
123 | 123 | case issueTx: IssueTransaction => | |
124 | 124 | let issuerAddress = addressFromPublicKey(issueTx.senderPublicKey) | |
125 | 125 | let taxSize = extract(getInteger(issuerAddress, toBase58String(assetId))) | |
126 | 126 | if ((firstRecipient == issuerAddress)) | |
127 | 127 | then (firstAmount >= ((secondAmount / 1000) * taxSize)) | |
128 | 128 | else false | |
129 | 129 | case _ => | |
130 | 130 | false | |
131 | 131 | } | |
132 | 132 | else if ((isUser == banned)) | |
133 | 133 | then throw("The recipient is banned. You cannot transfer this SmartAsset") | |
134 | 134 | else if ((isUser == isMerchant)) | |
135 | 135 | then throw("Merchants cannot recieve mass payments") | |
136 | 136 | else throw("Undefined situation!") | |
137 | 137 | else throw("The recipient is not authorized to possess this SmartAsset!") | |
138 | 138 | else if ((data == banned)) | |
139 | 139 | then throw("Your acount has been suspended!") | |
140 | 140 | else if ((data == isMerchant)) | |
141 | 141 | then throw("Merchant account cannot perform mass transfer") | |
142 | 142 | else throw("Undefined situation!") | |
143 | 143 | case ex: ExchangeTransaction => | |
144 | 144 | false | |
145 | 145 | case b: BurnTransaction => | |
146 | 146 | false | |
147 | 147 | case script: SetAssetScriptTransaction => | |
148 | 148 | if ((script.sender == admin)) | |
149 | 149 | then true | |
150 | 150 | else throw("Admin operation only..") | |
151 | 151 | case _ => | |
152 | 152 | true | |
153 | 153 | } |
github/deemru/w8io/fabc49c 35.33 ms ◑