Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployed contract cannot call another deployed contract #574

Closed
Guti opened this issue Jun 17, 2018 · 3 comments
Closed

Deployed contract cannot call another deployed contract #574

Guti opened this issue Jun 17, 2018 · 3 comments

Comments

@Guti
Copy link

Guti commented Jun 17, 2018

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

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
  }
}
@Earlz
Copy link
Contributor

Earlz commented Jul 6, 2018

What kind of error are you encountering?

@Guti
Copy link
Author

Guti commented Jul 6, 2018

Have you tried to run code that calls another contract?

@web3shannon
Copy link
Contributor

see #548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants