Skip to content

Commit d36f6a0

Browse files
committed
feat: internalize owner
1 parent ad03870 commit d36f6a0

File tree

2 files changed

+21
-35
lines changed

2 files changed

+21
-35
lines changed

src/Blue.sol

+21-4
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import {IOracle} from "src/interfaces/IOracle.sol";
77
import {MathLib} from "src/libraries/MathLib.sol";
88
import {SafeTransferLib} from "src/libraries/SafeTransferLib.sol";
99

10-
import {Ownable} from "src/Ownable.sol";
11-
1210
uint constant WAD = 1e18;
1311

1412
uint constant alpha = 0.5e18;
@@ -31,12 +29,14 @@ function irm(uint utilization) pure returns (uint) {
3129
return utilization / 365 days;
3230
}
3331

34-
contract Blue is Ownable {
32+
contract Blue {
3533
using MathLib for uint;
3634
using SafeTransferLib for IERC20;
3735

3836
// Storage.
3937

38+
// Owner.
39+
address public owner;
4040
// User' supply balances.
4141
mapping(Id => mapping(address => uint)) public supplyShare;
4242
// User' borrow balances.
@@ -54,7 +54,24 @@ contract Blue is Ownable {
5454
// Interests last update (used to check if a market has been created).
5555
mapping(Id => uint) public lastUpdate;
5656

57-
constructor(address owner) Ownable(owner) {}
57+
// Constructor.
58+
59+
constructor(address newOwner) {
60+
owner = newOwner;
61+
}
62+
63+
// Modifiers.
64+
65+
modifier onlyOwner() {
66+
require(msg.sender == owner, "not owner");
67+
_;
68+
}
69+
70+
// Only owner functions.
71+
72+
function transferOwnership(address newOwner) external onlyOwner {
73+
owner = newOwner;
74+
}
5875

5976
// Markets management.
6077

src/Ownable.sol

-31
This file was deleted.

0 commit comments

Comments
 (0)