Skip to content

Commit

Permalink
refactor: add ownable interface
Browse files Browse the repository at this point in the history
  • Loading branch information
evandrosaturnino committed Feb 3, 2024
1 parent 6da32f8 commit e141af1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
7 changes: 7 additions & 0 deletions packages/contracts/contracts/Dependencies/IOwnable.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;

interface IOwnable {
function transferOwnership(address newOwner) external;
}
4 changes: 3 additions & 1 deletion packages/contracts/contracts/Dependencies/Ownable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

pragma solidity ^0.8.17;

import "./IOwnable.sol";

/**
* Based on OpenZeppelin's Ownable contract:
* https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol
Expand All @@ -14,7 +16,7 @@ pragma solidity ^0.8.17;
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
contract Ownable is IOwnable {
address private _owner;

event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
Expand Down
4 changes: 2 additions & 2 deletions packages/contracts/contracts/Interfaces/ITHUSDToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
import "../Dependencies/IERC2612.sol";
import "../Dependencies/IOwnable.sol";

interface ITHUSDToken is IERC20Metadata, IERC2612 {
interface ITHUSDToken is IERC20Metadata, IOwnable, IERC2612 {

// --- Events ---

Expand All @@ -30,5 +31,4 @@ interface ITHUSDToken is IERC20Metadata, IERC2612 {
// --- Governance functions ---
function startRevokeMintList(address _account) external;
function finalizeRevokeMintList() external;
function transferOwnership(address newOwner) external;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

pragma solidity ^0.8.17;

import "../Interfaces/ITHUSDToken.sol";
import "../Dependencies/CheckContract.sol";
import "../Dependencies/Ownable.sol";
import "./Interfaces/ITHUSDToken.sol";
import "./Dependencies/CheckContract.sol";
import "./Dependencies/Ownable.sol";

contract THUSDOwner is Ownable, CheckContract {
ITHUSDToken private thusdToken;
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4385,11 +4385,6 @@
find-up "^4.1.0"
fs-extra "^8.1.0"

"@openzeppelin/[email protected]":
version "4.9.0"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-4.9.0.tgz#70aaef469c8ac5bb0ff781480f3d321cbf7be3a8"
integrity sha512-+6i2j6vr2fdudTqkBvG+UOosankukxYzg3WN1nqU7ijjQ5A4osWaD3ip6CEz6YvDoSdZgcFVZoiGr7zRlUUoZw==

"@openzeppelin/[email protected]":
version "4.9.2"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.9.2.tgz#1cb2d5e4d3360141a17dbc45094a8cad6aac16c1"
Expand Down

0 comments on commit e141af1

Please sign in to comment.