Skip to content

Commit d5c4aeb

Browse files
feat(evm): zkgm dryupgrade script and weth addresses (#3818)
2 parents e5f8fec + 5afbe33 commit d5c4aeb

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

evm/evm.nix

+16
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,14 @@ _: {
210210
rpc-url = "https://rpc-sepolia.rockx.com";
211211
private-key = ''"$1"'';
212212
extra-args = ''--verify --verifier etherscan --etherscan-api-key "$2"'';
213+
weth = "0x7b79995e5f793a07bc00c21412e50ecae098e7f9";
213214
}
214215
{
215216
network = "holesky";
216217
rpc-url = "https://1rpc.io/holesky";
217218
private-key = ''"$1"'';
218219
extra-args = ''--verify --verifier etherscan --etherscan-api-key "$2"'';
220+
weth = "0x94373a4919b3240d86ea41593d5eba789fef3848";
219221
}
220222
{
221223
network = "0g-testnet";
@@ -395,6 +397,7 @@ _: {
395397
dry ? false,
396398
rpc-url,
397399
protocol,
400+
weth ? "",
398401
...
399402
}:
400403
mkCi false (
@@ -433,6 +436,7 @@ _: {
433436
cp --no-preserve=mode -r ${self'.packages.evm-contracts}/* .
434437
cp --no-preserve=mode -r ${evmSources}/* .
435438
439+
WETH=${weth} \
436440
DEPLOYER="$argc_deployer_pk" \
437441
SENDER="$argc_sender_pk" \
438442
OWNER="${pkgs.lib.optionalString dry "$argc_owner_pk"}" \
@@ -758,6 +762,18 @@ _: {
758762
);
759763
}) networks
760764
)
765+
// builtins.listToAttrs (
766+
builtins.map (args: {
767+
name = "eth-dryupgrade-${args.network}-ucs03";
768+
value = eth-upgrade (
769+
{
770+
dry = true;
771+
protocol = "UCS03";
772+
}
773+
// args
774+
);
775+
}) networks
776+
)
761777
// builtins.listToAttrs (
762778
builtins.map (args: {
763779
name = "eth-dryupgrade-${args.network}-cometbls-client";

evm/scripts/Deploy.s.sol

+37
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,43 @@ contract GetDeployed is Script {
932932
}
933933
}
934934

935+
contract DryUpgradeUCS03 is Script {
936+
using LibString for *;
937+
938+
address immutable deployer;
939+
address immutable sender;
940+
address immutable owner;
941+
942+
constructor() {
943+
deployer = vm.envAddress("DEPLOYER");
944+
sender = vm.envAddress("SENDER");
945+
owner = vm.envAddress("OWNER");
946+
}
947+
948+
function getDeployed(
949+
string memory salt
950+
) internal view returns (address) {
951+
return CREATE3.predictDeterministicAddress(
952+
keccak256(abi.encodePacked(sender.toHexString(), "/", salt)),
953+
deployer
954+
);
955+
}
956+
957+
function run() public {
958+
address ucs03 = getDeployed(Protocols.make(Protocols.UCS03));
959+
960+
console.log(string(abi.encodePacked("UCS03: ", ucs03.toHexString())));
961+
962+
IWETH weth = IWETH(vm.envAddress("WETH"));
963+
964+
address newImplementation = address(new UCS03Zkgm());
965+
vm.prank(owner);
966+
UCS03Zkgm(ucs03).upgradeToAndCall(
967+
newImplementation, abi.encodeCall(UCS03Zkgm.setWeth, (weth))
968+
);
969+
}
970+
}
971+
935972
contract UpgradeUCS03 is Script {
936973
using LibString for *;
937974

0 commit comments

Comments
 (0)