Skip to content

Commit

Permalink
add
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani committed Jan 8, 2025
1 parent 253d540 commit 6428119
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions contracts/script/UpdateVkey.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.26;

import {stdJson} from "forge-std/StdJson.sol";
import {SP1Blobstream} from "../src/SP1Blobstream.sol";
import {BaseScript} from "./Base.s.sol";

// Required environment variables:
// - CHAINS (comma separated list of chain names)
// - CONTRACT_ADDRESS_{CHAIN_ID}

contract UpdateVkeyScript is BaseScript {
using stdJson for string;

function setUp() public {}

string internal constant KEY = "UpdateVkey";

/// Reads CONTRACT_ADDRESS_<CHAIN_ID> from the environment variables and updates the SP1 Verifier and program vkey.
function run() external multichain(KEY) broadcaster {
string memory contractAddressKey = string.concat("CONTRACT_ADDRESS_", vm.toString(block.chainid));
address existingProxyAddress = vm.envAddress(contractAddressKey);

SP1Blobstream sp1Blobstream = SP1Blobstream(address(existingProxyAddress));

// v4 program vkey
sp1Blobstream.updateProgramVkey(0x00a4a07806c0cb9bc8fcc14fed368a161b947d13b4a4fd58eb382d07a3373ef7);
}
}
2 changes: 1 addition & 1 deletion render.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ services:
rootDir: script
buildCommand: rm -rf build.rs && cargo build --bin operator --release
startCommand: cargo run --bin operator --release
autoDeploy: false
autoDeploy: true
envVars:
- key: CHAIN_ID
value: 534352
Expand Down

0 comments on commit 6428119

Please sign in to comment.