Created
August 19, 2022 15:17
-
-
Save ashwinYardi/4847131182c31e58a0e61714253cdd7f to your computer and use it in GitHub Desktop.
Contract which describes InheritedStorage approach for proxies and diamonds.
This file contains 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
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.8.0; | |
contract Storage { | |
uint firstVar; | |
uint secondVar; | |
string thirdVar; | |
string fourthVar; | |
} | |
contract FacetA is Storage { | |
function getVars() public view returns(uint, uint) { | |
return (firstVar, secondVar); | |
} | |
} | |
contract FacetB is Storage { | |
function getVars() public returns(string memory, string memory) { | |
thirdVar = "Ashwin"; | |
fourthVar = "Yardi"; | |
return (thirdVar, fourthVar); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment