Last active
March 24, 2018 21:13
-
-
Save scyclow/5342f4a3e2afaa8993163f699bea770c to your computer and use it in GitHub Desktop.
Writing flexible contracts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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