RejectPolicy
The RejectPolicy blocks transactions involving addresses on a denylist. It checks every address extracted from the transaction and immediately rejects if any of them is on the list, halting all subsequent policy checks.
Configuration
Address denylist
The denylist defines which addresses are blocked from participating in protected transactions. The list starts empty at deployment and must be populated afterward — until you add addresses, no transactions will be blocked by this policy.
Each address is added or removed individually. When a protected function is called, the extractor provides one or more addresses from the transaction. Which addresses the policy receives depends on the mapper configuration. If any of those addresses is on the denylist, the transaction is rejected immediately.
Runtime behavior
The policy expects a variable number of parameters from the extractor, each an address.
run()— Reverts if any address is on the denylist. ReturnsContinueotherwise.postRun()— No state changes.
API reference
Setter functions
rejectAddress(address account)— Adds an address to the denylist. Reverts if the address is already listed.unrejectAddress(address account)— Removes an address from the denylist. Reverts if the address is not listed.
View functions
addressRejected(address account)— Returnstrueif the address is on the denylist.
Use cases
- Account blocking — Block known malicious addresses, compromised wallets, or sanctioned entities from interacting with the contract.