-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy pathHookBase.sol
More file actions
35 lines (31 loc) · 1.01 KB
/
HookBase.sol
File metadata and controls
35 lines (31 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "solmate/utils/ReentrancyGuard.sol";
import "../common/Errors.sol";
import "../common/Constants.sol";
import "../interfaces/IHook.sol";
import "../utils/RescueBase.sol";
/**
* @title Base contract for super token and vault
* @notice It contains relevant execution payload storages.
* @dev This contract implements Socket's IPlug to enable message bridging and IMessageBridge
* to support any type of message bridge.
*/
abstract contract HookBase is ReentrancyGuard, IHook, RescueBase {
address public immutable vaultOrController;
bytes32 public hookType;
/**
* @notice Constructor for creating a new SuperToken.
*/
constructor(
address owner_,
address vaultOrController_
) AccessControl(owner_) {
vaultOrController = vaultOrController_;
_grantRole(RESCUE_ROLE, owner_);
}
modifier isVaultOrController() {
if (msg.sender != vaultOrController) revert NotAuthorized();
_;
}
}