Skip to content

Conversation

bmzig
Copy link
Contributor

@bmzig bmzig commented Nov 8, 2024

Orders inside the ERC7683OrderDepositor contract may be resolved either by the _resolve function or by the _resolveFor function. Both functions receive an order and convert it to the ResolvedCrossChainOrder struct, which contains the minReceived member of the Output[] type. However, inside both _resolve and _resolveFor functions, the minReceived member is initialized using the block.chainId cast to uint32, although the Output.chainId member is of type uint64. This means that the code will revert for blockchains with chainID not fitting into uint32, although it should work for all blockchains with chain IDs lower than type(uint64).max.

Consider casting block.chainId to uint64 instead of uint32 when initializing ResolvedCrossChainOrder.minReceived.

This commit changed the chainId field from a u64 to a u256, so the cast is now removed entirely.

Signed-off-by: bennett <bennett@umaproject.org>
@bmzig bmzig marked this pull request as ready for review November 14, 2024 20:42
@bmzig bmzig merged commit 1e5b204 into master Nov 15, 2024
9 checks passed
@bmzig bmzig deleted the 1124oz/l02 branch November 15, 2024 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants