diff --git a/.github/renovate.json b/.github/renovate.json index 888aa66..3b80abc 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -20,7 +20,12 @@ "dependencies" ], "rebaseWhen": "conflicted", - "packageRules": [], + "packageRules": [ + { + "groupName": "OpenZeppelin packages", + "matchPackagePatterns": ["^@openzeppelin/"] + } + ], "hostRules": [ { "timeout": 3000000 diff --git a/.github/workflows/solidity.yml b/.github/workflows/solidity.yml index 014e2ce..0521620 100644 --- a/.github/workflows/solidity.yml +++ b/.github/workflows/solidity.yml @@ -295,7 +295,7 @@ jobs: update-comment: true - name: Inject slug/short variables - uses: rlespinasse/github-slug-action@v4 + uses: rlespinasse/github-slug-action@v5 - name: Package version id: package-version @@ -375,7 +375,7 @@ jobs: with: commit_message: "chore: update package versions [skip ci]" branch: main - file_pattern: 'package.json README.md' + file_pattern: 'package.json README.md all_allocations.json' - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/.solhint.json b/.solhint.json index ce2220e..416e3e7 100644 --- a/.solhint.json +++ b/.solhint.json @@ -1,3 +1,8 @@ { - "extends": "solhint:recommended" + "extends": "solhint:recommended", + "rules": { + "immutable-vars-naming": "off", + "no-empty-blocks": "off", + "func-name-mixedcase": "off" + } } diff --git a/Dockerfile b/Dockerfile index a34e52b..fcf9ba7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:22.10.0 AS build +FROM node:22.11.0 AS build RUN --mount=type=cache,sharing=locked,target=/var/cache/apt \ export DEBIAN_FRONTEND=noninteractive && \ diff --git a/lib/forge-std/package.json b/lib/forge-std/package.json index 9bc3d24..14f3353 100644 --- a/lib/forge-std/package.json +++ b/lib/forge-std/package.json @@ -1,6 +1,6 @@ { "name": "forge-std", - "version": "1.9.3", + "version": "1.9.4", "description": "Forge Standard Library is a collection of helpful contracts and libraries for use with Forge and Foundry.", "homepage": "https://book.getfoundry.sh/forge/forge-std", "bugs": "https://github.com/foundry-rs/forge-std/issues", diff --git a/lib/forge-std/src/Vm.sol b/lib/forge-std/src/Vm.sol index 0f2dc50..73fc47e 100644 --- a/lib/forge-std/src/Vm.sol +++ b/lib/forge-std/src/Vm.sol @@ -264,6 +264,31 @@ interface VmSafe { address contractAddr; } + /// The transaction type (`txType`) of the broadcast. + enum BroadcastTxType { + // Represents a CALL broadcast tx. + Call, + // Represents a CREATE broadcast tx. + Create, + // Represents a CREATE2 broadcast tx. + Create2 + } + + /// Represents a transaction's broadcast details. + struct BroadcastTxSummary { + // The hash of the transaction that was broadcasted + bytes32 txHash; + // Represent the type of transaction among CALL, CREATE, CREATE2 + BroadcastTxType txType; + // The address of the contract that was called or created. + // This is address of the contract that is created if the txType is CREATE or CREATE2. + address contractAddress; + // The block number the transaction landed in. + uint64 blockNumber; + // Status of the transaction, retrieved from the transaction receipt. + bool success; + } + // ======== Crypto ======== /// Derives a private key from the name, labels the account with that name, and returns the wallet. @@ -771,6 +796,46 @@ interface VmSafe { /// `path` is relative to the project root. function writeLine(string calldata path, string calldata data) external; + /// Returns the most recent broadcast for the given contract on `chainId` matching `txType`. + /// + /// For example: + /// + /// The most recent deployment can be fetched by passing `txType` as `CREATE` or `CREATE2`. + /// + /// The most recent call can be fetched by passing `txType` as `CALL`. + function getBroadcast(string calldata contractName, uint64 chainId, BroadcastTxType txType) + external + returns (BroadcastTxSummary memory); + + /// Returns all broadcasts for the given contract on `chainId` with the specified `txType`. + /// + /// Sorted such that the most recent broadcast is the first element, and the oldest is the last. i.e descending order of BroadcastTxSummary.blockNumber. + function getBroadcasts(string calldata contractName, uint64 chainId, BroadcastTxType txType) + external + returns (BroadcastTxSummary[] memory); + + /// Returns all broadcasts for the given contract on `chainId`. + /// + /// Sorted such that the most recent broadcast is the first element, and the oldest is the last. i.e descending order of BroadcastTxSummary.blockNumber. + function getBroadcasts(string calldata contractName, uint64 chainId) + external + returns (BroadcastTxSummary[] memory); + + /// Returns the most recent deployment for the current `chainId`. + function getDeployment(string calldata contractName) external returns (address deployedAddress); + + /// Returns the most recent deployment for the given contract on `chainId` + function getDeployment(string calldata contractName, uint64 chainId) external returns (address deployedAddress); + + /// Returns all deployments for the given contract on `chainId` + /// + /// Sorted in descending order of deployment time i.e descending order of BroadcastTxSummary.blockNumber. + /// + /// The most recent deployment is the first element, and the oldest is the last. + function getDeployments(string calldata contractName, uint64 chainId) + external + returns (address[] memory deployedAddresses); + // ======== JSON ======== /// Checks if `key` exists in a JSON object. diff --git a/lib/forge-std/test/Vm.t.sol b/lib/forge-std/test/Vm.t.sol index 8642067..8b6113c 100644 --- a/lib/forge-std/test/Vm.t.sol +++ b/lib/forge-std/test/Vm.t.sol @@ -13,6 +13,6 @@ contract VmTest is Test { } function test_VmSafeInterfaceId() public pure { - assertEq(type(VmSafe).interfaceId, bytes4(0xb09496a4), "VmSafe"); + assertEq(type(VmSafe).interfaceId, bytes4(0x590bc2b4), "VmSafe"); } }