Hi I was searching on upgradeable/upgradable contracts, then I found this Rocket Pool by David Rugendyke https://gist.github.com/darcius/6e8fa4faa6d9139f3950b6f1d9e96038
/// @dev Only allow access from the latest version of a contract in the Rocket Pool network after deployment
modifier onlyLatestRocketNetworkContract() {
/* The owner is only allowed to set the storage upon deployment
to register the initial contracts, afterwards their direct access is disabled
only allow the owner of the storage contract to access these methods directly to set
some initial contract addresses during deployment,
after deployment their access is removed to ensure only visible contract methods
can write to storage. From then on, only registered contracts within the Rocket Pool network
can write to storage.
*/
if (msg.sender == owner) {
require(boolStorage[keccak256("contract.storage.initialised")] == false);
} else {
// Make sure the access is permitted to only contracts in our Dapp
require(addressStorage[keccak256("contract.address", msg.sender)] != 0x0);
}
_;
}
Could someone help me understand these two lines:
keccak256("contract.storage.initialised")
keccak256("contract.address", msg.sender)
http://solidity.readthedocs.io/en/develop/units-and-global-variables.html#mathematical-and-cryptographic-functions
I know keccak256(...) or sha3(...) computes the Ethereum-SHA-3 (Keccak-256) hash of the (tightly packed) arguments, then returns (bytes32)
but I could not find any reference regarding to ".initialised" Thank you