-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace explicit module owner address with mediator owner
- Loading branch information
1 parent
51e57e5
commit 9427d0f
Showing
10 changed files
with
92 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pragma solidity 0.7.5; | ||
|
||
interface IOwnable { | ||
function owner() external view returns (address); | ||
} |
30 changes: 0 additions & 30 deletions
30
contracts/upgradeable_contracts/modules/MediatorOwnableModule.sol
This file was deleted.
Oops, something went wrong.
44 changes: 44 additions & 0 deletions
44
contracts/upgradeable_contracts/modules/OmnibridgeModule.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
pragma solidity 0.7.5; | ||
|
||
import "@openzeppelin/contracts/utils/Address.sol"; | ||
import "../../interfaces/IOwnable.sol"; | ||
|
||
/** | ||
* @title OmnibridgeModule | ||
* @dev Common functionality for Omnibridge extension non-upgradeable module. | ||
*/ | ||
abstract contract OmnibridgeModule is IOwnable { | ||
IOwnable public mediator; | ||
|
||
/** | ||
* @dev Initializes this contract. | ||
* @param _mediator address of the Omnibridge mediator contract that is allowed to perform additional actions on the particular module. | ||
*/ | ||
constructor(IOwnable _mediator) { | ||
mediator = _mediator; | ||
} | ||
|
||
/** | ||
* @dev Throws if sender is not the owner of this contract. | ||
*/ | ||
modifier onlyOwner { | ||
require(msg.sender == owner()); | ||
_; | ||
} | ||
|
||
/** | ||
* @dev Throws if sender is not the mediator. | ||
*/ | ||
modifier onlyMediator { | ||
require(msg.sender == address(mediator)); | ||
_; | ||
} | ||
|
||
/** | ||
* Tells the contract owner address that is allowed to change configuration of this module. | ||
* @return address of the owner account. | ||
*/ | ||
function owner() public view override returns (address) { | ||
return mediator.owner(); | ||
} | ||
} |
8 changes: 4 additions & 4 deletions
8
contracts/upgradeable_contracts/modules/factory/TokenFactory.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters