Skip to content

Instantly share code, notes, and snippets.

@gakonst
Last active November 15, 2017 10:37
Show Gist options
  • Save gakonst/71a7830c57a078a36866a6249b868ad8 to your computer and use it in GitHub Desktop.
Save gakonst/71a7830c57a078a36866a6249b868ad8 to your computer and use it in GitHub Desktop.
pragma solidity 0.4.18;
contract C {
uint public x;
function cannotBeCalled() external {
x = 42;
}
function canBeCalled() {
x = 31337;
}
// does not compile because of this function.
// cannotBeCalled is not visible to the contract itself
function testExternal() {
cannotBeCalled();
}
}
contract D {
function test(address _address) {
C(_address).cannotBeCalled(); // this call is not a problem
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment