Skip to content

Commit

Permalink
[ETHEREUM-CONTRACTS] relax solidity pragma ^0.8.23 & update to 0.8.26 (
Browse files Browse the repository at this point in the history
…#1981)

* [ETHEREUM-CONTRACTS] relax solidity pragma ^0.8.23

* [solidity-semantic-money] relax solidity pragma ^0.8.23

* [solidity-semantic-money] adapt to latet forge-std

* ci.canary.yml: upgrade-contracts disabled

* to use solc 0.8.26

* [ethereum-contracts] use 0.8.26

* fix forge command

* fix build

* fix build

* sdk-core: fix build

* [ethereum-contracts] move mocks for foundry to foundry folder

* fix build

* fix build
  • Loading branch information
hellwolf authored Jul 3, 2024
1 parent 668d475 commit 60dc875
Show file tree
Hide file tree
Showing 134 changed files with 353 additions and 317 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/call.test-automation-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@ jobs:
- name: Test automation-contracts-scheduler
run: |
echo "FOUNDRY_PROFILE=ci" >> $GITHUB_ENV
echo "FOUNDRY_SOLC_VERSION=$SOLC" >> $GITHUB_ENV
yarn workspace scheduler test
- name: Test automation-contracts-autowrap
run: |
echo "FOUNDRY_PROFILE=ci" >> $GITHUB_ENV
echo "FOUNDRY_SOLC_VERSION=$SOLC" >> $GITHUB_ENV
yarn workspace autowrap test
2 changes: 0 additions & 2 deletions .github/workflows/call.test-ethereum-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ jobs:
if: inputs.run-coverage-tests == false
run: |
echo "FOUNDRY_PROFILE=ci" >> $GITHUB_ENV
echo "FOUNDRY_SOLC_VERSION=$SOLC" >> $GITHUB_ENV
yarn test
cat testing-benchmark.json
working-directory: ./packages/ethereum-contracts
Expand All @@ -92,7 +91,6 @@ jobs:
if: inputs.run-coverage-tests == true
run: |
echo "FOUNDRY_PROFILE=ci" >> $GITHUB_ENV
echo "FOUNDRY_SOLC_VERSION=$SOLC" >> $GITHUB_ENV
yarn test-coverage
working-directory: ./packages/ethereum-contracts
# NOTE: currently coverage report is not working properly in parallel mode.
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/call.test-solidity-semantic-money.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
- name: Build & Test
run: |
cd packages/solidity-semantic-money
# use native compiler provided through the nix devShell
echo "FOUNDRY_SOLC_VERSION=$SOLC" >> $GITHUB_ENV
make build-src test-all
env:
FOUNDRY_FUZZ_RUNS: 4200 # yea, baby
5 changes: 3 additions & 2 deletions .github/workflows/ci.canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@ jobs:
run: |
yarn install --frozen-lockfile
yarn lint
echo "FOUNDRY_PROFILE=ci" >> $GITHUB_ENV
echo "FOUNDRY_SOLC_VERSION=$SOLC" >> $GITHUB_ENV
yarn build
yarn test
env:
POLYGON_MAINNET_PROVIDER_URL: ${{ secrets.POLYGON_MAINNET_PROVIDER_URL }}
SUBGRAPH_RELEASE_TAG: dev
FOUNDRY_PROFILE: ci

test-hot-fuzz:
uses: ./.github/workflows/call.test-hot-fuzz.yml
Expand Down Expand Up @@ -276,6 +275,8 @@ jobs:
upgrade-contracts:
name: Upgrade ethereum-contracts on canary testnet (protocol release version "canary")

if: false # disable this for now

needs: [all-packages-tested]

runs-on: ubuntu-latest
Expand Down
27 changes: 20 additions & 7 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
flake-utils.lib.eachDefaultSystem (system:
let
minDevSolcVer = "solc_0_8_11"; # minimum solidity version used for external development
solcVer = "solc_0_8_23";
solcVer = "solc_0_8_26";
ghcVer92 = "ghc928";
ghcVer94 = "ghc948";

Expand Down
9 changes: 8 additions & 1 deletion packages/ethereum-contracts/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Breaking

- ISuperfuidPool self-transfer is not allowed
- FoundrySuperfluidTester is test with forge-std@v1.8.2, which may break with older forge-std lib
- FoundrySuperfluidTester is test with forge-std@v1.9.1, which may break with 1.7.x and prio forge-std lib

### Added

Expand All @@ -22,10 +22,17 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

### Changed

- relax pragram solidity with "^0.8.23"
- bump solc to 0.8.26
- fix a few types and build warnings
- rename '.prop.sol' to '.prop.t.sol'
- mark mock-contract files with 't.sol' to be skipped by foundry build automatically
- upgrade flake lock input: foundry

## Fixes

- make testTokenURIIsExpected work with non via-ir pipeline

## [v1.9.1] - 2024-03-19

### Breaking
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { UUPSProxiable } from "../upgradability/UUPSProxiable.sol";
import { ISuperAgreement } from "../interfaces/superfluid/ISuperAgreement.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import {
ISuperfluid,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import {
ISuperfluid,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPLv3
// solhint-disable not-rely-on-time
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import { IPoolAdminNFT } from "../../interfaces/agreements/gdav1/IPoolAdminNFT.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol";
import { IPoolMemberNFT } from "../../interfaces/agreements/gdav1/IPoolMemberNFT.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

// Notes: We use reserved slots for upgradable contracts.
// solhint-disable max-states-count
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPLv3
// solhint-disable not-rely-on-time
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

// Notes: We use these interfaces in natspec documentation below, grep @inheritdoc
// solhint-disable-next-line no-unused-import
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { BeaconProxy } from "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol";
import { ISuperfluidToken } from "../../interfaces/superfluid/ISuperfluidToken.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPLv3
// solhint-disable not-rely-on-time
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { BeaconProxiable } from "../../upgradability/BeaconProxiable.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import {
ISuperfluid,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { UUPSProxy } from "../upgradability/UUPSProxy.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { IRelayRecipient } from "../interfaces/utils/IRelayRecipient.sol";

Expand Down
2 changes: 1 addition & 1 deletion packages/ethereum-contracts/contracts/libs/CallUtils.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

/**
* @title Call utilities library that is absent from the OpenZeppelin
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPLv3
// solhint-disable const-name-snakecase
// solhint-disable max-line-length
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

/// @dev This is meant to be used by test framework to get the raw bytecode without compiling the origin contract
library ERC1820RegistryCompiled {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { IERC1820Registry } from "@openzeppelin/contracts/utils/introspection/IERC1820Registry.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

/**
* @title Utilities for fixed size data in storage
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

/// @title SafeGasLibrary
/// @author Superfluid
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import {ISuperfluidToken} from "../interfaces/superfluid/ISuperfluidToken.sol";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
SuperfluidGovernanceConfigs
} from "../interfaces/superfluid/ISuperfluid.sol";

pragma solidity 0.8.23;
pragma solidity ^0.8.23;

library SolvencyHelperLibrary {
function decode3PsData(ISuperfluid host, ISuperfluidToken token)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import {
ISuperfluid,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import {
ISuperfluid, ISuperfluidToken, ISuperToken, IConstantFlowAgreementV1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { CallUtils } from "../libs/CallUtils.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { CallUtils } from "../libs/CallUtils.sol";

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: AGPLv3
pragma solidity 0.8.23;
pragma solidity ^0.8.23;

import { CustomSuperTokenBase, ISuperToken } from "../interfaces/superfluid/CustomSuperTokenBase.sol";
import { UUPSProxy } from "../upgradability/UUPSProxy.sol";
Expand Down
Loading

0 comments on commit 60dc875

Please sign in to comment.