-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathHubbleBase.sol
64 lines (50 loc) · 1.59 KB
/
HubbleBase.sol
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.9;
import { ERC2771Context } from "@openzeppelin/contracts/metatx/ERC2771Context.sol";
import { Pausable } from "@openzeppelin/contracts/security/Pausable.sol";
import { Context } from "@openzeppelin/contracts/utils/Context.sol";
import { Governable } from "./Governable.sol";
/**
* @title This contract is used for posting margin (collateral), realizing PnL etc.
* @notice Most notable operations include addMargin, removeMargin and liquidations
*/
contract HubbleBase is Governable, Pausable, ERC2771Context {
/**
* @dev _trustedForwarder is an immutable var in ERC2771Context
*/
constructor(address _trustedForwarder) ERC2771Context(_trustedForwarder) {}
function trustedForwarder() external view returns(address) {
return _trustedForwarder;
}
/* ****************** */
/* Internal View */
/* ****************** */
function _msgSender()
internal
view
override(Context, ERC2771Context)
returns (address)
{
return super._msgSender();
}
function _msgData()
internal
view
override(Context, ERC2771Context)
returns (bytes memory)
{
return super._msgData();
}
function _blockTimestamp() internal view virtual returns (uint256) {
return block.timestamp;
}
/* ****************** */
/* Governance */
/* ****************** */
function pause() external onlyGovernance {
_pause();
}
function unpause() external onlyGovernance {
_unpause();
}
}