Skip to content

Commit

Permalink
Avoid possible panic when dropping signer bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinquaXD committed Jul 18, 2024
1 parent 79b4082 commit 5b3dd89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/cow-amm/src/amm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ impl Amm {
// The helper contract returns exactly that format but in our code base we
// expect the signature to not already include the signer address (the parts
// will be concatenated in the encoding logic) so we discard the first 20 bytes.
let signature = Signature::Eip1271(signature.0[20..].to_vec());
let raw_signature = signature.0.into_iter().skip(20).collect();
let signature = Signature::Eip1271(raw_signature);

Ok(TemplateOrder {
order,
Expand Down

0 comments on commit 5b3dd89

Please sign in to comment.