forked from matter-labs/era-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
177f18e
commit b91d35b
Showing
1 changed file
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
// SPDX-License-Identifier: MIT | ||
|
||
pragma solidity 0.8.20; | ||
|
||
interface IAllowList { | ||
/*////////////////////////////////////////////////////////////// | ||
EVENTS | ||
//////////////////////////////////////////////////////////////*/ | ||
|
||
/// @notice Access mode of target contract is changed | ||
event UpdateAccessMode(address indexed target, AccessMode previousMode, AccessMode newMode); | ||
|
||
/// @notice Permission to call is changed | ||
event UpdateCallPermission(address indexed caller, address indexed target, bytes4 indexed functionSig, bool status); | ||
|
||
/// @notice Deposit limit of a token is changed | ||
event UpdateDepositLimit(address indexed l1Token, bool depositLimitation, uint256 depositCap); | ||
|
||
/// @notice Type of access to a specific contract includes three different modes | ||
/// @param Closed No one has access to the contract | ||
/// @param SpecialAccessOnly Any address with granted special access can interact with a contract (see `hasSpecialAccessToCall`) | ||
/// @param Public Everyone can interact with a contract | ||
enum AccessMode { | ||
Closed, | ||
SpecialAccessOnly, | ||
Public | ||
} | ||
|
||
/// @dev A struct that contains deposit limit data of a token | ||
/// @param depositLimitation Whether any deposit limitation is placed or not | ||
/// @param depositCap The maximum amount that can be deposited. | ||
struct Deposit { | ||
bool depositLimitation; | ||
uint256 depositCap; | ||
} | ||
|
||
/*////////////////////////////////////////////////////////////// | ||
GETTERS | ||
//////////////////////////////////////////////////////////////*/ | ||
|
||
function getAccessMode(address _target) external view returns (AccessMode); | ||
|
||
function hasSpecialAccessToCall(address _caller, address _target, bytes4 _functionSig) external view returns (bool); | ||
|
||
function canCall(address _caller, address _target, bytes4 _functionSig) external view returns (bool); | ||
|
||
function getTokenDepositLimitData(address _l1Token) external view returns (Deposit memory); | ||
|
||
/*////////////////////////////////////////////////////////////// | ||
ALLOW LIST LOGIC | ||
//////////////////////////////////////////////////////////////*/ | ||
|
||
function setBatchAccessMode(address[] calldata _targets, AccessMode[] calldata _accessMode) external; | ||
|
||
function setAccessMode(address _target, AccessMode _accessMode) external; | ||
|
||
function setBatchPermissionToCall( | ||
address[] calldata _callers, | ||
address[] calldata _targets, | ||
bytes4[] calldata _functionSigs, | ||
bool[] calldata _enables | ||
) external; | ||
|
||
function setPermissionToCall(address _caller, address _target, bytes4 _functionSig, bool _enable) external; | ||
|
||
/*////////////////////////////////////////////////////////////// | ||
DEPOSIT LIMIT LOGIC | ||
//////////////////////////////////////////////////////////////*/ | ||
|
||
function setDepositLimit(address _l1Token, bool _depositLimitation, uint256 _depositCap) external; | ||
} |