Skip to content

Commit

Permalink
chore: restore the transparent proxy v4.9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
huyhuynh3103 committed Oct 10, 2024
1 parent 0f3f935 commit 485dcc1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
3 changes: 2 additions & 1 deletion script/BaseMigration.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Vm } from "../dependencies/forge-std-1.9.3/src/Vm.sol";
import { console } from "../dependencies/forge-std-1.9.3/src/console.sol";
import { LibString } from "../dependencies/solady-0.0.228/src/utils/LibString.sol";
import { RoninTransparentProxy } from "../src/RoninTransparentProxy.sol";
import { TransparentProxyOZv4_9_5 } from "../src/TransparentProxyOZv4_9_5.sol";

import { OnchainExecutor } from "./OnchainExecutor.s.sol";
import { IScriptExtended, ScriptExtended } from "./extensions/ScriptExtended.s.sol"; // cheat to load artifact to parent
Expand Down Expand Up @@ -328,6 +329,6 @@ abstract contract BaseMigration is ScriptExtended {
*/
function _precompileProxyContracts() internal pure virtual {
bytes memory dummy;
dummy = type(RoninTransparentProxy).creationCode;
dummy = type(TransparentProxyOZv4_9_5).creationCode;
}
}
2 changes: 1 addition & 1 deletion script/libraries/LibDeploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ library LibDeploy {
DeployInfo memory proxyInfo;
proxyInfo.callValue = callValue;
proxyInfo.by = implInfo.by;
proxyInfo.contractName = "RoninTransparentProxy";
proxyInfo.contractName = "TransparentProxyOZv4_9_5";
proxyInfo.absolutePath = string.concat(proxyInfo.contractName, ".sol:", proxyInfo.contractName);
proxyInfo.artifactName = string.concat(vm.replace(implInfo.artifactName, "Logic", ""), "Proxy");
proxyInfo.constructorArgs = abi.encode(impl, proxyAdmin, callData);
Expand Down
21 changes: 21 additions & 0 deletions src/TransparentProxyOZv4_9_5.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import {
ITransparentUpgradeableProxy,
TransparentUpgradeableProxy
} from "../dependencies/openzeppelin-v4-4.9.5/contracts/proxy/transparent/TransparentUpgradeableProxy.sol";

/**
* @title TransparentProxyOZv4_9_5
* @dev A contract that acts as a proxy for transparent upgrades.
*/
contract TransparentProxyOZv4_9_5 is TransparentUpgradeableProxy {
/**
* @dev Initializes the Proxy contract.
* @param logic The address of the logic contract.
* @param admin The address of the admin contract.
* @param data The initialization data.
*/
constructor(address logic, address admin, bytes memory data) payable TransparentUpgradeableProxy(logic, admin, data) { }
}

0 comments on commit 485dcc1

Please sign in to comment.