mip00.sol explains the setup of the whole system. build contains the final configuration for the deployment.
There each MToken is unpaused and an initial mint is done to prevent exchange rate manipulation.
The issue is that each token uses the same initialMintAmount. In the comments ETH and USDC are mentioned as tokens. Since these have different decimals the real value used for minting will be very different.
initialMintAmount is 1 ether in the base contract Configs.sol. Since it is unlikely that the deploying contract will have 1e18 USDC ($1 trillion) the build part of the setup and configuration will likely fail. Even if this isn't the actual initial mint amount there is no number that would fit both 6 decimal USDC and 18 decimal ETH at the same time.
Lines of code
https://github.com/code-423n4/2023-07-moonwell/blob/main/test/proposals/mips/mip00.sol#L351-L367
Vulnerability details
Impact
mip00.sol
explains the setup of the whole system.build
contains the final configuration for the deployment.There each
MToken
is unpaused and an initial mint is done to prevent exchange rate manipulation.The issue is that each token uses the same
initialMintAmount
. In the commentsETH
andUSDC
are mentioned as tokens. Since these have different decimals the real value used for minting will be very different.initialMintAmount
is1 ether
in the base contractConfigs.sol
. Since it is unlikely that the deploying contract will have1e18 USDC
($1 trillion) thebuild
part of the setup and configuration will likely fail. Even if this isn't the actual initial mint amount there is no number that would fit both 6 decimalUSDC
and 18 decimalETH
at the same time.Proof of Concept
https://github.com/code-423n4/2023-07-moonwell/blob/main/test/proposals/mips/mip00.sol#L334-L379
initialMintAmount
can be found to be1 ether
in base contractConfigs.sol
:https://github.com/code-423n4/2023-07-moonwell/blob/main/test/proposals/Configs.sol#L54-L55
Tools Used
Manual audit
Recommended Mitigation Steps
Consider adding a field in the configuration for
initialMintAmount
for each token.Assessed type
ERC20