Skip to content

Instantly share code, notes, and snippets.

@maurelian
Last active September 26, 2018 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maurelian/ce15d6fe0daca64b324ca0c1502017ea to your computer and use it in GitHub Desktop.
Save maurelian/ce15d6fe0daca64b324ca0c1502017ea to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.0;
contract ISomething {
function fooSomething() returns(uint);
}
contract BarGuy {
// This internal function use the type system for additional safety guarantees onthe input addres.
function barThing (ISomething _iSomething) internal returns(uint){
uint x = _iSomething.fooSomething();
}
}
contract BarDad is BarGuy {
function barbarbar(address _addr){
uint a = barThing(_addr); // TypeError: Invalid type for argument in function call. Invalid implicit conversion from address to contract ISomething requested.
uint a = barThing(_addr);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment