Description:
Proxy contract enabling upgradeable smart contract patterns. Delegates calls to an implementation contract.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"sources": {
"src/RSC_UpgradeManager.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
import {Ownable} from "./utils/Ownable.sol";
/// @title RSC_UpgradeManager
/// @notice Tracks implementation hashes/versions and emits upgrades
contract RSC_UpgradeManager is Ownable {
mapping(address => bytes32) public implHash; // proxy => codehash
mapping(address => uint256) public version; // proxy => version
event ImplementationSet(address indexed proxy, bytes32 codehash, uint256 version);
function register(address proxy, bytes32 codehash, uint256 ver) external onlyOwner {
implHash[proxy] = codehash;
version[proxy] = ver;
emit ImplementationSet(proxy, codehash, ver);
}
}
"
},
"src/utils/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title Minimal Ownable utility
abstract contract Ownable {
error NotOwner();
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
owner = msg.sender;
emit OwnershipTransferred(address(0), msg.sender);
}
modifier onlyOwner() {
if (msg.sender != owner) revert NotOwner();
_;
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "Owner=zero");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
"
}
},
"settings": {
"remappings": [
"forge-std/=lib/forge-std/src/",
"reactive-lib/=lib/reactive-lib/src/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": true
}
}}
Submitted on: 2025-09-27 11:50:49
Comments
Log in to comment.
No comments yet.