ConvexityProtocol
ConvexityProtocol copied to clipboard
Looking up token["ETH"] and checking for supportsAsset("ETH")
This is a low priority issue but something you may want to fix at some point.
There should be consistency when looking for the existence of a supported asset and returning the value for that supported asset.
The code below does an explicit check to see if "ETH" is a supported asset:
https://github.com/aparnakr/OptionsProtocol/blob/9363067b23278cd6d919cc0dad8ae0d4b489491f/contracts/OptionsFactory.sol#L154
However in the below code, it's assume that the lack of existence in the token[] is the value for the "ETH" token.
https://github.com/aparnakr/OptionsProtocol/blob/9363067b23278cd6d919cc0dad8ae0d4b489491f/contracts/OptionsFactory.sol#L75
This would be an issue in situations as follows:
- Someone accidentally calls addAsset("ETH", 123) - with a non-zero _addr).
- Solidity implementation change where token["ETH"] doesn't return 0. Perhap they change it to -1. This is unlikely to happen.
In both of the above situations, the rest of the system will break down since isETH() is expected to be ERC20(0).