Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/PDPVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ contract PDPVerifier is Initializable, UUPSUpgradeable, OwnableUpgradeable {
uint256 public constant NO_CHALLENGE_SCHEDULED = 0;
uint256 public constant NO_PROVEN_EPOCH = 0;

// Upgrade sequence number, used by Initializable.reinitializer
uint64 private immutable REINITIALIZER_VERSION;

// Events
event DataSetCreated(uint256 indexed setId, address indexed storageProvider);
event StorageProviderChanged(
Expand Down Expand Up @@ -160,8 +163,9 @@ contract PDPVerifier is Initializable, UUPSUpgradeable, OwnableUpgradeable {
// Methods

/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
constructor(uint64 _initializerVersion) {
_disableInitializers();
REINITIALIZER_VERSION = _initializerVersion;
}

function initialize(uint256 _challengeFinality) public initializer {
Expand All @@ -177,7 +181,7 @@ contract PDPVerifier is Initializable, UUPSUpgradeable, OwnableUpgradeable {
event ContractUpgraded(string version, address implementation);
event UpgradeAnnounced(PlannedUpgrade plannedUpgrade);

function migrate() external onlyProxy onlyOwner reinitializer(2) {
function migrate() external onlyProxy onlyOwner reinitializer(REINITIALIZER_VERSION) {
emit ContractUpgraded(VERSION, ERC1967Utils.getImplementation());
}

Expand Down
5 changes: 4 additions & 1 deletion src/SimplePDPService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ contract SimplePDPService is PDPListener, IPDPProvingSchedule, Initializable, UU
mapping(uint256 => uint256) public provingDeadlines;
mapping(uint256 => bool) public provenThisPeriod;

uint64 private immutable REINITIALIZER_VERSION;

/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
constructor(uint64 _reinitalizerVersion) {
REINITIALIZER_VERSION = _reinitalizerVersion;
_disableInitializers();
}

Expand Down
6 changes: 3 additions & 3 deletions test/ERC1967Proxy.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract ERC1967ProxyTest is Test {
// Set owner for testing
vm.startPrank(owner);
// Deploy implementation contract
implementation = new PDPVerifier();
implementation = new PDPVerifier(1);

// Deploy proxy pointing to implementation
bytes memory initData = abi.encodeWithSelector(
Expand Down Expand Up @@ -43,7 +43,7 @@ contract ERC1967ProxyTest is Test {
assertImplementationEquals(address(implementation));

// Deploy new implementation
PDPVerifier newImplementation = new PDPVerifier();
PDPVerifier newImplementation = new PDPVerifier(2);

// Announce upgrade first (required by new upgrade pattern)
PDPVerifier.PlannedUpgrade memory plan;
Expand All @@ -64,7 +64,7 @@ contract ERC1967ProxyTest is Test {
}

function testUpgradeFromNonOwnerNoGood() public {
PDPVerifier newImplementation = new PDPVerifier();
PDPVerifier newImplementation = new PDPVerifier(2);

// Announce upgrade first (as owner)
PDPVerifier.PlannedUpgrade memory plan;
Expand Down
30 changes: 15 additions & 15 deletions test/PDPVerifier.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ contract PDPVerifierDataSetCreateDeleteTest is MockFVMTest, PieceHelper {

function setUp() public override {
super.setUp();
PDPVerifier pdpVerifierImpl = new PDPVerifier();
PDPVerifier pdpVerifierImpl = new PDPVerifier(1);
uint256 challengeFinality = 2;
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, challengeFinality);
MyERC1967Proxy proxy = new MyERC1967Proxy(address(pdpVerifierImpl), initializeData);
Expand Down Expand Up @@ -240,7 +240,7 @@ contract PDPVerifierStorageProviderTest is MockFVMTest, PieceHelper {

function setUp() public override {
super.setUp();
PDPVerifier pdpVerifierImpl = new PDPVerifier();
PDPVerifier pdpVerifierImpl = new PDPVerifier(1);
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, 2);
MyERC1967Proxy proxy = new MyERC1967Proxy(address(pdpVerifierImpl), initializeData);
pdpVerifier = PDPVerifier(address(proxy));
Expand Down Expand Up @@ -340,7 +340,7 @@ contract PDPVerifierDataSetMutateTest is MockFVMTest, PieceHelper {

function setUp() public override {
super.setUp();
PDPVerifier pdpVerifierImpl = new PDPVerifier();
PDPVerifier pdpVerifierImpl = new PDPVerifier(1);
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, CHALLENGE_FINALITY_DELAY);
MyERC1967Proxy proxy = new MyERC1967Proxy(address(pdpVerifierImpl), initializeData);
pdpVerifier = PDPVerifier(address(proxy));
Expand Down Expand Up @@ -898,7 +898,7 @@ contract PDPVerifierPaginationTest is MockFVMTest, PieceHelper {

function setUp() public override {
super.setUp();
PDPVerifier pdpVerifierImpl = new PDPVerifier();
PDPVerifier pdpVerifierImpl = new PDPVerifier(1);
uint256 challengeFinality = 2;
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, challengeFinality);
MyERC1967Proxy proxy = new MyERC1967Proxy(address(pdpVerifierImpl), initializeData);
Expand Down Expand Up @@ -1182,7 +1182,7 @@ contract TestingRecordKeeperService is PDPListener, PDPRecordKeeper {
}

contract SumTreeInternalTestPDPVerifier is PDPVerifier {
constructor() {}
constructor() PDPVerifier(1) {}

function getTestHeightFromIndex(uint256 index) public pure returns (uint256) {
return heightFromIndex(index);
Expand Down Expand Up @@ -1628,7 +1628,7 @@ contract PDPListenerIntegrationTest is MockFVMTest, PieceHelper {

function setUp() public override {
super.setUp();
PDPVerifier pdpVerifierImpl = new PDPVerifier();
PDPVerifier pdpVerifierImpl = new PDPVerifier(1);
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, CHALLENGE_FINALITY_DELAY);
MyERC1967Proxy proxy = new MyERC1967Proxy(address(pdpVerifierImpl), initializeData);
pdpVerifier = PDPVerifier(address(proxy));
Expand Down Expand Up @@ -1718,7 +1718,7 @@ contract PDPVerifierExtraDataTest is MockFVMTest, PieceHelper {

function setUp() public override {
super.setUp();
PDPVerifier pdpVerifierImpl = new PDPVerifier();
PDPVerifier pdpVerifierImpl = new PDPVerifier(1);
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, CHALLENGE_FINALITY_DELAY);
MyERC1967Proxy proxy = new MyERC1967Proxy(address(pdpVerifierImpl), initializeData);
pdpVerifier = PDPVerifier(address(proxy));
Expand Down Expand Up @@ -1774,7 +1774,7 @@ contract PDPVerifierE2ETest is MockFVMTest, ProofBuilderHelper, PieceHelper {

function setUp() public override {
super.setUp();
PDPVerifier pdpVerifierImpl = new PDPVerifier();
PDPVerifier pdpVerifierImpl = new PDPVerifier(1);
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, CHALLENGE_FINALITY_DELAY);
MyERC1967Proxy proxy = new MyERC1967Proxy(address(pdpVerifierImpl), initializeData);
pdpVerifier = PDPVerifier(address(proxy));
Expand Down Expand Up @@ -1915,8 +1915,8 @@ contract PDPVerifierMigrateTest is Test {

function setUp() public {
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, 2);
implementation = new PDPVerifier();
newImplementation = new PDPVerifier();
implementation = new PDPVerifier(1);
newImplementation = new PDPVerifier(2);
proxy = new MyERC1967Proxy(address(implementation), initializeData);
pdpVerifier = PDPVerifier(address(proxy));
}
Expand All @@ -1928,7 +1928,7 @@ contract PDPVerifierMigrateTest is Test {
assertEq(afterEpoch, uint96(0));

// Deploy new implementation
PDPVerifier newImpl = new PDPVerifier();
PDPVerifier newImpl = new PDPVerifier(2);

// Announce upgrade
PDPVerifier.PlannedUpgrade memory plan;
Expand Down Expand Up @@ -1967,7 +1967,7 @@ contract PDPVerifierMigrateTest is Test {
}

function testAnnouncePlannedUpgradeOnlyOwner() public {
PDPVerifier newImpl = new PDPVerifier();
PDPVerifier newImpl = new PDPVerifier(2);
PDPVerifier.PlannedUpgrade memory plan;
plan.nextImplementation = address(newImpl);
plan.afterEpoch = uint96(vm.getBlockNumber()) + 2000;
Expand All @@ -1988,7 +1988,7 @@ contract PDPVerifierMigrateTest is Test {
}

function testAnnouncePlannedUpgradeInvalidEpoch() public {
PDPVerifier newImpl = new PDPVerifier();
PDPVerifier newImpl = new PDPVerifier(2);
PDPVerifier.PlannedUpgrade memory plan;
plan.nextImplementation = address(newImpl);
plan.afterEpoch = uint96(vm.getBlockNumber()); // Must be in the future
Expand Down Expand Up @@ -2033,7 +2033,7 @@ contract PDPVerifierFeeTest is MockFVMTest, PieceHelper, ProofBuilderHelper {

function setUp() public override {
super.setUp();
PDPVerifier pdpVerifierImpl = new PDPVerifier();
PDPVerifier pdpVerifierImpl = new PDPVerifier(1);
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, CHALLENGE_FINALITY_DELAY);
MyERC1967Proxy proxy = new MyERC1967Proxy(address(pdpVerifierImpl), initializeData);
pdpVerifier = PDPVerifier(address(proxy));
Expand Down Expand Up @@ -2173,7 +2173,7 @@ contract PDPVerifierStorageProviderListenerTest is MockFVMTest {

function setUp() public override {
super.setUp();
PDPVerifier pdpVerifierImpl = new PDPVerifier();
PDPVerifier pdpVerifierImpl = new PDPVerifier(1);
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, 2);
MyERC1967Proxy proxy = new MyERC1967Proxy(address(pdpVerifierImpl), initializeData);
pdpVerifier = PDPVerifier(address(proxy));
Expand Down
2 changes: 1 addition & 1 deletion test/PDPVerifierProofTest.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ contract PDPVerifierProofTest is MockFVMTest, ProofBuilderHelper, PieceHelper {

function setUp() public override {
super.setUp();
PDPVerifier pdpVerifierImpl = new PDPVerifier();
PDPVerifier pdpVerifierImpl = new PDPVerifier(1);
bytes memory initializeData = abi.encodeWithSelector(PDPVerifier.initialize.selector, CHALLENGE_FINALITY_DELAY);
MyERC1967Proxy proxy = new MyERC1967Proxy(address(pdpVerifierImpl), initializeData);
pdpVerifier = PDPVerifier(address(proxy));
Expand Down
4 changes: 2 additions & 2 deletions test/SimplePDPService.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract SimplePDPServiceTest is Test {

function setUp() public {
pdpVerifierAddress = address(this);
SimplePDPService pdpServiceImpl = new SimplePDPService();
SimplePDPService pdpServiceImpl = new SimplePDPService(1);
bytes memory initializeData =
abi.encodeWithSelector(SimplePDPService.initialize.selector, address(pdpVerifierAddress));
MyERC1967Proxy pdpServiceProxy = new MyERC1967Proxy(address(pdpServiceImpl), initializeData);
Expand Down Expand Up @@ -113,7 +113,7 @@ contract SimplePDPServiceFaultsTest is Test {

function setUp() public {
pdpVerifierAddress = address(this);
SimplePDPService pdpServiceImpl = new SimplePDPService();
SimplePDPService pdpServiceImpl = new SimplePDPService(1);
bytes memory initializeData =
abi.encodeWithSelector(SimplePDPService.initialize.selector, address(pdpVerifierAddress));
MyERC1967Proxy pdpServiceProxy = new MyERC1967Proxy(address(pdpServiceImpl), initializeData);
Expand Down
3 changes: 2 additions & 1 deletion tools/deploy-calibnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ fi

# Calibration testnet uses 10 epochs (vs 150 on mainnet)
CHALLENGE_FINALITY=10
VERIFIER_INIT_COUNTER=1

ADDR=$(cast wallet address --keystore "$KEYSTORE" --password "$PASSWORD")
echo "Deploying PDP verifier from address $ADDR"
# Parse the output of forge create to extract the contract address

NONCE="$(cast nonce --rpc-url "$RPC_URL" "$ADDR")"
VERIFIER_IMPLEMENTATION_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --broadcast --nonce $NONCE --chain-id 314159 src/PDPVerifier.sol:PDPVerifier | grep "Deployed to" | awk '{print $3}')
VERIFIER_IMPLEMENTATION_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --broadcast --nonce $NONCE --chain-id 314159 src/PDPVerifier.sol:PDPVerifier --constructor-args "$VERIFIER_INIT_COUNTER" | grep "Deployed to" | awk '{print $3}')
if [ -z "$VERIFIER_IMPLEMENTATION_ADDRESS" ]; then
echo "Error: Failed to extract PDP verifier contract address"
exit 1
Expand Down
4 changes: 2 additions & 2 deletions tools/deploy-devnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ lotus send $clientAddr 10000
sleep 5 ## Sleep for 5 seconds so fund are available and actor is registered

NONCE="$(cast nonce --rpc-url "$RPC_URL" "$clientAddr")"

VERIFIER_INIT_COUNTER=1
echo "Deploying PDP verifier"
# Parse the output of forge create to extract the contract address
VERIFIER_IMPLEMENTATION_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --nonce $NONCE --broadcast src/PDPVerifier.sol:PDPVerifier | grep "Deployed to" | awk '{print $3}')
VERIFIER_IMPLEMENTATION_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --nonce $NONCE --broadcast src/PDPVerifier.sol:PDPVerifier --constructor-args $VERIFIER_INIT_COUNTER | grep "Deployed to" | awk '{print $3}')
if [ -z "$VERIFIER_IMPLEMENTATION_ADDRESS" ]; then
echo "Error: Failed to extract PDP verifier contract address"
exit 1
Expand Down
3 changes: 2 additions & 1 deletion tools/deploy-mainnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ fi

# Mainnet uses 150 epochs (vs 10 on Calibration testnet)
CHALLENGE_FINALITY=150
VERIFIER_INIT_COUNTER=1

ADDR=$(cast wallet address --keystore "$KEYSTORE" --password "$PASSWORD")
echo "Deploying PDP verifier from address $ADDR"
# Parse the output of forge create to extract the contract address

NONCE="$(cast nonce --rpc-url "$RPC_URL" "$ADDR")"
VERIFIER_IMPLEMENTATION_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --broadcast --nonce $NONCE --chain-id 314 src/PDPVerifier.sol:PDPVerifier | grep "Deployed to" | awk '{print $3}')
VERIFIER_IMPLEMENTATION_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --broadcast --nonce $NONCE --chain-id 314 src/PDPVerifier.sol:PDPVerifier --constructor-args $VERIFIER_INIT_COUNTER | grep "Deployed to" | awk '{print $3}')
if [ -z "$VERIFIER_IMPLEMENTATION_ADDRESS" ]; then
echo "Error: Failed to extract PDP verifier contract address"
exit 1
Expand Down
4 changes: 3 additions & 1 deletion tools/deploy-simple-pdp-service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ echo "Using PDPVerifier at: $PDP_VERIFIER_ADDRESS"

NONCE="$(cast nonce --rpc-url "$RPC_URL" "$ADDR")"

VERIFIER_INIT_COUNTER=1

echo "Deploying SimplePDPService implementation..."
SERVICE_IMPLEMENTATION_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --broadcast --nonce $NONCE --chain-id $CHAIN_ID src/SimplePDPService.sol:SimplePDPService | grep "Deployed to" | awk '{print $3}')
SERVICE_IMPLEMENTATION_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --broadcast --nonce $NONCE --chain-id $CHAIN_ID src/SimplePDPService.sol:SimplePDPService --constructor-args $VERIFIER_INIT_COUNTER | grep "Deployed to" | awk '{print $3}')

if [ -z "$SERVICE_IMPLEMENTATION_ADDRESS" ]; then
echo "Error: Failed to extract SimplePDPService contract address"
Expand Down
11 changes: 8 additions & 3 deletions tools/deploy-transfer-ownership-upgrade-calibnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -euo pipefail
#####################################
# Environment variables & defaults #
#####################################

SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"
: "${FIL_CALIBNET_RPC_URL:?FIL_CALIBNET_RPC_URL not set. Please export it and rerun.}"
: "${FIL_CALIBNET_PRIVATE_KEY:?FIL_CALIBNET_PRIVATE_KEY not set. Please export it and rerun.}"
: "${NEW_OWNER:?NEW_OWNER not set. Please export it and rerun.}"
Expand Down Expand Up @@ -34,14 +34,17 @@ echo
# 2. Deploy PDPVerifier contract #
#####################################
echo "Deploying PDPVerifier contract ..."
# initial verifier init counter (default 1)
VERIFIER_INIT_COUNTER=1
DEPLOY_OUTPUT_VERIFIER=$(
forge create \
--rpc-url "$FIL_CALIBNET_RPC_URL" \
--private-key "$FIL_CALIBNET_PRIVATE_KEY" \
--chain-id "$CHAIN_ID" \
--broadcast \
--nonce $NONCE \
src/PDPVerifier.sol:PDPVerifier
src/PDPVerifier.sol:PDPVerifier \
--constructor-args $VERIFIER_INIT_COUNTER
)
NONCE=$(expr $NONCE + "1")

Expand Down Expand Up @@ -116,7 +119,9 @@ echo "========================================"
#####################################

echo "Deploying a new PDPVerifier contract ..."
DEPLOY_OUTPUT_VERIFIER_2=$(forge create --nonce $NONCE --broadcast --rpc-url "$FIL_CALIBNET_RPC_URL" --private-key "$FIL_CALIBNET_PRIVATE_KEY" --chain-id "$CHAIN_ID" src/PDPVerifier.sol:PDPVerifier)
# For the upgrade, compute next initializer counter from the proxy and pass it
UPGRADE_INIT_COUNTER=$(expr "$("$SCRIPT_DIR/get-initialized-counter.sh" "$PROXY_ADDRESS")" + 1)
DEPLOY_OUTPUT_VERIFIER_2=$(forge create --nonce $NONCE --broadcast --rpc-url "$FIL_CALIBNET_RPC_URL" --private-key "$FIL_CALIBNET_PRIVATE_KEY" --chain-id "$CHAIN_ID" src/PDPVerifier.sol:PDPVerifier --constructor-args $UPGRADE_INIT_COUNTER)
NONCE=$(expr $NONCE + "1")
PDP_VERIFIER_ADDRESS_2=$(echo "$DEPLOY_OUTPUT_VERIFIER_2" | grep "Deployed to" | awk '{print $3}')
echo "PDPVerifier deployed at: $PDP_VERIFIER_ADDRESS_2"
Expand Down
24 changes: 24 additions & 0 deletions tools/get-initialized-counter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
#
# Reads the current reinitializer counter from an OpenZeppelin
# Initializable proxy contract.
#
# The counter lives in the InitializableStorage struct at the
# ERC-7201 namespaced slot defined in:
# https://github.com/OpenZeppelin/openzeppelin-contracts/blob/dde766bd542e4a1695fe8e4a07dc03b77305f367/contracts/proxy/utils/Initializable.sol#L76-L77

if [ -z "$RPC_URL" ]; then
echo "Error: RPC_URL is not set"
exit 1
fi

if [ -z "$1" ]; then
echo "Error: Must specify a contract address"
exit 1
fi

# keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
INITIALIZABLE_STORAGE="0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00"
SLOT=$(cast storage --rpc-url "$RPC_URL" $1 $INITIALIZABLE_STORAGE)

cast to-base $SLOT 10
8 changes: 6 additions & 2 deletions tools/upgrade-contract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#
# Set DRY_RUN=false to actually deploy and broadcast transactions (default is dry-run for safety)
DRY_RUN=${DRY_RUN:-true}
SCRIPT_DIR="$(dirname "${BASH_SOURCE[0]}")"

if [ "$DRY_RUN" = "true" ]; then
echo "🧪 Running in DRY-RUN mode - simulation only, no actual deployment"
Expand Down Expand Up @@ -49,9 +50,11 @@ if [ -z "$IMPLEMENTATION_PATH" ]; then
exit 1
fi

UPGRADE_INIT_COUNTER=$(expr "$("$SCRIPT_DIR/get-initialized-counter.sh" "$PROXY_ADDRESS")" + 1)

if [ "$DRY_RUN" = "true" ]; then
echo "🔍 Simulating deployment of new $IMPLEMENTATION_PATH implementation contract"
forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --compiler-version 0.8.23 --chain-id "$CHAIN_ID" "$IMPLEMENTATION_PATH"
forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --compiler-version 0.8.30 --chain-id "$CHAIN_ID" "$IMPLEMENTATION_PATH" --constructor-args $UPGRADE_INIT_COUNTER

if [ $? -eq 0 ]; then
echo "✅ Contract compilation and simulation successful!"
Expand All @@ -67,8 +70,9 @@ if [ "$DRY_RUN" = "true" ]; then
fi
else
echo "🚀 Deploying new $IMPLEMENTATION_PATH implementation contract"

# Parse the output of forge create to extract the contract address
IMPLEMENTATION_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --broadcast --compiler-version 0.8.23 --chain-id "$CHAIN_ID" "$IMPLEMENTATION_PATH" | grep "Deployed to" | awk '{print $3}')
IMPLEMENTATION_ADDRESS=$(forge create --rpc-url "$RPC_URL" --keystore "$KEYSTORE" --password "$PASSWORD" --broadcast --compiler-version 0.8.30 --chain-id "$CHAIN_ID" "$IMPLEMENTATION_PATH" --constructor-args $UPGRADE_INIT_COUNTER | grep "Deployed to" | awk '{print $3}')

if [ -z "$IMPLEMENTATION_ADDRESS" ]; then
echo "❌ Error: Failed to extract PDP verifier contract address"
Expand Down