[Chore] - First pass contracts and makefile cleanup (#276)

* first pass contracts and makefile cleanup

* remove unused 4844 test files

* Remove Goerli references

* lint fixing

* lint fixing

* remove more Goerli references

* correct folder paths for L2 service tests

* fix pathing and hardhat version

* reinstate deleted file

* correct file pathing
This commit is contained in:
The Dark Jester
2024-11-06 02:21:14 -08:00
committed by GitHub
parent aa4e2e63f6
commit 4af87b5fe6
69 changed files with 143 additions and 6176 deletions

View File

@@ -13,7 +13,6 @@ assignees: ''
- Network scope: Select those that apply, or select All
- [ ] All
- [ ] Mainnet
- [ ] Testnet - Goerli
- [ ] Testnet - Sepolia
- [ ] Devnet

View File

@@ -80,7 +80,6 @@ deploy-linea-rollup-v5:
LINEA_ROLLUP_GENESIS_TIMESTAMP=1683325137 \
npx ts-node local-deployments-artifacts/deployPlonkVerifierAndLineaRollupV5.ts
deploy-linea-rollup-v6:
# WARNING: FOR LOCAL DEV ONLY - DO NOT REUSE THESE KEYS ELSEWHERE
cd contracts/; \
@@ -155,13 +154,6 @@ deploy-l2-test-erc20:
TEST_ERC20_INITIAL_SUPPLY=100000 \
npx ts-node local-deployments-artifacts/deployTestERC20.ts
upgrade-linea-rollup-on-uat:
cd contracts/; \
rm -f .openzeppelin/goerli.json; \
sed "s/BLOCKCHAIN_NODE=.*/BLOCKCHAIN_NODE=https:\/\/goerli.infura.io\/v3\/${INFURA_KEY}/" .env.template.uat > .env; \
sed -i~ "s/PRIVATE_KEY=.*/PRIVATE_KEY=${PRIVATE_KEY}/" .env; \
npx hardhat run ./scripts/upgrades/upgradeZkEVM.ts --network zkevm_dev
fresh-start-l2-blockchain-only:
make clean-environment
make start-l2-blockchain-only
@@ -183,10 +175,6 @@ fresh-start-all-traces-v2:
make clean-environment
make start-all-traces-v2
start-all-smc-v4:
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment
make deploy-contracts-v4
start-all:
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment
make deploy-contracts
@@ -194,11 +182,6 @@ start-all:
start-all-traces-v2:
L1_GENESIS_TIME=$(get_future_time) make start-whole-environment-traces-v2
make deploy-contracts
deploy-contracts-v4:
make compile-contracts
$(MAKE) -j2 deploy-linea-rollup-v4 deploy-l2messageservice
deploy-contracts:
cd contracts/; \
export L1_NONCE=$$(npx ts-node local-deployments-artifacts/get-wallet-nonce.ts --wallet-priv-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 --rpc-url http://localhost:8445) && \

View File

@@ -11,8 +11,8 @@ L2MSGSERVICE_L1L2_MESSAGE_SETTER="0x90F79bf6EB2c4f870365E785982E1f101E93b906"
L2MSGSERVICE_RATE_LIMIT_PERIOD="86400" #24Hours in seconds
L2MSGSERVICE_RATE_LIMIT_AMOUNT="1000000000000000000000" #1000ETH
BLOCKCHAIN_NODE="https://goerli.infura.io/v3/<infura_key>"
L2_BLOCKCHAIN_NODE="https://linea-goerli.infura.io/v3/<infura_key>"
BLOCKCHAIN_NODE="https://sepolia.infura.io/v3/<infura_key>"
L2_BLOCKCHAIN_NODE="https://linea-sepolia.infura.io/v3/<infura_key>"
DEPLOYMOCKVERIFIER="FALSE"
PRIVATE_KEY=

View File

@@ -11,8 +11,8 @@ L2MSGSERVICE_L1L2_MESSAGE_SETTER="0x90F79bf6EB2c4f870365E785982E1f101E93b906"
L2MSGSERVICE_RATE_LIMIT_PERIOD="86400" #24Hours in seconds
L2MSGSERVICE_RATE_LIMIT_AMOUNT="1000000000000000000000" #1000ETH
BLOCKCHAIN_NODE="https://goerli.infura.io/v3/<infura_key>"
L2_BLOCKCHAIN_NODE="https://linea-goerli.infura.io/v3/<infura_key>"
BLOCKCHAIN_NODE="https://sepolia.infura.io/v3/<infura_key>"
L2_BLOCKCHAIN_NODE="https://linea-sepolia.infura.io/v3/<infura_key>"
DEPLOYMOCKVERIFIER="FALSE"
PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

View File

@@ -1,6 +1,6 @@
export enum SupportedChainIds {
MAINNET = 1,
GOERLI = 5,
SEPOLIA = 11155111,
LINEA_TESTNET = 59140,
LINEA = 59144,
}

View File

@@ -1,22 +0,0 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.26;
import { LineaRollup } from "./LineaRollup.sol";
/**
* @title Contract to reinitialize cross-chain messaging on L1 and rollup proving.
* @author ConsenSys Software Inc.
* @dev Init indicates it is an initializer contract
* @custom:security-contact security-report@linea.build
*/
contract LineaRollupInit is LineaRollup {
/**
* @notice Reinitializes LineaRollup and underlying service dependencies.
* @param _initialStateRootHash The initial hash at migration used for proof verification.
* @param _initialL2BlockNumber The initial block number at migration.
*/
function initializeV2(uint256 _initialL2BlockNumber, bytes32 _initialStateRootHash) external reinitializer(3) {
currentL2BlockNumber = _initialL2BlockNumber;
stateRootHashes[_initialL2BlockNumber] = _initialStateRootHash;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,63 +0,0 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.19;
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { AccessControl } from "@openzeppelin/contracts/access/AccessControl.sol";
contract MyToken is ERC20, AccessControl {
error TokenIsSoulBound();
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
constructor(address minter) ERC20("MyToken", "MTK") {
_grantRole(DEFAULT_ADMIN_ROLE, minter);
_grantRole(MINTER_ROLE, minter);
}
function mint(address _to, uint256 _amount) external onlyRole(MINTER_ROLE) {
_mint(_to, _amount);
}
function batchMint(address[] calldata _to, uint256 _amount) external onlyRole(MINTER_ROLE) {
uint256 addressLength = _to.length;
for (uint256 i; i < addressLength; ) {
unchecked {
_mint(_to[i], _amount);
++i;
}
}
}
function batchMintMultiple(address[] calldata _to, uint256[] calldata _amounts) external onlyRole(MINTER_ROLE) {
require(_to.length == _amounts.length, "Array lengths do not match");
uint256 addressLength = _to.length;
for (uint256 i; i < addressLength; ) {
unchecked {
_mint(_to[i], _amounts[i]);
++i;
}
}
}
function transfer(address, uint256) public virtual override returns (bool) {
revert TokenIsSoulBound();
}
function transferFrom(address, address, uint256) public virtual override returns (bool) {
revert TokenIsSoulBound();
}
function approve(address, uint256) public virtual override returns (bool) {
revert TokenIsSoulBound();
}
function increaseAllowance(address, uint256) public virtual override returns (bool) {
revert TokenIsSoulBound();
}
function decreaseAllowance(address, uint256) public virtual override returns (bool) {
revert TokenIsSoulBound();
}
}

View File

@@ -13,14 +13,14 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments } = hre;
validateDeployBranchAndTags(hre.network.name);
const contractName = "LineaRollupInit";
const contractName = "LineaRollupV6";
const existingContractAddress = await getDeployedContractAddress(contractName, deployments);
const proxyAddress = getRequiredEnvVar("LINEA_ROLLUP_ADDRESS");
const initialL2BlockNumber = "3";
const initialStateRootHash = "0x3450000000000000000000000000000000000000000000000000000000000000";
const factory = await ethers.getContractFactory("LineaRollupInit");
const factory = await ethers.getContractFactory("LineaRollupV6");
if (existingContractAddress === undefined) {
console.log(`Deploying initial version, NB: the address will be saved if env SAVE_ADDRESS=true.`);
@@ -38,6 +38,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
console.log(`Contract deployed at ${contract}`);
// The encoding should be used through the safe.
// THIS IS JUST A SAMPLE AND WILL BE ADJUSTED WHEN NEEDED FOR GENERATING THE CALLDATA FOR THE UPGRADE CALL
const upgradeCallWithReinitializationUsingSecurityCouncil = ethers.concat([
"0x9623609d",
ethers.AbiCoder.defaultAbiCoder().encode(

View File

@@ -1,43 +0,0 @@
import { ethers } from "hardhat";
import { DeployFunction } from "hardhat-deploy/types";
import { HardhatRuntimeEnvironment } from "hardhat/types";
import { deployFromFactory } from "../scripts/hardhat/utils";
import { get1559Fees } from "../scripts/utils";
import {
tryVerifyContractWithConstructorArgs,
getDeployedContractAddress,
tryStoreAddress,
getRequiredEnvVar,
} from "../common/helpers";
const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
const { deployments } = hre;
const contractName = "MyToken";
const existingContractAddress = await getDeployedContractAddress(contractName, deployments);
const provider = ethers.provider;
const adminAddress = getRequiredEnvVar("MYTOKEN_ADMIN_ADDRESS");
if (existingContractAddress === undefined) {
console.log(`Deploying initial version, NB: the address will be saved if env SAVE_ADDRESS=true.`);
} else {
console.log(`Deploying new version, NB: ${existingContractAddress} will be overwritten if env SAVE_ADDRESS=true.`);
}
const contract = await deployFromFactory(contractName, provider, adminAddress, await get1559Fees(provider));
const contractAddress = await contract.getAddress();
console.log(`${contractName} deployed at ${contractAddress}`);
const deployTx = contract.deploymentTransaction();
if (!deployTx) {
throw "Contract deployment transaction receipt not found.";
}
await tryStoreAddress(hre.network.name, contractName, contractAddress, deployTx.hash);
const args = [adminAddress];
await tryVerifyContractWithConstructorArgs(contractAddress, "contracts/token/MyToken.sol:MyToken", args);
};
export default func;
func.tags = ["MYToken"];

View File

@@ -1 +0,0 @@
5

View File

@@ -1,5 +0,0 @@
{
"address": "0xB20e7214c0C60fF5156Eb592a40a88cBcfb03cDc",
"abi": "[{\"type\":\"function\",\"name\":\"Verify\",\"constant\":true,\"stateMutability\":\"view\",\"payable\":false,\"inputs\":[{\"type\":\"bytes\",\"name\":\"proof\"},{\"type\":\"uint256[]\",\"name\":\"public_inputs\"}],\"outputs\":[{\"type\":\"bool\",\"name\":\"success\"}]}]",
"transactionHash": "0x626b168da0c941578e2511c90369f4b96079b5307dbbe51be8122c46517dc97d"
}

View File

@@ -1,5 +0,0 @@
{
"address": "0x29d07227c033e75e1A567f81eE981D7a06154faC",
"abi": "[{\"type\":\"function\",\"name\":\"Verify\",\"constant\":true,\"stateMutability\":\"view\",\"payable\":false,\"inputs\":[{\"type\":\"bytes\",\"name\":\"proof\"},{\"type\":\"uint256[]\",\"name\":\"public_inputs\"}],\"outputs\":[{\"type\":\"bool\",\"name\":\"success\"}]}]",
"transactionHash": "0xfd1b390714a8b743718efe3e3d1a5830e28aa5c277763bb7dcb76a7ca74939a8"
}

View File

@@ -1,5 +0,0 @@
{
"address": "0xE1F005233fbc735e72982e11DD62E81F6d0fF8C1",
"abi": "[{\"type\":\"function\",\"name\":\"Verify\",\"constant\":true,\"stateMutability\":\"view\",\"payable\":false,\"inputs\":[{\"type\":\"bytes\",\"name\":\"proof\"},{\"type\":\"uint256[]\",\"name\":\"public_inputs\"}],\"outputs\":[{\"type\":\"bool\",\"name\":\"success\"}]}]",
"transactionHash": "0xb472d89c576a5781e1a45ae620b5f49a5eb4a58d77bf70bdd8cb9050a0208966"
}

View File

@@ -1,5 +0,0 @@
{
"address": "0xA23e7cb9bc9eF2A072E35cE36439735ef1b20113",
"abi": "[{\"type\":\"function\",\"name\":\"Verify\",\"constant\":true,\"stateMutability\":\"view\",\"payable\":false,\"inputs\":[{\"type\":\"bytes\",\"name\":\"proof\"},{\"type\":\"uint256[]\",\"name\":\"public_inputs\"}],\"outputs\":[{\"type\":\"bool\",\"name\":\"success\"}]}]",
"transactionHash": "0x9f64c8b5dd0b2db52821ff7cf7dd43b5490abf613a9e634ef168892ebc8c6acd"
}

View File

@@ -1 +0,0 @@
59140

File diff suppressed because one or more lines are too long

View File

@@ -42,7 +42,7 @@
"dotenv": "16.4.5",
"edit-json-file": "1.8.0",
"ethers": "6.12.0",
"hardhat": "2.22.10",
"hardhat": "2.22.11",
"hardhat-deploy": "0.12.4",
"hardhat-storage-layout": "0.1.7",
"hardhat-tracer": "2.8.2",

View File

@@ -1,26 +0,0 @@
{
"aggregatedProof": "0x1fe5267b8eafc819b3b74ab65b9e34362a35022232187314803267372d6ceffe2153541f479292f4ab57eeb145a192f1aed7f5ef9e0043db0d56313dec96eefb2015742f0bd1f0bc2d7580299c40b27631437a7463ce9dfcae3d22e421c7067c01229f2e356f2a1a334aa2518357628ff4c9c2603a5378500b7745a32a682959286db89403ce1630bd8f67b5d7215e4331cf12f4bbf1e2eafce24c7fca50b167298301b7267fdef114b5ebcafcfdc27725c332ebdce073cb4d20aedc741912ba02f66d94402a8c87effc0659255afdd704d9e84f00545d662127f5b5f0aac9fa00d3595236dd194c165f2021a6cd36f4354cdb45ff774df8e145804bdfca64f22ef402958c3659e87dfc8bfb59d006d65f5a690e1d5bf219abb9a0846e4b946c1b1f5bfa67e7a759230cfdbcc8c59ea1ea9e50ccc69080416ac59a63b3487a92141771b119932810469ed904f3054f36d9c8929cec6262719468c1784d07a0ea1a5836a08ce2d83344ac1a9c7225c0e43a51141a67c637a0c9c30bd98af734e40c7ab90abbb1866f10d6258a201d9a290987d82304f07032e9439a8fd017fbcb094a6c1007657ab3711ac1a106d230d6b49d3cf1ca5c6f5b0095e15c6c3673d20418aa76db1d96e38be28551e2c8913a7d48c0a56d9c922bf16db556b05e791c261b1f2cba652d6c368b60a63ddb350a12e256a915a27e464010e8fea18cb5c903c27f1683fcbcbb21399f76813288f38f68235b6f5a6a41139faf894c19a9af0fae4174b7fee8b9abfb50d49d59e27d766337307fb8b4d756f343f066672dc60991577ddcc2231b8dd215edbf78d8bd946067704f62a40bcb19593a78c0ea4f03bdd235742712148f7b7169e0767e3146bf27c19e3c74401c6d461cb55c4ccc1b853beae90d82a8929fe039b7ead8827b1d4443c5751bf00a5a14cc16f45d6c0188f7a7be76f133802e5f5a2c2834b5f916f62beec11fba816da5039d12fe1806c7fec2196075449a50fb2418a71c9faa09033f4f178683ee79e6af43b0e1ba2cd915cf409bcba2cdac3b6f1328eea241d2c85f39e7fb4e45aed4430b0826870ceeceeac26249914c76f53cd229baa5c6d1c63990670dcb29c573fe5259f9ca07191911ecf79c61edff2a672af0b92e917812e3929bed1edfbcb413ef121d2825ff7665487375108a686e5a8b6d06a934f1c926df0b50ebdf22f9366e33824922eccc7b55c619a0dcb6e9ba7a3df149f3ba8544e3f01b2356edcf8b4caad21622f29c3aef492d026dae7bd519ab733aa04e1dc2e785b842042ad3c7906168d7",
"aggregatedProverVersion": "test",
"aggregatedVerifierIndex": 1,
"aggregatedProofPublicInput": "0x231e898779333073b4d50d1132d89d60e969d9a1e3acd03fa169b4122ecfa373",
"dataHashes": [
"0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95",
"0x82694a9670032c50548d42dbf6f0d9d09febc4f2454796997ec9a4edc7f87106",
"0x017b1d49c6c7947f83855cc16063ef19d02369540b97867855427b56cdaea487"
],
"dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentAggregationFinalShnarf": "0x4f64fe1ce613546d34d666d8258c13c6296820fd13114d784203feb91276e838",
"finalShnarf": "0x01eac6954f735d506a9a7c519e62f1a3a75c0e48e058a6358be8d3896e93af10",
"parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd",
"parentAggregationLastBlockTimestamp": 1683325137,
"lastFinalizedBlockNumber": 0,
"finalTimestamp": 1683335137,
"finalBlockNumber": 114,
"l1RollingHash": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"l1RollingHashMessageNumber": 12,
"l2MerkleRoots": [
"0x54ace467f69267f4e71233605888cb0161f115c83ffeb1f1c9430c9988432f4e"
],
"l2MerkleTreesDepth": 5,
"l2MessagingBlocksOffsets": "0x00000000000000000000000fffff"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,395 +0,0 @@
import { AbiCoder, BytesLike, Transaction, Wallet, ethers } from "ethers";
import { commitmentsToVersionedHashes } from "@ethereumjs/util";
import * as kzg from "c-kzg";
import submissionDataJson2 from "../SixInOne/blocks-1-46.json";
import submissionDataJson from "./blocks-47-81.json";
import submissionDataJson3 from "./blocks-82-114.json";
import aggregateProof1to114 from "./aggregatedProof-1-114.json";
import { DataHexString } from "ethers/lib.commonjs/utils/data";
export function generateKeccak256(types: string[], values: unknown[], packed?: boolean) {
return ethers.keccak256(encodeData(types, values, packed));
}
export const encodeData = (types: string[], values: unknown[], packed?: boolean) => {
if (packed) {
return ethers.solidityPacked(types, values);
}
return AbiCoder.defaultAbiCoder().encode(types, values);
};
type SubmissionData = {
parentStateRootHash: string;
dataParentHash: string;
finalStateRootHash: string;
firstBlockInData: bigint;
finalBlockInData: bigint;
snarkHash: string;
};
export type ParentSubmissionData = {
finalStateRootHash: string;
firstBlockInData: bigint;
finalBlockInData: bigint;
shnarf: string;
dataParentHash: string;
};
export function generateSubmissionDataFromJSON(
startingBlockNumber: number,
endingBlockNumber: number,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parsedJSONData: any,
): { submissionData: SubmissionData; blob: Uint8Array } {
const returnData = {
parentStateRootHash: parsedJSONData.parentStateRootHash,
dataParentHash: parsedJSONData.parentDataHash,
finalStateRootHash: parsedJSONData.finalStateRootHash,
firstBlockInData: BigInt(startingBlockNumber),
finalBlockInData: BigInt(endingBlockNumber),
snarkHash: parsedJSONData.snarkHash,
};
return {
submissionData: returnData,
blob: ethers.decodeBase64(parsedJSONData.compressedData),
};
}
export function generateParentSubmissionData(finalStateRootHash: string, parentDataHash: string): ParentSubmissionData {
return {
finalStateRootHash: finalStateRootHash,
firstBlockInData: BigInt(0),
finalBlockInData: BigInt(0),
shnarf: ethers.keccak256(ethers.toUtf8Bytes(ethers.ZeroHash)),
dataParentHash: parentDataHash,
};
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function generateParentSubmissionDataFromJson(parsedJSONData: any): ParentSubmissionData {
return {
finalStateRootHash: parsedJSONData.finalStateRootHash,
firstBlockInData: BigInt(parsedJSONData.conflationOrder.startingBlockNumber),
finalBlockInData: BigInt(parsedJSONData.conflationOrder.upperBoundaries.slice(-1)[0]),
shnarf: parsedJSONData.expectedShnarf,
dataParentHash: parsedJSONData.parentDataHash,
};
}
export function generateSubmissionCallDataFromJSON(
startingBlockNumber: number,
endingBlockNumber: number,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parsedJSONData: any,
): { submissionData: SubmissionData } {
const returnData = {
parentStateRootHash: parsedJSONData.parentStateRootHash,
dataParentHash: parsedJSONData.parentDataHash,
finalStateRootHash: parsedJSONData.finalStateRootHash,
firstBlockInData: BigInt(startingBlockNumber),
finalBlockInData: BigInt(endingBlockNumber),
snarkHash: parsedJSONData.snarkHash,
compressedData: ethers.hexlify(ethers.decodeBase64(parsedJSONData.compressedData)),
};
return {
submissionData: returnData,
};
}
function getPadded(data: Uint8Array): Uint8Array {
const pdata = new Uint8Array(131072).fill(0);
pdata.set(data);
return pdata;
}
function requireEnv(name: string): string {
const envVariable = process.env[name];
if (!envVariable) {
throw new Error(`Missing ${name} environment variable`);
}
return envVariable;
}
function kzgCommitmentsToVersionedHashes(commitments: Uint8Array[]): string[] {
const versionedHashes = commitmentsToVersionedHashes(commitments);
return versionedHashes.map((versionedHash) => ethers.hexlify(versionedHash));
}
async function main() {
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
kzg.loadTrustedSetup(`${__dirname}/../trusted_setup.txt`);
const { submissionData: submissionData2, blob: blob2 } = generateSubmissionDataFromJSON(1, 46, submissionDataJson2);
const parentSubmissionData1 = generateParentSubmissionData(
"0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd",
ethers.ZeroHash,
);
const { submissionData } = generateSubmissionCallDataFromJSON(47, 81, submissionDataJson);
const parentSubmissionData2 = generateParentSubmissionDataFromJson(submissionDataJson2);
const { submissionData: submissionData3, blob: blob3 } = generateSubmissionDataFromJSON(82, 114, submissionDataJson3);
const parentSubmissionData3 = generateParentSubmissionDataFromJson(submissionDataJson);
const finalSubmissionData = generateParentSubmissionDataFromJson(submissionDataJson3);
const fullblob2 = getPadded(blob2);
const fullblob3 = getPadded(blob3);
const commitment2 = kzg.blobToKzgCommitment(fullblob2);
const commitment3 = kzg.blobToKzgCommitment(fullblob3);
const [versionedHash2, versionedHash3] = kzgCommitmentsToVersionedHashes([commitment2, commitment3]);
let encodedCall = encodeCall(submissionData2, parentSubmissionData1, [commitment2], submissionDataJson2);
await submitBlob(provider, wallet, encodedCall, destinationAddress, [versionedHash2], fullblob2);
await submitCalldata(submissionData, parentSubmissionData2);
encodedCall = encodeCall(submissionData3, parentSubmissionData3, [commitment3], submissionDataJson3);
await submitBlob(provider, wallet, encodedCall, destinationAddress, [versionedHash3], fullblob3);
await sendProof(aggregateProof1to114, parentSubmissionData1, finalSubmissionData);
}
function encodeCall(
submissionData: SubmissionData,
parentSubmissionData: ParentSubmissionData,
commitments: BytesLike[],
// eslint-disable-next-line @typescript-eslint/no-explicit-any
submissionDataJson: any,
): DataHexString {
const encodedCall = ethers.concat([
"0xf82c988c",
ethers.AbiCoder.defaultAbiCoder().encode(
[
"tuple(bytes32,bytes32,bytes32,uint256,uint256,bytes32)",
"tuple(bytes32,uint256,uint256,bytes32,bytes32)",
"uint256",
"bytes",
"bytes",
],
[
[
submissionData.parentStateRootHash,
submissionData.dataParentHash,
submissionData.finalStateRootHash,
submissionData.firstBlockInData,
submissionData.finalBlockInData,
submissionData.snarkHash,
],
[
parentSubmissionData.finalStateRootHash,
parentSubmissionData.firstBlockInData,
parentSubmissionData.finalBlockInData,
parentSubmissionData.shnarf,
parentSubmissionData.dataParentHash,
],
submissionDataJson.expectedY,
commitments[0],
submissionDataJson.kzgProofContract,
],
),
]);
return encodedCall;
}
async function submitBlob(
provider: ethers.JsonRpcProvider,
wallet: Wallet,
encodedCall: string,
destinationAddress: string,
versionedHashes: string[],
fullblob: Uint8Array,
) {
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
type: 3,
nonce,
value: 0,
kzg,
blobs: [fullblob],
gasLimit: 5_000_000,
blobVersionedHashes: versionedHashes,
maxFeePerBlobGas: maxFeePerGas!,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log({ transaction: tx, receipt });
}
async function sendProof(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
proofFile: any,
submissionData: ParentSubmissionData,
finalSubmissionData: ParentSubmissionData,
) {
console.log("proof");
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
const xxx = [
proofFile.aggregatedProof,
0,
[
proofFile.parentStateRootHash,
submissionData.shnarf,
proofFile.dataHashes.slice(-1)[0],
[
finalSubmissionData.finalStateRootHash,
finalSubmissionData.firstBlockInData,
finalSubmissionData.finalBlockInData,
finalSubmissionData.shnarf,
finalSubmissionData.dataParentHash,
],
proofFile.parentAggregationLastBlockTimestamp,
proofFile.finalTimestamp,
proofFile.l1RollingHash,
proofFile.l1RollingHashMessageNumber,
proofFile.l2MerkleRoots,
proofFile.l2MerkleTreesDepth,
proofFile.l2MessagingBlocksOffsets,
],
];
console.log(xxx);
const encodedCall = ethers.concat([
"0x727073c8",
ethers.AbiCoder.defaultAbiCoder().encode(
[
"bytes",
"uint256",
"tuple(bytes32,bytes32,bytes32,tuple(bytes32,uint256,uint256,bytes32,bytes32),uint256,uint256,bytes32,uint256,bytes32[],uint256,bytes)",
],
[
proofFile.aggregatedProof,
0,
[
proofFile.parentStateRootHash,
submissionData.shnarf,
proofFile.dataHashes.slice(-1)[0],
[
finalSubmissionData.finalStateRootHash,
finalSubmissionData.firstBlockInData,
finalSubmissionData.finalBlockInData,
finalSubmissionData.shnarf,
finalSubmissionData.dataParentHash,
],
proofFile.parentAggregationLastBlockTimestamp,
proofFile.finalTimestamp,
proofFile.l1RollingHash,
proofFile.l1RollingHashMessageNumber,
proofFile.l2MerkleRoots,
proofFile.l2MerkleTreesDepth,
proofFile.l2MessagingBlocksOffsets,
],
],
),
]);
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
nonce,
value: 0,
gasLimit: 5_000_000,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log({ transaction: tx, receipt });
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function submitCalldata(calldata: any, parentSubmissionData: ParentSubmissionData) {
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
const encodedCall = ethers.concat([
"0xc6251c58",
ethers.AbiCoder.defaultAbiCoder().encode(
[
"tuple(bytes32,bytes32,bytes32,uint256,uint256,bytes32,bytes)",
"tuple(bytes32,uint256,uint256,bytes32,bytes32)",
],
[
[
calldata.parentStateRootHash,
calldata.dataParentHash,
calldata.finalStateRootHash,
calldata.firstBlockInData,
calldata.finalBlockInData,
calldata.snarkHash,
calldata.compressedData,
],
[
parentSubmissionData.finalStateRootHash,
parentSubmissionData.firstBlockInData,
parentSubmissionData.finalBlockInData,
parentSubmissionData.shnarf,
parentSubmissionData.dataParentHash,
],
],
),
]);
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
nonce,
value: 0,
gasLimit: 5_000_000,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log({ transaction: tx, receipt });
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

View File

@@ -146,7 +146,7 @@ async function main() {
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
kzg.loadTrustedSetup(`${__dirname}/../trusted_setup.txt`);
kzg.loadTrustedSetup(`${__dirname}/trusted_setup.txt`);
const parentSubmissionData1 = generateParentSubmissionData(
"0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd",

View File

@@ -1,22 +0,0 @@
{
"aggregatedProof": "0x20732827391ad5a5df0d53b28ab354ecca70ccc4de92fb23a518ccc7d3492c320afc6cd28fc0f4190ec985b947787a8cbfa185fdeab41fe586a7a2c81aba775802543720e6224be0cca01afa8d2fc489639cb561add49a10496a3d8b8267c19f2e2b38026f7e2980908e88589479ccbd3468869554bc5c055a3d8752189b11882090bd3714278158f76cb0384cd4173bff2029ad74fc9d367c376c1edcad99f91f3c6f7a3ea3683d04dff0fd7fe953c334ecf1081aa49d30fe85cde0a101849e0aed76f9905df06d9076d51e2a97c2c05c64d62dc4b4785d208e8f692ef289b91f54985a79866d63cab792360048963de6f11a2c9ba21558ef8cd02acbe4d90e26020a6f73d04c953176f703c265c6c06c909e763f6742e686cecc39201a10f429aaef17f3963e95741831cd08795f4fb723a90749d8360a713f05e6998c1e2e14b5eb5f14efba252108cb354d7221c24d8057a908c0f11ec7d5621a8e97dbd30abbd543eafbc7f7c9c3e145dd309a8257519de2a31826a27e2e714af38369d50c9f865ead16dcbf3d40c0310fc5ce5624a88ed01793cbd083559eb222f60b45232d9253787c65c98bd649eae7cafe153903bbf7b111b85cd0841976a5920c9a01d7cd1b31545a1dc6c7a9cfaf985ce55b367e11eba90d5efdb1f957d43eedb72a4b759328bad9e173a151a251ccfb52b463dde2d593c5f2186799391d5c0132092cbbc24e65b79197900876e5d810f564f65b7fa1803168a3f6b8783e8118ca1a3346cc71faec9e61038660a800268b140c7926170968de8fc7381780d682912451dbdb298be466f122a0879b91eaadf4831d54e27a20916e103d71d50e039b2413e77c871f3902e19bbb432ab112eaf8e249a23d8c0e795f30bf4440c559fa025c40d57962c47eed08a7ba1751d5503fc7b935dc2ef36f2e5aa5dd308575cc24aa2ec20da42de4a0ae5b2c5674139d4cf620fcb4934cf3b315e61d31cd70ed05fb48ce6c62f974d47a8df1d432d65706e076e0e74afdf6f5aac5a8bedf102c109936c4dae4ddf68d0f738124ccd99b677fbd5d225d8bc300ec9b7ba7b4f07f0f4140123ba1a3d90dc15596ab335d3e6d985ae7b05b8fdee2092e076cd92a01002633a614a3cd0339daa7703d6fbfb8fc188d7b2dadfd1d6a839d6df3c8cd4912718d5041a0ee63e867557dd677f3dd7d6f2329f0ccec15a89b54099ae961c91bc048ac0006b53c03cf8d2c142cefe822472f9c0b9060f3914303b1bf0b5dcc0b26f8f21577d732e9b1634b1dbe3fef0c44053dd3c08f5d8cd522258a85f18f",
"aggregatedProverVersion": "test",
"aggregatedVerifierIndex": 1,
"aggregatedProofPublicInput": "0x276e5991b2c54ead939750d9f9ff67dc90a79e8dd17bf7528d1fd5ef9add0037",
"dataHashes": [
"0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c"
],
"dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd",
"parentAggregationLastBlockTimestamp": 1683325137,
"lastFinalizedBlockNumber": 0,
"finalTimestamp": 1683335137,
"finalBlockNumber": 46,
"l1RollingHash": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"l1RollingHashMessageNumber": 12,
"l2MerkleRoots": [
"0x97cd1539d08f7c0ba06ad836b2690eef50afd86609a0672517ec0ef8c1f94796"
],
"l2MerkleTreesDepth": 5,
"l2MessagingBlocksOffsets": "0x00000000000000000000000fffff"
}

View File

@@ -1,23 +0,0 @@
{
"aggregatedProof": "0x2d469df88312f32b8e4b689ebdab672b14dff77fc472b3b3bc3481b64921cadc2c422b0045ad11dac8a8cb4c57519e6325ba1f4e837e3a931208b9530bed67e91c26625523abd69510fec2852bfe93fb6893f8011d156da32f2367205483773e2c72c6c163a6ba50cd5573ffdfd6b8d93e7c42578b12434cd1de308c0720650b285497b617782c71ad63aa09f8d0dad8b4683d5e25a277358748f68f3b81fc292f7f983ed244eee0db89288d764aaff6c00df830f20ccab93ae11a2ae507ffa322c76db4af3de67e9d50078f3b49283a0af08350df1ac9b42ecf30f6e11526bd06269646f1f5e049c235bef2625f8d5feec18a807bf1b5e797ff8e516c0f0bf926c03b61e100daed4c089217fe9ccb518bcee2d1c6458d3ab8c55e763c6a13b029563adfc66fe13830354450caee49049b480ab85b09ce39677a588a7114154c00f49aed7ff0de838cd3772affeff4101783c1670c7a5fcd2fb4977801e8b7062ecf410067bc193c4e8e11a5e9e8254232f17e13805f73d4daf44cff409278390e12815e4860fce98daab617c470646f91ab708ae34c0501b5460fb9e97960d610998d2b35f9eef294d8476c9d8fdda6ca24056f33f2ac8a46c439ced4cc0ef92eb710c17ba07fd51fef1d5a55b1c9f610285cfc8e31facfa6bf61cce34be9792541decb8f907bfffb76bb3e66a2e12e75a79b74f86a2ea8317d3cb5243d57550aab1e76c567f4a9ee76c106aa2261ed178efa5324518493d3fefd34f8f1fa670e28d4f69716be043aef04867466e2b39f8fdb70f09fcc53e15abb21872013eb22b45c2c4ed2ced483a1bc63064b37aa31c4bff107f73cc5ec980f6ba154b07b09bc0f21c113d9dcc59a2df81449dc879321c061d4b8b085ea4ae5b6c23e91762d3c3bf89b5cc7594be1384064a0d42c13aa2d4aa30c5f6b9bef6ccbf18dbd672c5cb5547ab16375a137d572337d0ef8e05a48584ed3804d9e217b7bce1d83a0118553e7d4a92d002136a30e053f7a6a5210a31d19825d8e1264a1d6715389b025ff4bec874ae4739d9198e34beddb645842951b80018e9a11db1bb594919014225d8449f247a1966b9b9f790a4fb3060fc532defc2752741b31143e6407c1202c9e696844492e16c6576fe47eb9b5f06d83c79650e0ccae02375adb883a30462b35cfc46adf843bcf74f7b9844200f380b8c390fa6bdfbe2f25dd0be62e6aae25ec73777e1ba4a4ec2957b125aa9c79dca7d78130bf19b1ea811486682e5ee11a31f42a13b1303638b4978f087193844cd299d5c59561cdb8e8ee2b2ac8ffa6",
"aggregatedProverVersion": "test",
"aggregatedVerifierIndex": 1,
"aggregatedProofPublicInput": "0x0d0ec9112097d93742ccbbfb7099ea929e0d358b7a4242463ce97c7d18f17ae7",
"dataHashes": [
"0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95",
"0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618"
],
"dataParentHash": "0x7126453ddb4c09537a505a70bae0dd57a3f5daba4522fa1f79b760fb28efb35c",
"parentStateRootHash": "0xea09456033a79b5f8b369a95cce74d3dbe34fdd6415bff1a417ff8a8fa0cffd3",
"parentAggregationLastBlockTimestamp": 1683335137,
"lastFinalizedBlockNumber": 46,
"finalTimestamp": 1683355137,
"finalBlockNumber": 127,
"l1RollingHash": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"l1RollingHashMessageNumber": 12,
"l2MerkleRoots": [
"0x6de197db892fd7d3fe0a389452dae0c5d0520e23d18ad20327546e2189a7e3f1"
],
"l2MerkleTreesDepth": 5,
"l2MessagingBlocksOffsets": "0x00000000000000000000000fffff"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,273 +0,0 @@
import { BytesLike, Transaction, Wallet, ethers } from "ethers";
import { commitmentsToVersionedHashes } from "@ethereumjs/util";
import * as kzg from "c-kzg";
import submissionDataJson from "./blocks-1-46.json";
import submissionDataJson2 from "./blocks-47-92.json";
import submissionDataJson3 from "./blocks-93-127.json";
import aggregateProof1to46 from "./aggregatedProof-1-46.json";
import aggregateProof47to127 from "./aggregatedProof-47-127.json";
import { DataHexString } from "ethers/lib.commonjs/utils/data";
type SubmissionData = {
parentStateRootHash: string;
dataParentHash: string;
finalStateRootHash: string;
firstBlockInData: bigint;
finalBlockInData: bigint;
snarkHash: string;
};
export function generateSubmissionDataFromJSON(
startingBlockNumber: number,
endingBlockNumber: number,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parsedJSONData: any,
): { submissionData: SubmissionData; blob: Uint8Array } {
const returnData = {
parentStateRootHash: parsedJSONData.parentStateRootHash,
dataParentHash: parsedJSONData.parentDataHash,
finalStateRootHash: parsedJSONData.finalStateRootHash,
firstBlockInData: BigInt(startingBlockNumber),
finalBlockInData: BigInt(endingBlockNumber),
snarkHash: parsedJSONData.snarkHash,
};
return {
submissionData: returnData,
blob: ethers.decodeBase64(parsedJSONData.compressedData),
};
}
export function generateSubmissionCallDataFromJSON(
startingBlockNumber: number,
endingBlockNumber: number,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parsedJSONData: any,
): { submissionData: SubmissionData } {
const returnData = {
parentStateRootHash: parsedJSONData.parentStateRootHash,
dataParentHash: parsedJSONData.parentDataHash,
finalStateRootHash: parsedJSONData.finalStateRootHash,
firstBlockInData: BigInt(startingBlockNumber),
finalBlockInData: BigInt(endingBlockNumber),
snarkHash: parsedJSONData.snarkHash,
compressedData: ethers.hexlify(ethers.decodeBase64(parsedJSONData.compressedData)),
};
return {
submissionData: returnData,
};
}
function requireEnv(name: string): string {
const envVariable = process.env[name];
if (!envVariable) {
throw new Error(`Missing ${name} environment variable`);
}
return envVariable;
}
function kzgCommitmentsToVersionedHashes(commitments: Uint8Array[]): string[] {
const versionedHashes = commitmentsToVersionedHashes(commitments);
return versionedHashes.map((versionedHash) => ethers.hexlify(versionedHash));
}
async function main() {
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
kzg.loadTrustedSetup(`${__dirname}/../trusted_setup.txt`);
const { submissionData } = generateSubmissionCallDataFromJSON(1, 46, submissionDataJson);
const { submissionData: submissionData2, blob: blob2 } = generateSubmissionDataFromJSON(47, 92, submissionDataJson2);
const { submissionData: submissionData3, blob: blob3 } = generateSubmissionDataFromJSON(93, 127, submissionDataJson3);
const commitments2 = kzg.blobToKzgCommitment(blob2);
const commitments3 = kzg.blobToKzgCommitment(blob3);
const [versionedHashes2, versionedHashes3] = kzgCommitmentsToVersionedHashes([commitments2, commitments3]);
await submitCalldata(submissionData);
let encodedCall = encodeCall(submissionData2, [commitments2], submissionDataJson2);
await submitBlob(provider, wallet, encodedCall, destinationAddress, [versionedHashes2], blob2);
encodedCall = encodeCall(submissionData3, [commitments3], submissionDataJson3);
await submitBlob(provider, wallet, encodedCall, destinationAddress, [versionedHashes3], blob3);
await sendProof(aggregateProof1to46);
await sendProof(aggregateProof47to127);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function encodeCall(submissionData: SubmissionData, commitments: BytesLike[], submissionDataJson: any): DataHexString {
const encodedCall = ethers.concat([
"0x2d3c12e5",
ethers.AbiCoder.defaultAbiCoder().encode(
["tuple(bytes32,bytes32,bytes32,uint256,uint256,bytes32)", "uint256", "bytes", "bytes"],
[
[
submissionData.parentStateRootHash,
submissionData.dataParentHash,
submissionData.finalStateRootHash,
submissionData.firstBlockInData,
submissionData.finalBlockInData,
submissionData.snarkHash,
],
submissionDataJson.expectedY,
commitments[0],
submissionDataJson.kzgProofContract,
],
),
]);
return encodedCall;
}
async function submitBlob(
provider: ethers.JsonRpcProvider,
wallet: Wallet,
encodedCall: string,
destinationAddress: string,
versionedHashes: string[],
fullblob: Uint8Array,
) {
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
console.log("nonce", nonce);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
type: 3,
nonce,
value: 0,
kzg,
blobs: [fullblob],
gasLimit: 5_000_000,
blobVersionedHashes: versionedHashes,
maxFeePerBlobGas: maxFeePerGas!,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log({ transaction: tx, receipt });
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function sendProof(proofFile: any) {
console.log("proof");
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
const encodedCall = ethers.concat([
"0xd630280f",
ethers.AbiCoder.defaultAbiCoder().encode(
[
"bytes",
"uint256",
"tuple(bytes32,bytes32[],bytes32,uint256,uint256,uint256,bytes32,uint256,bytes32[],uint256,bytes)",
],
[
proofFile.aggregatedProof,
0,
[
proofFile.parentStateRootHash,
proofFile.dataHashes,
proofFile.dataParentHash,
proofFile.finalBlockNumber,
proofFile.parentAggregationLastBlockTimestamp,
proofFile.finalTimestamp,
proofFile.l1RollingHash,
proofFile.l1RollingHashMessageNumber,
proofFile.l2MerkleRoots,
proofFile.l2MerkleTreesDepth,
proofFile.l2MessagingBlocksOffsets,
],
],
),
]);
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
nonce,
value: 0,
gasLimit: 5_000_000,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log({ transaction: tx, receipt });
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function submitCalldata(calldata: any) {
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
const encodedCall = ethers.concat([
"0x7a776315",
ethers.AbiCoder.defaultAbiCoder().encode(
["tuple(bytes32,bytes32,bytes32,uint256,uint256,bytes32,bytes)"],
[
[
calldata.parentStateRootHash,
calldata.dataParentHash,
calldata.finalStateRootHash,
calldata.firstBlockInData,
calldata.finalBlockInData,
calldata.snarkHash,
calldata.compressedData,
],
],
),
]);
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
nonce,
value: 0,
gasLimit: 5_000_000,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log({ transaction: tx, receipt });
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

View File

@@ -1,29 +0,0 @@
{
"aggregatedProof": "0x026df7feeb2cc002cc600ffad35c6a913132c6ffd33c8bec6b6eeeab74875e630b02c55b02dcb08b5ca876113df1c2af6f0366eefbdbbe3f0c9eb10f4c50893728f217d93e2f769e16e12764c416c1c5108cdd12d578e6b95a4c0d4b80abbbd91185b4625b4257800302467fc807ef4d195da399947424521ba2ecceda1e900c2c976df8a8cf5bc7d97f4b45c6a1fb3b605b96c7a2b02ad2bd9349abc365aa612ca0e3942ec0c07efa7c974178acf1398bec47cc2697b2ebf405e1aac17d781a24958afd1ab3f237f17f9ba8bf899d55521314a4d35df7aa5540fc8695153a661443713035ebc568ca96dfd721f5ffa60d4520cea6b4629ed05f91961f8ff4ef1802296560d8727b6694d75b0bb85d7d64544ae2f64779f32fc5d58f2cbf106f2210532faf9023dad94af3e2fba94614aa34e7e37da65a2e9e63e48425b3eb3422ce97fdbfdedef32190989b78df2ea927eb6837d62f76dee7ceeac256b84fb21caf936758cc7d56151e1a5e979ca87917ad3f8e754cd31160a866a6d37ef1f807a1c08e4a85d5043d0b8a54b6facc8d0a8ce94d1715b317a9e8e9df9fc98d1b08e6169bd05f61cd5e32735d33e873b50e4c0354c4e0242966f882db2dd5efa325c658e3915899a8665e717d042c903ef5908528274c4295f76bc1189d3ff4a31a55e455a0b4fbe5a79338e400218ae31e90f35913602026c11000d66b37d8db0d0b3c1b365bae5f91f7278759924d7705f22c3c203a34ef135fcaf0d6de647d2a537f51f3d0fdeb4003f015a21a326c9d7fd29aea8db21dc3472506c8abdbab2b48e9d518fc94d9f700ed7cf949270cee7840c3728991439da93264c8abf2a8165dcb5b526966ed033a9b3b009b5bd713c680c4388b556870c8377834dde8221fbf7c4fac229d387d7fac7375790336d0bc0099a3dec3c92058fc9a66f79b1e28481795cafc2f3c5bde4c95d544f2cb18856679bcd82d63aa8c3eb639b9ca6009d057077279a7c66a2f55f30605115991f1afacc0b31df0621b9297e79bee500152db12459361dfee627eb4185d91123a8a1060de6d18b0b27171b78fd1b7ba0cd2d075c12981e3a61dddb8c2b81897b4df1177685da49984307eee4bbc77320b3cb5528bfc4d4d9f2006dd96896a9bef5a41ac570ea1c2180e1f649e3e177523012569019a06c70cb5c110884d85a2f1e7442e301efbe49707c22c98914cad2d0708e7fdb2e12b018fb37970b9b22cdf8553b51538f4ccdd5fcd969aedd9600b23b393745e2871bf1b9f2af7176deb4daa292e44f799dc4a72bf826a1c646f",
"aggregatedProverVersion": "test",
"aggregatedVerifierIndex": 1,
"aggregatedProofPublicInput": "0x1d2b9051238709f6f992a6bce6b5102a7182a6b9db4100ce46a9fe26f92dde78",
"dataHashes": [
"0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95",
"0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618",
"0x017b1d49c6c7947f83855cc16063ef19d02369540b97867855427b56cdaea487",
"0x012cab32c78df416fe59f8f123e2ded2466a64e201bacddc8396231f335d2088",
"0x0159ba31314753be910d2abb9b7aeeafbefd58cc4163e8d3cc6695315960c7c1",
"0x017207990658280f269f538918209b2ab0f4e70c4b222aa8067ed327caf3c762"
],
"dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentAggregationFinalShnarf": "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f",
"finalShnarf": "0x96ed18f2706ace8f30f5535d286087d34d1cc04a1e03b4100e24c209de5dcd6f",
"parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd",
"parentAggregationLastBlockTimestamp": 1683325137,
"lastFinalizedBlockNumber": 0,
"finalTimestamp": 1683335137,
"finalBlockNumber": 206,
"l1RollingHash": "0xdc8e70637c1048e1e0406c4ed6fab51a7489ccb52f37ddd2c135cb1aa18ec697",
"l1RollingHashMessageNumber": 1,
"l2MerkleRoots": [
"0xff0e2ae07c9c972f7ac6ab579a49376381d56f8101b37142cc52a4abef5cfb86"
],
"l2MerkleTreesDepth": 5,
"l2MessagingBlocksOffsets": "0x00000000000000000000000fffff"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,443 +0,0 @@
import { AbiCoder, BytesLike, Transaction, Wallet, ethers } from "ethers";
import { commitmentsToVersionedHashes } from "@ethereumjs/util";
import * as kzg from "c-kzg";
import submissionDataJson1 from "./blocks-1-46.json";
import submissionDataJson2 from "./blocks-47-81.json";
import submissionDataJson3 from "./blocks-82-114.json";
import submissionDataJson4 from "./blocks-115-155.json";
import submissionDataJson5 from "./blocks-156-175.json";
import submissionDataJson6 from "./blocks-176-206.json";
import aggregateProof1to206 from "./aggregatedProof-1-206.json";
import { DataHexString } from "ethers/lib.commonjs/utils/data";
const dataItems = [
submissionDataJson1,
submissionDataJson2,
submissionDataJson3,
submissionDataJson4,
submissionDataJson5,
submissionDataJson6,
];
export function generateKeccak256(types: string[], values: unknown[], packed?: boolean) {
return ethers.keccak256(encodeData(types, values, packed));
}
export const encodeData = (types: string[], values: unknown[], packed?: boolean) => {
if (packed) {
return ethers.solidityPacked(types, values);
}
return AbiCoder.defaultAbiCoder().encode(types, values);
};
export type SubmissionData = {
parentStateRootHash: string;
dataParentHash: string;
finalStateRootHash: string;
firstBlockInData: bigint;
finalBlockInData: bigint;
snarkHash: string;
};
export type BlobSubmissionData = {
submissionData: SubmissionData;
parentSubmissionData: ParentSubmissionData;
dataEvaluationClaim: bigint;
kzgCommitment: BytesLike;
kzgProof: BytesLike;
};
export type ParentSubmissionData = {
finalStateRootHash: string;
firstBlockInData: bigint;
finalBlockInData: bigint;
shnarf: string;
dataParentHash: string;
};
export function generateSubmissionDataFromJSON(
startingBlockNumber: number,
endingBlockNumber: number,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parsedJSONData: any,
): { submissionData: SubmissionData; blob: Uint8Array } {
const returnData = {
parentStateRootHash: parsedJSONData.parentStateRootHash,
dataParentHash: parsedJSONData.parentDataHash,
finalStateRootHash: parsedJSONData.finalStateRootHash,
firstBlockInData: BigInt(startingBlockNumber),
finalBlockInData: BigInt(endingBlockNumber),
snarkHash: parsedJSONData.snarkHash,
};
return {
submissionData: returnData,
blob: ethers.decodeBase64(parsedJSONData.compressedData),
};
}
export function generateParentSubmissionData(finalStateRootHash: string, parentDataHash: string): ParentSubmissionData {
return {
finalStateRootHash: finalStateRootHash,
firstBlockInData: BigInt(0),
finalBlockInData: BigInt(0),
shnarf: "0x47452a1b9ebadfe02bdd02f580fa1eba17680d57eec968a591644d05d78ee84f",
dataParentHash: parentDataHash,
};
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function generateParentSubmissionDataFromJson(parsedJSONData: any): ParentSubmissionData {
return {
finalStateRootHash: parsedJSONData.finalStateRootHash,
firstBlockInData: BigInt(parsedJSONData.conflationOrder.startingBlockNumber),
finalBlockInData: BigInt(parsedJSONData.conflationOrder.upperBoundaries.slice(-1)[0]),
shnarf: parsedJSONData.expectedShnarf,
dataParentHash: parsedJSONData.parentDataHash,
};
}
export function generateSubmissionCallDataFromJSON(
startingBlockNumber: number,
endingBlockNumber: number,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parsedJSONData: any,
): { submissionData: SubmissionData } {
const returnData = {
parentStateRootHash: parsedJSONData.parentStateRootHash,
dataParentHash: parsedJSONData.parentDataHash,
finalStateRootHash: parsedJSONData.finalStateRootHash,
firstBlockInData: BigInt(startingBlockNumber),
finalBlockInData: BigInt(endingBlockNumber),
snarkHash: parsedJSONData.snarkHash,
compressedData: ethers.hexlify(ethers.decodeBase64(parsedJSONData.compressedData)),
};
return {
submissionData: returnData,
};
}
function getPadded(data: Uint8Array): Uint8Array {
const pdata = new Uint8Array(131072).fill(0);
pdata.set(data);
return pdata;
}
function requireEnv(name: string): string {
const envVariable = process.env[name];
if (!envVariable) {
throw new Error(`Missing ${name} environment variable`);
}
return envVariable;
}
function kzgCommitmentsToVersionedHashes(commitments: Uint8Array[]): string[] {
const versionedHashes = commitmentsToVersionedHashes(commitments);
return versionedHashes.map((versionedHash) => ethers.hexlify(versionedHash));
}
async function main() {
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
kzg.loadTrustedSetup(`${__dirname}/../trusted_setup.txt`);
const parentSubmissionData1 = generateParentSubmissionData(
"0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd",
ethers.ZeroHash,
);
let kzgProofsArray: Uint8Array[] = [];
let commitmentsArray: Uint8Array[] = [];
let versionedHashesArray: string[] = [];
let blobsArray: Uint8Array[] = [];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
let kzgProofsContractArray: any[] = [];
// const parentSubmissionData: ParentSubmissionData[] = [];
let blobSubmissionData: BlobSubmissionData[] = [];
let previousSubmissionData = generateParentSubmissionData(
"0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd",
ethers.ZeroHash,
);
const finalSubmissionData = generateParentSubmissionDataFromJson(submissionDataJson6);
for (let i = 0; i < 3; i++) {
const { submissionData, blob } = generateSubmissionDataFromJSON(
dataItems[i].conflationOrder.startingBlockNumber,
dataItems[i].conflationOrder.upperBoundaries.slice(-1)[0],
dataItems[i],
);
const fullblob = getPadded(blob);
const commitment = kzg.blobToKzgCommitment(fullblob);
const kzgProof = kzg.computeBlobKzgProof(fullblob, commitment);
blobsArray.push(fullblob);
versionedHashesArray.push(kzgCommitmentsToVersionedHashes([commitment])[0]);
commitmentsArray.push(commitment);
kzgProofsArray.push(kzgProof);
kzgProofsContractArray.push(dataItems[i].kzgProofContract);
blobSubmissionData.push({
submissionData: submissionData,
parentSubmissionData: previousSubmissionData,
dataEvaluationClaim: BigInt(dataItems[i].expectedY),
kzgCommitment: commitment,
kzgProof: dataItems[i].kzgProofContract,
});
previousSubmissionData = generateParentSubmissionDataFromJson(dataItems[i]);
}
let encodedCall = encodeCall(blobSubmissionData);
await submitBlob(provider, wallet, encodedCall, destinationAddress, versionedHashesArray, blobsArray);
blobSubmissionData = [];
kzgProofsArray = [];
commitmentsArray = [];
versionedHashesArray = [];
blobsArray = [];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
kzgProofsContractArray = [];
for (let i = 3; i < dataItems.length; i++) {
const { submissionData, blob } = generateSubmissionDataFromJSON(
dataItems[i].conflationOrder.startingBlockNumber,
dataItems[i].conflationOrder.upperBoundaries.slice(-1)[0],
dataItems[i],
);
const fullblob = getPadded(blob);
const commitment = kzg.blobToKzgCommitment(fullblob);
const kzgProof = kzg.computeBlobKzgProof(fullblob, commitment);
blobsArray.push(fullblob);
versionedHashesArray.push(kzgCommitmentsToVersionedHashes([commitment])[0]);
commitmentsArray.push(commitment);
kzgProofsArray.push(kzgProof);
kzgProofsContractArray.push(dataItems[i].kzgProofContract);
blobSubmissionData.push({
submissionData: submissionData,
parentSubmissionData: previousSubmissionData,
dataEvaluationClaim: BigInt(dataItems[i].expectedY),
kzgCommitment: commitment,
kzgProof: dataItems[i].kzgProofContract,
});
previousSubmissionData = generateParentSubmissionDataFromJson(dataItems[i]);
}
encodedCall = encodeSecondCall(blobSubmissionData);
await submitBlob(provider, wallet, encodedCall, destinationAddress, versionedHashesArray, blobsArray);
await sendMessage();
await sendProof(aggregateProof1to206, parentSubmissionData1, finalSubmissionData);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function mapToTuple(blobSubmissionDataItems: BlobSubmissionData[]): any {
return blobSubmissionDataItems.map((blobSubmissionData) => [
[
blobSubmissionData.submissionData.finalStateRootHash,
blobSubmissionData.submissionData.firstBlockInData,
blobSubmissionData.submissionData.finalBlockInData,
blobSubmissionData.submissionData.snarkHash,
],
blobSubmissionData.dataEvaluationClaim,
blobSubmissionData.kzgCommitment,
blobSubmissionData.kzgProof,
]);
}
function encodeCall(submissionData: BlobSubmissionData[]): DataHexString {
const encodedCall = ethers.concat([
"0x42fbe842",
ethers.AbiCoder.defaultAbiCoder().encode(
["tuple(tuple(bytes32,uint256,uint256,bytes32),uint256,bytes,bytes)[]", "bytes32", "bytes32"],
[mapToTuple(submissionData), submissionData[0].parentSubmissionData.shnarf, dataItems[2].expectedShnarf],
),
]);
return encodedCall;
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function encodeSecondCall(submissionData: BlobSubmissionData[]): DataHexString {
const encodedCall = ethers.concat([
"0x42fbe842",
ethers.AbiCoder.defaultAbiCoder().encode(
["tuple(tuple(bytes32,uint256,uint256,bytes32),uint256,bytes,bytes)[]", "bytes32", "bytes32"],
[mapToTuple(submissionData), dataItems[2].expectedShnarf, dataItems[dataItems.length - 1].expectedShnarf],
),
]);
return encodedCall;
}
async function sendMessage() {
console.log("sending the message");
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
const encodedCall = ethers.concat([
"0x9f3ce55a",
ethers.AbiCoder.defaultAbiCoder().encode(
["address", "uint256", "bytes"],
["0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC", "50000000000000000", "0x"],
),
]);
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
nonce,
value: 1050000000000000000n,
gasLimit: 5_000_000,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log({ transaction: tx, receipt });
}
async function submitBlob(
provider: ethers.JsonRpcProvider,
wallet: Wallet,
encodedCall: string,
destinationAddress: string,
versionedHashes: string[],
fullblobs: Uint8Array[],
) {
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
console.log(encodedCall);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
type: 3,
nonce,
value: 0,
kzg,
blobs: fullblobs,
gasLimit: 5_000_000,
blobVersionedHashes: versionedHashes,
maxFeePerBlobGas: maxFeePerGas!,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log(versionedHashes);
console.log("BlobTX Hash: ", tx.hash);
console.log(`BlobTX receipt: ${JSON.stringify(receipt, null, 2)}`);
}
async function sendProof(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
proofFile: any,
submissionData: ParentSubmissionData,
finalSubmissionData: ParentSubmissionData,
) {
console.log("proof");
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
const finalSubmission = dataItems[dataItems.length - 1];
const proofData = [
proofFile.aggregatedProof,
0,
[
proofFile.parentStateRootHash,
submissionData.shnarf,
finalSubmissionData.finalBlockInData,
[
finalSubmission.prevShnarf,
finalSubmission.snarkHash,
finalSubmission.finalStateRootHash,
finalSubmission.expectedX,
finalSubmission.expectedY,
],
proofFile.parentAggregationLastBlockTimestamp,
proofFile.finalTimestamp,
"0x0000000000000000000000000000000000000000000000000000000000000000",
proofFile.l1RollingHash,
0, // last finalized message number
proofFile.l1RollingHashMessageNumber,
proofFile.l2MerkleTreesDepth,
proofFile.l2MerkleRoots,
proofFile.l2MessagingBlocksOffsets,
],
];
console.log(proofData);
const encodedCall = ethers.concat([
"0xabffac32",
ethers.AbiCoder.defaultAbiCoder().encode(
[
"bytes",
"uint256",
"tuple(bytes32,bytes32,uint256,tuple(bytes32,bytes32,bytes32,bytes32,bytes32),uint256,uint256,bytes32,bytes32,uint256,uint256,uint256,bytes32[],bytes)",
],
proofData,
),
]);
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
nonce,
value: 0,
gasLimit: 5_000_000,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log({ transaction: tx, receipt });
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

View File

@@ -1,23 +0,0 @@
{
"aggregatedProof": "0x066df7ab7e98425f6f4420a9f84dc0778f5732a2e6867331d600b4be4ec4d71f2ed2cb00ae9b91d83b9acfdf5b9e99bc09f9330b0045a45c2e0b82174824990f118fda6919cce05f3e742b6d908b19012f19b7fa5a4859c841b0fb4245ef4cab2f917a55d05cf6fcf1e686da1200b414233313b2b83a644cb98839bf2d025ddb0abfffd32a4d9271da6c035bbd29a17b062a16b4552af74e866816e8fb93292b1e9dc02ea9586973ab019af9b518933ef2b43a07dfca130c96de11e3ea6ec76821bf76414ab318a24074c96a2d4f9ea8229b1f95069c9891f8b9630ebb43aa501b1883f214128097bb02d8db95004169206817394c98a2bcc2c16c07a53bda9a0ab02b425bea284f90e19d98c135384b2f53969a2bd6c9a6ed4db23c45c1a2dc009df63e685dd458c285ec91972639b1fe196d835b6b6bfe54dfb25eae69a5b8168a6c341ab0ccae820aa1d7bafb276e30069bd2a5dc12ffba4963dba95d1b8a09cb518f02ed373de651362b5dced18ed89abd7544b465d27abaaed924d54112175dc49c7c09077c059dc6e84055e3aa6012e83863965e84a123995ffc234b481dc0ccfe79c52c033e55ca247db94cd5f9a7f788f29e08757b76e8967341df60142484b43ece53794ece4fbddac059f760dbccb6924f5ad6eb7f2c86c91324ad1fec8d725a7d0a69152239a5107ffc8ad38265dd4b61dc613ff53ba935d052921ec3d15f7662d7155c7bb7a40d531ff813f7d121b158f508d5360524841d20ee08e041228a91088241a542927a74e63c4e60e78f7c93b6bc0da3f2e6a9938b7601476a105dd6e289e769f466eca691aa0ea2e4065fca6106b863eb0d44a62c6827909145988fce252cc48c7fc4e0861a5cd2e1e7af1ecc4d1ffbbb98ef2c6a4e0e07d160a13aa28fe18fc4f88af7283780c0806e1d4edfa6cb1bf1cace3e98610c69c3abf8c70af727fa69d9df7ad77e3f91cb7a1e8f8dfa9be34732bda6133900aac696aa73cd7575bf603a3efc6b4d701690c4565effe660333a721dc850890cc7b562ed0fc7a2796d998f2e9263536bf4f59c43668a767c19fe2a906970dd136ad4c7b96678691270ffa4c68178de6ec6548eca71cdb49eea6a0f9c0b96a82c6ecbb46e4aa32194782a15f372b39e7782986d6729fdfbf7927ec473c32aab092b217b3596081654c172a00cc8010b69a5d0abd27b365022249b9a5205f0582afb1f90670da3e66ce65ab5ecaf0cc810c8f76e9b93cebffc3ad0160afdea4c1cb4fbb0b8203fd43eeaef0d4644af49f751f7e72fdc351ebc5c7c3d229a8092",
"aggregatedProverVersion": "test",
"aggregatedVerifierIndex": 1,
"aggregatedProofPublicInput": "0x0845ce6ad7b96ead3f07532f8c14efca7926d3b8a6b10254f1c4ba65bfb7f247",
"dataHashes": [
"0x01f5853fa56ab910be0933f2ee811bbc437500dba4e38acbae17eab00eec9f95",
"0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618"
],
"dataParentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"parentStateRootHash": "0x072ead6777750dc20232d1cee8dc9a395c2d350df4bbaa5096c6f59b214dcecd",
"parentAggregationLastBlockTimestamp": 1683325137,
"lastFinalizedBlockNumber": 0,
"finalTimestamp": 1683335137,
"finalBlockNumber": 81,
"l1RollingHash": "0xbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"l1RollingHashMessageNumber": 12,
"l2MerkleRoots": [
"0x6de197db892fd7d3fe0a389452dae0c5d0520e23d18ad20327546e2189a7e3f1"
],
"l2MerkleTreesDepth": 5,
"l2MessagingBlocksOffsets": "0x00000000000000000000000fffff"
}

View File

@@ -1,23 +0,0 @@
{
"aggregatedProof": "0x1cbd99a6717d59c1f3d0b401f51837eca8880dba59e06ef6d3d51c7f8b84bf3b0e28362df993991e53093cf0a5bf33524f894518d29f7e3b7662a8760efffb1b24bf4a192ed312058d456656c5e62daeaa5f39d12d5f0356607176cb755825b20c7f5bb8491f456973ecd82b9a89d3624659f123ad992f928b38ea389fe7339200fe3b06f738f976714e7e5076ed5fa5b5016b136ee86495623e06511604a0e92e87d1418e3e7cb378b2517ef518faef4a82e50f68884554f8f5b0f6129502782259d9aaa5de29d64f9ec69bc6010912a38d583df837744febca28bfa0a6a36f1fa62e63efc84520986c9a2cbe74b188c59b9abf1b6db87ea1f342a85883570519f084912710ac88051f00fa087dacb0a64f32ac71f73389f7bebaa138de8be1013d6f79215afeae40e365c316728a19c16c6b4f949d2a5f91881169c1459e430af11d232c48ef074b1f8fc75413bfe586185fd7c3ad46812b374113c02a7e2f3008fd0abb1fc412864bee93af6fce5c13a5aca9c16119d1ff550a775c22ce842380046dcfb7f602f99e123d00c8fc8ae242230b93902940611adf2465faa3ae11baccaa27f958117b817759a24290916be764a6ad53c4b9e7fe8c3cc2c7216d2fa188627bc1a1a9f51086b8734587e82c5e5c712bd67e6a96e2f0a494a7c038002937e32c41ef5f763fc0cc377b56ef2371ff45d1d5f6af8fc1d0a9e09d695c13de57d0d34e961b0c82fb7395ab187c980be2c6ffc2f6cf3bdc06ab0daa67c7034b9850e8af9343962392cb7b0685b3db328e6ad0edc8ea9930167dd4c1fa1c030977b4a996f9441fdf123d22566f066e8689e19133c642cee2946262dd760d1549bca5f966b3982822b3c98b120e26d41f5e313a241d8a0d5a558f7fe712c32b06b94eb5a2b707c134302879964ce9d7c65f4a9d0e1e5a55e49b1b74a52f4c1f4a9d2e57c8665b5a1d44a98eefa8bc85213fd2a4b973f0663c921010a4c800001f52612168d24d80aeced4ac922d8bb7388cc762d76e47ba63a79bc41928ee08fb4c74eeed5d9fcf9d47de8d45d0f8ed96c71453713ce69b7fcaa1aa28a33a2f7f91189c1617c6c852585510a19c6e0902b1f7137e1d93ee97826e6b510a682eb6c8d277cbbf2343979b29355a8427059084a16bfddd83ec04b87b8be56927168f6c57d638f3c87357408ab999cc10dae428ea8d0df307bef18c87fd234c250f8aeb4438cb80f9543b4e74be92fbc170d3e94878e3d154656c53b9122f14f314da523fe7c79e5c50d530107a3b7a97727e25b95bf9c1f68a1e48d7bdfcc27e",
"aggregatedProverVersion": "test",
"aggregatedVerifierIndex": 1,
"aggregatedProofPublicInput": "0x224c02f36233239efd78f5e99a2400bf60950d62c705b204797bd949a29aa993",
"dataHashes": [
"0x01bdfef0d1ddb163bf8431ea63ad7166bcd69a72a4fa30342138335d7fac96f4",
"0x0112b6fcf15707263de267fdc63c78cf9881654e88455b94fb8f9f7623223365"
],
"dataParentHash": "0x01a142b35ad91719145a4e3bf1d5402e6a73818db67312ade7a73ad5130ac618",
"parentStateRootHash": "0xf0f26782f7afb93f926cacb145f55530714f20b1356725e3971dc99e0ef8b591",
"parentAggregationLastBlockTimestamp": 1683335137,
"lastFinalizedBlockNumber": 81,
"finalTimestamp": 1683355137,
"finalBlockNumber": 153,
"l1RollingHash": "0xcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
"l1RollingHashMessageNumber": 14,
"l2MerkleRoots": [
"0xf82d0ea8590489e98ca4279f30bd4b32a4fd62e6574ddc4f606d6496096b3721"
],
"l2MerkleTreesDepth": 5,
"l2MessagingBlocksOffsets": "0x00000000000000000000000fffff"
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -1,221 +0,0 @@
import { BytesLike, Transaction, Wallet, ethers } from "ethers";
import { commitmentsToVersionedHashes } from "@ethereumjs/util";
import * as kzg from "c-kzg";
import submissionDataJson from "./blocks-1-46.json";
import submissionDataJson2 from "./blocks-47-81.json";
import submissionDataJson3 from "./blocks-82-119.json";
import submissionDataJson4 from "./blocks-120-153.json";
import aggregateProof1to81 from "./aggregatedProof-1-81.json";
import aggregateProof82to153 from "./aggregatedProof-82-153.json";
import { DataHexString } from "ethers/lib.commonjs/utils/data";
type SubmissionData = {
parentStateRootHash: string;
dataParentHash: string;
finalStateRootHash: string;
firstBlockInData: bigint;
finalBlockInData: bigint;
snarkHash: string;
};
export function generateSubmissionDataFromJSON(
startingBlockNumber: number,
endingBlockNumber: number,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parsedJSONData: any,
): { submissionData: SubmissionData; blob: Uint8Array } {
const returnData = {
parentStateRootHash: parsedJSONData.parentStateRootHash,
dataParentHash: parsedJSONData.parentDataHash,
finalStateRootHash: parsedJSONData.finalStateRootHash,
firstBlockInData: BigInt(startingBlockNumber),
finalBlockInData: BigInt(endingBlockNumber),
snarkHash: parsedJSONData.snarkHash,
};
return {
submissionData: returnData,
blob: ethers.decodeBase64(parsedJSONData.compressedData),
};
}
function requireEnv(name: string): string {
const envVariable = process.env[name];
if (!envVariable) {
throw new Error(`Missing ${name} environment variable`);
}
return envVariable;
}
function kzgCommitmentsToVersionedHashes(commitments: Uint8Array[]): string[] {
const versionedHashes = commitmentsToVersionedHashes(commitments);
return versionedHashes.map((versionedHash) => ethers.hexlify(versionedHash));
}
async function main() {
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
kzg.loadTrustedSetup(`${__dirname}/trusted_setup.txt`);
const { submissionData, blob } = generateSubmissionDataFromJSON(1, 46, submissionDataJson);
const { submissionData: submissionData2, blob: blob2 } = generateSubmissionDataFromJSON(47, 81, submissionDataJson2);
const { submissionData: submissionData3, blob: blob3 } = generateSubmissionDataFromJSON(82, 119, submissionDataJson3);
const { submissionData: submissionData4, blob: blob4 } = generateSubmissionDataFromJSON(
120,
153,
submissionDataJson4,
);
const commitments = kzg.blobToKzgCommitment(blob);
const commitments2 = kzg.blobToKzgCommitment(blob2);
const commitments3 = kzg.blobToKzgCommitment(blob3);
const commitments4 = kzg.blobToKzgCommitment(blob4);
const [versionedHashes, versionedHashes2, versionedHashes3, versionedHashes4] = kzgCommitmentsToVersionedHashes([
commitments,
commitments2,
commitments3,
commitments4,
]);
let encodedCall = encodeCall(submissionData, [commitments], submissionDataJson);
await submitBlob(provider, wallet, encodedCall, destinationAddress, [versionedHashes], blob);
encodedCall = encodeCall(submissionData2, [commitments2], submissionDataJson2);
await submitBlob(provider, wallet, encodedCall, destinationAddress, [versionedHashes2], blob2);
encodedCall = encodeCall(submissionData3, [commitments3], submissionDataJson3);
await submitBlob(provider, wallet, encodedCall, destinationAddress, [versionedHashes3], blob3);
encodedCall = encodeCall(submissionData4, [commitments4], submissionDataJson4);
await submitBlob(provider, wallet, encodedCall, destinationAddress, [versionedHashes4], blob4);
await sendProof(aggregateProof1to81);
await sendProof(aggregateProof82to153);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function encodeCall(submissionData: SubmissionData, commitments: BytesLike[], submissionDataJson: any): DataHexString {
const encodedCall = ethers.concat([
"0x2d3c12e5",
ethers.AbiCoder.defaultAbiCoder().encode(
["tuple(bytes32,bytes32,bytes32,uint256,uint256,bytes32)", "uint256", "bytes", "bytes"],
[
[
submissionData.parentStateRootHash,
submissionData.dataParentHash,
submissionData.finalStateRootHash,
submissionData.firstBlockInData,
submissionData.finalBlockInData,
submissionData.snarkHash,
],
submissionDataJson.expectedY,
commitments[0],
submissionDataJson.kzgProofContract,
],
),
]);
return encodedCall;
}
async function submitBlob(
provider: ethers.JsonRpcProvider,
wallet: Wallet,
encodedCall: string,
destinationAddress: string,
versionedHashes: string[],
fullblob: Uint8Array,
) {
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
type: 3,
nonce,
value: 0,
gasLimit: 5_000_000,
kzg,
blobs: [fullblob],
blobVersionedHashes: versionedHashes,
maxFeePerBlobGas: maxFeePerGas!,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log(receipt);
}
// eslint-disable-next-line @typescript-eslint/no-explicit-any
async function sendProof(proofFile: any) {
const rpcUrl = requireEnv("RPC_URL");
const privateKey = requireEnv("PRIVATE_KEY");
const destinationAddress = requireEnv("DESTINATION_ADDRESS");
const provider = new ethers.JsonRpcProvider(rpcUrl);
const wallet = new Wallet(privateKey, provider);
const encodedCall = ethers.concat([
"0xd630280f",
ethers.AbiCoder.defaultAbiCoder().encode(
[
"bytes",
"uint256",
"tuple(bytes32,bytes32[],bytes32,uint256,uint256,uint256,bytes32,uint256,bytes32[],uint256,bytes)",
],
[
proofFile.aggregatedProof,
0,
[
proofFile.parentStateRootHash,
proofFile.dataHashes,
proofFile.dataParentHash,
proofFile.finalBlockNumber,
proofFile.parentAggregationLastBlockTimestamp,
proofFile.finalTimestamp,
proofFile.l1RollingHash,
proofFile.l1RollingHashMessageNumber,
proofFile.l2MerkleRoots,
proofFile.l2MerkleTreesDepth,
proofFile.l2MessagingBlocksOffsets,
],
],
),
]);
const { maxFeePerGas, maxPriorityFeePerGas } = await provider.getFeeData();
const nonce = await provider.getTransactionCount(wallet.address);
const transaction = Transaction.from({
data: encodedCall,
maxPriorityFeePerGas: maxPriorityFeePerGas!,
maxFeePerGas: maxFeePerGas!,
to: destinationAddress,
chainId: 31648428,
nonce,
value: 0,
gasLimit: 5_000_000,
});
const tx = await wallet.sendTransaction(transaction);
const receipt = await tx.wait();
console.log({ transaction: tx, receipt: receipt });
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});

View File

@@ -9,7 +9,7 @@ import { TOKEN_BRIDGE_ROLES } from "contracts/common/constants";
export async function deployTokenBridge(messageServiceAddress: string, verbose = false) {
const [owner] = await ethers.getSigners();
const chainIds = [SupportedChainIds.GOERLI, SupportedChainIds.LINEA_TESTNET];
const chainIds = [SupportedChainIds.SEPOLIA, SupportedChainIds.LINEA_TESTNET];
const roleAddresses = generateRoleAssignments(TOKEN_BRIDGE_ROLES, owner.address, []);

View File

@@ -84,6 +84,7 @@ describe("L1MessageService", () => {
before(async () => {
[admin, pauser, limitSetter, notAuthorizedAccount, postmanAddress, l2Sender] = await ethers.getSigners();
// TODO adjust the tests to dynamically use whatever nonce is set for the merkle proof
await setNonce(admin.address, 1);
});

View File

@@ -1,109 +0,0 @@
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { TestLineaRollup, LineaRollupInit__factory } from "../typechain-types";
import {
GENESIS_L2_TIMESTAMP,
INITIALIZED_ALREADY_MESSAGE,
INITIAL_WITHDRAW_LIMIT,
LINEA_ROLLUP_INITIALIZE_SIGNATURE,
ONE_DAY_IN_SECONDS,
OPERATOR_ROLE,
pauseTypeRoles,
unpauseTypeRoles,
} from "./common/constants";
import { deployUpgradableFromFactory } from "./common/deployment";
import { expectRevertWithReason, generateRandomBytes } from "./common/helpers";
import { generateRoleAssignments } from "contracts/common/helpers";
import { LINEA_ROLLUP_ROLES } from "contracts/common/constants";
describe("LineaRollup Init contract", () => {
let LineaRollup: TestLineaRollup;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let admin: SignerWithAddress;
let verifier: string;
let securityCouncil: SignerWithAddress;
let operator: SignerWithAddress;
const multiCallAddress = "0xcA11bde05977b3631167028862bE2a173976CA11";
const parentStateRootHash = generateRandomBytes(32);
const firstBlockNumber = 199;
async function deployLineaRollupFixture() {
const PlonkVerifierFactory = await ethers.getContractFactory("TestPlonkVerifierForDataAggregation");
const plonkVerifier = await PlonkVerifierFactory.deploy();
await plonkVerifier.waitForDeployment();
verifier = await plonkVerifier.getAddress();
const genesisData = {
initialStateRootHash: parentStateRootHash,
initialL2BlockNumber: firstBlockNumber - 1,
genesisTimestamp: GENESIS_L2_TIMESTAMP,
defaultVerifier: verifier,
rateLimitPeriodInSeconds: ONE_DAY_IN_SECONDS,
rateLimitAmountInWei: INITIAL_WITHDRAW_LIMIT,
roleAddresses: generateRoleAssignments(LINEA_ROLLUP_ROLES, securityCouncil.address, [
{ role: OPERATOR_ROLE, addresses: [operator.address] },
]),
pauseTypeRoles: pauseTypeRoles,
unpauseTypeRoles: unpauseTypeRoles,
fallbackOperator: multiCallAddress,
defaultAdmin: securityCouncil.address,
};
const LineaRollup = (await deployUpgradableFromFactory("TestLineaRollup", [genesisData], {
initializer: LINEA_ROLLUP_INITIALIZE_SIGNATURE,
})) as unknown as TestLineaRollup;
return { LineaRollup };
}
before(async () => {
[admin, securityCouncil, operator] = await ethers.getSigners();
});
beforeEach(async () => {
const contracts = await loadFixture(deployLineaRollupFixture);
LineaRollup = contracts.LineaRollup;
});
describe("Re-initialisation", () => {
LineaRollupInit__factory.createInterface();
it("Should set the initial block number", async () => {
const l2block = 12121n;
const l2BlockNumber = await LineaRollup.currentL2BlockNumber();
const lineaRollupContract = await deployUpgradableFromFactory("LineaRollupInit", [l2block, parentStateRootHash], {
initializer: "initializeV2(uint256,bytes32)",
unsafeAllow: ["constructor"],
});
const currentL2BlockNumber = await lineaRollupContract.currentL2BlockNumber();
expect(currentL2BlockNumber).to.be.equal(l2block);
expect(currentL2BlockNumber).to.not.be.equal(l2BlockNumber);
expect(await LineaRollup.periodInSeconds()).to.be.equal(ONE_DAY_IN_SECONDS);
expect(lineaRollupContract.stateRootHashes(l2block)).to.not.be.equal(
LineaRollup.stateRootHashes(parentStateRootHash),
);
});
it("Cannot initialize twice", async () => {
const l2block = 12121n;
const l2BlockNumber = await LineaRollup.currentL2BlockNumber();
const lineaRollupContract = await deployUpgradableFromFactory("LineaRollupInit", [l2block, parentStateRootHash], {
initializer: "initializeV2(uint256,bytes32)",
unsafeAllow: ["constructor"],
});
await expectRevertWithReason(
lineaRollupContract.initializeV2(l2BlockNumber, parentStateRootHash),
INITIALIZED_ALREADY_MESSAGE,
);
});
});
});

View File

@@ -1,192 +0,0 @@
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import fs from "fs";
import { ethers } from "hardhat";
import path from "path";
import { TestLineaRollup } from "../typechain-types";
import {
GENESIS_L2_TIMESTAMP,
HASH_ZERO,
INITIAL_WITHDRAW_LIMIT,
ONE_DAY_IN_SECONDS,
TEST_PUBLIC_VERIFIER_INDEX,
} from "./common/constants";
import { deployUpgradableFromFactory } from "./common/deployment";
import { generateFinalizationDataFromJSON, generateSubmissionDataFromJSON } from "./common/helpers";
// This stores initialization data for the smart-contract
import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import INITIALIZATION_DATA from "./testData/integrationWithProver/rolling-hash-history.json";
const submissionsDirectory = `${__dirname}/testData/integrationWithProver/blobSubmissions`;
const finalizationDirectory = `${__dirname}/../../testdata/prover/prover-aggregation/responses`;
function scanAndParseDir(directory: string): {
start: number;
stop: number;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
parsed: any;
}[] {
const entries = fs.readdirSync(directory);
const parsedList = [];
for (const entry of entries) {
const filepath = path.join(directory, entry);
const dataTxt = fs.readFileSync(filepath, "utf-8");
const parsed = JSON.parse(dataTxt);
const blockRange = entry.split("-", 2);
parsedList.push({
start: parseInt(blockRange[0]),
stop: parseInt(blockRange[1]),
parsed: parsed,
});
}
return parsedList;
}
describe("Linea Rollup contract", () => {
let lineaRollup: TestLineaRollup;
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let admin: SignerWithAddress;
let verifier: string;
let securityCouncil: SignerWithAddress;
let operator: SignerWithAddress;
const multiCallAddress = "0xcA11bde05977b3631167028862bE2a173976CA11";
async function deployLineaRollupFixture() {
const PlonkVerifierFactory = await ethers.getContractFactory("TestPlonkVerifierForDataAggregation");
const plonkVerifier = await PlonkVerifierFactory.deploy();
await plonkVerifier.waitForDeployment();
verifier = await plonkVerifier.getAddress();
const lineaRollup = (await deployUpgradableFromFactory(
"TestLineaRollup",
[
INITIALIZATION_DATA.initialParentStateRootHash,
INITIALIZATION_DATA.initialFinalizedBlock,
verifier,
securityCouncil.address,
[operator.address],
ONE_DAY_IN_SECONDS,
INITIAL_WITHDRAW_LIMIT,
GENESIS_L2_TIMESTAMP,
multiCallAddress,
],
{
initializer: "initialize(bytes32,uint256,address,address,address[],uint256,uint256,uint256,address)",
unsafeAllow: ["constructor"],
},
)) as unknown as TestLineaRollup;
return lineaRollup;
}
before(async () => {
[admin, securityCouncil, operator] = await ethers.getSigners();
});
beforeEach(async () => {
lineaRollup = await loadFixture(deployLineaRollupFixture);
});
describe("Finalizing with the data generated from the prover's integration tests", () => {
beforeEach(async () => {
await lineaRollup.setupParentDataShnarf(
INITIALIZATION_DATA.initialParentDataHash,
INITIALIZATION_DATA.initialShnarf,
);
await lineaRollup.setupParentFinalizedStateRoot(
INITIALIZATION_DATA.initialParentDataHash,
INITIALIZATION_DATA.initialParentStateRootHash,
);
for (const event of INITIALIZATION_DATA.rollingHashHistory) {
await lineaRollup.setRollingHash(event.messageNumber, event.rollingHash);
}
await lineaRollup.setLastTimeStamp(0);
});
//skipped as discussed with Alex
it.skip(
"Should successfully finalize with previous submission data and data submitted in finalization",
async () => {
const submissionsJSON = scanAndParseDir(submissionsDirectory);
const finalizationsJSON = scanAndParseDir(finalizationDirectory);
let index = 0;
for (const submission of submissionsJSON) {
const submissionContractData = generateSubmissionDataFromJSON(
submission.start,
submission.stop,
submission.parsed,
);
if (index == 0) {
// bypass first submission which is the expected behavior
submissionContractData.dataParentHash = HASH_ZERO;
submissionContractData.parentStateRootHash = HASH_ZERO;
}
index++;
// console.log("sending submission", submission.start, submission.stop);
// NB: we are only interested in the transaction passing. That's why we
// don't bother checking the emitted events. Also, the events are
// tested in other separate tests.
await lineaRollup.connect(operator).submitData(submissionContractData, "0x", { gasLimit: 30_000_000 });
}
index = 0;
for (const finalization of finalizationsJSON) {
const finalizationData = generateFinalizationDataFromJSON(finalization.parsed);
if (index == 0) {
finalizationData.dataParentHash = HASH_ZERO;
}
index++;
// console.log("sending finalization", finalization.start, finalization.stop);
// NB: we are only interested in the transaction passing. That's why we
// don't bother checking the emitted events. Also, the events are
// tested in other separate tests.
await lineaRollup
.connect(operator)
.finalizeCompressedBlocksWithProof(
finalizationData.aggregatedProof,
TEST_PUBLIC_VERIFIER_INDEX,
finalizationData,
{
gasLimit: 30_000_000,
},
);
}
for (const finalization of finalizationsJSON) {
const finalizationData = generateFinalizationDataFromJSON(finalization.parsed);
// console.log("sending finalization", finalization.start, finalization.stop);
// NB: we are only interested in the transaction passing. That's why we
// don't bother checking the emitted events. Also, the events are
// tested in other separate tests.
await lineaRollup
.connect(operator)
.finalizeCompressedBlocksWithProof(
finalizationData.aggregatedProof,
TEST_PUBLIC_VERIFIER_INDEX,
finalizationData,
{
gasLimit: 30_000_000,
},
);
}
},
)
// The test has an extended timeout period. Without that, it will fail on
// the CI. This corresponds to 50sec as the timeout is given in ms.
.timeout(50_000);
});
});

View File

@@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { TestPauseManager } from "../typechain-types";
import { TestPauseManager } from "../../typechain-types";
import {
DEFAULT_ADMIN_ROLE,
GENERAL_PAUSE_TYPE,
@@ -24,9 +24,9 @@ import {
FINALIZATION_PAUSE_TYPE,
pauseTypeRoles,
unpauseTypeRoles,
} from "./common/constants";
import { deployUpgradableFromFactory } from "./common/deployment";
import { buildAccessErrorMessage, expectEvent } from "./common/helpers";
} from "../common/constants";
import { deployUpgradableFromFactory } from "../common/deployment";
import { buildAccessErrorMessage, expectEvent } from "../common/helpers";
async function deployTestPauseManagerFixture(): Promise<TestPauseManager> {
return deployUpgradableFromFactory("TestPauseManager", [

View File

@@ -1,10 +1,10 @@
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { Mimc, SparseMerkleProof } from "../typechain-types";
import merkleProofTestData from "./testData/merkle-proof-data.json";
import { deployFromFactory } from "./common/deployment";
import { expectRevertWithCustomError } from "./common/helpers";
import { Mimc, SparseMerkleProof } from "../../typechain-types";
import merkleProofTestData from "../testData/merkle-proof-data.json";
import { deployFromFactory } from "../common/deployment";
import { expectRevertWithCustomError } from "../common/helpers";
describe("SparseMerkleProof", () => {
let sparseMerkleProof: SparseMerkleProof;

View File

@@ -1,8 +1,8 @@
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { TestUtils } from "../typechain-types";
import { deployFromFactory } from "./common/deployment";
import { generateKeccak256, generateRandomBytes } from "./common/helpers";
import { TestUtils } from "../../typechain-types";
import { deployFromFactory } from "../common/deployment";
import { generateKeccak256, generateRandomBytes } from "../common/helpers";
describe("Utils Library", () => {
let contract: TestUtils;

View File

@@ -1,10 +1,10 @@
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { Mimc } from "../typechain-types";
import mimcTestData from "./testData/mimc-test-data.json";
import { deployFromFactory } from "./common/deployment";
import { expectRevertWithCustomError } from "./common/helpers";
import { Mimc } from "../../typechain-types";
import mimcTestData from "../testData/mimc-test-data.json";
import { deployFromFactory } from "../common/deployment";
import { expectRevertWithCustomError } from "../common/helpers";
describe("Mimc", () => {
let mimc: Mimc;

View File

@@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { TestL2MessageService, TestMessageServiceBase } from "../typechain-types";
import { TestL2MessageService, TestMessageServiceBase } from "../../typechain-types";
import {
INITIALIZED_ERROR_MESSAGE,
INITIAL_WITHDRAW_LIMIT,
@@ -10,9 +10,9 @@ import {
ONE_DAY_IN_SECONDS,
pauseTypeRoles,
unpauseTypeRoles,
} from "./common/constants";
import { deployUpgradableFromFactory } from "./common/deployment";
import { expectEvent, expectRevertWithCustomError, expectRevertWithReason } from "./common/helpers";
} from "../common/constants";
import { deployUpgradableFromFactory } from "../common/deployment";
import { expectEvent, expectRevertWithCustomError, expectRevertWithReason } from "../common/helpers";
import { generateRoleAssignments } from "contracts/common/helpers";
import { L2_MESSAGE_SERVICE_ROLES } from "contracts/common/constants";

View File

@@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { TestL2MessageManager } from "../typechain-types";
import { TestL2MessageManager } from "../../../typechain-types";
import {
DEFAULT_ADMIN_ROLE,
GENERAL_PAUSE_TYPE,
@@ -10,8 +10,8 @@ import {
L1_L2_MESSAGE_SETTER_ROLE,
pauseTypeRoles,
unpauseTypeRoles,
} from "./common/constants";
import { deployUpgradableFromFactory } from "./common/deployment";
} from "../../common/constants";
import { deployUpgradableFromFactory } from "../../common/deployment";
import {
buildAccessErrorMessage,
calculateRollingHashFromCollection,
@@ -20,7 +20,7 @@ import {
expectRevertWithReason,
generateKeccak256Hash,
generateNKeccak256Hashes,
} from "./common/helpers";
} from "../../common/helpers";
describe("L2MessageManager", () => {
let l2MessageManager: TestL2MessageManager;

View File

@@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers, upgrades } from "hardhat";
import { TestL2MessageService, TestReceivingContract } from "../typechain-types";
import { TestL2MessageService, TestReceivingContract } from "../../../typechain-types";
import {
ADDRESS_ZERO,
BLOCK_COINBASE,
@@ -26,8 +26,8 @@ import {
UNPAUSE_ALL_ROLE,
RATE_LIMIT_SETTER_ROLE,
USED_RATE_LIMIT_RESETTER_ROLE,
} from "./common/constants";
import { deployUpgradableFromFactory } from "./common/deployment";
} from "../../common/constants";
import { deployUpgradableFromFactory } from "../../common/deployment";
import {
buildAccessErrorMessage,
calculateRollingHash,
@@ -39,9 +39,9 @@ import {
expectRevertWithReason,
generateKeccak256,
generateKeccak256Hash,
} from "./common/helpers";
} from "../../common/helpers";
import { ZeroAddress } from "ethers";
import { generateRoleAssignments } from "../common/helpers";
import { generateRoleAssignments } from "../../../common/helpers";
import {
L2_MESSAGE_SERVICE_PAUSE_TYPES_ROLES,
L2_MESSAGE_SERVICE_ROLES,
@@ -50,7 +50,7 @@ import {
PAUSE_L2_L1_ROLE,
UNPAUSE_L1_L2_ROLE,
UNPAUSE_L2_L1_ROLE,
} from "../common/constants";
} from "../../../common/constants";
describe("L2MessageService", () => {
let l2MessageService: TestL2MessageService;

View File

@@ -2,21 +2,21 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { loadFixture, time } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers, upgrades } from "hardhat";
import { TestRateLimiter } from "../typechain-types";
import { TestRateLimiter } from "../../../typechain-types";
import {
DEFAULT_ADMIN_ROLE,
INITIALIZED_ERROR_MESSAGE,
ONE_DAY_IN_SECONDS,
RATE_LIMIT_SETTER_ROLE,
USED_RATE_LIMIT_RESETTER_ROLE,
} from "./common/constants";
import { deployUpgradableFromFactory } from "./common/deployment";
} from "../../common/constants";
import { deployUpgradableFromFactory } from "../../common/deployment";
import {
buildAccessErrorMessage,
expectEvent,
expectRevertWithCustomError,
expectRevertWithReason,
} from "./common/helpers";
} from "../../common/helpers";
describe("Rate limiter", () => {
let testRateLimiter: TestRateLimiter;

View File

@@ -2,9 +2,9 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { TimeLock } from "../typechain-types";
import { CANCELLER_ROLE, EXECUTOR_ROLE, PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE } from "./common/constants";
import { deployFromFactory } from "./common/deployment";
import { TimeLock } from "../../../typechain-types";
import { CANCELLER_ROLE, EXECUTOR_ROLE, PROPOSER_ROLE, TIMELOCK_ADMIN_ROLE } from "../../common/constants";
import { deployFromFactory } from "../../common/deployment";
describe("Timelock", () => {
let contract: TimeLock;

View File

@@ -2,9 +2,9 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { LineaSurgeXP, TestLineaSurgeXP } from "../typechain-types";
import { ADDRESS_ZERO, DEFAULT_ADMIN_ROLE, MINTER_ROLE, TRANSFER_ROLE } from "./common/constants";
import { deployFromFactory } from "./common/deployment";
import { LineaSurgeXP, TestLineaSurgeXP } from "../../typechain-types";
import { ADDRESS_ZERO, DEFAULT_ADMIN_ROLE, MINTER_ROLE, TRANSFER_ROLE } from "../common/constants";
import { deployFromFactory } from "../common/deployment";
describe("Linea Surge XP Token Tests", () => {
let contract: LineaSurgeXP;

View File

@@ -2,10 +2,10 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { LineaVoyageXP } from "../typechain-types";
import { DEFAULT_ADMIN_ROLE, MINTER_ROLE } from "./common/constants";
import { deployFromFactory } from "./common/deployment";
import { buildAccessErrorMessage, expectRevertWithCustomError, expectRevertWithReason } from "./common/helpers";
import { LineaVoyageXP } from "../../typechain-types";
import { DEFAULT_ADMIN_ROLE, MINTER_ROLE } from "../common/constants";
import { deployFromFactory } from "../common/deployment";
import { buildAccessErrorMessage, expectRevertWithCustomError, expectRevertWithReason } from "../common/helpers";
describe("Linea Voyage XP Token Tests", () => {
let contract: LineaVoyageXP;

View File

@@ -8,11 +8,11 @@ import {
MINTER_ROLE,
ONE_DAY_IN_SECONDS,
RATE_LIMIT_SETTER_ROLE,
} from "./common/constants";
import { deployFromFactory } from "./common/deployment";
import { TokenMintingRateLimiter } from "../typechain-types/contracts/token/TokenMintingRateLimiter";
import { LineaVoyageXP } from "../typechain-types";
import { buildAccessErrorMessage, expectRevertWithCustomError, expectRevertWithReason } from "./common/helpers";
} from "../common/constants";
import { deployFromFactory } from "../common/deployment";
import { TokenMintingRateLimiter } from "../../typechain-types/contracts/token/TokenMintingRateLimiter";
import { LineaVoyageXP } from "../../typechain-types";
import { buildAccessErrorMessage, expectRevertWithCustomError, expectRevertWithReason } from "../common/helpers";
describe("Token Minting Rate Limiter", () => {
let tokenMintingRateLimiter: TokenMintingRateLimiter;

View File

@@ -31,6 +31,7 @@ import {
expectRevertWithReason,
} from "../common/helpers";
import { DEFAULT_ADMIN_ROLE } from "contracts/common/constants";
import { SupportedChainIds } from "contracts/common/supportedNetworks";
const initialUserBalance = BigInt(10 ** 9);
const mockName = "L1 DAI";
@@ -181,8 +182,8 @@ describe("TokenBridge", function () {
defaultAdmin: PLACEHOLDER_ADDRESS,
messageService: PLACEHOLDER_ADDRESS,
tokenBeacon: PLACEHOLDER_ADDRESS,
sourceChainId: 5,
targetChainId: 51940,
sourceChainId: SupportedChainIds.SEPOLIA,
targetChainId: SupportedChainIds.LINEA_TESTNET,
reservedTokens: [],
roleAddresses: [],
pauseTypeRoles: [],

View File

@@ -2,7 +2,7 @@ import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { expect } from "chai";
import { ethers } from "hardhat";
import { RecoverFunds, TestExternalCalls } from "../typechain-types";
import { RecoverFunds, TestExternalCalls } from "../../typechain-types";
import {
ADDRESS_ZERO,
DEFAULT_ADMIN_ROLE,
@@ -10,9 +10,9 @@ import {
FUNCTION_EXECUTOR_ROLE,
INITIALIZED_ALREADY_MESSAGE,
INITIAL_WITHDRAW_LIMIT,
} from "./common/constants";
import { deployUpgradableFromFactory } from "./common/deployment";
import { buildAccessErrorMessage, expectRevertWithCustomError, expectRevertWithReason } from "./common/helpers";
} from "../common/constants";
import { deployUpgradableFromFactory } from "../common/deployment";
import { buildAccessErrorMessage, expectRevertWithCustomError, expectRevertWithReason } from "../common/helpers";
describe("RecoverFunds contract", () => {
let recoverFunds: RecoverFunds;

View File

@@ -33,7 +33,7 @@ To perform a dry run and verify if the corrent nodes are targetted, include the
# Ethstats
[Mainnet](https://ethstats.linea.build/)
[Testnet](https://ethstats.goerli.linea.build/)
[Testnet](https://ethstats.sepolia.linea.build/)
# Local Development
It is highly recommended to read the official docs of `oclif` as it is used to generate the CLI.

122
pnpm-lock.yaml generated
View File

@@ -173,16 +173,16 @@ importers:
version: 9.0.3
'@nomicfoundation/hardhat-ethers':
specifier: 3.0.5
version: 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
version: 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-network-helpers':
specifier: 1.0.10
version: 1.0.10(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
version: 1.0.10(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-toolbox':
specifier: 4.0.0
version: 4.0.0(jyfxkil3vfakgnenb4mg6e5zke)
version: 4.0.0(zgfjqfwfiondltx7mdbaovzgze)
'@nomicfoundation/hardhat-verify':
specifier: 1.1.1
version: 1.1.1(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
version: 1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@openzeppelin/contracts':
specifier: 4.9.6
version: 4.9.6
@@ -191,7 +191,7 @@ importers:
version: 4.9.6
'@openzeppelin/hardhat-upgrades':
specifier: 2.5.1
version: 2.5.1(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(encoding@0.1.13)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)
version: 2.5.1(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(encoding@0.1.13)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)
'@safe-global/protocol-kit':
specifier: 3.0.2
version: 3.0.2(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)
@@ -200,7 +200,7 @@ importers:
version: 4.0.2(bufferutil@4.0.8)(encoding@0.1.13)(utf-8-validate@5.0.10)
'@typechain/hardhat':
specifier: 9.1.0
version: 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))
version: 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))
'@types/diff':
specifier: 5.2.0
version: 5.2.0
@@ -229,17 +229,17 @@ importers:
specifier: 6.12.0
version: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)
hardhat:
specifier: 2.22.10
version: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
specifier: 2.22.11
version: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat-deploy:
specifier: 0.12.4
version: 0.12.4(bufferutil@4.0.8)(utf-8-validate@5.0.10)
hardhat-storage-layout:
specifier: 0.1.7
version: 0.1.7(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
version: 0.1.7(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
hardhat-tracer:
specifier: 2.8.2
version: 2.8.2(bufferutil@4.0.8)(chai@4.1.1)(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)
version: 2.8.2(bufferutil@4.0.8)(chai@4.1.1)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)
node-gyp:
specifier: 10.1.0
version: 10.1.0
@@ -3413,6 +3413,7 @@ packages:
'@web3modal/wagmi@5.1.11':
resolution: {integrity: sha512-etV1qfBVvh41EMuBHXUpcO/W818jZVNh5/l9Z5kqRPZxlQmBaJbt5mTzw6nw/Lujoe1yYKugGQFhgjfEQK+eyA==}
deprecated: Web3Modal is now Reown AppKit. Please follow the upgrade guide at https://docs.reown.com/appkit/upgrade/from-w3m-to-reown
peerDependencies:
'@wagmi/connectors': '>=4'
'@wagmi/core': '>=2.0.0'
@@ -4089,6 +4090,10 @@ packages:
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
engines: {node: '>= 8.10.0'}
chokidar@4.0.1:
resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==}
engines: {node: '>= 14.16.0'}
chownr@1.1.4:
resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==}
@@ -4715,6 +4720,7 @@ packages:
eciesjs@0.3.20:
resolution: {integrity: sha512-Rz5AB8v9+xmMdS/R7RzWPe/R8DP5QfyrkA6ce4umJopoB5su2H2aDy/GcgIfwhmCwxnBkqGf/PbGzmKcGtIgGA==}
deprecated: Please upgrade to v0.4+
edit-json-file@1.8.0:
resolution: {integrity: sha512-IBOpbe2aQufNl5oZ4jsr2AmNVUy5bO7jS5hk0cCyWhOLdH59Xv41B3XQObE/JB89Ae5qDY9hVsq13/hgGhFBZg==}
@@ -5089,6 +5095,7 @@ packages:
ethereumjs-abi@0.6.8:
resolution: {integrity: sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==}
deprecated: This library has been deprecated and usage is discouraged.
ethereumjs-util@6.2.1:
resolution: {integrity: sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==}
@@ -5654,8 +5661,8 @@ packages:
chai: 4.x
hardhat: '>=2.16 <2.21.0'
hardhat@2.22.10:
resolution: {integrity: sha512-JRUDdiystjniAvBGFmJRsiIZSOP2/6s++8xRDe3TzLeQXlWWHsXBrd9wd3JWFyKXvgMqMeLL5Sz/oNxXKYw9vg==}
hardhat@2.22.11:
resolution: {integrity: sha512-g9xr6BGXbzj2sqG9AjHwqeUOS9v2NwLbuq7rsdjMB2RLWmYp8IFdZnzq8UewwLJisuWgiygB+dwLktjqAbRuOw==}
hasBin: true
peerDependencies:
ts-node: '*'
@@ -6410,6 +6417,10 @@ packages:
json-stable-stringify-without-jsonify@1.0.1:
resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==}
json-stream-stringify@3.1.6:
resolution: {integrity: sha512-x7fpwxOkbhFCaJDJ8vb1fBY3DdSa4AlITaz+HHILQJzdPMnHEFjxPwVUi1ALIbcIxDE0PNe/0i7frnY8QnBQog==}
engines: {node: '>=7.10.1'}
json-stringify-safe@5.0.1:
resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==}
@@ -7900,6 +7911,10 @@ packages:
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
engines: {node: '>=8.10.0'}
readdirp@4.0.2:
resolution: {integrity: sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==}
engines: {node: '>= 14.16.0'}
readline@1.3.0:
resolution: {integrity: sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==}
@@ -11864,59 +11879,59 @@ snapshots:
optionalDependencies:
c-kzg: 2.1.2
'@nomicfoundation/hardhat-chai-matchers@2.0.8(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(chai@4.1.1)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))':
'@nomicfoundation/hardhat-chai-matchers@2.0.8(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(chai@4.1.1)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))':
dependencies:
'@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@types/chai-as-promised': 7.1.8
chai: 4.1.1
chai-as-promised: 7.1.2(chai@4.1.1)
deep-eql: 4.1.4
ethers: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
ordinal: 1.0.3
'@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))':
'@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))':
dependencies:
debug: 4.3.7(supports-color@8.1.1)
ethers: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
lodash.isequal: 4.5.0
transitivePeerDependencies:
- supports-color
'@nomicfoundation/hardhat-network-helpers@1.0.10(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))':
'@nomicfoundation/hardhat-network-helpers@1.0.10(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))':
dependencies:
ethereumjs-util: 7.1.5
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
'@nomicfoundation/hardhat-toolbox@4.0.0(jyfxkil3vfakgnenb4mg6e5zke)':
'@nomicfoundation/hardhat-toolbox@4.0.0(zgfjqfwfiondltx7mdbaovzgze)':
dependencies:
'@nomicfoundation/hardhat-chai-matchers': 2.0.8(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(chai@4.1.1)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-network-helpers': 1.0.10(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-verify': 1.1.1(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-chai-matchers': 2.0.8(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(chai@4.1.1)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-network-helpers': 1.0.10(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-verify': 1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@typechain/ethers-v6': 0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5)
'@typechain/hardhat': 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))
'@typechain/hardhat': 9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))
'@types/chai': 4.3.20
'@types/mocha': 10.0.9
'@types/node': 20.12.7
chai: 4.1.1
ethers: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat-gas-reporter: 1.0.10(bufferutil@4.0.8)(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)
solidity-coverage: 0.8.13(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat-gas-reporter: 1.0.10(bufferutil@4.0.8)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)
solidity-coverage: 0.8.13(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
ts-node: 10.9.2(@types/node@20.12.7)(typescript@5.4.5)
typechain: 8.3.2(typescript@5.4.5)
typescript: 5.4.5
'@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))':
'@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))':
dependencies:
'@ethersproject/abi': 5.7.0
'@ethersproject/address': 5.7.0
cbor: 8.1.0
chalk: 2.4.2
debug: 4.3.7(supports-color@8.1.1)
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
lodash.clonedeep: 4.5.0
semver: 6.3.1
table: 6.8.2
@@ -12062,9 +12077,9 @@ snapshots:
- debug
- encoding
'@openzeppelin/hardhat-upgrades@2.5.1(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(encoding@0.1.13)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)':
'@openzeppelin/hardhat-upgrades@2.5.1(@nomicfoundation/hardhat-ethers@3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(@nomicfoundation/hardhat-verify@1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)))(bufferutil@4.0.8)(encoding@0.1.13)(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10)':
dependencies:
'@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-ethers': 3.0.5(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@openzeppelin/defender-admin-client': 1.54.6(bufferutil@4.0.8)(debug@4.3.7)(encoding@0.1.13)(utf-8-validate@5.0.10)
'@openzeppelin/defender-base-client': 1.54.6(debug@4.3.7)(encoding@0.1.13)
'@openzeppelin/defender-sdk-base-client': 1.15.0(encoding@0.1.13)
@@ -12074,11 +12089,11 @@ snapshots:
debug: 4.3.7(supports-color@8.1.1)
ethereumjs-util: 7.1.5
ethers: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
proper-lockfile: 4.1.2
undici: 5.28.4
optionalDependencies:
'@nomicfoundation/hardhat-verify': 1.1.1(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
'@nomicfoundation/hardhat-verify': 1.1.1(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))
transitivePeerDependencies:
- bufferutil
- encoding
@@ -13048,12 +13063,12 @@ snapshots:
typechain: 8.3.2(typescript@5.4.5)
typescript: 5.4.5
'@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))':
'@typechain/hardhat@9.1.0(@typechain/ethers-v6@0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5))(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))':
dependencies:
'@typechain/ethers-v6': 0.5.1(ethers@6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10))(typechain@8.3.2(typescript@5.4.5))(typescript@5.4.5)
ethers: 6.12.0(bufferutil@4.0.8)(utf-8-validate@5.0.10)
fs-extra: 9.1.0
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
typechain: 8.3.2(typescript@5.4.5)
'@types/babel__core@7.20.5':
@@ -14824,6 +14839,10 @@ snapshots:
optionalDependencies:
fsevents: 2.3.3
chokidar@4.0.1:
dependencies:
readdirp: 4.0.2
chownr@1.1.4: {}
chownr@2.0.0: {}
@@ -15814,7 +15833,7 @@ snapshots:
debug: 4.3.7(supports-color@8.1.1)
enhanced-resolve: 5.17.1
eslint: 8.57.0
eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0)
eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.0))(eslint@8.57.0)
fast-glob: 3.3.2
get-tsconfig: 4.8.1
is-bun-module: 1.2.1
@@ -15827,7 +15846,7 @@ snapshots:
- eslint-import-resolver-webpack
- supports-color
eslint-module-utils@2.12.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0):
eslint-module-utils@2.12.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.0))(eslint@8.57.0):
dependencies:
debug: 3.2.7
optionalDependencies:
@@ -15849,7 +15868,7 @@ snapshots:
doctrine: 2.1.0
eslint: 8.57.0
eslint-import-resolver-node: 0.3.9
eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3)(eslint@8.57.0)
eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.31.0)(eslint@8.57.0))(eslint@8.57.0)
hasown: 2.0.2
is-core-module: 2.15.1
is-glob: 4.0.3
@@ -16905,11 +16924,11 @@ snapshots:
- supports-color
- utf-8-validate
hardhat-gas-reporter@1.0.10(bufferutil@4.0.8)(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10):
hardhat-gas-reporter@1.0.10(bufferutil@4.0.8)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10):
dependencies:
array-uniq: 1.0.3
eth-gas-reporter: 0.2.27(bufferutil@4.0.8)(utf-8-validate@5.0.10)
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
sha1: 1.1.1
transitivePeerDependencies:
- '@codechecks/client'
@@ -16917,24 +16936,24 @@ snapshots:
- debug
- utf-8-validate
hardhat-storage-layout@0.1.7(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)):
hardhat-storage-layout@0.1.7(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)):
dependencies:
console-table-printer: 2.12.1
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat-tracer@2.8.2(bufferutil@4.0.8)(chai@4.1.1)(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10):
hardhat-tracer@2.8.2(bufferutil@4.0.8)(chai@4.1.1)(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10))(utf-8-validate@5.0.10):
dependencies:
chai: 4.1.1
chalk: 4.1.2
debug: 4.3.7(supports-color@8.1.1)
ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
transitivePeerDependencies:
- bufferutil
- supports-color
- utf-8-validate
hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10):
hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10):
dependencies:
'@ethersproject/abi': 5.7.0
'@metamask/eth-sig-util': 4.0.1
@@ -16951,7 +16970,7 @@ snapshots:
ansi-escapes: 4.3.2
boxen: 5.1.2
chalk: 2.4.2
chokidar: 3.6.0
chokidar: 4.0.1
ci-info: 2.0.0
debug: 4.3.7(supports-color@8.1.1)
enquirer: 2.4.1
@@ -16964,6 +16983,7 @@ snapshots:
glob: 7.2.0
immutable: 4.3.7
io-ts: 1.10.4
json-stream-stringify: 3.1.6
keccak: 3.0.4
lodash: 4.17.21
mnemonist: 0.38.5
@@ -17889,6 +17909,8 @@ snapshots:
json-stable-stringify-without-jsonify@1.0.1: {}
json-stream-stringify@3.1.6: {}
json-stringify-safe@5.0.1: {}
json5@1.0.2:
@@ -19493,6 +19515,8 @@ snapshots:
dependencies:
picomatch: 2.3.1
readdirp@4.0.2: {}
readline@1.3.0: {}
real-require@0.1.0: {}
@@ -20050,7 +20074,7 @@ snapshots:
solidity-comments-extractor@0.0.8: {}
solidity-coverage@0.8.13(hardhat@2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)):
solidity-coverage@0.8.13(hardhat@2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)):
dependencies:
'@ethersproject/abi': 5.7.0
'@solidity-parser/parser': 0.18.0
@@ -20061,7 +20085,7 @@ snapshots:
ghost-testrpc: 0.0.2
global-modules: 2.0.0
globby: 10.0.2
hardhat: 2.22.10(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
hardhat: 2.22.11(bufferutil@4.0.8)(c-kzg@2.1.2)(ts-node@10.9.2(@types/node@20.12.7)(typescript@5.4.5))(typescript@5.4.5)(utf-8-validate@5.0.10)
jsonschema: 1.4.1
lodash: 4.17.21
mocha: 10.7.3

View File

@@ -35,7 +35,7 @@ To install this package, execute the following command:
This package exposes two main classes for usage:
- The `PostmanServiceClient` class is used to run a Postman service for delivering messages.
- The `LineaSDK` class is used to interact with smart contracts on Ethereum and Linea (both Goerli and Mainnet).
- The `LineaSDK` class is used to interact with smart contracts on Ethereum and Linea (both Sepolia and Mainnet).
## License

View File

@@ -1,199 +0,0 @@
{
"id": 1,
"name": "money transfer",
"context": {
"chainId": 59140,
"url": "https://rpc.goerli.linea.build",
"nbOfExecutions": 1
//"source": 0x1d80c1698946ee65b6A6B78F468B47f6bd4516f0
},
"calls": [
//round robin money transfer
{
"nbOfExecution": 0,
"scenario": {
"scenarioType": "RoundRobinMoneyTransfer",
"wallet": "new",
"nbTransfers": 200,
"nbWallets": 20
}
},
//self tx with random payload -- does not seem to work ...
{
"nbOfExecution": 0,
"scenario": {
"scenarioType": "SelfTransactionWithRandomPayload",
"wallet": "new",
"nbTransfers": 1,
"nbWallets": 100,
"payloadSize": 5000
}
},
//addToStorageMap
{
"nbOfExecution": 1,
"scenario": {
"scenarioType": "ContractCall",
"wallet": "new",
"contract": {
"contractCallType": "CallExistingContract",
"contractAddress": "0x13B252598e0Ed9E4436467B39eC5E8Bc22584d1c",
"methodAndParameters": {
"type": "GenericCall",
"numberOfTimes": 250,
"methodName": "addToStorageMap",
"price": 25000,
"parameters": [
{
"solidityType": "Address",
"type": "SimpleParameter",
"value": "15000"
},
{
"solidityType": "Uint256",
"type": "SimpleParameter",
"value": "15000"
}
]
}
}
}
},
//createStruct
{
"nbOfExecution": 1,
"scenario": {
"scenarioType": "ContractCall",
"wallet": "new",
"contract": {
"contractCallType": "CallExistingContract",
"contractAddress": "0xdce94FA9142b24a2e6c5f3C3141317c62a2Ad7c4",
"methodAndParameters": {
"type": "GenericCall",
"numberOfTimes": 250,
"methodName": "createStruct",
"price": 25000,
"parameters": [
{
"solidityType": "Uint256",
"type": "SimpleParameter",
"value": "0"
}
]
}
}
}
},
//CreateContract
{
"nbOfExecution": 1, //does not work if set to more than 1...
"scenario": {
"scenarioType": "ContractCall",
"wallet": "source",
"contract": {
"contractCallType": "CreateContract",
"name": "dummyContract",
"byteCode": "0x608060405234801561001057600080fd5b506108e5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c806381cec0fe1161008c578063c7dd97f611610066578063c7dd97f6146101d3578063d75522da146101e6578063de36d65714610207578063eb6c7bc01461023e57600080fd5b806381cec0fe146101a35780639b0e317c146101b6578063c2d7ff5b146101c057600080fd5b8063445a31dc116100c8578063445a31dc1461013d57806348286a551461015d57806365e884381461017d5780636bd969ad1461019057600080fd5b8063101eb93a146100ef57806314b05a3814610104578063293fd05d1461012a575b600080fd5b6101026100fd3660046105af565b610273565b005b61011761011236600461068b565b6102cc565b6040519081526020015b60405180910390f35b6101026101383660046105af565b6102fc565b61011761014b366004610705565b60016020526000908152604090205481565b61017061016b36600461068b565b610351565b6040516101219190610795565b61010261018b3660046105af565b61037a565b61017061019e36600461068b565b6103b2565b6101026101b13660046107a8565b6103c5565b6000546101179081565b6101026101ce3660046105af565b610560565b6101176101e136600461068b565b61059c565b6101026101f43660046105af565b6040805160208101909152819052600055565b61010261021536600461080a565b73ffffffffffffffffffffffffffffffffffffffff909116600090815260016020526040902055565b61010261024c366004610705565b73ffffffffffffffffffffffffffffffffffffffff16600090815260016020526040812055565b60005b818110156102c857604080516020810183905201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301905252806102c081610834565b915050610276565b5050565b6000816040516020016102df9190610893565b604051602081830303815290604052805190602001209050919050565b60005b818110156102c857604080516020810183905201604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403019052528061034981610834565b9150506102ff565b6060816040516020016103649190610795565b6040516020818303038152906040529050919050565b60405181815233907f2a1343a7ef16865394327596242ebb1d13cafbd9dbb29027e89cbc0212cfa7379060200160405180910390a250565b6060816040516020016103649190610893565b60008273ffffffffffffffffffffffffffffffffffffffff16826040516103ec9190610893565b6000604051808303816000865af19150503d8060008114610429576040519150601f19603f3d011682016040523d82523d6000602084013e61042e565b606091505b505090508061049e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600b60248201527f43616c6c206661696c656400000000000000000000000000000000000000000060448201526064015b60405180910390fd5b60405130906104ae908490610893565b600060405180830381855af49150503d80600081146104e9576040519150601f19603f3d011682016040523d82523d6000602084013e6104ee565b606091505b5050809150508061055b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f44656c656761746563616c6c206661696c6564000000000000000000000000006044820152606401610495565b505050565b60408051338152602081018390527f86a4f961b36de6c45328ad9f8656c035c3f2414b5710cb261e19c9b0a8851203910160405180910390a150565b6000816040516020016102df9190610795565b6000602082840312156105c157600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600067ffffffffffffffff80841115610612576106126105c8565b604051601f85017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610658576106586105c8565b8160405280935085815286868601111561067157600080fd5b858560208301376000602087830101525050509392505050565b60006020828403121561069d57600080fd5b813567ffffffffffffffff8111156106b457600080fd5b8201601f810184136106c557600080fd5b6106d4848235602084016105f7565b949350505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461070057600080fd5b919050565b60006020828403121561071757600080fd5b610720826106dc565b9392505050565b60005b8381101561074257818101518382015260200161072a565b50506000910152565b60008151808452610763816020860160208601610727565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081526000610720602083018461074b565b600080604083850312156107bb57600080fd5b6107c4836106dc565b9150602083013567ffffffffffffffff8111156107e057600080fd5b8301601f810185136107f157600080fd5b610800858235602084016105f7565b9150509250929050565b6000806040838503121561081d57600080fd5b610826836106dc565b946020939093013593505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361088c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b600082516108a5818460208701610727565b919091019291505056fea2646970667358221220074d6f5a354629cf279c1cff0e21dacfb07ec4644065ef2edca3e52716c2669264736f6c63430008130033"
}
}
},
//Mint
{
"nbOfExecution": 1,
"scenario": {
"scenarioType": "ContractCall",
"wallet": "source", // contract 0x9d97700664141F25638463C5F1A024Ea24D902f5 can be called only by the owner
"contract": {
"contractCallType": "CallExistingContract",
"contractAddress": "0x9d97700664141F25638463C5F1A024Ea24D902f5",
"methodAndParameters": {
"type": "Mint",
"numberOfTimes": 100,
"address": "0x5341E203DDF276B661AdB904D6dEF1AB8944Cdc3",
"amount": 1
}
}
}
},
//BatchMint
{
"nbOfExecution": 1,
"scenario": {
"scenarioType": "ContractCall",
"wallet": "source", // contract 0x9d97700664141F25638463C5F1A024Ea24D902f5 can be called only by the owner
"contract": {
"contractCallType": "CallExistingContract",
"contractAddress": "0x9d97700664141F25638463C5F1A024Ea24D902f5",
"methodAndParameters": {
"type": "BatchMint",
"numberOfTimes": 100,
"address": ["0f344eb0ce3ec45c994d7abd7897821632f9619c","0x538791da292d3cdeee10574e4fdaf7d2220476a3","0x2ee8153d412a71663801c2201209891e882bb2a2",
"0xfa9bff942055cd823843ceeb0b50dc17f5f0f1e8","0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e","0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e",
"0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e","0xa5376f1151a6629281af4a79c8ebb0af60887be7","0x7ec2c4e2e7d7cf7fb84367a318dc17f908c3388d",
"0xb9d2786314d848c081f68499c93baab90ab18652","0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e","0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e",
"0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e","0x11b75115e902fa43f797d34b5252ef69f604369e","0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e",
"0xb64e5d16e6ec0e15c46dad842d2a1fac765e1bb3","0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e","0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e",
"0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e","0xd902a49242f5aefb5743204b929e6a10d01a8df8","0x963911ce50eCf3f292faEA21D3a3ABF678E2FA9e",
"0xbde4a7da0abf9ab0ebe97648ee2a9ec7713bbb23","0xe3060172919c3f11ef36ec7f05417a2e5c35b947","0x2f06eb7d40585bc87a9374a68a4297f69ec0a1cb"],
"amount": 1000
}
}
}
},
//testIndexedEventEmitting
{
"nbOfExecution": 1,
"scenario": {
"scenarioType": "ContractCall",
"wallet": "new",
"contract": {
"contractCallType": "CallExistingContract",
"contractAddress": "0xdce94FA9142b24a2e6c5f3C3141317c62a2Ad7c4",
"methodAndParameters": {
"type": "GenericCall",
"numberOfTimes": 250,
"methodName": "testIndexedEventEmitting",
"price": 25000,
"parameters": [
{
"solidityType": "Uint256",
"type": "SimpleParameter",
"value": "0"
}
]
}
}
}
},
//addToStorageMap
{
"nbOfExecution": 1,
"scenario": {
"scenarioType": "ContractCall",
"wallet": "new",
"contract": {
"contractCallType": "CallExistingContract",
"contractAddress": "0xdce94FA9142b24a2e6c5f3C3141317c62a2Ad7c4",
"methodAndParameters": {
"type": "GenericCall",
"numberOfTimes": 250,
"methodName": "addToStorageMap",
"price": 25000,
"parameters": [
{
"solidityType": "Address",
"type": "SimpleParameter",
"value": "0x1d80c1698946ee65b6A6B78F468B47f6bd4516f0"
},
{
"solidityType": "Uint256",
"type": "SimpleParameter",
"value": "15000"
}
]
}
}
}
}
]
}

View File

@@ -9,7 +9,7 @@ import tech.pegasys.teku.infrastructure.async.SafeFuture
class BlockReader {
private val web3jClient: Web3j = Web3j.build(
HttpService("https://linea-goerli.infura.io/v3/"),
HttpService("https://linea-sepolia.infura.io/v3/"),
1000,
Async.defaultExecutorService()
)