diff --git a/src/user/AppBase.sol b/src/user/AppBase.sol index a102a23..956d673 100644 --- a/src/user/AppBase.sol +++ b/src/user/AppBase.sol @@ -17,10 +17,16 @@ pragma solidity ^0.8.17; +import "../interfaces/IORMP.sol"; + // https://eips.ethereum.org/EIPS/eip-5164 abstract contract AppBase { function protocol() public view virtual returns (address); + function _setAppConfig(address oracle, address relayer) internal virtual { + IORMP(protocol()).setAppConfig(oracle, relayer); + } + modifier onlyORMP() { require(protocol() == msg.sender, "!ormp-recver"); _; diff --git a/src/user/Application.sol b/src/user/Application.sol index 458e470..f981bfe 100644 --- a/src/user/Application.sol +++ b/src/user/Application.sol @@ -17,7 +17,6 @@ pragma solidity ^0.8.17; -import "../interfaces/IORMP.sol"; import "./AppBase.sol"; abstract contract Application is AppBase { @@ -30,8 +29,4 @@ abstract contract Application is AppBase { function protocol() public view virtual override returns (address) { return _ORMP; } - - function _setAppConfig(address oracle, address relayer) internal virtual { - IORMP(protocol()).setAppConfig(oracle, relayer); - } } diff --git a/src/user/UpgradeableApplication.sol b/src/user/UpgradeableApplication.sol index 1f0bc47..886f2c3 100644 --- a/src/user/UpgradeableApplication.sol +++ b/src/user/UpgradeableApplication.sol @@ -17,7 +17,6 @@ pragma solidity ^0.8.17; -import "../interfaces/IORMP.sol"; import "./AppBase.sol"; abstract contract UpgradeableApplication is AppBase { @@ -37,8 +36,4 @@ abstract contract UpgradeableApplication is AppBase { _ormp = ormp; emit SetORMP(ormp); } - - function _setAppConfig(address oracle, address relayer) internal virtual { - IORMP(protocol()).setAppConfig(oracle, relayer); - } }