No check on the return value of create
can have any unintended consequences.
In deployToken
function we are using create
to deploy a new ERC20 contract but the catch here is that there is no check on the return value of create
. If due to any reason create
fail it will return 0. and if we see the code of deployToken
which is as follow
Then we can see that there isn't any kind of check on the return value, the code is always assuming that the create
is successful.
Then the code is storing the return value of create which should be instead an address
in the s_tokenToAddress
mapping
Since is deployed ERC20 token is being used in the protocol,failure to deploy it and assuming that its successfully deployed will cause many unintended consequences.
Manual review
I recommend checking the return condition of create
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.