Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove upgradeable app and fix #146 #148

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/user/AppBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,7 @@ 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");
modifier onlyORMP() virtual {
_;
}

Expand Down
13 changes: 9 additions & 4 deletions src/user/Application.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,18 @@ pragma solidity ^0.8.17;
import "./AppBase.sol";

abstract contract Application is AppBase {
address private immutable _ORMP;
address public immutable ORMP;

modifier onlyORMP() override {
require(ORMP == msg.sender, "!ormp");
_;
}

constructor(address ormp) {
_ORMP = ormp;
ORMP = ormp;
}

function protocol() public view virtual override returns (address) {
return _ORMP;
function _setAppConfig(address oracle, address relayer) internal virtual {
IORMP(ORMP).setAppConfig(oracle, relayer);
}
}
39 changes: 0 additions & 39 deletions src/user/UpgradeableApplication.sol

This file was deleted.

Loading