chore: sync submodule state (parent ref update)
Made-with: Cursor
This commit is contained in:
29
script/deploy/UpgradeUniversalAssetRegistry.s.sol
Normal file
29
script/deploy/UpgradeUniversalAssetRegistry.s.sol
Normal file
@@ -0,0 +1,29 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.20;
|
||||
|
||||
import {Script, console} from "forge-std/Script.sol";
|
||||
import {UniversalAssetRegistry} from "../../contracts/registry/UniversalAssetRegistry.sol";
|
||||
|
||||
/**
|
||||
* @title UpgradeUniversalAssetRegistry
|
||||
* @notice Deploy a new UniversalAssetRegistry implementation and upgrade the proxy to it.
|
||||
* @dev Caller must have UPGRADER_ROLE on the proxy. Env: UNIVERSAL_ASSET_REGISTRY (proxy address), PRIVATE_KEY.
|
||||
* Use when the current implementation does not expose registerGRUCompliantAsset (e.g. older deployment).
|
||||
*/
|
||||
contract UpgradeUniversalAssetRegistry is Script {
|
||||
function run() external {
|
||||
address proxyAddr = vm.envAddress("UNIVERSAL_ASSET_REGISTRY");
|
||||
uint256 pk = vm.envUint("PRIVATE_KEY");
|
||||
|
||||
vm.startBroadcast(pk);
|
||||
|
||||
UniversalAssetRegistry newImpl = new UniversalAssetRegistry();
|
||||
console.log("New implementation deployed at:", address(newImpl));
|
||||
|
||||
UniversalAssetRegistry proxy = UniversalAssetRegistry(proxyAddr);
|
||||
proxy.upgradeToAndCall(address(newImpl), "");
|
||||
console.log("Proxy", proxyAddr, "upgraded to", address(newImpl));
|
||||
|
||||
vm.stopBroadcast();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user