Browse Source

Merge branch 'master' into typo-fixes

Hadrien Croubois 1 month ago
parent
commit
9f882bf97f

+ 1 - 1
.github/workflows/actionlint.yml

@@ -9,7 +9,7 @@ jobs:
   lint:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Add problem matchers
         run: |
           # https://github.com/rhysd/actionlint/blob/3a2f2c7/docs/usage.md#problem-matchers

+ 1 - 1
.github/workflows/changeset.yml

@@ -19,7 +19,7 @@ jobs:
     runs-on: ubuntu-latest
     if: ${{ !contains(github.event.pull_request.labels.*.name, 'ignore-changeset') }}
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
         with:
           fetch-depth: 0 # Include history so Changesets finds merge-base
       - name: Set up environment

+ 8 - 8
.github/workflows/checks.yml

@@ -20,7 +20,7 @@ jobs:
   lint:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - run: npm run lint
@@ -34,7 +34,7 @@ jobs:
       CI: true
       GAS: true
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - name: Run tests and generate gas report
@@ -55,7 +55,7 @@ jobs:
     env:
       FORCE_COLOR: 1
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
         with:
           fetch-depth: 0 # Include history so patch conflicts are resolved automatically
       - name: Set up environment
@@ -81,7 +81,7 @@ jobs:
   tests-foundry:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
         with:
           submodules: recursive
       - name: Set up environment
@@ -92,7 +92,7 @@ jobs:
   coverage:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - name: Run coverage
@@ -104,7 +104,7 @@ jobs:
   harnesses:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - name: Compile harnesses
@@ -115,7 +115,7 @@ jobs:
   slither:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - uses: crytic/slither-action@v0.4.1
@@ -123,7 +123,7 @@ jobs:
   codespell:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Run CodeSpell
         uses: codespell-project/actions-codespell@v2.1
         with:

+ 1 - 1
.github/workflows/docs.yml

@@ -11,7 +11,7 @@ jobs:
   build:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - run: bash scripts/git-user-config.sh

+ 3 - 3
.github/workflows/formal-verification.yml

@@ -20,7 +20,7 @@ jobs:
   apply-diff:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Apply patches
         run: make -C certora apply
 
@@ -28,7 +28,7 @@ jobs:
     runs-on: ubuntu-latest
     if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'formal-verification')
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
         with:
           fetch-depth: 0
       - name: Set up environment
@@ -71,7 +71,7 @@ jobs:
   halmos:
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - name: Install python

+ 8 - 8
.github/workflows/release-cycle.yml

@@ -27,7 +27,7 @@ jobs:
       pull-requests: read
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - id: state
@@ -58,7 +58,7 @@ jobs:
     if: needs.state.outputs.start == 'true'
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - run: bash scripts/git-user-config.sh
@@ -81,7 +81,7 @@ jobs:
     if: needs.state.outputs.promote == 'true'
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - run: bash scripts/git-user-config.sh
@@ -102,7 +102,7 @@ jobs:
     if: needs.state.outputs.changesets == 'true'
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
         with:
           fetch-depth: 0 # To get all tags
       - name: Set up environment
@@ -135,7 +135,7 @@ jobs:
     if: needs.state.outputs.publish == 'true'
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Set up environment
         uses: ./.github/actions/setup
       - id: pack
@@ -169,10 +169,10 @@ jobs:
     name: Tarball Integrity Check
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
       - name: Download tarball artifact
         id: artifact
-        uses: actions/download-artifact@v4
+        uses: actions/download-artifact@v5
         with:
           name: ${{ github.ref_name }}
       - name: Check integrity
@@ -191,7 +191,7 @@ jobs:
     env:
       MERGE_BRANCH: merge/${{ github.ref_name }}
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
         with:
           fetch-depth: 0 # All branches
       - name: Set up environment

+ 1 - 1
.github/workflows/upgradeable.yml

@@ -11,7 +11,7 @@ jobs:
     environment: push-upgradeable
     runs-on: ubuntu-latest
     steps:
-      - uses: actions/checkout@v4
+      - uses: actions/checkout@v5
         with:
           repository: OpenZeppelin/openzeppelin-contracts-upgradeable
           fetch-depth: 0

+ 6 - 6
package-lock.json

@@ -38,7 +38,7 @@
         "lint-staged": "^16.0.0",
         "lodash.startcase": "^4.4.0",
         "micromatch": "^4.0.2",
-        "p-limit": "^6.0.0",
+        "p-limit": "^7.0.0",
         "prettier": "^3.0.0",
         "prettier-plugin-solidity": "^2.0.0",
         "rimraf": "^6.0.0",
@@ -8106,16 +8106,16 @@
       }
     },
     "node_modules/p-limit": {
-      "version": "6.2.0",
-      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-6.2.0.tgz",
-      "integrity": "sha512-kuUqqHNUqoIWp/c467RI4X6mmyuojY5jGutNU0wVTmEOOfcuwLqyMVoAi9MKi2Ak+5i9+nhmrK4ufZE8069kHA==",
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-7.0.0.tgz",
+      "integrity": "sha512-WeCdPG5OjujcMWjSkOS0kt3bo+LmroXLmOnJ4SPhZfz5pffQxDUNcYscbZgyGwKf9r9z7gRfKjDNno5cZyQAZQ==",
       "dev": true,
       "license": "MIT",
       "dependencies": {
-        "yocto-queue": "^1.1.1"
+        "yocto-queue": "^1.2.1"
       },
       "engines": {
-        "node": ">=18"
+        "node": ">=20"
       },
       "funding": {
         "url": "https://github.com/sponsors/sindresorhus"

+ 1 - 1
package.json

@@ -81,7 +81,7 @@
     "lint-staged": "^16.0.0",
     "lodash.startcase": "^4.4.0",
     "micromatch": "^4.0.2",
-    "p-limit": "^6.0.0",
+    "p-limit": "^7.0.0",
     "prettier": "^3.0.0",
     "prettier-plugin-solidity": "^2.0.0",
     "rimraf": "^6.0.0",

+ 4 - 4
test/governance/Governor.test.js

@@ -682,7 +682,7 @@ describe('Governor', function () {
 
           await expect(this.helper.propose())
             .to.be.revertedWithCustomError(this.mock, 'GovernorInvalidProposalLength')
-            .withArgs(0, 0, 0);
+            .withArgs(0n, 0n, 0n);
         });
 
         it('mismatch #1', async function () {
@@ -696,7 +696,7 @@ describe('Governor', function () {
           );
           await expect(this.helper.propose())
             .to.be.revertedWithCustomError(this.mock, 'GovernorInvalidProposalLength')
-            .withArgs(0, 1, 1);
+            .withArgs(0n, 1n, 1n);
         });
 
         it('mismatch #2', async function () {
@@ -710,7 +710,7 @@ describe('Governor', function () {
           );
           await expect(this.helper.propose())
             .to.be.revertedWithCustomError(this.mock, 'GovernorInvalidProposalLength')
-            .withArgs(1, 1, 0);
+            .withArgs(1n, 1n, 0n);
         });
 
         it('mismatch #3', async function () {
@@ -724,7 +724,7 @@ describe('Governor', function () {
           );
           await expect(this.helper.propose())
             .to.be.revertedWithCustomError(this.mock, 'GovernorInvalidProposalLength')
-            .withArgs(1, 0, 1);
+            .withArgs(1n, 0n, 1n);
         });
       });
 

+ 4 - 4
test/governance/TimelockController.test.js

@@ -739,7 +739,7 @@ describe('TimelockController', function () {
                   ),
               )
                 .to.be.revertedWithCustomError(this.mock, 'TimelockInvalidOperationLength')
-                .withArgs(0, this.operation.payloads.length, this.operation.values.length);
+                .withArgs(0n, this.operation.payloads.length, this.operation.values.length);
             });
 
             it('length mismatch #2', async function () {
@@ -1152,7 +1152,7 @@ describe('TimelockController', function () {
     it('call payable with eth', async function () {
       const operation = genOperation(
         this.callreceivermock,
-        1,
+        1n,
         this.callreceivermock.interface.encodeFunctionData('mockFunction'),
         ethers.ZeroHash,
         '0x5ab73cd33477dcd36c1e05e28362719d0ed59a7b9ff14939de63a43073dc1f44',
@@ -1170,7 +1170,7 @@ describe('TimelockController', function () {
       await this.mock
         .connect(this.executor)
         .execute(operation.target, operation.value, operation.data, operation.predecessor, operation.salt, {
-          value: 1,
+          value: 1n,
         });
 
       expect(await ethers.provider.getBalance(this.mock)).to.equal(0n);
@@ -1264,7 +1264,7 @@ describe('TimelockController', function () {
         await this.token.connect(this.other).safeTransferFrom(
           this.other,
           this.mock,
-          ...Object.entries(tokenIds)[0n], // id + amount
+          ...Object.entries(tokenIds)[0], // id + amount
           '0x',
         );
       });

+ 1 - 1
test/governance/extensions/GovernorCountingOverridable.test.js

@@ -93,7 +93,7 @@ describe('GovernorCountingOverridable', function () {
         expect(await ethers.provider.getBalance(this.receiver)).to.equal(value);
       });
 
-      describe('cast override vote', async function () {
+      describe('cast override vote', function () {
         beforeEach(async function () {
           // user 1 -(delegate 10 tokens)-> user 2
           // user 2 -(delegate 7 tokens)-> user 2

+ 1 - 1
test/governance/extensions/GovernorSequentialProposalId.test.js

@@ -167,7 +167,7 @@ describe('GovernorSequentialProposalId', function () {
         await this.helper.connect(this.proposer).propose();
         await expect(this.helper.connect(this.proposer).propose())
           .to.be.revertedWithCustomError(this.mock, 'GovernorUnexpectedProposalState')
-          .withArgs(await this.proposal.id, 0, ethers.ZeroHash);
+          .withArgs(await this.proposal.id, 0n, ethers.ZeroHash);
       });
 
       it('nominal workflow', async function () {

+ 9 - 9
test/governance/utils/Votes.behavior.js

@@ -65,7 +65,7 @@ function shouldBehaveLikeVotes(tokens, { mode = 'blocknumber', fungible = true }
 
         expect(await this.votes.delegates(this.alice)).to.equal(this.alice);
         expect(await this.votes.getVotes(this.alice)).to.equal(weight);
-        expect(await this.votes.getVotes(this.bob)).to.equal(0);
+        expect(await this.votes.getVotes(this.bob)).to.equal(0n);
 
         const tx = await this.votes.connect(this.alice).delegate(this.bob);
         const timepoint = await time.clockFromReceipt[mode](tx);
@@ -74,9 +74,9 @@ function shouldBehaveLikeVotes(tokens, { mode = 'blocknumber', fungible = true }
           .to.emit(this.votes, 'DelegateChanged')
           .withArgs(this.alice, this.alice, this.bob)
           .to.emit(this.votes, 'DelegateVotesChanged')
-          .withArgs(this.alice, weight, 0)
+          .withArgs(this.alice, weight, 0n)
           .to.emit(this.votes, 'DelegateVotesChanged')
-          .withArgs(this.bob, 0, weight);
+          .withArgs(this.bob, 0n, weight);
 
         expect(await this.votes.delegates(this.alice)).to.equal(this.bob);
         expect(await this.votes.getVotes(this.alice)).to.equal(0n);
@@ -117,7 +117,7 @@ function shouldBehaveLikeVotes(tokens, { mode = 'blocknumber', fungible = true }
             .to.emit(this.votes, 'DelegateChanged')
             .withArgs(this.delegator, ethers.ZeroAddress, this.delegatee)
             .to.emit(this.votes, 'DelegateVotesChanged')
-            .withArgs(this.delegatee, 0, weight);
+            .withArgs(this.delegatee, 0n, weight);
 
           expect(await this.votes.delegates(this.delegator.address)).to.equal(this.delegatee);
           expect(await this.votes.getVotes(this.delegator.address)).to.equal(0n);
@@ -187,7 +187,7 @@ function shouldBehaveLikeVotes(tokens, { mode = 'blocknumber', fungible = true }
 
           await expect(this.votes.delegateBySig(this.delegatee, nonce + 1n, ethers.MaxUint256, v, r, s))
             .to.be.revertedWithCustomError(this.votes, 'InvalidAccountNonce')
-            .withArgs(this.delegator, 0);
+            .withArgs(this.delegator, 0n);
         });
 
         it('rejects expired permit', async function () {
@@ -217,7 +217,7 @@ function shouldBehaveLikeVotes(tokens, { mode = 'blocknumber', fungible = true }
       });
 
       it('reverts if block number >= current block', async function () {
-        const timepoint = 5e10;
+        const timepoint = 50_000_000_000n;
         const clock = await this.votes.clock();
         await expect(this.votes.getPastTotalSupply(timepoint))
           .to.be.revertedWithCustomError(this.votes, 'ERC5805FutureLookup')
@@ -257,7 +257,7 @@ function shouldBehaveLikeVotes(tokens, { mode = 'blocknumber', fungible = true }
         t4.timepoint = await time.clockFromReceipt[mode](t4);
         t5.timepoint = await time.clockFromReceipt[mode](t5);
 
-        expect(await this.votes.getPastTotalSupply(t0.timepoint - 1n)).to.equal(0);
+        expect(await this.votes.getPastTotalSupply(t0.timepoint - 1n)).to.equal(0n);
         expect(await this.votes.getPastTotalSupply(t0.timepoint)).to.equal(weight[0]);
         expect(await this.votes.getPastTotalSupply(t0.timepoint + 1n)).to.equal(weight[0]);
         expect(await this.votes.getPastTotalSupply(t1.timepoint)).to.equal(weight[0] + weight[1]);
@@ -268,7 +268,7 @@ function shouldBehaveLikeVotes(tokens, { mode = 'blocknumber', fungible = true }
         expect(await this.votes.getPastTotalSupply(t3.timepoint + 1n)).to.equal(weight[0] + weight[2]);
         expect(await this.votes.getPastTotalSupply(t4.timepoint)).to.equal(weight[2]);
         expect(await this.votes.getPastTotalSupply(t4.timepoint + 1n)).to.equal(weight[2]);
-        expect(await this.votes.getPastTotalSupply(t5.timepoint)).to.equal(0);
+        expect(await this.votes.getPastTotalSupply(t5.timepoint)).to.equal(0n);
         await expect(this.votes.getPastTotalSupply(t5.timepoint + 1n))
           .to.be.revertedWithCustomError(this.votes, 'ERC5805FutureLookup')
           .withArgs(t5.timepoint + 1n, t5.timepoint + 1n);
@@ -287,7 +287,7 @@ function shouldBehaveLikeVotes(tokens, { mode = 'blocknumber', fungible = true }
       describe('getPastVotes', function () {
         it('reverts if block number >= current block', async function () {
           const clock = await this.votes.clock();
-          const timepoint = 5e10; // far in the future
+          const timepoint = 50_000_000_000n; // far in the future
           await expect(this.votes.getPastVotes(this.bob, timepoint))
             .to.be.revertedWithCustomError(this.votes, 'ERC5805FutureLookup')
             .withArgs(timepoint, clock);