Skip to content
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

Remediate malformed return during the twin transfer #771

Merged
merged 4 commits into from
Aug 28, 2023

Conversation

zajck
Copy link
Member

@zajck zajck commented Aug 11, 2023

Fix #769

Try-catch can be used only on external calls/contract creation, therefore it needed to be handled differently.

The most concise way (and without the need for assembly) was to say that return is valid iff its length is 0 or length is 32 and decoded into uint256 its value is exactly 1 (corresponds to true if considered a boolean).

@zajck zajck added bug Something isn't working v2.3.0 labels Aug 11, 2023
@zajck zajck self-assigned this Aug 11, 2023
@coveralls
Copy link

coveralls commented Aug 11, 2023

Coverage Status

coverage: 99.582%. remained the same when pulling 97845a5 on twin-malformed-return into 621b124 on main.

@mischat
Copy link
Member

mischat commented Aug 28, 2023

@zajck could you please fix the merge conflicts in this PR ?

Copy link
Contributor

@albertfolch-redeemeum albertfolch-redeemeum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@mischat mischat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mischat mischat merged commit ba611bb into main Aug 28, 2023
10 checks passed
@zajck zajck deleted the twin-malformed-return branch August 29, 2023 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v2.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

twin transfer issue - malformed return data
4 participants