Skip to content

Commit

Permalink
Simply Application (#139)
Browse files Browse the repository at this point in the history
* simply

* simply
  • Loading branch information
hujw77 authored Mar 13, 2024
1 parent c5f0ff0 commit e0aeb25
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
6 changes: 6 additions & 0 deletions src/user/AppBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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");
_;
Expand Down
5 changes: 0 additions & 5 deletions src/user/Application.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

pragma solidity ^0.8.17;

import "../interfaces/IORMP.sol";
import "./AppBase.sol";

abstract contract Application is AppBase {
Expand All @@ -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);
}
}
5 changes: 0 additions & 5 deletions src/user/UpgradeableApplication.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

pragma solidity ^0.8.17;

import "../interfaces/IORMP.sol";
import "./AppBase.sol";

abstract contract UpgradeableApplication is AppBase {
Expand All @@ -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);
}
}

0 comments on commit e0aeb25

Please sign in to comment.