Created
September 16, 2022 15:58
-
-
Save casweeney/87ada9ed15650854f75b06747c1fde11 to your computer and use it in GitHub Desktop.
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
| //SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.1; | |
| import "./Proxiable.sol"; | |
| contract ImplementationA is Proxiable { | |
| address public owner; | |
| uint public count; | |
| bool public initalized = false; | |
| function initialize() public { | |
| require(owner == address(0), "Already initalized"); | |
| require(!initalized, "Already initalized"); | |
| owner = msg.sender; | |
| initalized = true; | |
| } | |
| function encode() public pure returns(bytes memory ){ | |
| return abi.encodeWithSignature("initialize()"); | |
| } | |
| function increment() public { | |
| count++; | |
| } | |
| function updateCode(address newCode) onlyOwner public { | |
| updateCodeAddress(newCode); | |
| } | |
| modifier onlyOwner() { | |
| require(msg.sender == owner, "Only owner is allowed to perform this action"); | |
| _; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.1;
contract Proxiable {
// Code position in storage is keccak256("PROXIABLE") = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7"
}