33pragma solidity ^ 0.8.20 ;
44
55/* ==== Abtract contracts === */
6- import {RuleBlacklistInvariantStorage} from "./abstract/RuleAddressSet/invariantStorage/RuleBlacklistInvariantStorage.sol " ;
6+ import {RuleBlacklistInvariantStorage} from
7+ "./abstract/RuleAddressSet/invariantStorage/RuleBlacklistInvariantStorage.sol " ;
78import {RuleAddressSet} from "./abstract/RuleAddressSet/RuleAddressSet.sol " ;
89import {RuleValidateTransfer} from "./abstract/RuleValidateTransfer.sol " ;
910/* ==== Interfaces === */
@@ -54,7 +55,7 @@ contract RuleBlacklist is RuleValidateTransfer, RuleAddressSet, RuleBlacklistInv
5455 /*
5556 * @inheritdoc IERC7943NonFungibleComplianceExtend
5657 */
57- function detectTransferRestriction (address from , address to , uint256 /* tokenId */ , uint256 value )
58+ function detectTransferRestriction (address from , address to , uint256 , /* tokenId */ uint256 value )
5859 public
5960 view
6061 override (IERC7943NonFungibleComplianceExtend )
@@ -80,14 +81,15 @@ contract RuleBlacklist is RuleValidateTransfer, RuleAddressSet, RuleBlacklistInv
8081 }
8182
8283 /**
83- * @inheritdoc IERC7943NonFungibleComplianceExtend
84- */
85- function detectTransferRestrictionFrom (address spender , address from , address to , uint256 /* tokenId */ , uint256 value )
86- public
87- view
88- override (IERC7943NonFungibleComplianceExtend )
89- returns (uint8 )
90- {
84+ * @inheritdoc IERC7943NonFungibleComplianceExtend
85+ */
86+ function detectTransferRestrictionFrom (
87+ address spender ,
88+ address from ,
89+ address to ,
90+ uint256 , /* tokenId */
91+ uint256 value
92+ ) public view override (IERC7943NonFungibleComplianceExtend ) returns (uint8 ) {
9193 return detectTransferRestrictionFrom (spender, from, to, value);
9294 }
9395
@@ -97,7 +99,13 @@ contract RuleBlacklist is RuleValidateTransfer, RuleAddressSet, RuleBlacklistInv
9799 * @return true if the restriction code is known, false otherwise
98100 *
99101 */
100- function canReturnTransferRestrictionCode (uint8 _restrictionCode ) public pure virtual override (IRule) returns (bool ) {
102+ function canReturnTransferRestrictionCode (uint8 _restrictionCode )
103+ public
104+ pure
105+ virtual
106+ override (IRule)
107+ returns (bool )
108+ {
101109 return _restrictionCode == CODE_ADDRESS_FROM_IS_BLACKLISTED
102110 || _restrictionCode == CODE_ADDRESS_TO_IS_BLACKLISTED || _restrictionCode == CODE_ADDRESS_SPENDER_IS_BLACKLISTED;
103111 }
@@ -108,7 +116,13 @@ contract RuleBlacklist is RuleValidateTransfer, RuleAddressSet, RuleBlacklistInv
108116 * @return true if the transfer is valid, false otherwise
109117 *
110118 */
111- function messageForTransferRestriction (uint8 _restrictionCode ) public pure virtual override (IERC1404 ) returns (string memory ) {
119+ function messageForTransferRestriction (uint8 _restrictionCode )
120+ public
121+ pure
122+ virtual
123+ override (IERC1404 )
124+ returns (string memory )
125+ {
112126 if (_restrictionCode == CODE_ADDRESS_FROM_IS_BLACKLISTED) {
113127 return TEXT_ADDRESS_FROM_IS_BLACKLISTED;
114128 } else if (_restrictionCode == CODE_ADDRESS_TO_IS_BLACKLISTED) {
@@ -122,17 +136,38 @@ contract RuleBlacklist is RuleValidateTransfer, RuleAddressSet, RuleBlacklistInv
122136
123137 /* ============ State Functions ============ */
124138
125- function transferred (address from , address to , uint256 value ) public view virtual override (IERC3643IComplianceContract ) {
139+ function transferred (address from , address to , uint256 value )
140+ public
141+ view
142+ virtual
143+ override (IERC3643IComplianceContract )
144+ {
126145 uint8 code = this .detectTransferRestriction (from, to, value);
127- require (code == uint8 (REJECTED_CODE_BASE.TRANSFER_OK), RuleBlacklist_InvalidTransfer (address (this ), from, to, value, code));
146+ require (
147+ code == uint8 (REJECTED_CODE_BASE.TRANSFER_OK),
148+ RuleBlacklist_InvalidTransfer (address (this ), from, to, value, code)
149+ );
128150 }
129151
130- function transferred (address spender , address from , address to , uint256 value ) public view virtual override (IRuleEngine) {
152+ function transferred (address spender , address from , address to , uint256 value )
153+ public
154+ view
155+ virtual
156+ override (IRuleEngine)
157+ {
131158 uint8 code = this .detectTransferRestrictionFrom (spender, from, to, value);
132- require (code == uint8 (REJECTED_CODE_BASE.TRANSFER_OK), RuleBlacklist_InvalidTransfer (address (this ), from, to, value, code));
159+ require (
160+ code == uint8 (REJECTED_CODE_BASE.TRANSFER_OK),
161+ RuleBlacklist_InvalidTransfer (address (this ), from, to, value, code)
162+ );
133163 }
134164
135- function transferred (address spender , address from , address to , uint256 /* tokenId */ , uint256 value ) public view virtual override (IERC7943NonFungibleComplianceExtend ) {
165+ function transferred (address spender , address from , address to , uint256 , /* tokenId */ uint256 value )
166+ public
167+ view
168+ virtual
169+ override (IERC7943NonFungibleComplianceExtend )
170+ {
136171 transferred (spender, from, to, value);
137172 }
138173}
0 commit comments