Skip to content

Commit

Permalink
feat: internalize owner
Browse files Browse the repository at this point in the history
  • Loading branch information
MerlinEgalite committed Jul 6, 2023
1 parent ad03870 commit d36f6a0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 35 deletions.
25 changes: 21 additions & 4 deletions src/Blue.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import {IOracle} from "src/interfaces/IOracle.sol";
import {MathLib} from "src/libraries/MathLib.sol";
import {SafeTransferLib} from "src/libraries/SafeTransferLib.sol";

import {Ownable} from "src/Ownable.sol";

uint constant WAD = 1e18;

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

contract Blue is Ownable {
contract Blue {
using MathLib for uint;
using SafeTransferLib for IERC20;

// Storage.

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

constructor(address owner) Ownable(owner) {}
// Constructor.

constructor(address newOwner) {
owner = newOwner;
}

// Modifiers.

modifier onlyOwner() {
require(msg.sender == owner, "not owner");
_;
}

// Only owner functions.

function transferOwnership(address newOwner) external onlyOwner {
owner = newOwner;
}

// Markets management.

Expand Down
31 changes: 0 additions & 31 deletions src/Ownable.sol

This file was deleted.

0 comments on commit d36f6a0

Please sign in to comment.