-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
40 changed files
with
666 additions
and
618 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// SPDX-License-Identifier: GPL-3.0-only | ||
pragma solidity >=0.8.9; | ||
|
||
import "../interfaces/adapters/IMessageReceiverAdapter.sol"; | ||
import "../controllers/MessageReceiverGAC.sol"; | ||
|
||
abstract contract BaseReceiverAdapter is IMessageReceiverAdapter { | ||
MessageReceiverGAC public immutable receiverGAC; | ||
address public senderAdapter; | ||
|
||
modifier onlyGlobalOwner() { | ||
if (!receiverGAC.isGlobalOwner(msg.sender)) { | ||
revert Error.CALLER_NOT_OWNER(); | ||
} | ||
_; | ||
} | ||
|
||
constructor(address _receiverGAC) { | ||
if (_receiverGAC == address(0)) { | ||
revert Error.ZERO_ADDRESS_INPUT(); | ||
} | ||
receiverGAC = MessageReceiverGAC(_receiverGAC); | ||
} | ||
|
||
/// @inheritdoc IMessageReceiverAdapter | ||
function updateSenderAdapter(address _newSender) external override onlyGlobalOwner { | ||
if (_newSender == address(0)) { | ||
revert Error.ZERO_ADDRESS_INPUT(); | ||
} | ||
|
||
address oldSender = senderAdapter; | ||
senderAdapter = _newSender; | ||
|
||
emit SenderAdapterUpdated(oldSender, _newSender); | ||
} | ||
} |
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
Oops, something went wrong.