When investors call withdraw_shares to redeem shares for ETH, Cyfrin_Hub attempts a raw_call to send the ETH to the caller. However, if the shareholder is a smart contract without a default payable function, the call will fail and the withdraw will revert. Therefore, shares held by one of these contracts will be unredeemable.
Likelihood:
The shareholder must be a smart contract wallet without the ability to receive payment.
Impact:
The affected shareholder will never be able to redeem their shares, and the shares will be perminently out of circulation.
Create this DeadShares contract in tests/unit/attackContracts.
Then add this test in tests/unit/test_Industry.py.
This test will show that attempts for the contract to withdraw ETH for the shares will always revert.
You should not be pushing ETH inside withdraw_shares. Instead, consider adopting a method for users to pull ETH from the contract rather than push it to them. This could be done but setting pull amounts in a mapping during withdraw_shares and creating another function for a user to pull out the funds. Even if a smart contract wallet doesn't redeem their ETH, the shares will then be available for other investors.
You could also consider adding a function to convert the ETH into WETH and send it to the contract if they are unable to redeem the ETH directly. This could be callable by any EOA on behalf of the smart contract wallet.
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.