morpho-org / morpho-token-upgradeable

Other
7 stars 7 forks source link

Nested possible reverts #101

Open colin-morpho opened 3 days ago

colin-morpho commented 3 days ago

The style used in the require found here https://github.com/morpho-org/morpho-token-upgradeable/blob/41e7f07bf44925453b7214090f30cef40a62c743/src/DelegationToken.sol#L119 should be avoided as we are nesting out two possible revert causes, one for arithmetic overflows and one for the actual revert condition.

colin-morpho commented 3 days ago

Here it's ok because nonce overflows are impossible in practice, but this require style should be avoided.