-
Notifications
You must be signed in to change notification settings - Fork 419
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
Graduate to yarn 4 🧶 #2899
Graduate to yarn 4 🧶 #2899
Changes from 16 commits
1693683
3880cd2
bf82623
b58095c
506d347
d4ad8d4
4deb562
c62e38c
084789f
b8bedd5
0050172
5525227
c85d53e
7e45e62
502a792
2b3cb19
ac1217f
e11fbfb
e1c7fcf
49e5b2f
ea66dd8
fe52a78
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"*.js": "prettier --write", | ||
"*.ts": "prettier --write", | ||
"*.md": "prettier --write", | ||
"*.sol": "prettier --write" | ||
"*.md": "prettier --write" | ||
} |
This file was deleted.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
compressionLevel: mixed | ||
|
||
enableGlobalCache: false | ||
|
||
enableScripts: false | ||
|
||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | ||
spec: "@yarnpkg/plugin-workspace-tools" | ||
- path: .yarn/plugins/@yarnpkg/plugin-outdated.cjs | ||
spec: "https://mskelton.dev/yarn-outdated/v3" | ||
- path: .yarn/plugins/@yarnpkg/plugin-version.cjs | ||
spec: "@yarnpkg/plugin-version" | ||
|
||
yarnPath: .yarn/releases/yarn-3.2.0.cjs | ||
yarnPath: .yarn/releases/yarn-4.0.1.cjs |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,52 +191,51 @@ | |
* @param _metadata Metadata used by the ISM to verify `_message`. | ||
* @param _message Formatted Hyperlane message (refer to Message.sol). | ||
*/ | ||
function process(bytes calldata _metadata, bytes calldata _message) | ||
external | ||
payable | ||
override | ||
{ | ||
function process( | ||
bytes calldata _metadata, | ||
bytes calldata _message | ||
) external payable override { | ||
/// CHECKS /// | ||
|
||
// Check that the message was intended for this mailbox. | ||
require(_message.version() == VERSION, "Mailbox: bad version"); | ||
require( | ||
_message.destination() == localDomain, | ||
"Mailbox: unexpected destination" | ||
); | ||
|
||
// Check that the message hasn't already been delivered. | ||
bytes32 _id = _message.id(); | ||
require(delivered(_id) == false, "Mailbox: already delivered"); | ||
|
||
// Get the recipient's ISM. | ||
address recipient = _message.recipientAddress(); | ||
IInterchainSecurityModule ism = recipientIsm(recipient); | ||
|
||
/// EFFECTS /// | ||
|
||
deliveries[_id] = Delivery({ | ||
processor: msg.sender, | ||
blockNumber: uint48(block.number) | ||
}); | ||
emit Process(_message.origin(), _message.sender(), recipient); | ||
emit ProcessId(_id); | ||
|
||
/// INTERACTIONS /// | ||
|
||
// Verify the message via the interchain security module. | ||
require( | ||
ism.verify(_metadata, _message), | ||
"Mailbox: ISM verification failed" | ||
); | ||
|
||
// Deliver the message to the recipient. | ||
IMessageRecipient(recipient).handle{value: msg.value}( | ||
_message.origin(), | ||
_message.sender(), | ||
_message.body() | ||
); | ||
} | ||
Check warning Code scanning / Slither Dangerous strict equalities Medium
Mailbox.process(bytes,bytes) uses a dangerous strict equality:
- require(bool,string)(delivered(_id) == false,Mailbox: already delivered) |
||
|
||
/** | ||
* @notice Returns the account that processed the message. | ||
|
@@ -391,11 +390,9 @@ | |
* @param _recipient The message recipient whose ISM should be returned. | ||
* @return The ISM to use for `_recipient`. | ||
*/ | ||
function recipientIsm(address _recipient) | ||
public | ||
view | ||
returns (IInterchainSecurityModule) | ||
{ | ||
function recipientIsm( | ||
address _recipient | ||
) public view returns (IInterchainSecurityModule) { | ||
// use low-level staticcall in case of revert or empty return data | ||
(bool success, bytes memory returnData) = _recipient.staticcall( | ||
abi.encodeCall( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,28 +59,26 @@ | |
} | ||
|
||
// ============ Internal functions ============ | ||
function _quoteDispatch(bytes calldata, bytes calldata) | ||
internal | ||
pure | ||
override | ||
returns (uint256) | ||
{ | ||
function _quoteDispatch( | ||
bytes calldata, | ||
bytes calldata | ||
) internal pure override returns (uint256) { | ||
return 0; // gas subsidized by the L2 | ||
} | ||
|
||
/// @inheritdoc AbstractMessageIdAuthHook | ||
function _sendMessageId(bytes calldata metadata, bytes memory payload) | ||
internal | ||
override | ||
{ | ||
function _sendMessageId( | ||
bytes calldata metadata, | ||
bytes memory payload | ||
) internal override { | ||
require( | ||
metadata.msgValue(0) < 2**255, | ||
metadata.msgValue(0) < 2 ** 255, | ||
"OPStackHook: msgValue must be less than 2 ** 255" | ||
); | ||
l1Messenger.sendMessage{value: metadata.msgValue(0)}( | ||
TypeCasts.bytes32ToAddress(ism), | ||
payload, | ||
GAS_LIMIT | ||
); | ||
} | ||
Check failure Code scanning / Slither Functions that send Ether to arbitrary destinations High
OPStackHook._sendMessageId(bytes,bytes) sends eth to arbitrary user
Dangerous calls: - l1Messenger.sendMessage{value: metadata.msgValue(0)}(TypeCasts.bytes32ToAddress(ism),payload,GAS_LIMIT) |
||
} |
Check notice
Code scanning / Slither
Missing zero address validation