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

Reentrancy in oToken.addAndSellERC20CollateralOption(uint256,uint256,address) (oToken.sol#197-211) #157

Open
ghost opened this issue Aug 11, 2020 · 0 comments
Labels
crytic Create by crytic security report

Comments

@ghost
Copy link

ghost commented Aug 11, 2020

Reentrancy in oToken.addAndSellERC20CollateralOption(uint256,uint256,address) (oToken.sol#197-211):
External calls:
- addERC20Collateral(msg.sender,amtCollateral) (oToken.sol#202)
- require(bool,string)(collateral.transferFrom(msg.sender,address(this),amt),Could not transfer in collateral tokens) (OptionsContract.sol#362-365)
State variables written after the call(s):
- issueOTokens(amtToCreate,address(this)) (oToken.sol#203)
- _balances[account] = _balances[account].add(amount) (@openzeppelin/contracts/token/ERC20/ERC20.sol#176)
- issueOTokens(amtToCreate,address(this)) (oToken.sol#203)
- _totalSupply = _totalSupply.add(amount) (@openzeppelin/contracts/token/ERC20/ERC20.sol#175)

Apply the check-effects-interactions pattern.

@antoncoding antoncoding added the crytic Create by crytic security report label Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crytic Create by crytic security report
Projects
None yet
Development

No branches or pull requests

1 participant