-
Exchange could be created with address 0.
-
Consider index
_tokenaddress atCreatedExchangeevent for traceability.
- Missing dev notation.
tokenToBaseExchangeTransferInputdoesn't pull sender tokens and therefore the base token reserves will be lowered meanwhile the token reserves will keep the same. Moreover, therecipientwill receive the tokens bought with the base and the sender will keep her tokens. This will allow the emptying of the base reserves from every exchange by another token.
-
AddLiquidityevent will be emitted twice ifp_totalSupplyis0. -
Add reentrancy guard to avoid microtrading by swapping base to token (normal) -> token to base (profit) -> token to base (normal) -> base to token (profit) -> base to token and so on for ERC777 tokens.
-
removeBaseLiquidityandremoveTokenLiquidityare burningamountonly for either the base nor the token. This will freeze the other by not removing them usingremoveLiquidity. Consider adding a secure mechanism for users to accept using those methods like a commit and reveal where a front-end can not confuse them by sending a built-in transaction.
-
Missing dev notation.
-
Desfswap.iocould bedefswap.io. -
p_prefix can be removed and therefore the getters. -
TODOcomment in code. -
For events log order, consider moving contract related events to the end.
-
Typo:
- Line 405:
defswap: _exchange can't be Uniswaotodefswap: _exchange can't be Uniswap.
- Line 405:
- Is uniswap whitelisted? why taken fee?
- Why not minReturn > 0 ?