Skip to content

Commit

Permalink
add private (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 authored Mar 12, 2024
1 parent 152d678 commit d456a45
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/user/Application.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,21 @@ import "../interfaces/IORMP.sol";
import "./AppBase.sol";

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

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

function ormpSender() public view virtual override returns (address) {
return ORMP;
return _ORMP;
}

function ormpRecver() public view virtual override returns (address) {
return ORMP;
}

function _setAppConfig(address oracle, address relayer) internal virtual {
IORMP(ORMP).setAppConfig(oracle, relayer);
IORMP(_ORMP).setAppConfig(oracle, relayer);
}
}
20 changes: 10 additions & 10 deletions src/user/UpgradeableApplication.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,40 +21,40 @@ import "../interfaces/IORMP.sol";
import "./AppBase.sol";

abstract contract UpgradeableApplication is AppBase {
address public sender;
address public recver;
address private sender;
address private recver;

event SetSender(address ormp);
event SetRecver(address ormp);

constructor(address ormp) {
sender = ormp;
recver = ormp;
_sender = ormp;
_recver = ormp;
}

function ormpSender() public view virtual override returns (address) {
return sender;
return _sender;
}

function ormpRecver() public view virtual override returns (address) {
return recver;
return _recver;
}

function _setSender(address ormp) internal virtual {
sender = ormp;
_sender = ormp;
emit SetSender(ormp);
}

function _setRecver(address ormp) internal virtual {
recver = ormp;
_recver = ormp;
emit SetRecver(ormp);
}

function _setSenderConfig(address oracle, address relayer) internal virtual {
IORMP(sender).setAppConfig(oracle, relayer);
IORMP(ormpSender()).setAppConfig(oracle, relayer);
}

function _setRecverConfig(address oracle, address relayer) internal virtual {
IORMP(recver).setAppConfig(oracle, relayer);
IORMP(ormpRecver()).setAppConfig(oracle, relayer);
}
}

0 comments on commit d456a45

Please sign in to comment.