Skip to content

Instantly share code, notes, and snippets.

@hadv
Created June 20, 2021 17:01
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 hadv/5317bf279c8fcb3bd45f3378c105ebbf to your computer and use it in GitHub Desktop.
Save hadv/5317bf279c8fcb3bd45f3378c105ebbf to your computer and use it in GitHub Desktop.
pragma solidity ^0.5.8;
interface StorageInterface {
function saveValue(uint x) public returns (bool);
}
contract Machine {
StorageInterface public s;
constructor(StorageInterface addr) public {
s = addr;
calculateResult = 0;
}
function saveValue(uint x) public returns (bool) {
s.setValue(x);
return true;
}
function getValue() public view returns (uint) {
return s.val();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment