Skip to content

Commit

Permalink
fix #59
Browse files Browse the repository at this point in the history
  • Loading branch information
hujw77 committed Oct 26, 2023
1 parent bc0114c commit 18526af
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/user/Application.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ abstract contract Application {
IEndpoint(TRUSTED_ORMP).setAppConfig(oracle, relayer);
}

function isTrustedORMP(address ormp) public view returns (bool) {
return TRUSTED_ORMP == ormp;
modifier onlyORMP() {
require(TRUSTED_ORMP == msg.sender, "!ormp");
_;
}

function _messageId() internal pure returns (bytes32 _msgDataMessageId) {
Expand All @@ -50,8 +51,8 @@ abstract contract Application {
}
}

function _xmsgSender() internal view returns (address payable _from) {
require(msg.data.length >= 20 && isTrustedORMP(msg.sender), "!xmsgSender");
function _xmsgSender() internal pure returns (address payable _from) {
require(msg.data.length >= 20, "!xmsgSender");
assembly {
_from := shr(96, calldataload(sub(calldatasize(), 20)))
}
Expand Down

0 comments on commit 18526af

Please sign in to comment.