Closed code423n4 closed 2 years ago
jayjonah8
In SingleTokenJoin.sol, the constructor accepts 2 addresses which are _INTERMEDIATE_TOKEN and _uniSwapLikeRouter and sets them in storage without ensuring that they are both different. This check can avoid costly mistakes during deployment.
https://github.com/code-423n4/2021-12-amun/blob/main/contracts/basket/contracts/singleJoinExit/SingleTokenJoin.sol#L30
Manual code review
Add to constructor: require(_INTERMEDIATE_TOKEN != _uniSwapLikeRouter, "DUPLICATE ADDRESS")
No need to check for every value that could be set wrong
Agree with sponsor, this adds unnecessary overhead for a trusted deployment setup.
Handle
jayjonah8
Vulnerability details
Impact
In SingleTokenJoin.sol, the constructor accepts 2 addresses which are _INTERMEDIATE_TOKEN and _uniSwapLikeRouter and sets them in storage without ensuring that they are both different. This check can avoid costly mistakes during deployment.
Proof of Concept
https://github.com/code-423n4/2021-12-amun/blob/main/contracts/basket/contracts/singleJoinExit/SingleTokenJoin.sol#L30
Tools Used
Manual code review
Recommended Mitigation Steps
Add to constructor: require(_INTERMEDIATE_TOKEN != _uniSwapLikeRouter, "DUPLICATE ADDRESS")