Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Invalid

Owner can not deposit assets into the inheritanceManager contract

Summary

There is no direct way for the owner to transfer asstes into the inheritanceManager contract, because there is no "deposit" function.

Vulnerability Details

The ability of the owner to deposit assets into the inheritanceManager contract is the first condition for the inheritance system to work. If that is not happening, the inheritance will not take place, the inheritanceManager is not valid.

Impact

If the inheritanceManager contracts's balance is always 0, the beneficiaries will always inherit 0 assets, which make this inheritance system useless.

Tools Used

Manual review

Recommendations

Include a "deposit" function in the inheritanceManager contract:

/**
* @dev Allows the owner to deposit ETH or ERC-20 tokens into the contract.
* @param _tokenAddress The address of the ERC-20 token to deposit. Use address(0) for ETH.
* @param _amount The amount of tokens or ETH to deposit.
*/
function deposit(address _tokenAddress, uint256 _amount) external payable onlyOwner {
if (_tokenAddress == address(0)) {
// Depositing ETH
require(msg.value == _amount, "Incorrect ETH amount sent");
} else {
// Depositing ERC-20 tokens
// The owner must first approve the contract to spend tokens
IERC20(_tokenAddress).safeTransferFrom(msg.sender, address(this), _amount);
}
// Reset the inactivity timer
_setDeadline();
}

This will allow the user to deposit assets into the inheritanceManager contract, making assets ready for a future inheritance situation.

Updates

Lead Judging Commences

0xtimefliez Lead Judge 9 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!