🤷♂️🤷♂ 🤷♂ Lack of Access Control
What is it even
🧨 Real Case: The HospoWise Hack
Internal/private vs public/external functions
function payWithERC20(address erc20TokenAddress, uint256 amount, address fromAddress, address toAddress) public {
// check from and to address
require(fromAddress != toAddress, "Cannot transfer to self address");
require(toAddress != address(0), "Invalid to address");
require(amount > 0, "Amount must be greater than 0");
IERC20 token = IERC20(erc20TokenAddress);
token.safeTransferFrom(fromAddress, toAddress, amount);
}🤦♂️ Wrong implementation of access control
Conclusion
Last updated