Looking around I found Solidity functions - private visibility but not an answer to my specific question. Basically my question is: is the private
keyword enforced at the Solidity language level or EVM level? My intuition says it is a Solidity feature but I wanted to double check here.
I am just getting started with Ethereum so pardon any beginner mistakes. Consider the following Solidity code:
contract Silly {
function unsafePrivateWithdraw(address addr, uint amount) private {
addr.transfer(amount);
}
function safeWithdraw(address addr, uint amount) {
if (!checkWithdrawConditions) throw; // pseudocode
unsafePrivateWithdraw(addr, amount);
}
}
I know that using Solidity one wouldn't be able to call unsafePrivateWithdraw
directly. But could somebody write in LLL or EVM opcodes a direct call to the address of the unsafePrivateWithdraw
function?