Skip to content

Instantly share code, notes, and snippets.

@scyclow
Last active March 24, 2018 21:13
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 scyclow/5342f4a3e2afaa8993163f699bea770c to your computer and use it in GitHub Desktop.
Save scyclow/5342f4a3e2afaa8993163f699bea770c to your computer and use it in GitHub Desktop.
Writing flexible contracts
import "FeatureContract.sol"
contract CoreContract {
FeatureContract public featureContract;
address public CEO;
function FastCashMoneyPlusPermissions(address _featureContractAddress) public {
featureContract = FeatureContract(_featureContractAddress);
}
modifier onlyCEO() {
require(msg.sender == CEO);
_;
}
function doSomething() {
featureContract.someFunction();
}
function updateFeatureContract(address _newFeatureContractAddress) onlyCEO {
featureContract = FeatureContract(_newFeatureContractAddress);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment