-
Notifications
You must be signed in to change notification settings - Fork 1
Reentrancy protection #21
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
base: master
Are you sure you want to change the base?
Conversation
contracts/LedgerChannel.sol
Outdated
| require(now > Channels[_lcID].LCopenTimeout); | ||
| require(msg.sender == Channels[_lcID].partyAddresses[0], "Request not sent by channel party A"); | ||
| require(Channels[_lcID].isOpen == false, "Channel has been joined"); | ||
| require(now > Channels[_lcID].LCopenTimeout, "Channel timeout has not expire"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: expired
| uint256 ethbalanceA = Channels[_lcID].ethBalances[0]; | ||
| uint256 tokenbalanceA = Channels[_lcID].erc20Balances[0]; | ||
|
|
||
| Channels[_lcID].ethBalances[0] = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: copy ethBalanceA, tokenBalanceA, token to variables, and delete the channel before transfers. Might consume less gas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion is invalid till repository includes some sort of gas meter.
a11966d to
117b7f2
Compare
Test error msgs
…/virtual-channels into reentrancy-protection
…-channels into reentrancy-protection
…-channels into reentrancy-protection
PR for reentrancy fix in LCOpenTimeout.