You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pragma solidity ^0.4.11;
contract Service{
function isAlive() public constant returns(bool alive) {
return true;
}
}
pragma solidity ^0.4.11;
// describe the interface
contract Service{
function isAlive() constant returns(bool alive) {} // empty because we're not concerned with internal details
}
contract Client {
Service _s; // "Service" is a Type and the compiler can "see" it because this is one file.
function Client(address serviceAddress) {
_s = Service(serviceAddress); // _s will be the "Service" located at serviceAddress
}
function Ping() public constant returns(bool response) {
return _s.isAlive(); // message/response to Service is intuitive
}
}
The text was updated successfully, but these errors were encountered:
I can not make my code work.
I tried to execute the example contract of the following post and neither:
https://ethereum.stackexchange.com/questions/24713/how-can-a-deployed-contract-call-another-deployed-contract-by-interface-and-ad
The text was updated successfully, but these errors were encountered: