Skip to content

Commit 599adde

Browse files
committed
feat(evm): add PassthroughAuth/IAuth
1 parent 0e1a04e commit 599adde

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

packages/evm/contracts/auth/IAuth.sol

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// SPDX-License-Identifier: GPL-3.0
2+
pragma solidity ^0.8.24;
3+
4+
/// @title IAuth Interface
5+
/// @dev Interface for authorization contracts.
6+
interface IAuth {
7+
/// @notice Checks if an address is authorized
8+
/// @param addr The address to check for authorization
9+
/// @return bool Returns true if the address is authorized, false otherwise
10+
function isAuthorized(address addr) external view returns (bool);
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// SPDX-License-Identifier: GPL-3.0
2+
pragma solidity ^0.8.24;
3+
import {IAuth} from "contracts/auth/IAuth.sol";
4+
/// @title Passthrough Authorization Contract
5+
/// @dev Implements the IAuth interface, always authorizing access.
6+
contract PassthroughAuth is IAuth {
7+
/// @notice Checks if an address is authorized
8+
/// @dev In this implementation, all addresses are authorized.
9+
/// @param user The address to check for authorization
10+
/// @return bool Always returns true, indicating any address is authorized
11+
function isAuthorized(address user) public view override returns (bool) {
12+
return true;
13+
}
14+
}

0 commit comments

Comments
 (0)