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.addERC20CollateralOption(uint256,uint256,address) (oToken.sol#160-167) #156

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.addERC20CollateralOption(uint256,uint256,address) (oToken.sol#160-167):
External calls:
- addERC20Collateral(msg.sender,amtCollateral) (oToken.sol#165)
- 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,receiver) (oToken.sol#166)
- _balances[account] = _balances[account].add(amount) (@openzeppelin/contracts/token/ERC20/ERC20.sol#176)
- issueOTokens(amtToCreate,receiver) (oToken.sol#166)
- _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