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

Apply check-effect-interaction pattern to contract. #653

Merged
merged 1 commit into from
May 11, 2022

Conversation

IlyasRidhuan
Copy link
Contributor

It's generally good/safe behaviour to ensure that if a require check passes, that we immediately resolve the state effects before performing any interaction.

This PR applies to two areas:

  1. advanceWithdrawal: Prevents re-entrancy on transferFrom. This isn't really an attack since if currentOwner is set to a malicious contract that re-enters, msg.sender will reference the contract and the attacker will cycle their funds. Nevertheless, we are modifying this to be safe.

  2. requestBlockPayment: I don't think this is easily re-entrant, but just modifying it for safety.

@Westlad Westlad merged commit b8c4482 into master May 11, 2022
@Westlad Westlad deleted the contract/re-entrancy branch May 11, 2022 08:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants