Skip to content

Commit

Permalink
move to IAuthZone
Browse files Browse the repository at this point in the history
  • Loading branch information
anukul committed Nov 2, 2023
1 parent dcbba6b commit 22dc7c3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 25 deletions.
28 changes: 28 additions & 0 deletions src/zone/extensions/IAuthZone.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;

interface IAuthZone {
event FilterUpdated(address indexed actor, Filter filter);

struct RangeFilter {
uint gt;
uint lt;
}

struct TokenFilter {
address token;
RangeFilter amount;
}

struct Filter {
address offerer;
TokenFilter[] offer;
TokenFilter consideration;
RangeFilter deadline;
RangeFilter nonce;
}

function setAuthorizationFilter(address actor, Filter calldata filter) external;

function authorizationFilter(address actor) external view returns (Filter memory);
}
24 changes: 0 additions & 24 deletions src/zone/extensions/IMainZone.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,6 @@ interface IMainZone {

event SecondaryZoneSet(address indexed newSecondayZone);

event FilterUpdated(address indexed actor, Filter filter);

struct RangeFilter {
uint gt;
uint lt;
}

struct TokenFilter {
address token;
RangeFilter amount;
}

struct Filter {
address offerer;
TokenFilter[] offer;
TokenFilter consideration;
RangeFilter deadline;
RangeFilter nonce;
}

/**
* @notice Get the secondary zone address that performs additional validation for this zone.
*
Expand Down Expand Up @@ -57,8 +37,4 @@ interface IMainZone {
* @notice Restricted function to resume regular validation functionality.
*/
function unpause() external;

function setAuthorizationFilter(address actor, Filter calldata filter) external;

function authorizationFilter(address actor) external view returns (Filter memory);
}
3 changes: 2 additions & 1 deletion src/zone/extensions/MainZone.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ pragma solidity 0.8.17;

// Inheritances
import {IMainZone} from "./IMainZone.sol";
import {IAuthZone} from "./IAuthZone.sol";
import {Zone} from "../Zone.sol";
import {AccessControlDefaultAdminRules} from "@openzeppelin/access/AccessControlDefaultAdminRules.sol";
import {Pausable} from "@openzeppelin/security/Pausable.sol";

// Interfaces
import {IFloodPlain} from "../../flood-plain/IFloodPlain.sol";

contract MainZone is Zone, IMainZone, AccessControlDefaultAdminRules, Pausable {
contract MainZone is Zone, IMainZone, IAuthZone, AccessControlDefaultAdminRules, Pausable {
bytes32 public constant CALLER_ROLE = keccak256("CALLER_ROLE");
bytes32 public constant FULFILLER_ROLE = keccak256("FULFILLER_ROLE");
bytes32 public constant BOOK_ROLE = keccak256("BOOK_ROLE");
Expand Down

0 comments on commit 22dc7c3

Please sign in to comment.