From 60dc875e9a5a7488b13a683d7ecd32f1bebd01be Mon Sep 17 00:00:00 2001 From: Miao ZhiCheng Date: Thu, 4 Jul 2024 03:49:53 +0800 Subject: [PATCH] [ETHEREUM-CONTRACTS] relax solidity pragma ^0.8.23 & update to 0.8.26 (#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 --- .../call.test-automation-contracts.yml | 2 - .../call.test-ethereum-contracts.yml | 2 - .../call.test-solidity-semantic-money.yml | 2 - .github/workflows/ci.canary.yml | 5 +- flake.lock | 27 +++++-- flake.nix | 2 +- packages/ethereum-contracts/CHANGELOG.md | 9 ++- .../contracts/agreements/AgreementBase.sol | 2 +- .../contracts/agreements/AgreementLibrary.sol | 2 +- .../agreements/ConstantFlowAgreementV1.sol | 2 +- .../InstantDistributionAgreementV1.sol | 2 +- .../gdav1/GeneralDistributionAgreementV1.sol | 2 +- .../agreements/gdav1/PoolAdminNFT.sol | 2 +- .../agreements/gdav1/PoolMemberNFT.sol | 2 +- .../agreements/gdav1/PoolNFTBase.sol | 2 +- .../agreements/gdav1/SuperfluidPool.sol | 2 +- .../gdav1/SuperfluidPoolDeployerLibrary.sol | 2 +- .../gdav1/SuperfluidPoolPlaceholder.sol | 2 +- .../gov/SuperfluidGovernanceBase.sol | 2 +- .../contracts/gov/SuperfluidGovernanceII.sol | 2 +- .../contracts/libs/BaseRelayRecipient.sol | 2 +- .../contracts/libs/CallUtils.sol | 2 +- .../libs/ERC1820RegistryCompiled.sol | 2 +- .../contracts/libs/ERC777Helper.sol | 2 +- .../contracts/libs/FixedSizeData.sol | 2 +- .../contracts/libs/SafeGasLibrary.sol | 2 +- .../contracts/libs/SlotsBitmapLibrary.sol | 2 +- .../contracts/libs/SolvencyHelperLibrary.sol | 2 +- ...{AgreementMock.sol => AgreementMock.t.sol} | 2 +- .../{CFAAppMocks.sol => CFAAppMocks.t.sol} | 2 +- ...FALibraryMock.sol => CFALibraryMock.t.sol} | 2 +- ...{CallUtilsMock.sol => CallUtilsMock.t.sol} | 2 +- ...lUtilsTester.sol => CallUtilsTester.t.sol} | 2 +- .../contracts/mocks/CrossStreamSuperApp.sol | 47 ----------- ...kenMock.sol => CustomSuperTokenMock.t.sol} | 2 +- ...ck.sol => ERC777SenderRecipientMock.t.sol} | 2 +- ...fluidMock.sol => FakeSuperfluidMock.t.sol} | 2 +- ...{ForwarderMock.sol => ForwarderMock.t.sol} | 2 +- ...rAppTester.sol => IDASuperAppTester.t.sol} | 2 +- ...LibraryMock.sol => IDAv1LibraryMock.t.sol} | 2 +- ...kSmartWallet.sol => MockSmartWallet.t.sol} | 2 +- ...TesterApp.sol => MultiFlowTesterApp.t.sol} | 2 +- ...mRedirector.sol => StreamRedirector.t.sol} | 2 +- ...{SuperAppMocks.sol => SuperAppMocks.t.sol} | 4 +- ...ryMock.sol => SuperTokenFactoryMock.t.sol} | 2 +- ...Mock.sol => SuperTokenLibraryV1Mock.t.sol} | 2 +- ...uperTokenMock.sol => SuperTokenMock.t.sol} | 7 +- ...ock.sol => SuperfluidDestructorMock.t.sol} | 2 +- ...k.sol => SuperfluidGovernanceIIMock.t.sol} | 2 +- ...uperfluidMock.sol => SuperfluidMock.t.sol} | 2 +- ...xiableMock.sol => UUPSProxiableMock.t.sol} | 2 +- .../superfluid/ConstantInflowNFT.sol | 2 +- .../superfluid/ConstantOutflowNFT.sol | 2 +- .../contracts/superfluid/FlowNFTBase.sol | 2 +- .../FullUpgradableSuperTokenProxy.sol | 2 +- .../contracts/superfluid/SuperToken.sol | 2 +- .../superfluid/SuperTokenFactory.sol | 2 +- .../contracts/superfluid/Superfluid.sol | 2 +- .../contracts/superfluid/SuperfluidToken.sol | 2 +- .../contracts/tokens/PureSuperToken.sol | 2 +- .../contracts/tokens/SETH.sol | 2 +- .../upgradability/BeaconProxiable.sol | 2 +- .../SuperfluidUpgradeableBeacon.sol | 2 +- .../contracts/upgradability/UUPSProxiable.sol | 2 +- .../contracts/upgradability/UUPSProxy.sol | 2 +- .../contracts/upgradability/UUPSUtils.sol | 2 +- .../contracts/utils/BatchLiquidator.sol | 2 +- .../contracts/utils/CFAv1Forwarder.sol | 2 +- .../contracts/utils/DMZForwarder.sol | 2 +- .../contracts/utils/ForwarderBase.sol | 2 +- .../contracts/utils/GDAv1Forwarder.sol | 2 +- .../contracts/utils/IDAv1Forwarder.sol | 2 +- .../contracts/utils/MacroForwarder.sol | 2 +- .../contracts/utils/SuperUpgrader.sol | 2 +- .../contracts/utils/TOGA.sol | 2 +- packages/ethereum-contracts/foundry.toml | 3 +- packages/ethereum-contracts/hardhat.config.ts | 2 +- packages/ethereum-contracts/package.json | 2 +- .../contracts/agreements/AgreementHelper.ts | 2 +- .../foundry/StorageLayoutTestBase.t.sol} | 6 +- .../foundry/SuperfluidFrameworkDeployer.t.sol | 2 +- .../ConstantFlowAgreementV1.ACL.t.sol | 2 +- .../ConstantFlowAgreementV1.prop.t.sol | 2 +- .../agreements/ConstantFlowAgreementV1.t.sol | 2 +- .../InstantDistributionAgreementV1.t.sol | 2 +- .../gdav1/GeneralDistributionAgreement.t.sol | 4 +- .../GeneralDistributionAgreementV1.prop.t.sol | 2 +- .../SuperfluidPoolUpgradabilityMock.t.sol} | 12 +-- .../test/foundry/apps/CFASuperAppBase.t.sol | 9 ++- .../foundry/apps/CFASuperAppBaseTester.t.sol} | 8 +- .../foundry/apps/CrossStreamSuperApp.t.sol | 45 ++++++++++- .../apps/SuperAppTester/FlowSplitter.sol | 2 +- .../apps/SuperAppTester/SuperAppTest.t.sol | 2 +- .../apps/SuperAppTester/handlers/Handler.sol | 2 +- .../handlers/IStreamHandler.sol | 2 +- .../foundry/echidna/EchidnaTestCases.t.sol | 4 +- .../foundry/gov/SuperfluidGovernanceII.t.sol | 5 +- .../foundry/libs/AgreementLibrary.prop.t.sol | 2 +- .../test/foundry/libs/CallUtils.t.sol | 2 +- .../libs/SlotsBitmapLibrary.prop.t.sol | 2 +- .../foundry/superfluid/CFAv1NFTMock.t.sol} | 11 +-- .../CFAv1NFTUpgradabilityMock.t.sol} | 18 ++--- .../superfluid/ConstantInflowNFT.t.sol | 2 +- .../superfluid/ConstantOutflowNFT.t.sol | 78 +++++++++++-------- .../test/foundry/superfluid/ERC721.t.sol | 8 +- .../foundry/superfluid/FlowNFTBase.prop.t.sol | 2 +- .../test/foundry/superfluid/FlowNFTBase.t.sol | 12 +-- .../foundry/superfluid/PoolAdminNFT.t.sol | 2 +- .../foundry/superfluid/PoolMemberNFT.t.sol | 2 +- .../test/foundry/superfluid/PoolNFTBase.t.sol | 8 +- .../foundry/superfluid/PoolNFTMock.t.sol} | 13 ++-- .../PoolNFTUpgradabilityMock.t.sol} | 20 ++--- .../test/foundry/superfluid/SuperToken.t.sol | 2 +- .../superfluid/SuperTokenFactory.t.sol | 2 +- .../superfluid/Superfluid.BatchCall.t.sol | 4 +- .../test/foundry/superfluid/Superfluid.t.sol | 4 +- .../superfluid/SuperfluidPool.prop.t.sol | 2 +- .../SuperfluidUpgradeableBeacon.t.sol | 2 +- .../test/foundry/utils/BatchLiquidator.t.sol | 2 +- .../test/foundry/utils/IDAv1Forwarder.t.sol | 2 +- .../test/foundry/utils/MacroForwarder.t.sol | 2 +- .../test/foundry/utils/TOGA.t.sol | 2 +- packages/ethereum-contracts/truffle-config.js | 2 +- .../contracts/NoGetUnderlyingToken.sol | 2 +- .../sdk-core/contracts/SuperAppTester.sol | 2 +- packages/solidity-semantic-money/foundry.toml | 3 +- .../src/examples/Aqueduct.sol | 2 +- .../src/ref-impl/ToySuperToken.sol | 2 +- .../src/ref-impl/ToySuperfluidPool.sol | 2 +- .../src/ref-impl/ToySuperfluidToken.sol | 2 +- .../test/SemanticMoney.t.sol | 72 ++++++++--------- .../test/examples/Aqueduct.t.sol | 4 +- .../test/ref-impl/CertoraHarness.sol | 2 +- .../test/ref-impl/ToySuperToken.t.sol | 10 +-- 134 files changed, 353 insertions(+), 317 deletions(-) rename packages/ethereum-contracts/contracts/mocks/{AgreementMock.sol => AgreementMock.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{CFAAppMocks.sol => CFAAppMocks.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{CFALibraryMock.sol => CFALibraryMock.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{CallUtilsMock.sol => CallUtilsMock.t.sol} (98%) rename packages/ethereum-contracts/contracts/mocks/{CallUtilsTester.sol => CallUtilsTester.t.sol} (95%) delete mode 100644 packages/ethereum-contracts/contracts/mocks/CrossStreamSuperApp.sol rename packages/ethereum-contracts/contracts/mocks/{CustomSuperTokenMock.sol => CustomSuperTokenMock.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{ERC777SenderRecipientMock.sol => ERC777SenderRecipientMock.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{FakeSuperfluidMock.sol => FakeSuperfluidMock.t.sol} (95%) rename packages/ethereum-contracts/contracts/mocks/{ForwarderMock.sol => ForwarderMock.t.sol} (97%) rename packages/ethereum-contracts/contracts/mocks/{IDASuperAppTester.sol => IDASuperAppTester.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{IDAv1LibraryMock.sol => IDAv1LibraryMock.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{MockSmartWallet.sol => MockSmartWallet.t.sol} (94%) rename packages/ethereum-contracts/contracts/mocks/{MultiFlowTesterApp.sol => MultiFlowTesterApp.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{StreamRedirector.sol => StreamRedirector.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{SuperAppMocks.sol => SuperAppMocks.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{SuperTokenFactoryMock.sol => SuperTokenFactoryMock.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{SuperTokenLibraryV1Mock.sol => SuperTokenLibraryV1Mock.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{SuperTokenMock.sol => SuperTokenMock.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{SuperfluidDestructorMock.sol => SuperfluidDestructorMock.t.sol} (91%) rename packages/ethereum-contracts/contracts/mocks/{SuperfluidGovernanceIIMock.sol => SuperfluidGovernanceIIMock.t.sol} (96%) rename packages/ethereum-contracts/contracts/mocks/{SuperfluidMock.sol => SuperfluidMock.t.sol} (99%) rename packages/ethereum-contracts/contracts/mocks/{UUPSProxiableMock.sol => UUPSProxiableMock.t.sol} (96%) rename packages/ethereum-contracts/{contracts/mocks/IStorageLayoutBase.sol => test/foundry/StorageLayoutTestBase.t.sol} (55%) rename packages/ethereum-contracts/{contracts/mocks/SuperfluidPoolUpgradabilityMock.sol => test/foundry/agreements/gdav1/SuperfluidPoolUpgradabilityMock.t.sol} (85%) rename packages/ethereum-contracts/{contracts/mocks/CFASuperAppBaseTester.sol => test/foundry/apps/CFASuperAppBaseTester.t.sol} (89%) rename packages/ethereum-contracts/{contracts/mocks/CFAv1NFTMock.sol => test/foundry/superfluid/CFAv1NFTMock.t.sol} (92%) rename packages/ethereum-contracts/{contracts/mocks/CFAv1NFTUpgradabilityMock.sol => test/foundry/superfluid/CFAv1NFTUpgradabilityMock.t.sol} (92%) rename packages/ethereum-contracts/{contracts/mocks/PoolNFTMock.sol => test/foundry/superfluid/PoolNFTMock.t.sol} (88%) rename packages/ethereum-contracts/{contracts/mocks/PoolNFTUpgradabilityMock.sol => test/foundry/superfluid/PoolNFTUpgradabilityMock.t.sol} (88%) diff --git a/.github/workflows/call.test-automation-contracts.yml b/.github/workflows/call.test-automation-contracts.yml index beac3f49cd..b8cf75784b 100644 --- a/.github/workflows/call.test-automation-contracts.yml +++ b/.github/workflows/call.test-automation-contracts.yml @@ -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 diff --git a/.github/workflows/call.test-ethereum-contracts.yml b/.github/workflows/call.test-ethereum-contracts.yml index cb67fb35c0..0ab64beb6e 100644 --- a/.github/workflows/call.test-ethereum-contracts.yml +++ b/.github/workflows/call.test-ethereum-contracts.yml @@ -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 @@ -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. diff --git a/.github/workflows/call.test-solidity-semantic-money.yml b/.github/workflows/call.test-solidity-semantic-money.yml index 6b48ed99ae..ac629f98f7 100644 --- a/.github/workflows/call.test-solidity-semantic-money.yml +++ b/.github/workflows/call.test-solidity-semantic-money.yml @@ -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 diff --git a/.github/workflows/ci.canary.yml b/.github/workflows/ci.canary.yml index 79d64a17b1..89f27780e3 100644 --- a/.github/workflows/ci.canary.yml +++ b/.github/workflows/ci.canary.yml @@ -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 @@ -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 diff --git a/flake.lock b/flake.lock index 83f4a97425..ebd320ecd2 100644 --- a/flake.lock +++ b/flake.lock @@ -28,11 +28,11 @@ ] }, "locked": { - "lastModified": 1717405880, - "narHash": "sha256-qcXXOnRSl0sGKm7JknntBU4su8/342YKZvjklHsIl+Q=", + "lastModified": 1719997877, + "narHash": "sha256-/Edw+w0PiGgxwnCeJycM0VgH4HtlCi91v1d8xbi+REE=", "owner": "shazow", "repo": "foundry.nix", - "rev": "708c0df1e36b5185a727a3c517a5100e46392792", + "rev": "02febba4f1cf0606d790acdb24adcf7a64afb4e1", "type": "github" }, "original": { @@ -73,14 +73,15 @@ ], "nixpkgs": [ "nixpkgs" - ] + ], + "solc-macos-amd64-list-json": "solc-macos-amd64-list-json" }, "locked": { - "lastModified": 1706563406, - "narHash": "sha256-XoMphCwfqx00wx/2nALvMPEAmD32A8lwSmwI5MNopyA=", + "lastModified": 1717442267, + "narHash": "sha256-6TnQvA6Q/xC3r1M+wGC5gnDc/5XfOPjC8X6LlGDWDNc=", "owner": "hellwolf", "repo": "solc.nix", - "rev": "c863de2fa3721fc4201484c084a49e996ce21e19", + "rev": "2ac2862f224aa0d67cbc6b3246392489f8a50596", "type": "github" }, "original": { @@ -89,6 +90,18 @@ "type": "github" } }, + "solc-macos-amd64-list-json": { + "flake": false, + "locked": { + "narHash": "sha256-Prwz95BgMHcWd72VwVbcH17LsV9f24K2QMcUiWUQZzI=", + "type": "file", + "url": "https://github.com/ethereum/solc-bin/raw/f743ca7/macosx-amd64/list.json" + }, + "original": { + "type": "file", + "url": "https://github.com/ethereum/solc-bin/raw/f743ca7/macosx-amd64/list.json" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index f552a7eb89..ce3fe67b2c 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; diff --git a/packages/ethereum-contracts/CHANGELOG.md b/packages/ethereum-contracts/CHANGELOG.md index 3865b17a62..5cefe71267 100644 --- a/packages/ethereum-contracts/CHANGELOG.md +++ b/packages/ethereum-contracts/CHANGELOG.md @@ -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 @@ -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 diff --git a/packages/ethereum-contracts/contracts/agreements/AgreementBase.sol b/packages/ethereum-contracts/contracts/agreements/AgreementBase.sol index cce4e2e418..aae9e32c0d 100644 --- a/packages/ethereum-contracts/contracts/agreements/AgreementBase.sol +++ b/packages/ethereum-contracts/contracts/agreements/AgreementBase.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/agreements/AgreementLibrary.sol b/packages/ethereum-contracts/contracts/agreements/AgreementLibrary.sol index 51d1ea0d4f..6d7324c214 100644 --- a/packages/ethereum-contracts/contracts/agreements/AgreementLibrary.sol +++ b/packages/ethereum-contracts/contracts/agreements/AgreementLibrary.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, diff --git a/packages/ethereum-contracts/contracts/agreements/ConstantFlowAgreementV1.sol b/packages/ethereum-contracts/contracts/agreements/ConstantFlowAgreementV1.sol index cc85dc1456..d4e0edc98d 100644 --- a/packages/ethereum-contracts/contracts/agreements/ConstantFlowAgreementV1.sol +++ b/packages/ethereum-contracts/contracts/agreements/ConstantFlowAgreementV1.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, diff --git a/packages/ethereum-contracts/contracts/agreements/InstantDistributionAgreementV1.sol b/packages/ethereum-contracts/contracts/agreements/InstantDistributionAgreementV1.sol index 832a8f5dcc..6bd8a6740b 100644 --- a/packages/ethereum-contracts/contracts/agreements/InstantDistributionAgreementV1.sol +++ b/packages/ethereum-contracts/contracts/agreements/InstantDistributionAgreementV1.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/agreements/gdav1/GeneralDistributionAgreementV1.sol b/packages/ethereum-contracts/contracts/agreements/gdav1/GeneralDistributionAgreementV1.sol index 21de10a40a..133557ce90 100644 --- a/packages/ethereum-contracts/contracts/agreements/gdav1/GeneralDistributionAgreementV1.sol +++ b/packages/ethereum-contracts/contracts/agreements/gdav1/GeneralDistributionAgreementV1.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/agreements/gdav1/PoolAdminNFT.sol b/packages/ethereum-contracts/contracts/agreements/gdav1/PoolAdminNFT.sol index 2a73cc5c1f..4b86cb5b83 100644 --- a/packages/ethereum-contracts/contracts/agreements/gdav1/PoolAdminNFT.sol +++ b/packages/ethereum-contracts/contracts/agreements/gdav1/PoolAdminNFT.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/agreements/gdav1/PoolMemberNFT.sol b/packages/ethereum-contracts/contracts/agreements/gdav1/PoolMemberNFT.sol index 06ee1cb997..2387806555 100644 --- a/packages/ethereum-contracts/contracts/agreements/gdav1/PoolMemberNFT.sol +++ b/packages/ethereum-contracts/contracts/agreements/gdav1/PoolMemberNFT.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/agreements/gdav1/PoolNFTBase.sol b/packages/ethereum-contracts/contracts/agreements/gdav1/PoolNFTBase.sol index c0689ded5a..c0a061103c 100644 --- a/packages/ethereum-contracts/contracts/agreements/gdav1/PoolNFTBase.sol +++ b/packages/ethereum-contracts/contracts/agreements/gdav1/PoolNFTBase.sol @@ -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 diff --git a/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPool.sol b/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPool.sol index d0b7e912b7..7c273e9ded 100644 --- a/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPool.sol +++ b/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPool.sol @@ -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 diff --git a/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPoolDeployerLibrary.sol b/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPoolDeployerLibrary.sol index 4a4c7d4842..a54019225f 100644 --- a/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPoolDeployerLibrary.sol +++ b/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPoolDeployerLibrary.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPoolPlaceholder.sol b/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPoolPlaceholder.sol index 7879629324..491492765b 100644 --- a/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPoolPlaceholder.sol +++ b/packages/ethereum-contracts/contracts/agreements/gdav1/SuperfluidPoolPlaceholder.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/gov/SuperfluidGovernanceBase.sol b/packages/ethereum-contracts/contracts/gov/SuperfluidGovernanceBase.sol index 29d7dfcf24..02d8beb2fd 100644 --- a/packages/ethereum-contracts/contracts/gov/SuperfluidGovernanceBase.sol +++ b/packages/ethereum-contracts/contracts/gov/SuperfluidGovernanceBase.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, diff --git a/packages/ethereum-contracts/contracts/gov/SuperfluidGovernanceII.sol b/packages/ethereum-contracts/contracts/gov/SuperfluidGovernanceII.sol index 664a1148c3..541c24254d 100644 --- a/packages/ethereum-contracts/contracts/gov/SuperfluidGovernanceII.sol +++ b/packages/ethereum-contracts/contracts/gov/SuperfluidGovernanceII.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/libs/BaseRelayRecipient.sol b/packages/ethereum-contracts/contracts/libs/BaseRelayRecipient.sol index ba6489bc87..8f86ba53c9 100644 --- a/packages/ethereum-contracts/contracts/libs/BaseRelayRecipient.sol +++ b/packages/ethereum-contracts/contracts/libs/BaseRelayRecipient.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/libs/CallUtils.sol b/packages/ethereum-contracts/contracts/libs/CallUtils.sol index 6c85a4cedf..91392b0038 100644 --- a/packages/ethereum-contracts/contracts/libs/CallUtils.sol +++ b/packages/ethereum-contracts/contracts/libs/CallUtils.sol @@ -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 diff --git a/packages/ethereum-contracts/contracts/libs/ERC1820RegistryCompiled.sol b/packages/ethereum-contracts/contracts/libs/ERC1820RegistryCompiled.sol index 0cd3dee8c0..fa245fa4f4 100644 --- a/packages/ethereum-contracts/contracts/libs/ERC1820RegistryCompiled.sol +++ b/packages/ethereum-contracts/contracts/libs/ERC1820RegistryCompiled.sol @@ -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 { diff --git a/packages/ethereum-contracts/contracts/libs/ERC777Helper.sol b/packages/ethereum-contracts/contracts/libs/ERC777Helper.sol index 2533d0d428..1842629981 100644 --- a/packages/ethereum-contracts/contracts/libs/ERC777Helper.sol +++ b/packages/ethereum-contracts/contracts/libs/ERC777Helper.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/libs/FixedSizeData.sol b/packages/ethereum-contracts/contracts/libs/FixedSizeData.sol index 55442882e6..93d847cc34 100644 --- a/packages/ethereum-contracts/contracts/libs/FixedSizeData.sol +++ b/packages/ethereum-contracts/contracts/libs/FixedSizeData.sol @@ -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 diff --git a/packages/ethereum-contracts/contracts/libs/SafeGasLibrary.sol b/packages/ethereum-contracts/contracts/libs/SafeGasLibrary.sol index 211e8fb06a..c16654bb1e 100644 --- a/packages/ethereum-contracts/contracts/libs/SafeGasLibrary.sol +++ b/packages/ethereum-contracts/contracts/libs/SafeGasLibrary.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; /// @title SafeGasLibrary /// @author Superfluid diff --git a/packages/ethereum-contracts/contracts/libs/SlotsBitmapLibrary.sol b/packages/ethereum-contracts/contracts/libs/SlotsBitmapLibrary.sol index 824e6e1929..3322b7056e 100644 --- a/packages/ethereum-contracts/contracts/libs/SlotsBitmapLibrary.sol +++ b/packages/ethereum-contracts/contracts/libs/SlotsBitmapLibrary.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/libs/SolvencyHelperLibrary.sol b/packages/ethereum-contracts/contracts/libs/SolvencyHelperLibrary.sol index 3ea991d819..765215cb41 100644 --- a/packages/ethereum-contracts/contracts/libs/SolvencyHelperLibrary.sol +++ b/packages/ethereum-contracts/contracts/libs/SolvencyHelperLibrary.sol @@ -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) diff --git a/packages/ethereum-contracts/contracts/mocks/AgreementMock.sol b/packages/ethereum-contracts/contracts/mocks/AgreementMock.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/AgreementMock.sol rename to packages/ethereum-contracts/contracts/mocks/AgreementMock.t.sol index e0a2b342ad..bcfac48017 100644 --- a/packages/ethereum-contracts/contracts/mocks/AgreementMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/AgreementMock.t.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/mocks/CFAAppMocks.sol b/packages/ethereum-contracts/contracts/mocks/CFAAppMocks.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/CFAAppMocks.sol rename to packages/ethereum-contracts/contracts/mocks/CFAAppMocks.t.sol index a3e0fca7e0..ef7a92ce30 100644 --- a/packages/ethereum-contracts/contracts/mocks/CFAAppMocks.sol +++ b/packages/ethereum-contracts/contracts/mocks/CFAAppMocks.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, diff --git a/packages/ethereum-contracts/contracts/mocks/CFALibraryMock.sol b/packages/ethereum-contracts/contracts/mocks/CFALibraryMock.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/CFALibraryMock.sol rename to packages/ethereum-contracts/contracts/mocks/CFALibraryMock.t.sol index be508cb8a8..3dfdf0b466 100644 --- a/packages/ethereum-contracts/contracts/mocks/CFALibraryMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/CFALibraryMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, ISuperfluidToken, ISuperToken, IConstantFlowAgreementV1 diff --git a/packages/ethereum-contracts/contracts/mocks/CallUtilsMock.sol b/packages/ethereum-contracts/contracts/mocks/CallUtilsMock.t.sol similarity index 98% rename from packages/ethereum-contracts/contracts/mocks/CallUtilsMock.sol rename to packages/ethereum-contracts/contracts/mocks/CallUtilsMock.t.sol index e475a85dd2..59c8dde78d 100644 --- a/packages/ethereum-contracts/contracts/mocks/CallUtilsMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/CallUtilsMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { CallUtils } from "../libs/CallUtils.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/CallUtilsTester.sol b/packages/ethereum-contracts/contracts/mocks/CallUtilsTester.t.sol similarity index 95% rename from packages/ethereum-contracts/contracts/mocks/CallUtilsTester.sol rename to packages/ethereum-contracts/contracts/mocks/CallUtilsTester.t.sol index afb8831b84..87e56d8bf7 100644 --- a/packages/ethereum-contracts/contracts/mocks/CallUtilsTester.sol +++ b/packages/ethereum-contracts/contracts/mocks/CallUtilsTester.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { CallUtils } from "../libs/CallUtils.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/CrossStreamSuperApp.sol b/packages/ethereum-contracts/contracts/mocks/CrossStreamSuperApp.sol deleted file mode 100644 index 4166cb4cf2..0000000000 --- a/packages/ethereum-contracts/contracts/mocks/CrossStreamSuperApp.sol +++ /dev/null @@ -1,47 +0,0 @@ -// SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; - -import { ISuperfluid, ISuperToken } from "../interfaces/superfluid/ISuperfluid.sol"; -import { CFASuperAppBase } from "../apps/CFASuperAppBase.sol"; -import { SuperTokenV1Library } from "../apps/SuperTokenV1Library.sol"; - -using SuperTokenV1Library for ISuperToken; - -/// @title CrossStreamSuperApp -/// @author Superfluid -/// @dev A super app used for testing "cross-stream" flows in callbacks -/// and its behavior surrounding the internal protocol accounting. -/// That is, two senders sending a flow to the super app -contract CrossStreamSuperApp is CFASuperAppBase { - address public flowRecipient; - address public prevSender; - int96 public prevFlowRate; - - constructor(ISuperfluid host_, address z_) CFASuperAppBase(host_) { - selfRegister(true, true, true); - flowRecipient = z_; - } - - function onFlowCreated(ISuperToken superToken, address sender, bytes calldata ctx) - internal - override - returns (bytes memory newCtx) - { - newCtx = ctx; - - // get incoming stream - int96 inFlowRate = superToken.getFlowRate(sender, address(this)); - - if (prevSender == address(0)) { - // first flow to super app creates a flow - newCtx = superToken.createFlowWithCtx(flowRecipient, inFlowRate, newCtx); - } else { - // subsequent flows to super app updates and deletes the flow - newCtx = superToken.updateFlowWithCtx(flowRecipient, inFlowRate, newCtx); - newCtx = superToken.deleteFlowWithCtx(prevSender, address(this), newCtx); - } - - prevSender = sender; - prevFlowRate = inFlowRate; - } -} diff --git a/packages/ethereum-contracts/contracts/mocks/CustomSuperTokenMock.sol b/packages/ethereum-contracts/contracts/mocks/CustomSuperTokenMock.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/CustomSuperTokenMock.sol rename to packages/ethereum-contracts/contracts/mocks/CustomSuperTokenMock.t.sol index fa9c503727..3cf3a3daf6 100644 --- a/packages/ethereum-contracts/contracts/mocks/CustomSuperTokenMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/CustomSuperTokenMock.t.sol @@ -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"; diff --git a/packages/ethereum-contracts/contracts/mocks/ERC777SenderRecipientMock.sol b/packages/ethereum-contracts/contracts/mocks/ERC777SenderRecipientMock.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/ERC777SenderRecipientMock.sol rename to packages/ethereum-contracts/contracts/mocks/ERC777SenderRecipientMock.t.sol index 15b2655374..f6ca024fce 100644 --- a/packages/ethereum-contracts/contracts/mocks/ERC777SenderRecipientMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/ERC777SenderRecipientMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { Context } from "@openzeppelin/contracts/utils/Context.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/FakeSuperfluidMock.sol b/packages/ethereum-contracts/contracts/mocks/FakeSuperfluidMock.t.sol similarity index 95% rename from packages/ethereum-contracts/contracts/mocks/FakeSuperfluidMock.sol rename to packages/ethereum-contracts/contracts/mocks/FakeSuperfluidMock.t.sol index 115e1a09b7..53df7296a3 100644 --- a/packages/ethereum-contracts/contracts/mocks/FakeSuperfluidMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/FakeSuperfluidMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { CallUtils } from "../libs/CallUtils.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/ForwarderMock.sol b/packages/ethereum-contracts/contracts/mocks/ForwarderMock.t.sol similarity index 97% rename from packages/ethereum-contracts/contracts/mocks/ForwarderMock.sol rename to packages/ethereum-contracts/contracts/mocks/ForwarderMock.t.sol index 394bde0ba9..f03c442429 100644 --- a/packages/ethereum-contracts/contracts/mocks/ForwarderMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/ForwarderMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { CallUtils } from "../libs/CallUtils.sol"; import { IRelayRecipient } from "../interfaces/utils/IRelayRecipient.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/IDASuperAppTester.sol b/packages/ethereum-contracts/contracts/mocks/IDASuperAppTester.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/IDASuperAppTester.sol rename to packages/ethereum-contracts/contracts/mocks/IDASuperAppTester.t.sol index a1e73c614f..ac9d2a5488 100644 --- a/packages/ethereum-contracts/contracts/mocks/IDASuperAppTester.sol +++ b/packages/ethereum-contracts/contracts/mocks/IDASuperAppTester.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, diff --git a/packages/ethereum-contracts/contracts/mocks/IDAv1LibraryMock.sol b/packages/ethereum-contracts/contracts/mocks/IDAv1LibraryMock.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/IDAv1LibraryMock.sol rename to packages/ethereum-contracts/contracts/mocks/IDAv1LibraryMock.t.sol index d17ff9a727..938d2fb327 100644 --- a/packages/ethereum-contracts/contracts/mocks/IDAv1LibraryMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/IDAv1LibraryMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; pragma experimental ABIEncoderV2; import {ISuperfluid, ISuperfluidToken, ISuperToken} from "../interfaces/superfluid/ISuperfluid.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/MockSmartWallet.sol b/packages/ethereum-contracts/contracts/mocks/MockSmartWallet.t.sol similarity index 94% rename from packages/ethereum-contracts/contracts/mocks/MockSmartWallet.sol rename to packages/ethereum-contracts/contracts/mocks/MockSmartWallet.t.sol index fdb6fe9329..1edf9e5833 100644 --- a/packages/ethereum-contracts/contracts/mocks/MockSmartWallet.sol +++ b/packages/ethereum-contracts/contracts/mocks/MockSmartWallet.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperToken, IERC20 } from "../interfaces/superfluid/ISuperfluid.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/MultiFlowTesterApp.sol b/packages/ethereum-contracts/contracts/mocks/MultiFlowTesterApp.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/MultiFlowTesterApp.sol rename to packages/ethereum-contracts/contracts/mocks/MultiFlowTesterApp.t.sol index 900bf63fad..53476772f7 100644 --- a/packages/ethereum-contracts/contracts/mocks/MultiFlowTesterApp.sol +++ b/packages/ethereum-contracts/contracts/mocks/MultiFlowTesterApp.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, diff --git a/packages/ethereum-contracts/contracts/mocks/StreamRedirector.sol b/packages/ethereum-contracts/contracts/mocks/StreamRedirector.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/StreamRedirector.sol rename to packages/ethereum-contracts/contracts/mocks/StreamRedirector.t.sol index 36d4fb918d..12c3bcbad0 100644 --- a/packages/ethereum-contracts/contracts/mocks/StreamRedirector.sol +++ b/packages/ethereum-contracts/contracts/mocks/StreamRedirector.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, ISuperToken, SuperAppBase, ISuperApp, SuperAppDefinitions, IConstantFlowAgreementV1, ISuperAgreement diff --git a/packages/ethereum-contracts/contracts/mocks/SuperAppMocks.sol b/packages/ethereum-contracts/contracts/mocks/SuperAppMocks.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/SuperAppMocks.sol rename to packages/ethereum-contracts/contracts/mocks/SuperAppMocks.t.sol index 35d0f439b8..1781a599d2 100644 --- a/packages/ethereum-contracts/contracts/mocks/SuperAppMocks.sol +++ b/packages/ethereum-contracts/contracts/mocks/SuperAppMocks.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, @@ -8,7 +8,7 @@ import { ISuperAgreement, SuperAppDefinitions } from "../superfluid/Superfluid.sol"; -import { AgreementMock } from "./AgreementMock.sol"; +import { AgreementMock } from "./AgreementMock.t.sol"; contract SuperAppMockAux { diff --git a/packages/ethereum-contracts/contracts/mocks/SuperTokenFactoryMock.sol b/packages/ethereum-contracts/contracts/mocks/SuperTokenFactoryMock.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/SuperTokenFactoryMock.sol rename to packages/ethereum-contracts/contracts/mocks/SuperTokenFactoryMock.t.sol index b8e079e074..824d006bd6 100644 --- a/packages/ethereum-contracts/contracts/mocks/SuperTokenFactoryMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/SuperTokenFactoryMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, diff --git a/packages/ethereum-contracts/contracts/mocks/SuperTokenLibraryV1Mock.sol b/packages/ethereum-contracts/contracts/mocks/SuperTokenLibraryV1Mock.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/SuperTokenLibraryV1Mock.sol rename to packages/ethereum-contracts/contracts/mocks/SuperTokenLibraryV1Mock.t.sol index 3ee4869538..663034e984 100644 --- a/packages/ethereum-contracts/contracts/mocks/SuperTokenLibraryV1Mock.sol +++ b/packages/ethereum-contracts/contracts/mocks/SuperTokenLibraryV1Mock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, ISuperToken } from "../interfaces/superfluid/ISuperfluid.sol"; import { SuperAppDefinitions } from "../interfaces/superfluid/ISuperfluid.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/SuperTokenMock.sol b/packages/ethereum-contracts/contracts/mocks/SuperTokenMock.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/SuperTokenMock.sol rename to packages/ethereum-contracts/contracts/mocks/SuperTokenMock.t.sol index 42107a49d6..5863890cdb 100644 --- a/packages/ethereum-contracts/contracts/mocks/SuperTokenMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/SuperTokenMock.t.sol @@ -1,11 +1,12 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; + +import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { ISuperfluid, IERC20, IConstantInflowNFT, IConstantOutflowNFT, IPoolAdminNFT, IPoolMemberNFT } from "../interfaces/superfluid/ISuperfluid.sol"; import { UUPSProxiable } from "../upgradability/UUPSProxiable.sol"; -import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import { ERC777Helper } from "../libs/ERC777Helper.sol"; import { SuperToken } from "../superfluid/SuperToken.sol"; import { SuperfluidToken } from "../superfluid/SuperfluidToken.sol"; @@ -17,7 +18,7 @@ contract SuperTokenStorageLayoutTester is SuperToken { IConstantInflowNFT constantInflowNFTProxy, IPoolAdminNFT poolAdminNFTProxy, IPoolMemberNFT poolMemberNFTProxy - ) SuperToken(host, constantOutflowNFTProxy, constantInflowNFTProxy, poolAdminNFTProxy, poolMemberNFTProxy) + ) SuperToken(host, constantOutflowNFTProxy, constantInflowNFTProxy, poolAdminNFTProxy, poolMemberNFTProxy) // solhint-disable-next-line no-empty-blocks { } diff --git a/packages/ethereum-contracts/contracts/mocks/SuperfluidDestructorMock.sol b/packages/ethereum-contracts/contracts/mocks/SuperfluidDestructorMock.t.sol similarity index 91% rename from packages/ethereum-contracts/contracts/mocks/SuperfluidDestructorMock.sol rename to packages/ethereum-contracts/contracts/mocks/SuperfluidDestructorMock.t.sol index fb2f3dbe8f..33252f20e8 100644 --- a/packages/ethereum-contracts/contracts/mocks/SuperfluidDestructorMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/SuperfluidDestructorMock.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: AGPLv3 // solhint-disable -pragma solidity 0.8.23; +pragma solidity ^0.8.23; contract SuperfluidDestructorMock { diff --git a/packages/ethereum-contracts/contracts/mocks/SuperfluidGovernanceIIMock.sol b/packages/ethereum-contracts/contracts/mocks/SuperfluidGovernanceIIMock.t.sol similarity index 96% rename from packages/ethereum-contracts/contracts/mocks/SuperfluidGovernanceIIMock.sol rename to packages/ethereum-contracts/contracts/mocks/SuperfluidGovernanceIIMock.t.sol index 1736a5af0d..7cce278d75 100644 --- a/packages/ethereum-contracts/contracts/mocks/SuperfluidGovernanceIIMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/SuperfluidGovernanceIIMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { SuperfluidGovernanceII } from "../gov/SuperfluidGovernanceII.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/SuperfluidMock.sol b/packages/ethereum-contracts/contracts/mocks/SuperfluidMock.t.sol similarity index 99% rename from packages/ethereum-contracts/contracts/mocks/SuperfluidMock.sol rename to packages/ethereum-contracts/contracts/mocks/SuperfluidMock.t.sol index d516c7c338..0b9e2a9d91 100644 --- a/packages/ethereum-contracts/contracts/mocks/SuperfluidMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/SuperfluidMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { Superfluid, diff --git a/packages/ethereum-contracts/contracts/mocks/UUPSProxiableMock.sol b/packages/ethereum-contracts/contracts/mocks/UUPSProxiableMock.t.sol similarity index 96% rename from packages/ethereum-contracts/contracts/mocks/UUPSProxiableMock.sol rename to packages/ethereum-contracts/contracts/mocks/UUPSProxiableMock.t.sol index 2fc6699595..0a4b8af744 100644 --- a/packages/ethereum-contracts/contracts/mocks/UUPSProxiableMock.sol +++ b/packages/ethereum-contracts/contracts/mocks/UUPSProxiableMock.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { UUPSProxiable } from "../upgradability/UUPSProxiable.sol"; diff --git a/packages/ethereum-contracts/contracts/superfluid/ConstantInflowNFT.sol b/packages/ethereum-contracts/contracts/superfluid/ConstantInflowNFT.sol index 98304fd782..44bbd35627 100644 --- a/packages/ethereum-contracts/contracts/superfluid/ConstantInflowNFT.sol +++ b/packages/ethereum-contracts/contracts/superfluid/ConstantInflowNFT.sol @@ -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 { IGeneralDistributionAgreementV1 } from "../interfaces/agreements/gdav1/IGeneralDistributionAgreementV1.sol"; diff --git a/packages/ethereum-contracts/contracts/superfluid/ConstantOutflowNFT.sol b/packages/ethereum-contracts/contracts/superfluid/ConstantOutflowNFT.sol index 534855ace6..98c5592dff 100644 --- a/packages/ethereum-contracts/contracts/superfluid/ConstantOutflowNFT.sol +++ b/packages/ethereum-contracts/contracts/superfluid/ConstantOutflowNFT.sol @@ -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 { IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import { ISuperfluidToken } from "../interfaces/superfluid/ISuperfluidToken.sol"; diff --git a/packages/ethereum-contracts/contracts/superfluid/FlowNFTBase.sol b/packages/ethereum-contracts/contracts/superfluid/FlowNFTBase.sol index cb9c91a927..3629dfa7f1 100644 --- a/packages/ethereum-contracts/contracts/superfluid/FlowNFTBase.sol +++ b/packages/ethereum-contracts/contracts/superfluid/FlowNFTBase.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; // solhint-disable max-states-count // Notes: We use reserved slots for upgradable contracts. diff --git a/packages/ethereum-contracts/contracts/superfluid/FullUpgradableSuperTokenProxy.sol b/packages/ethereum-contracts/contracts/superfluid/FullUpgradableSuperTokenProxy.sol index b7e327a880..5870bd8174 100644 --- a/packages/ethereum-contracts/contracts/superfluid/FullUpgradableSuperTokenProxy.sol +++ b/packages/ethereum-contracts/contracts/superfluid/FullUpgradableSuperTokenProxy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperTokenFactory } from "../interfaces/superfluid/ISuperTokenFactory.sol"; import { Proxy } from "@openzeppelin/contracts/proxy/Proxy.sol"; diff --git a/packages/ethereum-contracts/contracts/superfluid/SuperToken.sol b/packages/ethereum-contracts/contracts/superfluid/SuperToken.sol index b2eeee0717..f6ac26f51f 100644 --- a/packages/ethereum-contracts/contracts/superfluid/SuperToken.sol +++ b/packages/ethereum-contracts/contracts/superfluid/SuperToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; // solhint-disable max-states-count // Notes: SuperToken is rich with states, disable this default rule here. diff --git a/packages/ethereum-contracts/contracts/superfluid/SuperTokenFactory.sol b/packages/ethereum-contracts/contracts/superfluid/SuperTokenFactory.sol index 67bd08a06e..fe9db038e0 100644 --- a/packages/ethereum-contracts/contracts/superfluid/SuperTokenFactory.sol +++ b/packages/ethereum-contracts/contracts/superfluid/SuperTokenFactory.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/packages/ethereum-contracts/contracts/superfluid/Superfluid.sol b/packages/ethereum-contracts/contracts/superfluid/Superfluid.sol index a4fbedf23d..02867ff032 100644 --- a/packages/ethereum-contracts/contracts/superfluid/Superfluid.sol +++ b/packages/ethereum-contracts/contracts/superfluid/Superfluid.sol @@ -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"; import { UUPSProxiable } from "../upgradability/UUPSProxiable.sol"; diff --git a/packages/ethereum-contracts/contracts/superfluid/SuperfluidToken.sol b/packages/ethereum-contracts/contracts/superfluid/SuperfluidToken.sol index 83ffc62593..cb5218676e 100644 --- a/packages/ethereum-contracts/contracts/superfluid/SuperfluidToken.sol +++ b/packages/ethereum-contracts/contracts/superfluid/SuperfluidToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol"; diff --git a/packages/ethereum-contracts/contracts/tokens/PureSuperToken.sol b/packages/ethereum-contracts/contracts/tokens/PureSuperToken.sol index 11681904c5..0deeb3dcff 100644 --- a/packages/ethereum-contracts/contracts/tokens/PureSuperToken.sol +++ b/packages/ethereum-contracts/contracts/tokens/PureSuperToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperToken, diff --git a/packages/ethereum-contracts/contracts/tokens/SETH.sol b/packages/ethereum-contracts/contracts/tokens/SETH.sol index c8eec65449..7b6532cf14 100644 --- a/packages/ethereum-contracts/contracts/tokens/SETH.sol +++ b/packages/ethereum-contracts/contracts/tokens/SETH.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperToken, diff --git a/packages/ethereum-contracts/contracts/upgradability/BeaconProxiable.sol b/packages/ethereum-contracts/contracts/upgradability/BeaconProxiable.sol index a8339a6b9b..43db85e730 100644 --- a/packages/ethereum-contracts/contracts/upgradability/BeaconProxiable.sol +++ b/packages/ethereum-contracts/contracts/upgradability/BeaconProxiable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; diff --git a/packages/ethereum-contracts/contracts/upgradability/SuperfluidUpgradeableBeacon.sol b/packages/ethereum-contracts/contracts/upgradability/SuperfluidUpgradeableBeacon.sol index ba23d1aef2..3dc1bbc9f6 100644 --- a/packages/ethereum-contracts/contracts/upgradability/SuperfluidUpgradeableBeacon.sol +++ b/packages/ethereum-contracts/contracts/upgradability/SuperfluidUpgradeableBeacon.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { UpgradeableBeacon diff --git a/packages/ethereum-contracts/contracts/upgradability/UUPSProxiable.sol b/packages/ethereum-contracts/contracts/upgradability/UUPSProxiable.sol index bb1a37f46f..13f5fc9036 100644 --- a/packages/ethereum-contracts/contracts/upgradability/UUPSProxiable.sol +++ b/packages/ethereum-contracts/contracts/upgradability/UUPSProxiable.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { UUPSUtils } from "./UUPSUtils.sol"; import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol"; diff --git a/packages/ethereum-contracts/contracts/upgradability/UUPSProxy.sol b/packages/ethereum-contracts/contracts/upgradability/UUPSProxy.sol index eeac91eae0..c871838a61 100644 --- a/packages/ethereum-contracts/contracts/upgradability/UUPSProxy.sol +++ b/packages/ethereum-contracts/contracts/upgradability/UUPSProxy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { UUPSUtils } from "./UUPSUtils.sol"; import { Proxy } from "@openzeppelin/contracts/proxy/Proxy.sol"; diff --git a/packages/ethereum-contracts/contracts/upgradability/UUPSUtils.sol b/packages/ethereum-contracts/contracts/upgradability/UUPSUtils.sol index dcdedf669f..224a44009f 100644 --- a/packages/ethereum-contracts/contracts/upgradability/UUPSUtils.sol +++ b/packages/ethereum-contracts/contracts/upgradability/UUPSUtils.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; /** * @title UUPS (Universal Upgradeable Proxy Standard) Shared Library diff --git a/packages/ethereum-contracts/contracts/utils/BatchLiquidator.sol b/packages/ethereum-contracts/contracts/utils/BatchLiquidator.sol index bca8ee8d51..d8d2ccd01e 100644 --- a/packages/ethereum-contracts/contracts/utils/BatchLiquidator.sol +++ b/packages/ethereum-contracts/contracts/utils/BatchLiquidator.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, ISuperAgreement, ISuperToken, ISuperfluidPool, diff --git a/packages/ethereum-contracts/contracts/utils/CFAv1Forwarder.sol b/packages/ethereum-contracts/contracts/utils/CFAv1Forwarder.sol index 89c4408ecc..89f9a17c08 100644 --- a/packages/ethereum-contracts/contracts/utils/CFAv1Forwarder.sol +++ b/packages/ethereum-contracts/contracts/utils/CFAv1Forwarder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, diff --git a/packages/ethereum-contracts/contracts/utils/DMZForwarder.sol b/packages/ethereum-contracts/contracts/utils/DMZForwarder.sol index 5c36c8ea7e..caaa47497d 100644 --- a/packages/ethereum-contracts/contracts/utils/DMZForwarder.sol +++ b/packages/ethereum-contracts/contracts/utils/DMZForwarder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; diff --git a/packages/ethereum-contracts/contracts/utils/ForwarderBase.sol b/packages/ethereum-contracts/contracts/utils/ForwarderBase.sol index b30d4bde90..7097873328 100644 --- a/packages/ethereum-contracts/contracts/utils/ForwarderBase.sol +++ b/packages/ethereum-contracts/contracts/utils/ForwarderBase.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { BatchOperation, ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol"; import { CallUtils } from "../libs/CallUtils.sol"; diff --git a/packages/ethereum-contracts/contracts/utils/GDAv1Forwarder.sol b/packages/ethereum-contracts/contracts/utils/GDAv1Forwarder.sol index 2673099504..bc7af3235a 100644 --- a/packages/ethereum-contracts/contracts/utils/GDAv1Forwarder.sol +++ b/packages/ethereum-contracts/contracts/utils/GDAv1Forwarder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, ISuperfluidToken } from "../interfaces/superfluid/ISuperfluid.sol"; import { ISuperfluidPool } from "../agreements/gdav1/SuperfluidPool.sol"; diff --git a/packages/ethereum-contracts/contracts/utils/IDAv1Forwarder.sol b/packages/ethereum-contracts/contracts/utils/IDAv1Forwarder.sol index 8bd109fd37..adcc812400 100644 --- a/packages/ethereum-contracts/contracts/utils/IDAv1Forwarder.sol +++ b/packages/ethereum-contracts/contracts/utils/IDAv1Forwarder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, ISuperfluidToken } from "../interfaces/superfluid/ISuperfluid.sol"; import { IInstantDistributionAgreementV1 } from "../interfaces/agreements/IInstantDistributionAgreementV1.sol"; diff --git a/packages/ethereum-contracts/contracts/utils/MacroForwarder.sol b/packages/ethereum-contracts/contracts/utils/MacroForwarder.sol index 8f601e999e..c68a323183 100644 --- a/packages/ethereum-contracts/contracts/utils/MacroForwarder.sol +++ b/packages/ethereum-contracts/contracts/utils/MacroForwarder.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IUserDefinedMacro } from "../interfaces/utils/IUserDefinedMacro.sol"; import { ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol"; diff --git a/packages/ethereum-contracts/contracts/utils/SuperUpgrader.sol b/packages/ethereum-contracts/contracts/utils/SuperUpgrader.sol index a83570805b..ba410beb21 100644 --- a/packages/ethereum-contracts/contracts/utils/SuperUpgrader.sol +++ b/packages/ethereum-contracts/contracts/utils/SuperUpgrader.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { AccessControlEnumerable } from "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; diff --git a/packages/ethereum-contracts/contracts/utils/TOGA.sol b/packages/ethereum-contracts/contracts/utils/TOGA.sol index fb0d5aae56..30dcf941c5 100644 --- a/packages/ethereum-contracts/contracts/utils/TOGA.sol +++ b/packages/ethereum-contracts/contracts/utils/TOGA.sol @@ -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"; diff --git a/packages/ethereum-contracts/foundry.toml b/packages/ethereum-contracts/foundry.toml index 052a997e02..bfc0278b1c 100644 --- a/packages/ethereum-contracts/foundry.toml +++ b/packages/ethereum-contracts/foundry.toml @@ -2,7 +2,7 @@ root = '../..' src = 'packages/ethereum-contracts/contracts' test = 'packages/ethereum-contracts/test/foundry' -solc_version = "0.8.23" +solc_version = "0.8.26" #deny_warnings = true ignored_error_codes = [ 1699 # assembly { selfdestruct } in contracts/mocks/SuperfluidDestructorMock.sol @@ -32,6 +32,7 @@ wrap_comments = true [profile.ci] offline = true +verbosity = 2 [profile.ci.fuzz] runs = 1000 diff --git a/packages/ethereum-contracts/hardhat.config.ts b/packages/ethereum-contracts/hardhat.config.ts index d1453421b5..91301ba2d1 100644 --- a/packages/ethereum-contracts/hardhat.config.ts +++ b/packages/ethereum-contracts/hardhat.config.ts @@ -93,7 +93,7 @@ function createNetworkConfig( const config: HardhatUserConfig = { solidity: { - version: "0.8.23", + version: "0.8.26", settings: { optimizer: { enabled: true, diff --git a/packages/ethereum-contracts/package.json b/packages/ethereum-contracts/package.json index 52e4ece8e2..12ec29657d 100644 --- a/packages/ethereum-contracts/package.json +++ b/packages/ethereum-contracts/package.json @@ -60,7 +60,7 @@ "posttest": "yarn testenv:stop", "test-coverage": "run-s test-coverage:*", "test-coverage:hardhat": "yarn run-hardhat coverage --testfiles testsuites/all-contracts.js --solcoverjs ./.solcover.js", - "test-coverage:foundry": "yarn run-foundry coverage --hardhat --report lcov", + "test-coverage:foundry": "yarn run-foundry coverage --gas-limit 999999999999 --report lcov", "test-slither": "tasks/test-slither.sh", "lint": "run-s lint:*", "lint:sol": "solhint -w 0 `find contracts -name *.sol` && echo '✔ Your .sol files look good.'", diff --git a/packages/ethereum-contracts/test/contracts/agreements/AgreementHelper.ts b/packages/ethereum-contracts/test/contracts/agreements/AgreementHelper.ts index e29ae8b7b2..05bdd5598f 100644 --- a/packages/ethereum-contracts/test/contracts/agreements/AgreementHelper.ts +++ b/packages/ethereum-contracts/test/contracts/agreements/AgreementHelper.ts @@ -4,7 +4,7 @@ import {ethers} from "hardhat"; import IConstantFlowAgreementV1Artifact from "../../../build/hardhat/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol/IConstantFlowAgreementV1.json"; import IInstantDistributionAgreementV1Artifact from "../../../build/hardhat/contracts/interfaces/agreements/IInstantDistributionAgreementV1.sol/IInstantDistributionAgreementV1.json"; -import SuperfluidMockArtifact from "../../../build/hardhat/contracts/mocks/SuperfluidMock.sol/SuperfluidMock.json"; +import SuperfluidMockArtifact from "../../../build/hardhat/contracts/mocks/SuperfluidMock.t.sol/SuperfluidMock.json"; import TestEnvironment from "../../TestEnvironment"; import { diff --git a/packages/ethereum-contracts/contracts/mocks/IStorageLayoutBase.sol b/packages/ethereum-contracts/test/foundry/StorageLayoutTestBase.t.sol similarity index 55% rename from packages/ethereum-contracts/contracts/mocks/IStorageLayoutBase.sol rename to packages/ethereum-contracts/test/foundry/StorageLayoutTestBase.t.sol index 0ba2441109..5c4cffb488 100644 --- a/packages/ethereum-contracts/contracts/mocks/IStorageLayoutBase.sol +++ b/packages/ethereum-contracts/test/foundry/StorageLayoutTestBase.t.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; -interface IStorageLayoutBase { +abstract contract StorageLayoutTestBase { error STORAGE_LOCATION_CHANGED(string _name); -} \ No newline at end of file +} diff --git a/packages/ethereum-contracts/test/foundry/SuperfluidFrameworkDeployer.t.sol b/packages/ethereum-contracts/test/foundry/SuperfluidFrameworkDeployer.t.sol index fe5ebf060f..c8b62eeb5a 100644 --- a/packages/ethereum-contracts/test/foundry/SuperfluidFrameworkDeployer.t.sol +++ b/packages/ethereum-contracts/test/foundry/SuperfluidFrameworkDeployer.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { FoundrySuperfluidTester } from "./FoundrySuperfluidTester.sol"; import { IPureSuperToken, ISETH, TestToken, SuperToken } from "../../contracts/utils/SuperfluidFrameworkDeployer.sol"; diff --git a/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.ACL.t.sol b/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.ACL.t.sol index 5f7cc18f68..2d8256baa9 100644 --- a/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.ACL.t.sol +++ b/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.ACL.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperToken, SuperToken } from "../../../contracts/superfluid/SuperToken.sol"; import { IConstantFlowAgreementV1 } from "../../../contracts/interfaces/agreements/IConstantFlowAgreementV1.sol"; diff --git a/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.prop.t.sol b/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.prop.t.sol index 50a77dd90d..9cc190359c 100644 --- a/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.prop.t.sol +++ b/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.prop.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "forge-std/Test.sol"; diff --git a/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.t.sol b/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.t.sol index 77ad32e71b..4221a66583 100644 --- a/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.t.sol +++ b/packages/ethereum-contracts/test/foundry/agreements/ConstantFlowAgreementV1.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { console } from "forge-std/Test.sol"; import { FoundrySuperfluidTester, SuperTokenV1Library } from "../FoundrySuperfluidTester.sol"; diff --git a/packages/ethereum-contracts/test/foundry/agreements/InstantDistributionAgreementV1.t.sol b/packages/ethereum-contracts/test/foundry/agreements/InstantDistributionAgreementV1.t.sol index ef7a75dc6b..ab58a6dab8 100644 --- a/packages/ethereum-contracts/test/foundry/agreements/InstantDistributionAgreementV1.t.sol +++ b/packages/ethereum-contracts/test/foundry/agreements/InstantDistributionAgreementV1.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "../FoundrySuperfluidTester.sol"; import { ISuperToken } from "../../../contracts/superfluid/SuperToken.sol"; diff --git a/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol b/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol index 6a91b1e0b4..c7e96329bb 100644 --- a/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol +++ b/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreement.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import { SafeCast } from "@openzeppelin/contracts/utils/math/SafeCast.sol"; @@ -14,13 +14,13 @@ import { SuperfluidUpgradeableBeacon } from "../../../../contracts/upgradability import { ISuperToken, SuperToken } from "../../../../contracts/superfluid/SuperToken.sol"; import { ISuperfluidToken } from "../../../../contracts/interfaces/superfluid/ISuperfluidToken.sol"; import { ISuperfluidPool, SuperfluidPool } from "../../../../contracts/agreements/gdav1/SuperfluidPool.sol"; -import { SuperfluidPoolStorageLayoutMock } from "../../../../contracts/mocks/SuperfluidPoolUpgradabilityMock.sol"; import { IPoolNFTBase } from "../../../../contracts/interfaces/agreements/gdav1/IPoolNFTBase.sol"; import { IPoolAdminNFT } from "../../../../contracts/interfaces/agreements/gdav1/IPoolAdminNFT.sol"; import { IPoolMemberNFT } from "../../../../contracts/interfaces/agreements/gdav1/IPoolMemberNFT.sol"; import { IFlowNFTBase } from "../../../../contracts/interfaces/superfluid/IFlowNFTBase.sol"; import { IConstantOutflowNFT } from "../../../../contracts/interfaces/superfluid/IConstantOutflowNFT.sol"; import { IConstantInflowNFT } from "../../../../contracts/interfaces/superfluid/IConstantInflowNFT.sol"; +import { SuperfluidPoolStorageLayoutMock } from "./SuperfluidPoolUpgradabilityMock.t.sol"; /// @title GeneralDistributionAgreementV1 Integration Tests /// @author Superfluid diff --git a/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreementV1.prop.t.sol b/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreementV1.prop.t.sol index d3d750f4cb..95d4b2e336 100644 --- a/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreementV1.prop.t.sol +++ b/packages/ethereum-contracts/test/foundry/agreements/gdav1/GeneralDistributionAgreementV1.prop.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "forge-std/Test.sol"; import { IBeacon } from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/SuperfluidPoolUpgradabilityMock.sol b/packages/ethereum-contracts/test/foundry/agreements/gdav1/SuperfluidPoolUpgradabilityMock.t.sol similarity index 85% rename from packages/ethereum-contracts/contracts/mocks/SuperfluidPoolUpgradabilityMock.sol rename to packages/ethereum-contracts/test/foundry/agreements/gdav1/SuperfluidPoolUpgradabilityMock.t.sol index 3e3f38c649..92f0922920 100644 --- a/packages/ethereum-contracts/contracts/mocks/SuperfluidPoolUpgradabilityMock.sol +++ b/packages/ethereum-contracts/test/foundry/agreements/gdav1/SuperfluidPoolUpgradabilityMock.t.sol @@ -1,14 +1,16 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; -import { GeneralDistributionAgreementV1 } from "../agreements/gdav1/GeneralDistributionAgreementV1.sol"; -import { SuperfluidPool } from "../agreements/gdav1/SuperfluidPool.sol"; -import { IStorageLayoutBase } from "./IStorageLayoutBase.sol"; +import { + GeneralDistributionAgreementV1 +} from "../../../../contracts/agreements/gdav1/GeneralDistributionAgreementV1.sol"; +import { SuperfluidPool } from "../../../../contracts/agreements/gdav1/SuperfluidPool.sol"; +import { StorageLayoutTestBase } from "../../StorageLayoutTestBase.t.sol"; /// @title SuperfluidPoolStorageLayoutMock /// @notice A mock SuperfluidPool contract for testing storage layout. /// @dev This contract *MUST* have the same storage layout as SuperfluidPool. -contract SuperfluidPoolStorageLayoutMock is SuperfluidPool, IStorageLayoutBase { +contract SuperfluidPoolStorageLayoutMock is SuperfluidPool, StorageLayoutTestBase { constructor(GeneralDistributionAgreementV1 gda_) SuperfluidPool(gda_) { } function validateStorageLayout() public pure { diff --git a/packages/ethereum-contracts/test/foundry/apps/CFASuperAppBase.t.sol b/packages/ethereum-contracts/test/foundry/apps/CFASuperAppBase.t.sol index 6c3c621dcc..eefa08c094 100644 --- a/packages/ethereum-contracts/test/foundry/apps/CFASuperAppBase.t.sol +++ b/packages/ethereum-contracts/test/foundry/apps/CFASuperAppBase.t.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "forge-std/console.sol"; + import "../FoundrySuperfluidTester.sol"; -import { CFASuperAppBase } from "../../../contracts/apps/CFASuperAppBase.sol"; -import { CFASuperAppBaseTester } from "../../../contracts/mocks/CFASuperAppBaseTester.sol"; + import { ISuperToken, ISuperApp, @@ -12,6 +12,9 @@ import { } from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; import { IConstantFlowAgreementV1 } from "../../../contracts/interfaces/agreements/IConstantFlowAgreementV1.sol"; import { SuperTokenV1Library } from "../../../contracts/apps/SuperTokenV1Library.sol"; +import { CFASuperAppBase } from "../../../contracts/apps/CFASuperAppBase.sol"; + +import { CFASuperAppBaseTester } from "./CFASuperAppBaseTester.t.sol"; contract CFASuperAppBaseTest is FoundrySuperfluidTester { using SuperTokenV1Library for SuperToken; diff --git a/packages/ethereum-contracts/contracts/mocks/CFASuperAppBaseTester.sol b/packages/ethereum-contracts/test/foundry/apps/CFASuperAppBaseTester.t.sol similarity index 89% rename from packages/ethereum-contracts/contracts/mocks/CFASuperAppBaseTester.sol rename to packages/ethereum-contracts/test/foundry/apps/CFASuperAppBaseTester.t.sol index 38fcb0d3df..48fbb81d27 100644 --- a/packages/ethereum-contracts/contracts/mocks/CFASuperAppBaseTester.sol +++ b/packages/ethereum-contracts/test/foundry/apps/CFASuperAppBaseTester.t.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; -import { ISuperfluid, ISuperToken } from "../interfaces/superfluid/ISuperfluid.sol"; -import { CFASuperAppBase } from "../apps/CFASuperAppBase.sol"; -import { SuperTokenV1Library } from "../apps/SuperTokenV1Library.sol"; +import { ISuperfluid, ISuperToken } from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; +import { CFASuperAppBase } from "../../../contracts/apps/CFASuperAppBase.sol"; +import { SuperTokenV1Library } from "../../../contracts/apps/SuperTokenV1Library.sol"; contract CFASuperAppBaseTester is CFASuperAppBase { using SuperTokenV1Library for ISuperToken; diff --git a/packages/ethereum-contracts/test/foundry/apps/CrossStreamSuperApp.t.sol b/packages/ethereum-contracts/test/foundry/apps/CrossStreamSuperApp.t.sol index e502bd120b..672687a1c1 100644 --- a/packages/ethereum-contracts/test/foundry/apps/CrossStreamSuperApp.t.sol +++ b/packages/ethereum-contracts/test/foundry/apps/CrossStreamSuperApp.t.sol @@ -1,7 +1,9 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; -import { CrossStreamSuperApp } from "../../../contracts/mocks/CrossStreamSuperApp.sol"; +import { ISuperfluid, ISuperToken } from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; +import { CFASuperAppBase } from "../../../contracts/apps/CFASuperAppBase.sol"; +import { SuperTokenV1Library } from "../../../contracts/apps/SuperTokenV1Library.sol"; import { SuperTokenV1Library } from "../../../contracts/apps/SuperTokenV1Library.sol"; import { ISuperToken } from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; @@ -11,6 +13,45 @@ import "forge-std/Test.sol"; using SuperTokenV1Library for ISuperToken; +/// @title CrossStreamSuperApp +/// @author Superfluid +/// @dev A super app used for testing "cross-stream" flows in callbacks +/// and its behavior surrounding the internal protocol accounting. +/// That is, two senders sending a flow to the super app +contract CrossStreamSuperApp is CFASuperAppBase { + address public flowRecipient; + address public prevSender; + int96 public prevFlowRate; + + constructor(ISuperfluid host_, address z_) CFASuperAppBase(host_) { + selfRegister(true, true, true); + flowRecipient = z_; + } + + function onFlowCreated(ISuperToken superToken, address sender, bytes calldata ctx) + internal + override + returns (bytes memory newCtx) + { + newCtx = ctx; + + // get incoming stream + int96 inFlowRate = superToken.getFlowRate(sender, address(this)); + + if (prevSender == address(0)) { + // first flow to super app creates a flow + newCtx = superToken.createFlowWithCtx(flowRecipient, inFlowRate, newCtx); + } else { + // subsequent flows to super app updates and deletes the flow + newCtx = superToken.updateFlowWithCtx(flowRecipient, inFlowRate, newCtx); + newCtx = superToken.deleteFlowWithCtx(prevSender, address(this), newCtx); + } + + prevSender = sender; + prevFlowRate = inFlowRate; + } +} + contract CrossStreamSuperAppTest is FoundrySuperfluidTester { CrossStreamSuperApp public superApp; diff --git a/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/FlowSplitter.sol b/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/FlowSplitter.sol index 2496dbe472..808b9f34bb 100644 --- a/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/FlowSplitter.sol +++ b/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/FlowSplitter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.23; +pragma solidity ^0.8.23; // code taken from: // https://github.com/superfluid-finance/super-examples/blob/main/projects/flow-splitter/contracts/FlowSplitter.sol diff --git a/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/SuperAppTest.t.sol b/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/SuperAppTest.t.sol index 93d253799c..797b5f0fa1 100644 --- a/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/SuperAppTest.t.sol +++ b/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/SuperAppTest.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "forge-std/Test.sol"; import "forge-std/console.sol"; diff --git a/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/handlers/Handler.sol b/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/handlers/Handler.sol index 6c071110a1..46bbda62d6 100644 --- a/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/handlers/Handler.sol +++ b/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/handlers/Handler.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "forge-std/Test.sol"; import "./IStreamHandler.sol"; diff --git a/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/handlers/IStreamHandler.sol b/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/handlers/IStreamHandler.sol index 10684b8726..37fd6ce25a 100644 --- a/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/handlers/IStreamHandler.sol +++ b/packages/ethereum-contracts/test/foundry/apps/SuperAppTester/handlers/IStreamHandler.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; // Interface to define expected behavior of a stream handler. // We are defining a stream operation as a create, update, or delete flow. diff --git a/packages/ethereum-contracts/test/foundry/echidna/EchidnaTestCases.t.sol b/packages/ethereum-contracts/test/foundry/echidna/EchidnaTestCases.t.sol index 98f0557883..c25489a0a1 100644 --- a/packages/ethereum-contracts/test/foundry/echidna/EchidnaTestCases.t.sol +++ b/packages/ethereum-contracts/test/foundry/echidna/EchidnaTestCases.t.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; -import { FoundrySuperfluidTester } from "../FoundrySuperfluidTester.sol"; +import { FoundrySuperfluidTester } from "../../foundry/FoundrySuperfluidTester.sol"; import { ISuperfluidPool, SuperfluidPool } from "../../../contracts/agreements/gdav1/SuperfluidPool.sol"; import { SuperTokenV1Library } from "../../../contracts/apps/SuperTokenV1Library.sol"; import { ISuperToken, SuperToken } from "../../../contracts/superfluid/SuperToken.sol"; diff --git a/packages/ethereum-contracts/test/foundry/gov/SuperfluidGovernanceII.t.sol b/packages/ethereum-contracts/test/foundry/gov/SuperfluidGovernanceII.t.sol index 2648a6896c..8ce9cbda94 100644 --- a/packages/ethereum-contracts/test/foundry/gov/SuperfluidGovernanceII.t.sol +++ b/packages/ethereum-contracts/test/foundry/gov/SuperfluidGovernanceII.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "../FoundrySuperfluidTester.sol"; import { UUPSProxiable } from "../../../contracts/upgradability/UUPSProxiable.sol"; @@ -7,7 +7,6 @@ import { ISuperToken, SuperToken } from "../../../contracts/superfluid/SuperToke import { SuperTokenV1Library } from "../../../contracts/apps/SuperTokenV1Library.sol"; import { ISuperAgreement } from "../../../contracts/interfaces/superfluid/ISuperAgreement.sol"; import { ISuperfluid } from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; -import { AgreementMock } from "../../../contracts/mocks/AgreementMock.sol"; import { SuperfluidPool } from "../../../contracts/agreements/gdav1/SuperfluidPool.sol"; contract SuperfluidGovernanceIntegrationTest is FoundrySuperfluidTester { @@ -68,7 +67,7 @@ contract SuperfluidGovernanceIntegrationTest is FoundrySuperfluidTester { "testUpdateContractsToUpgradePoolBeaconLogic: pool beacon logic not upgraded" ); } - + function testRevertUpgradePoolBeaconLogicWhenNotGovernance() public { SuperfluidPool newPoolLogic = new SuperfluidPool(sf.gda); vm.expectRevert(); diff --git a/packages/ethereum-contracts/test/foundry/libs/AgreementLibrary.prop.t.sol b/packages/ethereum-contracts/test/foundry/libs/AgreementLibrary.prop.t.sol index 697a9b6497..3e4612da59 100644 --- a/packages/ethereum-contracts/test/foundry/libs/AgreementLibrary.prop.t.sol +++ b/packages/ethereum-contracts/test/foundry/libs/AgreementLibrary.prop.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { AgreementLibrary } from "../../../contracts/agreements/AgreementLibrary.sol"; diff --git a/packages/ethereum-contracts/test/foundry/libs/CallUtils.t.sol b/packages/ethereum-contracts/test/foundry/libs/CallUtils.t.sol index fd8187fe35..9a68c67c43 100644 --- a/packages/ethereum-contracts/test/foundry/libs/CallUtils.t.sol +++ b/packages/ethereum-contracts/test/foundry/libs/CallUtils.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "forge-std/Test.sol"; diff --git a/packages/ethereum-contracts/test/foundry/libs/SlotsBitmapLibrary.prop.t.sol b/packages/ethereum-contracts/test/foundry/libs/SlotsBitmapLibrary.prop.t.sol index 347ac551b1..b1c64df1e2 100644 --- a/packages/ethereum-contracts/test/foundry/libs/SlotsBitmapLibrary.prop.t.sol +++ b/packages/ethereum-contracts/test/foundry/libs/SlotsBitmapLibrary.prop.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "forge-std/Test.sol"; import { ERC1820RegistryCompiled } from "../../../contracts/libs/ERC1820RegistryCompiled.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/CFAv1NFTMock.sol b/packages/ethereum-contracts/test/foundry/superfluid/CFAv1NFTMock.t.sol similarity index 92% rename from packages/ethereum-contracts/contracts/mocks/CFAv1NFTMock.sol rename to packages/ethereum-contracts/test/foundry/superfluid/CFAv1NFTMock.t.sol index 45454bf12f..439d6e881c 100644 --- a/packages/ethereum-contracts/contracts/mocks/CFAv1NFTMock.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/CFAv1NFTMock.t.sol @@ -1,19 +1,20 @@ // SPDX-License-Identifier: AGPLv3 // solhint-disable reason-string // solhint-disable not-rely-on-time -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; + import { IConstantFlowAgreementV1, IGeneralDistributionAgreementV1, ISuperfluid, IConstantInflowNFT, IConstantOutflowNFT -} from "../interfaces/superfluid/ISuperfluid.sol"; -import { ConstantOutflowNFT } from "../superfluid/ConstantOutflowNFT.sol"; -import { ConstantInflowNFT } from "../superfluid/ConstantInflowNFT.sol"; -import { FlowNFTBase } from "../superfluid/FlowNFTBase.sol"; +} from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; +import { ConstantOutflowNFT } from "../../../contracts/superfluid/ConstantOutflowNFT.sol"; +import { ConstantInflowNFT } from "../../../contracts/superfluid/ConstantInflowNFT.sol"; +import { FlowNFTBase } from "../../../contracts/superfluid/FlowNFTBase.sol"; /// @title FlowNFTBaseMock /// @author Superfluid diff --git a/packages/ethereum-contracts/contracts/mocks/CFAv1NFTUpgradabilityMock.sol b/packages/ethereum-contracts/test/foundry/superfluid/CFAv1NFTUpgradabilityMock.t.sol similarity index 92% rename from packages/ethereum-contracts/contracts/mocks/CFAv1NFTUpgradabilityMock.sol rename to packages/ethereum-contracts/test/foundry/superfluid/CFAv1NFTUpgradabilityMock.t.sol index f404d48558..2d0ca77cd5 100644 --- a/packages/ethereum-contracts/contracts/mocks/CFAv1NFTUpgradabilityMock.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/CFAv1NFTUpgradabilityMock.t.sol @@ -1,12 +1,12 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IConstantFlowAgreementV1, IGeneralDistributionAgreementV1, ISuperfluid } - from "../interfaces/superfluid/ISuperfluid.sol"; -import { ConstantInflowNFT, IConstantInflowNFT } from "../superfluid/ConstantInflowNFT.sol"; -import { ConstantOutflowNFT, IConstantOutflowNFT } from "../superfluid/ConstantOutflowNFT.sol"; -import { FlowNFTBase } from "../superfluid/FlowNFTBase.sol"; -import { IStorageLayoutBase } from "./IStorageLayoutBase.sol"; + from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; +import { ConstantInflowNFT, IConstantInflowNFT } from "../../../contracts/superfluid/ConstantInflowNFT.sol"; +import { ConstantOutflowNFT, IConstantOutflowNFT } from "../../../contracts/superfluid/ConstantOutflowNFT.sol"; +import { FlowNFTBase } from "../../../contracts/superfluid/FlowNFTBase.sol"; +import { StorageLayoutTestBase } from "../StorageLayoutTestBase.t.sol"; /*////////////////////////////////////////////////////////////////////////// FlowNFTBase Mocks @@ -16,7 +16,7 @@ import { IStorageLayoutBase } from "./IStorageLayoutBase.sol"; /// @author Superfluid /// @notice A mock FlowNFTBase contract for testing storage layout. /// @dev This contract *MUST* have the same storage layout as FlowNFTBase.sol -contract FlowNFTBaseStorageLayoutMock is FlowNFTBase, IStorageLayoutBase { +contract FlowNFTBaseStorageLayoutMock is FlowNFTBase, StorageLayoutTestBase { constructor(ISuperfluid host, IConstantFlowAgreementV1 cfaV1, IGeneralDistributionAgreementV1 gdaV1) FlowNFTBase(host, cfaV1, gdaV1) @@ -92,7 +92,7 @@ contract FlowNFTBaseStorageLayoutMock is FlowNFTBase, IStorageLayoutBase { /// @author Superfluid /// @notice A mock ConstantOutflowNFT contract for testing storage layout. /// @dev This contract *MUST* have the same storage layout as ConstantOutflowNFT.sol -contract ConstantInflowNFTStorageLayoutMock is ConstantInflowNFT, IStorageLayoutBase { +contract ConstantInflowNFTStorageLayoutMock is ConstantInflowNFT, StorageLayoutTestBase { constructor( ISuperfluid host, @@ -145,7 +145,7 @@ contract ConstantInflowNFTStorageLayoutMock is ConstantInflowNFT, IStorageLayout /// @author Superfluid /// @notice A mock ConstantOutflowNFT contract for testing storage layout. /// @dev This contract *MUST* have the same storage layout as ConstantOutflowNFT.sol -contract ConstantOutflowNFTStorageLayoutMock is ConstantOutflowNFT, IStorageLayoutBase { +contract ConstantOutflowNFTStorageLayoutMock is ConstantOutflowNFT, StorageLayoutTestBase { constructor( ISuperfluid host, diff --git a/packages/ethereum-contracts/test/foundry/superfluid/ConstantInflowNFT.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/ConstantInflowNFT.t.sol index c883a5acd8..ee26eade89 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/ConstantInflowNFT.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/ConstantInflowNFT.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IERC165, IERC721, IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import { ConstantOutflowNFT } from "../../../contracts/superfluid/ConstantOutflowNFT.sol"; diff --git a/packages/ethereum-contracts/test/foundry/superfluid/ConstantOutflowNFT.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/ConstantOutflowNFT.t.sol index 5026c047c5..e06dff36b9 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/ConstantOutflowNFT.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/ConstantOutflowNFT.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import { IERC165, IERC721, IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; @@ -11,13 +11,20 @@ import { import { ConstantInflowNFT } from "../../../contracts/superfluid/ConstantInflowNFT.sol"; import { FoundrySuperfluidTester, SuperTokenV1Library } from "../FoundrySuperfluidTester.sol"; import { IFlowNFTBase } from "../../../contracts/interfaces/superfluid/IFlowNFTBase.sol"; -import { FlowNFTBaseTest } from "./FlowNFTBase.t.sol"; -import { SuperToken, SuperTokenMock } from "../../../contracts/mocks/SuperTokenMock.sol"; -import { ConstantOutflowNFTMock } from "../../../contracts/mocks/CFAv1NFTMock.sol"; -import { NoNFTSuperTokenMock } from "../../../contracts/mocks/SuperTokenMock.sol"; import { TestToken } from "../../../contracts/utils/TestToken.sol"; import { SuperTokenV1Library } from "../../../contracts/apps/SuperTokenV1Library.sol"; import { ISuperToken } from "../../../contracts/superfluid/SuperToken.sol"; +import { SuperToken, SuperTokenMock, NoNFTSuperTokenMock } from "../../../contracts/mocks/SuperTokenMock.t.sol"; +import { FlowNFTBaseTest } from "./FlowNFTBase.t.sol"; +import { ConstantOutflowNFTMock } from "./CFAv1NFTMock.t.sol"; + + +library StringExtra { + function concat(string memory a, string memory b) internal pure returns (string memory) { + return string(abi.encodePacked(a, b)); + } +} +using StringExtra for string; contract ConstantOutflowNFTTest is FlowNFTBaseTest { using Strings for uint256; @@ -227,37 +234,42 @@ contract ConstantOutflowNFTTest is FlowNFTBaseTest { _assertNFTFlowDataStateIsEmpty(nftId); } - function testTokenURIIsExpected() public { - int96 flowRate = 42069; + function testTokenURIIsExpected(uint32 startDate, uint32 flowRate) public { + vm.assume(flowRate > 0); address flowSender = alice; address flowReceiver = bob; - _helperCreateFlowAndAssertNFTInvariants(flowSender, flowReceiver, flowRate); - - uint256 nftId = _helperGetNFTID(address(superTokenMock), flowSender, flowReceiver); - assertEq( - constantOutflowNFT.tokenURI(nftId), - string( - abi.encodePacked( - "https://nft.superfluid.finance/cfa/v2/getmeta?flowRate=", - uint256(uint96(flowRate)).toString(), - "&outgoing=true", - "&token_address=", - Strings.toHexString(uint256(uint160(address(superTokenMock))), 20), - "&chain_id=", - block.chainid.toString(), - "&token_symbol=", - superTokenMock.symbol(), - "&sender=", - Strings.toHexString(uint256(uint160(flowSender)), 20), - "&receiver=", - Strings.toHexString(uint256(uint160(flowReceiver)), 20), - "&token_decimals=", - uint256(superTokenMock.decimals()).toString(), - "&start_date=1" // timestamp shifts 1 - ) - ) - ); + vm.warp(startDate); + _helperCreateFlowAndAssertNFTInvariants(flowSender, flowReceiver, int96(int256(uint256(flowRate)))); + + string memory tokenURI; + { + uint256 nftId = _helperGetNFTID(address(superTokenMock), flowSender, flowReceiver); + tokenURI = constantOutflowNFT.tokenURI(nftId); + } + + string memory expectedTokenURI; + { + expectedTokenURI = string("https://nft.superfluid.finance/cfa/v2/getmeta?flowRate=") + .concat(uint256(flowRate).toString()); + expectedTokenURI = expectedTokenURI.concat("&outgoing=true"); + expectedTokenURI = expectedTokenURI.concat("&token_address=") + .concat(Strings.toHexString(uint256(uint160(address(superTokenMock))), 20)); + expectedTokenURI = expectedTokenURI.concat("&chain_id=") + .concat(block.chainid.toString()); + expectedTokenURI = expectedTokenURI.concat("&token_symbol=") + .concat(superTokenMock.symbol()); + expectedTokenURI = expectedTokenURI.concat("&sender=") + .concat(Strings.toHexString(uint256(uint160(flowSender)), 20)); + expectedTokenURI = expectedTokenURI.concat("&receiver=") + .concat(Strings.toHexString(uint256(uint160(flowReceiver)), 20)); + expectedTokenURI = expectedTokenURI.concat("&token_decimals=") + .concat(uint256(superTokenMock.decimals()).toString()); + expectedTokenURI = expectedTokenURI.concat("&start_date=") + .concat(uint256(startDate).toString()); + } + + assertEq(tokenURI, expectedTokenURI); } function testCreateUpdateDeleteFlowNoNFTToken() public { diff --git a/packages/ethereum-contracts/test/foundry/superfluid/ERC721.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/ERC721.t.sol index 86daa2eaaa..5c72ede53e 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/ERC721.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/ERC721.t.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IERC721Metadata } from "@openzeppelin/contracts/interfaces/IERC721Metadata.sol"; import { FoundrySuperfluidTester } from "../FoundrySuperfluidTester.sol"; -import { ConstantOutflowNFTMock, ConstantInflowNFTMock } from "../../../contracts/mocks/CFAv1NFTMock.sol"; -import { PoolAdminNFTMock, PoolMemberNFTMock } from "../../../contracts/mocks/PoolNFTMock.sol"; +import { ConstantOutflowNFTMock, ConstantInflowNFTMock } from "./CFAv1NFTMock.t.sol"; +import { PoolAdminNFTMock, PoolMemberNFTMock } from "./PoolNFTMock.t.sol"; import { ConstantOutflowNFT, IConstantOutflowNFT } from "../../../contracts/superfluid/ConstantOutflowNFT.sol"; import { ConstantInflowNFT, IConstantInflowNFT } from "../../../contracts/superfluid/ConstantInflowNFT.sol"; import { TestToken } from "../../../contracts/utils/TestToken.sol"; @@ -12,7 +12,7 @@ import { PoolAdminNFT, IPoolAdminNFT } from "../../../contracts/agreements/gdav1 import { PoolMemberNFT, IPoolMemberNFT } from "../../../contracts/agreements/gdav1/PoolMemberNFT.sol"; import { UUPSProxy } from "../../../contracts/upgradability/UUPSProxy.sol"; import { UUPSProxiable } from "../../../contracts/upgradability/UUPSProxiable.sol"; -import { SuperToken, SuperTokenMock } from "../../../contracts/mocks/SuperTokenMock.sol"; +import { SuperToken, SuperTokenMock } from "../../../contracts/mocks/SuperTokenMock.t.sol"; contract ERC721IntegrationTest is FoundrySuperfluidTester { string internal constant POOL_MEMBER_NFT_NAME_TEMPLATE = "Pool Member NFT"; diff --git a/packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.prop.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.prop.t.sol index b1b2e12488..339de5d93d 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.prop.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.prop.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { FoundrySuperfluidTester } from "../FoundrySuperfluidTester.sol"; diff --git a/packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.t.sol index c118c1072e..423b2eac1b 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/FlowNFTBase.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IERC165, IERC721, IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; @@ -15,16 +15,16 @@ import { ConstantInflowNFT, IConstantInflowNFT } from "../../../contracts/superf import { IPoolAdminNFT } from "../../../contracts/agreements/gdav1/PoolAdminNFT.sol"; import { IPoolMemberNFT } from "../../../contracts/agreements/gdav1/PoolMemberNFT.sol"; import { SuperTokenV1Library } from "../../../contracts/apps/SuperTokenV1Library.sol"; -import { FoundrySuperfluidTester } from "../FoundrySuperfluidTester.sol"; -import { ConstantOutflowNFTMock, ConstantInflowNFTMock } from "../../../contracts/mocks/CFAv1NFTMock.sol"; -import { SuperToken, SuperTokenMock } from "../../../contracts/mocks/SuperTokenMock.sol"; -import { FlowNFTBaseMock } from "../../../contracts/mocks/CFAv1NFTMock.sol"; +import { ConstantOutflowNFTMock, ConstantInflowNFTMock } from "./CFAv1NFTMock.t.sol"; +import { SuperToken, SuperTokenMock } from "../../../contracts/mocks/SuperTokenMock.t.sol"; import { TestToken } from "../../../contracts/utils/TestToken.sol"; +import { FlowNFTBaseMock } from "./CFAv1NFTMock.t.sol"; +import { FoundrySuperfluidTester } from "../FoundrySuperfluidTester.sol"; import { FlowNFTBaseStorageLayoutMock, ConstantInflowNFTStorageLayoutMock, ConstantOutflowNFTStorageLayoutMock -} from "../../../contracts/mocks/CFAv1NFTUpgradabilityMock.sol"; +} from "./CFAv1NFTUpgradabilityMock.t.sol"; import { ERC721IntegrationTest } from "./ERC721.t.sol"; abstract contract FlowNFTBaseTest is ERC721IntegrationTest { diff --git a/packages/ethereum-contracts/test/foundry/superfluid/PoolAdminNFT.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/PoolAdminNFT.t.sol index a272f17ca0..1d33ffbea6 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/PoolAdminNFT.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/PoolAdminNFT.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IERC165, IERC721, IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; diff --git a/packages/ethereum-contracts/test/foundry/superfluid/PoolMemberNFT.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/PoolMemberNFT.t.sol index 0915899611..dad71ff3c9 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/PoolMemberNFT.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/PoolMemberNFT.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IERC165, IERC721, IERC721Metadata } from "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; diff --git a/packages/ethereum-contracts/test/foundry/superfluid/PoolNFTBase.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/PoolNFTBase.t.sol index 3f35801cf1..a54ed4c924 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/PoolNFTBase.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/PoolNFTBase.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { IERC165, IERC721, IERC721Metadata } from "@openzeppelin/contracts/interfaces/IERC721Metadata.sol"; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; @@ -8,15 +8,15 @@ import { PoolNFTBaseStorageLayoutMock, PoolAdminNFTStorageLayoutMock, PoolMemberNFTStorageLayoutMock -} from "../../../contracts/mocks/PoolNFTUpgradabilityMock.sol"; +} from "./PoolNFTUpgradabilityMock.t.sol"; import { IPoolNFTBase, PoolNFTBase } from "../../../contracts/agreements/gdav1/PoolNFTBase.sol"; import { ConstantOutflowNFT, IConstantOutflowNFT } from "../../../contracts/superfluid/ConstantOutflowNFT.sol"; import { ConstantInflowNFT, IConstantInflowNFT } from "../../../contracts/superfluid/ConstantInflowNFT.sol"; import { TestToken } from "../../../contracts/utils/TestToken.sol"; import { PoolAdminNFT, IPoolAdminNFT } from "../../../contracts/agreements/gdav1/PoolAdminNFT.sol"; import { PoolMemberNFT, IPoolMemberNFT } from "../../../contracts/agreements/gdav1/PoolMemberNFT.sol"; -import { ConstantOutflowNFTMock, ConstantInflowNFTMock } from "../../../contracts/mocks/CFAv1NFTMock.sol"; -import { PoolNFTBaseMock } from "../../../contracts/mocks/PoolNFTMock.sol"; +import { ConstantOutflowNFTMock, ConstantInflowNFTMock } from "./CFAv1NFTMock.t.sol"; +import { PoolNFTBaseMock } from "./PoolNFTMock.t.sol"; import { ISuperfluidPool } from "../../../contracts/agreements/gdav1/SuperfluidPool.sol"; import { ERC721IntegrationTest } from "./ERC721.t.sol"; diff --git a/packages/ethereum-contracts/contracts/mocks/PoolNFTMock.sol b/packages/ethereum-contracts/test/foundry/superfluid/PoolNFTMock.t.sol similarity index 88% rename from packages/ethereum-contracts/contracts/mocks/PoolNFTMock.sol rename to packages/ethereum-contracts/test/foundry/superfluid/PoolNFTMock.t.sol index d1979816b2..04110c4a7c 100644 --- a/packages/ethereum-contracts/contracts/mocks/PoolNFTMock.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/PoolNFTMock.t.sol @@ -1,12 +1,15 @@ // SPDX-License-Identifier: AGPLv3 // solhint-disable reason-string -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; -import { IGeneralDistributionAgreementV1, ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol"; -import { PoolAdminNFT } from "../agreements/gdav1/PoolAdminNFT.sol"; -import { PoolMemberNFT } from "../agreements/gdav1/PoolMemberNFT.sol"; -import { PoolNFTBase } from "../agreements/gdav1/PoolNFTBase.sol"; + +import { + IGeneralDistributionAgreementV1, ISuperfluid +} from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; +import { PoolAdminNFT } from "../../../contracts/agreements/gdav1/PoolAdminNFT.sol"; +import { PoolMemberNFT } from "../../../contracts/agreements/gdav1/PoolMemberNFT.sol"; +import { PoolNFTBase } from "../../../contracts/agreements/gdav1/PoolNFTBase.sol"; contract PoolNFTBaseMock is PoolNFTBase { using Strings for uint256; diff --git a/packages/ethereum-contracts/contracts/mocks/PoolNFTUpgradabilityMock.sol b/packages/ethereum-contracts/test/foundry/superfluid/PoolNFTUpgradabilityMock.t.sol similarity index 88% rename from packages/ethereum-contracts/contracts/mocks/PoolNFTUpgradabilityMock.sol rename to packages/ethereum-contracts/test/foundry/superfluid/PoolNFTUpgradabilityMock.t.sol index ace431351a..f462a8e070 100644 --- a/packages/ethereum-contracts/contracts/mocks/PoolNFTUpgradabilityMock.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/PoolNFTUpgradabilityMock.t.sol @@ -1,14 +1,16 @@ // SPDX-License-Identifier: AGPLv3 // solhint-disable reason-string -pragma solidity 0.8.23; +pragma solidity ^0.8.23; -import { PoolNFTBase } from "../agreements/gdav1/PoolNFTBase.sol"; -import { IGeneralDistributionAgreementV1, ISuperfluid } from "../interfaces/superfluid/ISuperfluid.sol"; -import { PoolMemberNFT } from "../agreements/gdav1/PoolMemberNFT.sol"; -import { PoolAdminNFT } from "../agreements/gdav1/PoolAdminNFT.sol"; -import { IStorageLayoutBase } from "./IStorageLayoutBase.sol"; +import { PoolNFTBase } from "../../../contracts/agreements/gdav1/PoolNFTBase.sol"; +import { + IGeneralDistributionAgreementV1, ISuperfluid +} from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; +import { PoolMemberNFT } from "../../../contracts/agreements/gdav1/PoolMemberNFT.sol"; +import { PoolAdminNFT } from "../../../contracts/agreements/gdav1/PoolAdminNFT.sol"; +import { StorageLayoutTestBase } from "../StorageLayoutTestBase.t.sol"; -contract PoolNFTBaseStorageLayoutMock is PoolNFTBase, IStorageLayoutBase { +contract PoolNFTBaseStorageLayoutMock is PoolNFTBase, StorageLayoutTestBase { constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolNFTBase(host, gdaV1) { } function validateStorageLayout() public virtual { @@ -71,7 +73,7 @@ contract PoolNFTBaseStorageLayoutMock is PoolNFTBase, IStorageLayoutBase { } } -contract PoolAdminNFTStorageLayoutMock is PoolAdminNFT, IStorageLayoutBase { +contract PoolAdminNFTStorageLayoutMock is PoolAdminNFT, StorageLayoutTestBase { constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolAdminNFT(host, gdaV1) { } function validateStorageLayout() public virtual { @@ -111,7 +113,7 @@ contract PoolAdminNFTStorageLayoutMock is PoolAdminNFT, IStorageLayoutBase { } } -contract PoolMemberNFTStorageLayoutMock is PoolMemberNFT, IStorageLayoutBase { +contract PoolMemberNFTStorageLayoutMock is PoolMemberNFT, StorageLayoutTestBase { constructor(ISuperfluid host, IGeneralDistributionAgreementV1 gdaV1) PoolMemberNFT(host, gdaV1) { } function validateStorageLayout() public virtual { diff --git a/packages/ethereum-contracts/test/foundry/superfluid/SuperToken.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/SuperToken.t.sol index 85013ed052..1c2f031429 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/SuperToken.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/SuperToken.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { Test } from "forge-std/Test.sol"; import { UUPSProxy } from "../../../contracts/upgradability/UUPSProxy.sol"; diff --git a/packages/ethereum-contracts/test/foundry/superfluid/SuperTokenFactory.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/SuperTokenFactory.t.sol index eece7f6443..e164348d98 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/SuperTokenFactory.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/SuperTokenFactory.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { FoundrySuperfluidTester } from "../FoundrySuperfluidTester.sol"; import { SuperTokenFactory } from "../../../contracts/superfluid/SuperTokenFactory.sol"; diff --git a/packages/ethereum-contracts/test/foundry/superfluid/Superfluid.BatchCall.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/Superfluid.BatchCall.t.sol index 6571cf6814..ad56918876 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/Superfluid.BatchCall.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/Superfluid.BatchCall.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { stdError } from "forge-std/Test.sol"; @@ -9,7 +9,7 @@ import { IGeneralDistributionAgreementV1, ISuperfluidPool, PoolConfig } from ".. import { IConstantFlowAgreementV1, ISuperToken, ISuperfluidToken } from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; import { FoundrySuperfluidTester } from "../FoundrySuperfluidTester.sol"; import { SuperTokenV1Library } from "../../../contracts/apps/SuperTokenV1Library.sol"; -import { SuperAppMock } from "../../../contracts/mocks/SuperAppMocks.sol"; +import { SuperAppMock } from "../../../contracts/mocks/SuperAppMocks.t.sol"; import { DMZForwarder } from "../../../contracts/utils/DMZForwarder.sol"; import { Ownable } from '@openzeppelin/contracts/access/Ownable.sol'; import { BaseRelayRecipient } from "../../../contracts/libs/BaseRelayRecipient.sol"; diff --git a/packages/ethereum-contracts/test/foundry/superfluid/Superfluid.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/Superfluid.t.sol index 97ea632f58..68480e9d0b 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/Superfluid.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/Superfluid.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "../FoundrySuperfluidTester.sol"; import { UUPSProxiable } from "../../../contracts/upgradability/UUPSProxiable.sol"; @@ -7,7 +7,7 @@ import { SuperToken } from "../../../contracts/superfluid/SuperToken.sol"; import { SuperTokenV1Library } from "../../../contracts/apps/SuperTokenV1Library.sol"; import { ISuperAgreement } from "../../../contracts/interfaces/superfluid/ISuperAgreement.sol"; import { ISuperfluid } from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; -import { AgreementMock } from "../../../contracts/mocks/AgreementMock.sol"; +import { AgreementMock } from "../../../contracts/mocks/AgreementMock.t.sol"; contract SuperfluidIntegrationTest is FoundrySuperfluidTester { using SuperTokenV1Library for SuperToken; diff --git a/packages/ethereum-contracts/test/foundry/superfluid/SuperfluidPool.prop.t.sol b/packages/ethereum-contracts/test/foundry/superfluid/SuperfluidPool.prop.t.sol index 9518ad24af..7a09f8574f 100644 --- a/packages/ethereum-contracts/test/foundry/superfluid/SuperfluidPool.prop.t.sol +++ b/packages/ethereum-contracts/test/foundry/superfluid/SuperfluidPool.prop.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "forge-std/Test.sol"; import "@superfluid-finance/solidity-semantic-money/src/SemanticMoney.sol"; diff --git a/packages/ethereum-contracts/test/foundry/upgradability/SuperfluidUpgradeableBeacon.t.sol b/packages/ethereum-contracts/test/foundry/upgradability/SuperfluidUpgradeableBeacon.t.sol index 7cddaeda4b..5117ad87a5 100644 --- a/packages/ethereum-contracts/test/foundry/upgradability/SuperfluidUpgradeableBeacon.t.sol +++ b/packages/ethereum-contracts/test/foundry/upgradability/SuperfluidUpgradeableBeacon.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { Test } from "forge-std/Test.sol"; diff --git a/packages/ethereum-contracts/test/foundry/utils/BatchLiquidator.t.sol b/packages/ethereum-contracts/test/foundry/utils/BatchLiquidator.t.sol index b598bae38f..60fab41092 100644 --- a/packages/ethereum-contracts/test/foundry/utils/BatchLiquidator.t.sol +++ b/packages/ethereum-contracts/test/foundry/utils/BatchLiquidator.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { FoundrySuperfluidTester, SuperTokenV1Library } from "../FoundrySuperfluidTester.sol"; import { diff --git a/packages/ethereum-contracts/test/foundry/utils/IDAv1Forwarder.t.sol b/packages/ethereum-contracts/test/foundry/utils/IDAv1Forwarder.t.sol index a97178b7d4..856d7fb504 100644 --- a/packages/ethereum-contracts/test/foundry/utils/IDAv1Forwarder.t.sol +++ b/packages/ethereum-contracts/test/foundry/utils/IDAv1Forwarder.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { FoundrySuperfluidTester, SuperTokenV1Library } from "../FoundrySuperfluidTester.sol"; import { ISuperToken } from "../../../contracts/superfluid/SuperToken.sol"; diff --git a/packages/ethereum-contracts/test/foundry/utils/MacroForwarder.t.sol b/packages/ethereum-contracts/test/foundry/utils/MacroForwarder.t.sol index e8754b10d8..2e84154ffd 100644 --- a/packages/ethereum-contracts/test/foundry/utils/MacroForwarder.t.sol +++ b/packages/ethereum-contracts/test/foundry/utils/MacroForwarder.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, BatchOperation } from "../../../contracts/interfaces/superfluid/ISuperfluid.sol"; import { ISuperToken } from "../../../contracts/superfluid/SuperToken.sol"; diff --git a/packages/ethereum-contracts/test/foundry/utils/TOGA.t.sol b/packages/ethereum-contracts/test/foundry/utils/TOGA.t.sol index d012e51f14..d39afe4456 100644 --- a/packages/ethereum-contracts/test/foundry/utils/TOGA.t.sol +++ b/packages/ethereum-contracts/test/foundry/utils/TOGA.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: AGPLv3 -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import "forge-std/Test.sol"; import { FoundrySuperfluidTester, SuperTokenV1Library } from "../FoundrySuperfluidTester.sol"; diff --git a/packages/ethereum-contracts/truffle-config.js b/packages/ethereum-contracts/truffle-config.js index 359f1aa42d..4b06ef4675 100644 --- a/packages/ethereum-contracts/truffle-config.js +++ b/packages/ethereum-contracts/truffle-config.js @@ -375,7 +375,7 @@ const E = (module.exports = { // Fetch exact version from solc-bin (default: truffle's version) // If SOLC environment variable is provided, assuming it is available as "solc", use it instead. // Ref, this maybe possible in the future: https://github.com/trufflesuite/truffle/pull/6007 - version: process.env.SOLC ? "native" : "0.8.23", + version: process.env.SOLC ? "native" : "0.8.26", settings: { // See the solidity docs for advice about optimization and evmVersion optimizer: { diff --git a/packages/sdk-core/contracts/NoGetUnderlyingToken.sol b/packages/sdk-core/contracts/NoGetUnderlyingToken.sol index 3f9365792d..a8d58ede86 100644 --- a/packages/sdk-core/contracts/NoGetUnderlyingToken.sol +++ b/packages/sdk-core/contracts/NoGetUnderlyingToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.23; +pragma solidity ^0.8.23; contract NoGetUnderlyingToken { diff --git a/packages/sdk-core/contracts/SuperAppTester.sol b/packages/sdk-core/contracts/SuperAppTester.sol index 6994f04a1a..32b46a0037 100644 --- a/packages/sdk-core/contracts/SuperAppTester.sol +++ b/packages/sdk-core/contracts/SuperAppTester.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ISuperfluid, diff --git a/packages/solidity-semantic-money/foundry.toml b/packages/solidity-semantic-money/foundry.toml index 4d4636410f..1dd24e4df7 100644 --- a/packages/solidity-semantic-money/foundry.toml +++ b/packages/solidity-semantic-money/foundry.toml @@ -3,8 +3,9 @@ root = '../..' src = 'packages/solidity-semantic-money/src' out = 'packages/solidity-semantic-money/out/default' cache_path = 'packages/solidity-semantic-money/out/default.cache' -solc_version = '0.8.23' +solc_version = '0.8.26' evm_version = 'paris' # no PUSH0 for now +deny_warnings = true via_ir = false remappings = [ '@superfluid-finance/solidity-semantic-money/src/=packages/solidity-semantic-money/src/', diff --git a/packages/solidity-semantic-money/src/examples/Aqueduct.sol b/packages/solidity-semantic-money/src/examples/Aqueduct.sol index ceea62e24d..794b81bc09 100644 --- a/packages/solidity-semantic-money/src/examples/Aqueduct.sol +++ b/packages/solidity-semantic-money/src/examples/Aqueduct.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { diff --git a/packages/solidity-semantic-money/src/ref-impl/ToySuperToken.sol b/packages/solidity-semantic-money/src/ref-impl/ToySuperToken.sol index fb0df23007..074eb05147 100644 --- a/packages/solidity-semantic-money/src/ref-impl/ToySuperToken.sol +++ b/packages/solidity-semantic-money/src/ref-impl/ToySuperToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.23; +pragma solidity ^0.8.23; // solhint-disable not-rely-on-time diff --git a/packages/solidity-semantic-money/src/ref-impl/ToySuperfluidPool.sol b/packages/solidity-semantic-money/src/ref-impl/ToySuperfluidPool.sol index b16916af4f..ab23129214 100644 --- a/packages/solidity-semantic-money/src/ref-impl/ToySuperfluidPool.sol +++ b/packages/solidity-semantic-money/src/ref-impl/ToySuperfluidPool.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.23; +pragma solidity ^0.8.23; // solhint-disable not-rely-on-time diff --git a/packages/solidity-semantic-money/src/ref-impl/ToySuperfluidToken.sol b/packages/solidity-semantic-money/src/ref-impl/ToySuperfluidToken.sol index 3c7dae538b..5c999ae717 100644 --- a/packages/solidity-semantic-money/src/ref-impl/ToySuperfluidToken.sol +++ b/packages/solidity-semantic-money/src/ref-impl/ToySuperfluidToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.23; +pragma solidity ^0.8.23; // solhint-disable not-rely-on-time diff --git a/packages/solidity-semantic-money/test/SemanticMoney.t.sol b/packages/solidity-semantic-money/test/SemanticMoney.t.sol index d115be2528..267a5e3970 100644 --- a/packages/solidity-semantic-money/test/SemanticMoney.t.sol +++ b/packages/solidity-semantic-money/test/SemanticMoney.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { Test } from "forge-std/Test.sol"; import { @@ -16,19 +16,19 @@ contract SemanticMoneyTest is Test { p._flow_rate = FlowRate.wrap(FlowRate.unwrap(p._flow_rate) >> 2); } - function assertEq(FlowRate a, FlowRate b, string memory e) internal { + function assertEq(FlowRate a, FlowRate b, string memory e) internal pure { assertEq(FlowRate.unwrap(a), FlowRate.unwrap(b), e); } - function assertEq(Unit a, Unit b, string memory e) internal { + function assertEq(Unit a, Unit b, string memory e) internal pure { assertEq(Unit.unwrap(a), Unit.unwrap(b), e); } - function assertEq(Value a, Value b, string memory e) internal { + function assertEq(Value a, Value b, string memory e) internal pure { assertEq(Value.unwrap(a), Value.unwrap(b), e); } - function assertEq(Time a, Time b, string memory e) internal { + function assertEq(Time a, Time b, string memory e) internal pure { assertEq(Time.unwrap(a), Time.unwrap(b), e); } - function assertEq(BasicParticle memory a, BasicParticle memory b, string memory e) internal { + function assertEq(BasicParticle memory a, BasicParticle memory b, string memory e) internal pure { assertEq(a._settled_at, b._settled_at, e); assertEq(a._settled_value, b._settled_value, e); assertEq(a._flow_rate, b._flow_rate, e); @@ -39,7 +39,7 @@ contract SemanticMoneyTest is Test { //////////////////////////////////////////////////////////////////////////////// /// value `mul` unit distributive law: v * (u1 + u2) = v * u1 + v * u2 - function test_value_mul_unit_distributive_law(int128 x_, Unit u1, Unit u2) external { + function test_value_mul_unit_distributive_law(int128 x_, Unit u1, Unit u2) external pure { Value x = Value.wrap(x_); int256 tu = int256(Unit.unwrap(u1)) + int256(Unit.unwrap(u2)); // FIXME NB! vm.assume crashes solc/yul 0.8.19 @@ -48,14 +48,14 @@ contract SemanticMoneyTest is Test { } /// Value `mul.div` unit is a fixed-point function - function test_value_muldiv_unit_fixed(int128 x_, Unit u) external { + function test_value_muldiv_unit_fixed(int128 x_, Unit u) external pure { if (Unit.unwrap(u) == 0) return; Value x = Value.wrap(x_); assertEq(x.div(u).mul(u), x.div(u).mul(u).div(u).mul(u), "e1"); } /// flowrate `mul` unit distributive law: r * (u1 + u2) = r * u1 + r * u2 - function test_flowrate_mul_unit_distributive_law(int64 r_, int64 u1_, int64 u2_) external { + function test_flowrate_mul_unit_distributive_law(int64 r_, int64 u1_, int64 u2_) external pure { // eliminate the signed integer overflow case if (int256(r_) * (int256(u1_) + int256(u2_)) > type(int128).max || int256(r_) * (int256(u1_) + int256(u2_)) < type(int128).min) return; @@ -66,7 +66,7 @@ contract SemanticMoneyTest is Test { } /// FlowRate `mul.div` unit is a fixed-point function - function test_flowrate_muldiv_unit_fixed(int64 r_, int64 u_) external { + function test_flowrate_muldiv_unit_fixed(int64 r_, int64 u_) external pure { if (u_ == 0) return; FlowRate r = FlowRate.wrap(r_); Unit u = Unit.wrap(u_); @@ -74,7 +74,7 @@ contract SemanticMoneyTest is Test { } /// flowrate and unit quotien remainder law: (q, e) = r \ u => q * u + e = r - function test_flowrate_quotrem_unit(FlowRate r, Unit u) external { + function test_flowrate_quotrem_unit(FlowRate r, Unit u) external pure { // FIXME NB! vm.assume crashes solc/yul 0.8.19 atm, using simpler prunings if (Unit.unwrap(u) == 0) return; // eliminate the div by 0 case if (FlowRate.unwrap(r) == type(int128).min) return; // eliminate the signed integer overflow case @@ -82,7 +82,7 @@ contract SemanticMoneyTest is Test { assertEq(q.mul(u) + e, r, "e1"); } - function test_operators() external { + function test_operators() external pure { assertTrue(Time.wrap(0) == Time.wrap(0)); assertTrue(Time.wrap(0) != Time.wrap(1)); assertTrue(Time.wrap(0) < Time.wrap(1)); @@ -161,20 +161,22 @@ contract SemanticMoneyTest is Test { // Particle/Universal Index Properties: Monoidal Laws & Monetary Unit Laws //////////////////////////////////////////////////////////////////////////////// - function test_u_monoid_identity(BasicParticle memory p1) external { + function test_u_monoid_identity(BasicParticle memory p1) external pure { BasicParticle memory id; assertEq(p1, p1.mappend(id), "e1"); assertEq(p1, id.mappend(p1), "e2"); } - function test_u_monoid_assoc(BasicParticle memory p1, BasicParticle memory p2, BasicParticle memory p3) external { + function test_u_monoid_assoc(BasicParticle memory p1, BasicParticle memory p2, BasicParticle memory p3) + external pure + { limitToSafeParticle(p1); limitToSafeParticle(p2); limitToSafeParticle(p3); assertEq(p1.mappend(p2).mappend(p3), p1.mappend(p2.mappend(p3)), "e2"); } - function test_u_settle_idempotence(BasicParticle memory p, uint16 m) external { + function test_u_settle_idempotence(BasicParticle memory p, uint16 m) external pure { limitToSafeParticle(p); Time t1 = p.settled_at() + Time.wrap(m); @@ -184,7 +186,7 @@ contract SemanticMoneyTest is Test { assertEq(p1, p2, "e2"); } - function test_u_constant_rtb(BasicParticle memory p, uint16 m1, uint16 m2, uint16 m3) external { + function test_u_constant_rtb(BasicParticle memory p, uint16 m1, uint16 m2, uint16 m3) external pure { limitToSafeParticle(p); Time t1 = p.settled_at() + Time.wrap(m1); @@ -220,7 +222,7 @@ contract SemanticMoneyTest is Test { function (BasicParticle memory, BasicParticle memory, Time, int64) internal pure returns (BasicParticle memory, BasicParticle memory) op1, function (BasicParticle memory, BasicParticle memory, Time, int64) - internal pure returns (BasicParticle memory, BasicParticle memory) op2) internal { + internal pure returns (BasicParticle memory, BasicParticle memory) op2) internal pure { UUTestVars memory d; d.t1 = Time.wrap(m1); d.t2 = d.t1 + Time.wrap(m2); @@ -230,19 +232,19 @@ contract SemanticMoneyTest is Test { (d.a, d.b) = op2(d.a, d.b, d.t2, x2); assertEq(0, Value.unwrap(d.a.rtb(d.t3) + d.b.rtb(d.t3))); } - function test_uu_ss(uint16 m1, int64 x1, uint16 m2, int64 x2, uint16 m3) external { + function test_uu_ss(uint16 m1, int64 x1, uint16 m2, int64 x2, uint16 m3) external pure { run_uu_test(m1, x1, m2, x2, m3, uu_shift2, uu_shift2); } - function test_uu_ff(uint16 m1, int64 r1, uint16 m2, int64 r2, uint16 m3) external { + function test_uu_ff(uint16 m1, int64 r1, uint16 m2, int64 r2, uint16 m3) external pure { run_uu_test(m1, r1, m2, r2, m3, uu_flow2, uu_flow2); } - function test_uu_fs(uint16 m1, int64 r1, uint16 m2, int64 x2, uint16 m3) external { + function test_uu_fs(uint16 m1, int64 r1, uint16 m2, int64 x2, uint16 m3) external pure { run_uu_test(m1, r1, m2, x2, m3, uu_flow2, uu_shift2); } - function test_uu_sf(uint16 m1, int64 x1, uint16 m2, int64 r2, uint16 m3) external { + function test_uu_sf(uint16 m1, int64 x1, uint16 m2, int64 r2, uint16 m3) external pure { run_uu_test(m1, x1, m2, r2, m3, uu_shift2, uu_flow2); } - function test_uu_flow2(uint16 m1, int64 r1, uint16 m2, int64 r2, uint16 m3) external { + function test_uu_flow2(uint16 m1, int64 r1, uint16 m2, int64 r2, uint16 m3) external pure { UUTestVars memory d; d.t1 = Time.wrap(m1); d.t2 = d.t1 + Time.wrap(m2); @@ -255,7 +257,7 @@ contract SemanticMoneyTest is Test { assertEq(Value.unwrap(d.b.rtb(d.t3)), int256(r1) * int256(uint256(m2)) + int256(r2) * int256(uint256(m3))); } - function test_uu_shift_flow2b(uint16 m1, int64 r1, uint16 m2, int64 r2, uint16 m3) external { + function test_uu_shift_flow2b(uint16 m1, int64 r1, uint16 m2, int64 r2, uint16 m3) external pure { UUTestVars memory d; d.t1 = Time.wrap(m1); d.t2 = d.t1 + Time.wrap(m2); @@ -268,7 +270,7 @@ contract SemanticMoneyTest is Test { assertEq(Value.unwrap(d.b.rtb(d.t3)), int256(r1) * int256(uint256(m2)) + (int256(r1) + int256(r2)) * int256(uint256(m3))); } - function test_uu_shift_flow2ab_equiv(int64 r1, uint16 m1, int64 r2, uint16 m2) external { + function test_uu_shift_flow2ab_equiv(int64 r1, uint16 m1, int64 r2, uint16 m2) external pure { Time t1 = Time.wrap(m1); Time t2 = Time.wrap(m1) + Time.wrap(m2); BasicParticle memory a0; @@ -318,7 +320,7 @@ contract SemanticMoneyTest is Test { function (BasicParticle memory, PDPoolIndex memory, Time, int64) internal pure returns (BasicParticle memory, PDPoolIndex memory) op2, // final test time - uint16 m5) internal { + uint16 m5) internal pure { UPDPTestVars memory d; d.t1 = Time.wrap(m1); d.t2 = d.t1 + Time.wrap(m2); @@ -345,28 +347,28 @@ contract SemanticMoneyTest is Test { uint16 m2, int64 x2, // distribute uint16 m3, int64 u2, // update unit uint16 m4, int64 x4, // distribute - uint16 m5) external { + uint16 m5) external pure { run_updp_1m_test(m1, u1, m2, x2, updp_shift2, m3, u2, m4, x4, updp_shift2, m5); } function test_updp_1m_ff(uint16 m1, int64 u1, // update unit uint16 m2, int64 r2, // distribute flow uint16 m3, int64 u2, // update unit uint16 m4, int64 r4, // distribute flow - uint16 m5) external { + uint16 m5) external pure { run_updp_1m_test(m1, u1, m2, r2, updp_flow2, m3, u2, m4, r4, updp_flow2, m5); } function test_updp_1m_sf(uint16 m1, int64 u1, // update unit uint16 m2, int64 x2, // distribute uint16 m3, int64 u2, // update unit uint16 m4, int64 r4, // distribute flow - uint16 m5) external { + uint16 m5) external pure { run_updp_1m_test(m1, u1, m2, x2, updp_shift2, m3, u2, m4, r4, updp_flow2, m5); } function test_updp_1m_fs(uint16 m1, int64 u1, // update unit uint16 m2, int64 r2, // distribute flow uint16 m3, int64 u2, // update unit uint16 m4, int64 x4, // distribute - uint16 m5) external { + uint16 m5) external pure { run_updp_1m_test(m1, u1, m2, r2, updp_flow2, m3, u2, m4, x4, updp_shift2, m5); } @@ -383,7 +385,7 @@ contract SemanticMoneyTest is Test { function (BasicParticle memory, PDPoolIndex memory, Time, int64) internal pure returns (BasicParticle memory, PDPoolIndex memory) op2, // final test time - uint16 m5) internal { + uint16 m5) internal pure { UPDPTestVars memory d; d.t1 = Time.wrap(m1); d.t2 = d.t1 + Time.wrap(m2); @@ -412,31 +414,31 @@ contract SemanticMoneyTest is Test { uint16 m2, int64 x2, // distribute uint16 m3, int64 u2, // update unit uint16 m4, int64 x4, // distribute - uint16 m5) external { + uint16 m5) external pure { run_updp_2m_test(m1, u1, m2, x2, updp_shift2, m3, u2, m4, x4, updp_shift2, m5); } function test_updp_2m_ff(uint16 m1, int64 u1, // update unit uint16 m2, int64 r2, // distribute flow uint16 m3, int64 u2, // update unit uint16 m4, int64 r4, // distribute flow - uint16 m5) external { + uint16 m5) external pure { run_updp_2m_test(m1, u1, m2, r2, updp_flow2, m3, u2, m4, r4, updp_flow2, m5); } function test_updp_2m_sf(uint16 m1, int64 u1, // update unit uint16 m2, int64 x2, // distribute uint16 m3, int64 u2, // update unit uint16 m4, int64 r4, // distribute flow - uint16 m5) external { + uint16 m5) external pure { run_updp_2m_test(m1, u1, m2, x2, updp_shift2, m3, u2, m4, r4, updp_flow2, m5); } function test_updp_2m_fs(uint16 m1, int64 u1, // update unit uint16 m2, int64 r2, // distribute flow uint16 m3, int64 u2, // update unit uint16 m4, int64 x4, // distribute - uint16 m5) external { + uint16 m5) external pure { run_updp_2m_test(m1, u1, m2, r2, updp_flow2, m3, u2, m4, x4, updp_shift2, m5); } - function test_updp_flow2(uint16 m1, int64 r1, uint16 m2, int64 r2, uint16 m3) external { + function test_updp_flow2(uint16 m1, int64 r1, uint16 m2, int64 r2, uint16 m3) external pure { UPDPTestVars memory d; d.t1 = Time.wrap(m1); d.t2 = d.t1 + Time.wrap(m2); diff --git a/packages/solidity-semantic-money/test/examples/Aqueduct.t.sol b/packages/solidity-semantic-money/test/examples/Aqueduct.t.sol index c505c6e352..acb77a4a7b 100644 --- a/packages/solidity-semantic-money/test/examples/Aqueduct.t.sol +++ b/packages/solidity-semantic-money/test/examples/Aqueduct.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.23; +pragma solidity ^0.8.23; // solhint-disable not-rely-on-time @@ -57,7 +57,7 @@ contract AqueductTest is Test { } } - function assertEq(Value a, Value b, string memory e) internal { + function assertEq(Value a, Value b, string memory e) internal pure { assertEq(Value.unwrap(a), Value.unwrap(b), e); } diff --git a/packages/solidity-semantic-money/test/ref-impl/CertoraHarness.sol b/packages/solidity-semantic-money/test/ref-impl/CertoraHarness.sol index 35e8c06db8..f0060bce85 100644 --- a/packages/solidity-semantic-money/test/ref-impl/CertoraHarness.sol +++ b/packages/solidity-semantic-money/test/ref-impl/CertoraHarness.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.23; +pragma solidity ^0.8.23; import { ToySuperfluidPool } from "../../src/ref-impl/ToySuperfluidToken.sol"; diff --git a/packages/solidity-semantic-money/test/ref-impl/ToySuperToken.t.sol b/packages/solidity-semantic-money/test/ref-impl/ToySuperToken.t.sol index 9dc5e85497..28e70aa6b2 100644 --- a/packages/solidity-semantic-money/test/ref-impl/ToySuperToken.t.sol +++ b/packages/solidity-semantic-money/test/ref-impl/ToySuperToken.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.23; +pragma solidity ^0.8.23; // solhint-disable not-rely-on-time @@ -62,17 +62,17 @@ contract ToySuperTokenTest is Test { vm.stopPrank(); } - function assertEq(FlowRate a, FlowRate b, string memory e) internal { + function assertEq(FlowRate a, FlowRate b, string memory e) internal pure { assertEq(FlowRate.unwrap(a), FlowRate.unwrap(b), e); } - function assertEq(Unit a, Unit b, string memory e) internal { + function assertEq(Unit a, Unit b, string memory e) internal pure { assertEq(Unit.unwrap(a), Unit.unwrap(b), e); } - function assertEq(Value a, Value b, string memory e) internal { + function assertEq(Value a, Value b, string memory e) internal pure { assertEq(Value.unwrap(a), Value.unwrap(b), e); } function getAdjustmentFlowRate(ToySuperfluidPool pool, address expectedRecipient) - internal returns (FlowRate) + internal view returns (FlowRate) { (address recipient, ,FlowRate r) = token.getPoolAdjustmentFlowInfo(pool); assertEq(recipient, expectedRecipient, "expectedRecipient fail");