Closed 0xSpacePirate closed 2 months ago
Duplicate of #4
https://github.com/Egis-Security/CTF_Challenge/issues/4 is focused on: lastDeployed = vaultAddress:
Which is not that big of an issue since if a user calls the function immediately after another user then the track of lastDeployed is lost.
My issue focuses on the missing return vaultAddress;
For instance, in a single transaction:
Factory::deployVault
.Factory::deployVault
.Factory::deployVault
.lastDeployed = User C vault address. User A & User B addresses are permamently lost.
Hence, the missing return vaultAddress is a way bigger issue than the one in https://github.com/Egis-Security/CTF_Challenge/issues/4.
Description of the Bug:
In
Factory::deployVault
the idea of the function is to deploy a newly createdVault
, once the deployed theVault
returns its address on the blockchain, however this address is never returned:vaultAddress = address(new Vault{salt: salt}(msg.sender));
Hence, a user paid gas to execute the
Factory::deployVault
but did not get the address of their newly deployed contract and they will NOT know which contract they can use to deposit/withdraw and unlock.In addition, the
lastDeployed
variable is created but never updated.Impact: Impact: High Likelihood: High
User cannot access their vault contract since they will not know the address.
Solution:
Add the following lines in the
Factory::deployVault
to prevent this issue: