Skip to content

Conversation

laisolizq
Copy link
Collaborator

Add tool to create genesis with hardhat

@laisolizq laisolizq marked this pull request as draft August 14, 2025 08:23
@laisolizq laisolizq force-pushed the feature/sovereign-genesis-hardhat branch from 3856a4d to 5b0d647 Compare August 14, 2025 15:01

/**
* Scan all SSTORE opcodes in a trace
* Does not take into account revert operations neither depth
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whith the updated version, depth is taken into account


- Copy genesis base file:
```
cp ./tools/createSovereignGenesis/genesis-base.json.example ./tools/createSovereignGenesis/genesis-base.json
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong path

}

// Get proxy transaction hash
const proxyTx = await contract.deploymentTransaction();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

await not needed

implStorageWrites[depthTokenWrappedImpl];
}
} catch (error) {
logger.error('Could not get Bridge implementation storage writes:', error);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logging the error is not enough, the script should exit/fail. Same for other logger.error of the script

const txDeployTimelock = await timelockContract.deploymentTransaction();
const txDeployTimelockHash = txDeployTimelock ? txDeployTimelock.hash : undefined;

// Transfer ownership of the proxyAdmon to the timelock
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Transfer ownership of the proxyAdmon to the timelock
// Transfer ownership of the proxyAdmin to the timelock

proxiedTokensManager,
} = initializeParams;

const txInitialitzeBridge = await sovereignChainBridgeContract.initialize(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const txInitialitzeBridge = await sovereignChainBridgeContract.initialize(
const txInitializeBridge = await sovereignChainBridgeContract.initialize(

expectedStorageModifications.BridgeL2SovereignChain = await getExpectedStorageProxy(
sovereignChainBridgeContract.target,
);
// Bridge initialitzation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Bridge initialitzation
// Bridge initialization

JSON.stringify(actualStorage, null, 2),
);

let equal = await deepEqual(storageModifications, expectedStorageModifications);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need await

Copy link

@laisolizq laisolizq force-pushed the feature/sovereign-genesis-hardhat branch 2 times, most recently from 94f02f3 to 7e88563 Compare August 22, 2025 11:12
- `useAggOracleCommittee`: `true/false`. Indicates if use aggOracleCommittee
- if `useAggOracleCommittee == true`:
- `ownerAddress`: Address that will own the AggOracleCommittee contract (typically a timelock contract)
- `aggOracleMembers`: Array of addresses that will act as initial oracle members
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Params are "aggOracleCommittee", "aggOracleOwner" according to the code

@laisolizq laisolizq requested a review from ignasirv August 29, 2025 08:21
@laisolizq laisolizq marked this pull request as ready for review September 1, 2025 08:53
tokenWrappedAddress.toLocaleLowerCase().slice(2),
);
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebase with the commit of feature/v12.
Add bridgeLib since it is the latest SC deployed automatically by the bridge.

@@ -0,0 +1,120 @@
# Create sovereign genesis
Script to generate the genesis file for a rollup with `SovereignContracts`. This genesis is aimed to be used for chains that are run with vanilla clients.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add warning code is not audited yep

const dateStr = new Date().toISOString();

async function main() {
logger.info('Start create-sovereign-genesis tool');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add logger warning --> code is not audited yet

@laisolizq laisolizq force-pushed the feature/sovereign-genesis-hardhat branch from d586c3a to 9a29126 Compare September 15, 2025 15:58
@laisolizq laisolizq requested a review from krlosMata September 15, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants