diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml index e6b94c06..d6bbf72c 100644 --- a/.github/workflows/npm.yml +++ b/.github/workflows/npm.yml @@ -31,7 +31,7 @@ jobs: always-auth: true - name: Install solc - run: svm install 0.7.6 && svm install 0.8.17 && svm use 0.8.17 + run: svm install 0.7.6 && svm install 0.8.20 && svm use 0.8.20 - name: Fix ownership run: git config --global --add safe.directory /__w/contracts-v3/contracts-v3 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 92929ca7..4d069dd2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,7 +25,7 @@ jobs: submodules: recursive - name: Install solc - run: svm install 0.7.6 && svm install 0.8.17 && svm use 0.8.17 + run: svm install 0.7.6 && svm install 0.8.20 && svm use 0.8.20 - name: Fix ownership run: git config --global --add safe.directory /__w/contracts-v3/contracts-v3 @@ -92,4 +92,4 @@ jobs: # echo "> $(jq --raw-output '.returns.cut.value' broadcast/SmartDeploy.s.sol/5/dry-run/hash-latest.json || echo "Not Available")" >> $GITHUB_STEP_SUMMARY # echo " - sepolia \`$(jq --raw-output '.returns.upgradeHash.value' broadcast/SmartDeploy.s.sol/11155111/dry-run/hash-latest.json || echo "Not Available")\`" >> $GITHUB_STEP_SUMMARY - # echo "> $(jq --raw-output '.returns.cut.value' broadcast/SmartDeploy.s.sol/11155111/dry-run/hash-latest.json || echo "Not Available") >> $GITHUB_STEP_SUMMARY \ No newline at end of file + # echo "> $(jq --raw-output '.returns.cut.value' broadcast/SmartDeploy.s.sol/11155111/dry-run/hash-latest.json || echo "Not Available") >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/upgrade-goerli-diamond.yml b/.github/workflows/upgrade-goerli-diamond.yml index 191a83ba..0111ecb0 100644 --- a/.github/workflows/upgrade-goerli-diamond.yml +++ b/.github/workflows/upgrade-goerli-diamond.yml @@ -23,7 +23,7 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} - name: Install solc - run: svm install 0.8.17 && svm use 0.8.17 + run: svm install 0.8.20 && svm use 0.8.20 - name: Fix ownership run: git config --global --add safe.directory /__w/contracts-v3/contracts-v3 diff --git a/cli-tools/prep-upgrade.js b/cli-tools/prep-upgrade.js index 02adad52..7e134547 100644 --- a/cli-tools/prep-upgrade.js +++ b/cli-tools/prep-upgrade.js @@ -12,7 +12,7 @@ const filePath = process.argv[2]; // get the file path from CLI argument const generateS03UpgradeDiamond = (facetCuts, updateStateAddress) => { let script = `// SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /// ------------------------------------------------------------------------------------------------------------ /// diff --git a/foundry.toml b/foundry.toml index e8505fe0..74919dfa 100644 --- a/foundry.toml +++ b/foundry.toml @@ -57,7 +57,7 @@ fs_permissions = [ ] [profile.test] -solc = '0.8.17' +solc = '0.8.20' auto_detect_solc = false optimizer = false ffi = true diff --git a/package.json b/package.json index 25e2a0ee..b282d34c 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "glob": "^8.0.3", "prettier": "^2.7.1", "prettier-plugin-solidity": "^1.0.0-beta.19", - "solc": "0.8.17", + "solc": "0.8.20", "solhint": "^3.3.7", "solidity-coverage": "^0.7.21", "solidity-docgen": "^0.5.17" @@ -56,4 +56,4 @@ "dependencies": { "yarn": "^1.22.19" } -} \ No newline at end of file +} diff --git a/script/AddSupportedExternalToken.s.sol b/script/AddSupportedExternalToken.s.sol index 6602be9c..cc85e65e 100644 --- a/script/AddSupportedExternalToken.s.sol +++ b/script/AddSupportedExternalToken.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import "forge-std/Script.sol"; import { INayms, IDiamondCut } from "src/diamonds/nayms/INayms.sol"; diff --git a/script/CheckBytecode.s.sol b/script/CheckBytecode.s.sol index e1019ce4..4537b249 100644 --- a/script/CheckBytecode.s.sol +++ b/script/CheckBytecode.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { INayms } from "src/diamonds/nayms/INayms.sol"; import "script/utils/DeploymentHelpers.sol"; diff --git a/script/CodeRecon.s.sol b/script/CodeRecon.s.sol index a84cc3ba..ba34dbbf 100644 --- a/script/CodeRecon.s.sol +++ b/script/CodeRecon.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { strings } from "lib/solidity-stringutils/src/strings.sol"; import { IDiamondLoupe } from "src/diamonds/shared/interfaces/IDiamondLoupe.sol"; diff --git a/script/CreateEntity.s.sol b/script/CreateEntity.s.sol index 48aed805..b069f861 100644 --- a/script/CreateEntity.s.sol +++ b/script/CreateEntity.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import "forge-std/Script.sol"; import { INayms, IDiamondCut } from "src/diamonds/nayms/INayms.sol"; diff --git a/script/UpdateCommissions.sol b/script/UpdateCommissions.sol index 841c4479..1f2c47c9 100644 --- a/script/UpdateCommissions.sol +++ b/script/UpdateCommissions.sol @@ -1,5 +1,5 @@ // // SPDX-License-Identifier: MIT -// pragma solidity 0.8.17; +// pragma solidity 0.8.20; // import "forge-std/console2.sol"; // import "forge-std/Script.sol"; diff --git a/script/deployment/DeployERC20.s.sol b/script/deployment/DeployERC20.s.sol index 8e5cc4b3..9690df7b 100644 --- a/script/deployment/DeployERC20.s.sol +++ b/script/deployment/DeployERC20.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /// @notice Quickly deploy a mock ERC20 token, for testing only! diff --git a/script/deployment/DiamondChecker.s.sol b/script/deployment/DiamondChecker.s.sol index 11e961eb..e10ed4cc 100644 --- a/script/deployment/DiamondChecker.s.sol +++ b/script/deployment/DiamondChecker.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { IDiamondCut } from "src/diamonds/nayms/INayms.sol"; import "script/utils/DeploymentHelpers.sol"; diff --git a/script/deployment/GenerateInterfaces.s.sol b/script/deployment/GenerateInterfaces.s.sol index 0a8d05da..1a5b1a28 100644 --- a/script/deployment/GenerateInterfaces.s.sol +++ b/script/deployment/GenerateInterfaces.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import "script/utils/DeploymentHelpers.sol"; import "script/utils/LibGeneratedNaymsFacetHelpers.sol"; diff --git a/script/deployment/ReplaceDiamondCut.s.sol b/script/deployment/ReplaceDiamondCut.s.sol index cb5b3549..06d57258 100644 --- a/script/deployment/ReplaceDiamondCut.s.sol +++ b/script/deployment/ReplaceDiamondCut.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import "script/utils/DeploymentHelpers.sol"; diff --git a/script/deployment/ReplaceOwnershipFacet.s.sol b/script/deployment/ReplaceOwnershipFacet.s.sol index 4ae1f744..584ce2fd 100644 --- a/script/deployment/ReplaceOwnershipFacet.s.sol +++ b/script/deployment/ReplaceOwnershipFacet.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import "script/utils/DeploymentHelpers.sol"; diff --git a/script/deployment/S01DeployContract.s.sol b/script/deployment/S01DeployContract.s.sol index f05ec538..7f00b038 100644 --- a/script/deployment/S01DeployContract.s.sol +++ b/script/deployment/S01DeployContract.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { IDiamondCut } from "src/diamonds/nayms/INayms.sol"; import "script/utils/DeploymentHelpers.sol"; @@ -9,7 +9,14 @@ import "script/utils/DeploymentHelpers.sol"; /// note The upgradeHash returned here is only correct for upgrading a single facet, and assuming all methods are `replaced`. If we were to add and/or remove methods, we would need to add them to the `cut` array. contract S01DeployContract is DeploymentHelpers { - function run(string calldata contractName) external returns (IDiamondCut.FacetCut[] memory cut, bytes32 upgradeHash, bytes32 upgradeHashOld) { + function run(string calldata contractName) + external + returns ( + IDiamondCut.FacetCut[] memory cut, + bytes32 upgradeHash, + bytes32 upgradeHashOld + ) + { address deployer = msg.sender; vm.label(deployer, "S01DeployContract deployer"); vm.startBroadcast(deployer); diff --git a/script/deployment/S02ScheduleUpgrade.s.sol b/script/deployment/S02ScheduleUpgrade.s.sol index 07cf1a90..0e44462a 100644 --- a/script/deployment/S02ScheduleUpgrade.s.sol +++ b/script/deployment/S02ScheduleUpgrade.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import "script/utils/DeploymentHelpers.sol"; diff --git a/script/deployment/SmartDeploy.s.sol b/script/deployment/SmartDeploy.s.sol index 59ef5ce7..5338b1a3 100644 --- a/script/deployment/SmartDeploy.s.sol +++ b/script/deployment/SmartDeploy.s.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import "../utils/DeploymentHelpers.sol"; diff --git a/script/legacy/IAdminFacet-17276760.sol b/script/legacy/IAdminFacet-17276760.sol index 45736198..bd2879ec 100644 --- a/script/legacy/IAdminFacet-17276760.sol +++ b/script/legacy/IAdminFacet-17276760.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /// @dev IAdminFacet used during mainnet block 17276760 diff --git a/script/legacy/IMarketFacet-17334000.sol b/script/legacy/IMarketFacet-17334000.sol index 799247a2..2ae4084c 100644 --- a/script/legacy/IMarketFacet-17334000.sol +++ b/script/legacy/IMarketFacet-17334000.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /// @dev IMarketFacet at block 17334000, prior to fee updates diff --git a/script/utils/DeploymentHelpers.sol b/script/utils/DeploymentHelpers.sol index 5a5a662a..b45a7c9f 100644 --- a/script/utils/DeploymentHelpers.sol +++ b/script/utils/DeploymentHelpers.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import "forge-std/Test.sol"; import { strings } from "lib/solidity-stringutils/src/strings.sol"; diff --git a/src/diamonds/nayms/AppStorage.sol b/src/diamonds/nayms/AppStorage.sol index bdc464b8..093c3206 100644 --- a/src/diamonds/nayms/AppStorage.sol +++ b/src/diamonds/nayms/AppStorage.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /// @notice storage for nayms v3 decentralized insurance platform diff --git a/src/diamonds/nayms/INayms.sol b/src/diamonds/nayms/INayms.sol index c8d1906c..26163056 100644 --- a/src/diamonds/nayms/INayms.sol +++ b/src/diamonds/nayms/INayms.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; // solhint-disable no-empty-blocks diff --git a/src/diamonds/nayms/InitDiamond.sol b/src/diamonds/nayms/InitDiamond.sol index 0a5c8c68..3fc40be5 100644 --- a/src/diamonds/nayms/InitDiamond.sol +++ b/src/diamonds/nayms/InitDiamond.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "./AppStorage.sol"; import { LibHelpers } from "./libs/LibHelpers.sol"; diff --git a/src/diamonds/nayms/Modifiers.sol b/src/diamonds/nayms/Modifiers.sol index c756bcdd..58bda09e 100644 --- a/src/diamonds/nayms/Modifiers.sol +++ b/src/diamonds/nayms/Modifiers.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /// @notice modifiers diff --git a/src/diamonds/nayms/Nayms.sol b/src/diamonds/nayms/Nayms.sol index 027a9e02..0ff3975c 100644 --- a/src/diamonds/nayms/Nayms.sol +++ b/src/diamonds/nayms/Nayms.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /******************************************************************************\ * Author: Nick Mudge (https://twitter.com/mudgen) diff --git a/src/diamonds/nayms/facets/ACLFacet.sol b/src/diamonds/nayms/facets/ACLFacet.sol index 19e2438e..0b847190 100644 --- a/src/diamonds/nayms/facets/ACLFacet.sol +++ b/src/diamonds/nayms/facets/ACLFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibAdmin } from "../libs/LibAdmin.sol"; import { LibACL, LibHelpers } from "../libs/LibACL.sol"; diff --git a/src/diamonds/nayms/facets/AdminFacet.sol b/src/diamonds/nayms/facets/AdminFacet.sol index 9ecb4353..6c3fd624 100644 --- a/src/diamonds/nayms/facets/AdminFacet.sol +++ b/src/diamonds/nayms/facets/AdminFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "../AppStorage.sol"; import { Modifiers } from "../Modifiers.sol"; diff --git a/src/diamonds/nayms/facets/EntityFacet.sol b/src/diamonds/nayms/facets/EntityFacet.sol index 4de93a93..5f8ae8e2 100644 --- a/src/diamonds/nayms/facets/EntityFacet.sol +++ b/src/diamonds/nayms/facets/EntityFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Entity, SimplePolicy, Stakeholders, FeeSchedule } from "../AppStorage.sol"; import { Modifiers } from "../Modifiers.sol"; diff --git a/src/diamonds/nayms/facets/GovernanceFacet.sol b/src/diamonds/nayms/facets/GovernanceFacet.sol index da878b3c..4fe8b960 100644 --- a/src/diamonds/nayms/facets/GovernanceFacet.sol +++ b/src/diamonds/nayms/facets/GovernanceFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibAdmin } from "../libs/LibAdmin.sol"; import { LibConstants as LC } from "../libs/LibConstants.sol"; diff --git a/src/diamonds/nayms/facets/MarketFacet.sol b/src/diamonds/nayms/facets/MarketFacet.sol index b990e8f5..f6d46433 100644 --- a/src/diamonds/nayms/facets/MarketFacet.sol +++ b/src/diamonds/nayms/facets/MarketFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Modifiers } from "../Modifiers.sol"; import { CalculatedFees, MarketInfo } from "../AppStorage.sol"; diff --git a/src/diamonds/nayms/facets/NaymsTokenFacet.sol b/src/diamonds/nayms/facets/NaymsTokenFacet.sol index e39fcf78..f72ec103 100644 --- a/src/diamonds/nayms/facets/NaymsTokenFacet.sol +++ b/src/diamonds/nayms/facets/NaymsTokenFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { INaymsTokenFacet } from "../interfaces/INaymsTokenFacet.sol"; import { LibNaymsToken } from "../libs/LibNaymsToken.sol"; diff --git a/src/diamonds/nayms/facets/SimplePolicyFacet.sol b/src/diamonds/nayms/facets/SimplePolicyFacet.sol index 6ccbc26c..4f302e4e 100644 --- a/src/diamonds/nayms/facets/SimplePolicyFacet.sol +++ b/src/diamonds/nayms/facets/SimplePolicyFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Modifiers } from "../Modifiers.sol"; import { SimplePolicyInfo, SimplePolicy, CalculatedFees } from "../AppStorage.sol"; diff --git a/src/diamonds/nayms/facets/SystemFacet.sol b/src/diamonds/nayms/facets/SystemFacet.sol index 019c92aa..e2d141be 100644 --- a/src/diamonds/nayms/facets/SystemFacet.sol +++ b/src/diamonds/nayms/facets/SystemFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibConstants as LC } from "../libs/LibConstants.sol"; import { Modifiers } from "../Modifiers.sol"; diff --git a/src/diamonds/nayms/facets/TokenizedVaultFacet.sol b/src/diamonds/nayms/facets/TokenizedVaultFacet.sol index eef14bef..311cb6ef 100644 --- a/src/diamonds/nayms/facets/TokenizedVaultFacet.sol +++ b/src/diamonds/nayms/facets/TokenizedVaultFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Modifiers } from "../Modifiers.sol"; import { LibConstants as LC } from "../libs/LibConstants.sol"; diff --git a/src/diamonds/nayms/facets/TokenizedVaultIOFacet.sol b/src/diamonds/nayms/facets/TokenizedVaultIOFacet.sol index 1942314f..56e13ca4 100644 --- a/src/diamonds/nayms/facets/TokenizedVaultIOFacet.sol +++ b/src/diamonds/nayms/facets/TokenizedVaultIOFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Modifiers } from "../Modifiers.sol"; import { LibTokenizedVaultIO } from "../libs/LibTokenizedVaultIO.sol"; diff --git a/src/diamonds/nayms/facets/UserFacet.sol b/src/diamonds/nayms/facets/UserFacet.sol index 0d07df3b..ed4fad6b 100644 --- a/src/diamonds/nayms/facets/UserFacet.sol +++ b/src/diamonds/nayms/facets/UserFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibConstants as LC } from "../libs/LibConstants.sol"; import { Modifiers } from "../Modifiers.sol"; diff --git a/src/diamonds/nayms/interfaces/CustomErrors.sol b/src/diamonds/nayms/interfaces/CustomErrors.sol index d8ea30c1..bd63890c 100644 --- a/src/diamonds/nayms/interfaces/CustomErrors.sol +++ b/src/diamonds/nayms/interfaces/CustomErrors.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /// @dev The Nayms Diamond (proxy contract) owner (address) must be mutually exclusive with the system admin role. error OwnerCannotBeSystemAdmin(); diff --git a/src/diamonds/nayms/interfaces/FreeStructs.sol b/src/diamonds/nayms/interfaces/FreeStructs.sol index 2548f838..dd85905f 100644 --- a/src/diamonds/nayms/interfaces/FreeStructs.sol +++ b/src/diamonds/nayms/interfaces/FreeStructs.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; struct MarketInfo { bytes32 creator; // entity ID diff --git a/src/diamonds/nayms/interfaces/IACLFacet.sol b/src/diamonds/nayms/interfaces/IACLFacet.sol index f992fa9e..982b9190 100644 --- a/src/diamonds/nayms/interfaces/IACLFacet.sol +++ b/src/diamonds/nayms/interfaces/IACLFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /** * @title Access Control List diff --git a/src/diamonds/nayms/interfaces/IAdminFacet.sol b/src/diamonds/nayms/interfaces/IAdminFacet.sol index 9de405cd..90758d61 100644 --- a/src/diamonds/nayms/interfaces/IAdminFacet.sol +++ b/src/diamonds/nayms/interfaces/IAdminFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { FeeSchedule } from "./FreeStructs.sol"; diff --git a/src/diamonds/nayms/interfaces/IEntityFacet.sol b/src/diamonds/nayms/interfaces/IEntityFacet.sol index be38e5f4..14476a9b 100644 --- a/src/diamonds/nayms/interfaces/IEntityFacet.sol +++ b/src/diamonds/nayms/interfaces/IEntityFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { FeeSchedule, SimplePolicy, Entity, Stakeholders } from "./FreeStructs.sol"; diff --git a/src/diamonds/nayms/interfaces/IGovernanceFacet.sol b/src/diamonds/nayms/interfaces/IGovernanceFacet.sol index 65677011..7398db2e 100644 --- a/src/diamonds/nayms/interfaces/IGovernanceFacet.sol +++ b/src/diamonds/nayms/interfaces/IGovernanceFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; interface IGovernanceFacet { /** diff --git a/src/diamonds/nayms/interfaces/IMarketFacet.sol b/src/diamonds/nayms/interfaces/IMarketFacet.sol index 32524561..ce048942 100644 --- a/src/diamonds/nayms/interfaces/IMarketFacet.sol +++ b/src/diamonds/nayms/interfaces/IMarketFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { MarketInfo } from "./FreeStructs.sol"; diff --git a/src/diamonds/nayms/interfaces/INaymsTokenFacet.sol b/src/diamonds/nayms/interfaces/INaymsTokenFacet.sol index d35c75fe..506c58f2 100644 --- a/src/diamonds/nayms/interfaces/INaymsTokenFacet.sol +++ b/src/diamonds/nayms/interfaces/INaymsTokenFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /** * @title Nayms token facet. diff --git a/src/diamonds/nayms/interfaces/ISimplePolicyFacet.sol b/src/diamonds/nayms/interfaces/ISimplePolicyFacet.sol index 3dd1ff04..fd253220 100644 --- a/src/diamonds/nayms/interfaces/ISimplePolicyFacet.sol +++ b/src/diamonds/nayms/interfaces/ISimplePolicyFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { SimplePolicyInfo, SimplePolicy, CalculatedFees } from "./FreeStructs.sol"; diff --git a/src/diamonds/nayms/interfaces/ISystemFacet.sol b/src/diamonds/nayms/interfaces/ISystemFacet.sol index f79c8909..f5304066 100644 --- a/src/diamonds/nayms/interfaces/ISystemFacet.sol +++ b/src/diamonds/nayms/interfaces/ISystemFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Entity } from "./FreeStructs.sol"; diff --git a/src/diamonds/nayms/interfaces/ITokenizedVaultFacet.sol b/src/diamonds/nayms/interfaces/ITokenizedVaultFacet.sol index 355bb3fc..2bd3cb92 100644 --- a/src/diamonds/nayms/interfaces/ITokenizedVaultFacet.sol +++ b/src/diamonds/nayms/interfaces/ITokenizedVaultFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; interface ITokenizedVaultFacet { /** diff --git a/src/diamonds/nayms/interfaces/ITokenizedVaultIOFacet.sol b/src/diamonds/nayms/interfaces/ITokenizedVaultIOFacet.sol index 7846f0d5..d1b4d285 100644 --- a/src/diamonds/nayms/interfaces/ITokenizedVaultIOFacet.sol +++ b/src/diamonds/nayms/interfaces/ITokenizedVaultIOFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /** * @title Token Vault IO diff --git a/src/diamonds/nayms/interfaces/IUserFacet.sol b/src/diamonds/nayms/interfaces/IUserFacet.sol index 67e2d751..12b55f79 100644 --- a/src/diamonds/nayms/interfaces/IUserFacet.sol +++ b/src/diamonds/nayms/interfaces/IUserFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /** * @title Users diff --git a/src/diamonds/nayms/libs/LibACL.sol b/src/diamonds/nayms/libs/LibACL.sol index 5a7bbf06..21e4b7b7 100644 --- a/src/diamonds/nayms/libs/LibACL.sol +++ b/src/diamonds/nayms/libs/LibACL.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "../AppStorage.sol"; import { LibDiamond } from "src/diamonds/shared/libs/LibDiamond.sol"; diff --git a/src/diamonds/nayms/libs/LibAdmin.sol b/src/diamonds/nayms/libs/LibAdmin.sol index cff53326..68829242 100644 --- a/src/diamonds/nayms/libs/LibAdmin.sol +++ b/src/diamonds/nayms/libs/LibAdmin.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, FunctionLockedStorage, LibAppStorage } from "../AppStorage.sol"; import { LibConstants } from "./LibConstants.sol"; diff --git a/src/diamonds/nayms/libs/LibConstants.sol b/src/diamonds/nayms/libs/LibConstants.sol index bae86710..7d68b842 100644 --- a/src/diamonds/nayms/libs/LibConstants.sol +++ b/src/diamonds/nayms/libs/LibConstants.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /** * @dev Settings keys. diff --git a/src/diamonds/nayms/libs/LibEIP712.sol b/src/diamonds/nayms/libs/LibEIP712.sol index 59f2a2e3..8f1f7ee8 100644 --- a/src/diamonds/nayms/libs/LibEIP712.sol +++ b/src/diamonds/nayms/libs/LibEIP712.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "../AppStorage.sol"; diff --git a/src/diamonds/nayms/libs/LibEntity.sol b/src/diamonds/nayms/libs/LibEntity.sol index 41beabf0..96c61b1b 100644 --- a/src/diamonds/nayms/libs/LibEntity.sol +++ b/src/diamonds/nayms/libs/LibEntity.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibAppStorage, AppStorage } from "../AppStorage.sol"; import { Entity, SimplePolicy, Stakeholders, FeeSchedule } from "../AppStorage.sol"; diff --git a/src/diamonds/nayms/libs/LibFeeRouter.sol b/src/diamonds/nayms/libs/LibFeeRouter.sol index 81cf911d..c2232a14 100644 --- a/src/diamonds/nayms/libs/LibFeeRouter.sol +++ b/src/diamonds/nayms/libs/LibFeeRouter.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage, CalculatedFees, FeeAllocation, FeeSchedule } from "../AppStorage.sol"; import { LibObject } from "./LibObject.sol"; diff --git a/src/diamonds/nayms/libs/LibHelpers.sol b/src/diamonds/nayms/libs/LibHelpers.sol index 69abc951..b6dc60c1 100644 --- a/src/diamonds/nayms/libs/LibHelpers.sol +++ b/src/diamonds/nayms/libs/LibHelpers.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /// @notice Pure functions library LibHelpers { diff --git a/src/diamonds/nayms/libs/LibMarket.sol b/src/diamonds/nayms/libs/LibMarket.sol index 7400c60d..1e2e8122 100644 --- a/src/diamonds/nayms/libs/LibMarket.sol +++ b/src/diamonds/nayms/libs/LibMarket.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "../AppStorage.sol"; import { MarketInfo, TokenAmount, CalculatedFees } from "../AppStorage.sol"; diff --git a/src/diamonds/nayms/libs/LibNaymsToken.sol b/src/diamonds/nayms/libs/LibNaymsToken.sol index 9717b4c9..cf90d970 100644 --- a/src/diamonds/nayms/libs/LibNaymsToken.sol +++ b/src/diamonds/nayms/libs/LibNaymsToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "../AppStorage.sol"; diff --git a/src/diamonds/nayms/libs/LibObject.sol b/src/diamonds/nayms/libs/LibObject.sol index b4df26c0..3adf70ee 100644 --- a/src/diamonds/nayms/libs/LibObject.sol +++ b/src/diamonds/nayms/libs/LibObject.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "../AppStorage.sol"; import { LibHelpers } from "./LibHelpers.sol"; diff --git a/src/diamonds/nayms/libs/LibSimplePolicy.sol b/src/diamonds/nayms/libs/LibSimplePolicy.sol index 1a2c1da0..68ed0beb 100644 --- a/src/diamonds/nayms/libs/LibSimplePolicy.sol +++ b/src/diamonds/nayms/libs/LibSimplePolicy.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "../AppStorage.sol"; import { Entity, SimplePolicy } from "../AppStorage.sol"; diff --git a/src/diamonds/nayms/libs/LibTokenizedVault.sol b/src/diamonds/nayms/libs/LibTokenizedVault.sol index 81c7b8f6..01dfb3b3 100644 --- a/src/diamonds/nayms/libs/LibTokenizedVault.sol +++ b/src/diamonds/nayms/libs/LibTokenizedVault.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "../AppStorage.sol"; import { LibAdmin } from "./LibAdmin.sol"; diff --git a/src/diamonds/nayms/libs/LibTokenizedVaultIO.sol b/src/diamonds/nayms/libs/LibTokenizedVaultIO.sol index 263e1855..2bcb50d3 100644 --- a/src/diamonds/nayms/libs/LibTokenizedVaultIO.sol +++ b/src/diamonds/nayms/libs/LibTokenizedVaultIO.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibHelpers } from "./LibHelpers.sol"; import { LibTokenizedVault } from "./LibTokenizedVault.sol"; diff --git a/src/diamonds/shared/facets/DiamondCutFacet.sol b/src/diamonds/shared/facets/DiamondCutFacet.sol index 3d215cd3..b7471171 100644 --- a/src/diamonds/shared/facets/DiamondCutFacet.sol +++ b/src/diamonds/shared/facets/DiamondCutFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /******************************************************************************\ * Author: Nick Mudge (https://twitter.com/mudgen) diff --git a/src/diamonds/shared/facets/DiamondLoupeFacet.sol b/src/diamonds/shared/facets/DiamondLoupeFacet.sol index d7b18b74..b5154c17 100644 --- a/src/diamonds/shared/facets/DiamondLoupeFacet.sol +++ b/src/diamonds/shared/facets/DiamondLoupeFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /******************************************************************************\ * Author: Nick Mudge (https://twitter.com/mudgen) diff --git a/src/diamonds/shared/facets/NaymsOwnershipFacet.sol b/src/diamonds/shared/facets/NaymsOwnershipFacet.sol index 95db0417..55b3f73e 100644 --- a/src/diamonds/shared/facets/NaymsOwnershipFacet.sol +++ b/src/diamonds/shared/facets/NaymsOwnershipFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibAdmin } from "src/diamonds/nayms/libs/LibAdmin.sol"; import { LibACL } from "src/diamonds/nayms/libs/LibACL.sol"; diff --git a/src/diamonds/shared/facets/OwnershipFacet.sol b/src/diamonds/shared/facets/OwnershipFacet.sol index 0e0419c7..c9c28177 100644 --- a/src/diamonds/shared/facets/OwnershipFacet.sol +++ b/src/diamonds/shared/facets/OwnershipFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibDiamond } from "../libs/LibDiamond.sol"; import { IERC173 } from "../interfaces/IERC173.sol"; diff --git a/src/diamonds/shared/facets/PhasedDiamondCutFacet.sol b/src/diamonds/shared/facets/PhasedDiamondCutFacet.sol index 3d681259..990aa4d8 100644 --- a/src/diamonds/shared/facets/PhasedDiamondCutFacet.sol +++ b/src/diamonds/shared/facets/PhasedDiamondCutFacet.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /******************************************************************************\ * Author: Nick Mudge (https://twitter.com/mudgen) diff --git a/src/diamonds/shared/interfaces/IDiamondCut.sol b/src/diamonds/shared/interfaces/IDiamondCut.sol index 517cce42..7c6a1025 100644 --- a/src/diamonds/shared/interfaces/IDiamondCut.sol +++ b/src/diamonds/shared/interfaces/IDiamondCut.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /******************************************************************************\ * Author: Nick Mudge (https://twitter.com/mudgen) diff --git a/src/diamonds/shared/interfaces/IDiamondLoupe.sol b/src/diamonds/shared/interfaces/IDiamondLoupe.sol index 8d4ca317..d8c2d25c 100644 --- a/src/diamonds/shared/interfaces/IDiamondLoupe.sol +++ b/src/diamonds/shared/interfaces/IDiamondLoupe.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /******************************************************************************\ * Author: Nick Mudge (https://twitter.com/mudgen) diff --git a/src/diamonds/shared/interfaces/IERC165.sol b/src/diamonds/shared/interfaces/IERC165.sol index 64b099d3..d1d345e1 100644 --- a/src/diamonds/shared/interfaces/IERC165.sol +++ b/src/diamonds/shared/interfaces/IERC165.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; interface IERC165 { /// @notice Query if a contract implements an interface diff --git a/src/diamonds/shared/interfaces/IERC173.sol b/src/diamonds/shared/interfaces/IERC173.sol index 47e48a70..4f62a7bb 100644 --- a/src/diamonds/shared/interfaces/IERC173.sol +++ b/src/diamonds/shared/interfaces/IERC173.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /// @title ERC-173 Contract Ownership Standard /// Note: the ERC-165 identifier for this interface is 0x7f5828d0 is ERC165 diff --git a/src/diamonds/shared/libs/LibDiamond.sol b/src/diamonds/shared/libs/LibDiamond.sol index 7eb8052b..87cebe60 100644 --- a/src/diamonds/shared/libs/LibDiamond.sol +++ b/src/diamonds/shared/libs/LibDiamond.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /******************************************************************************\ * Author: Nick Mudge (https://twitter.com/mudgen) diff --git a/src/erc20/ERC20Wrapper.sol b/src/erc20/ERC20Wrapper.sol index b2136499..276fa2fc 100644 --- a/src/erc20/ERC20Wrapper.sol +++ b/src/erc20/ERC20Wrapper.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { IERC20 } from "./IERC20.sol"; import { INayms } from "../diamonds/nayms/INayms.sol"; diff --git a/src/erc20/IERC20.sol b/src/erc20/IERC20.sol index d908c76b..fddf1811 100644 --- a/src/erc20/IERC20.sol +++ b/src/erc20/IERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /** * See https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/token/ERC20 diff --git a/src/erc20/LibERC20.sol b/src/erc20/LibERC20.sol index e85d60e4..bd5dd53b 100644 --- a/src/erc20/LibERC20.sol +++ b/src/erc20/LibERC20.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; /******************************************************************************\ * Author: Nick Mudge diff --git a/src/utils/Create3Deployer.sol b/src/utils/Create3Deployer.sol index 9c9b765a..5ab42372 100644 --- a/src/utils/Create3Deployer.sol +++ b/src/utils/Create3Deployer.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { CREATE3 } from "solmate/utils/CREATE3.sol"; diff --git a/src/utils/OneOff360InitDiamond.sol b/src/utils/OneOff360InitDiamond.sol index cf5e5c4b..94ab4a46 100644 --- a/src/utils/OneOff360InitDiamond.sol +++ b/src/utils/OneOff360InitDiamond.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "../diamonds/nayms/AppStorage.sol"; import { LibHelpers } from "../diamonds/nayms/libs/LibHelpers.sol"; diff --git a/src/utils/ReentrancyGuard.sol b/src/utils/ReentrancyGuard.sol index 72b138eb..24eb778b 100644 --- a/src/utils/ReentrancyGuard.sol +++ b/src/utils/ReentrancyGuard.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibAppStorage } from "src/diamonds/nayms/AppStorage.sol"; diff --git a/test/NewFees.t.sol b/test/NewFees.t.sol index c8c77ea4..8aba58ed 100644 --- a/test/NewFees.t.sol +++ b/test/NewFees.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; // solhint-disable no-console import { console2 } from "forge-std/console2.sol"; diff --git a/test/ReplaceDiamondCut.t.sol b/test/ReplaceDiamondCut.t.sol index c0aedceb..cd17fa83 100644 --- a/test/ReplaceDiamondCut.t.sol +++ b/test/ReplaceDiamondCut.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Test } from "forge-std/Test.sol"; diff --git a/test/T01Deployment.t.sol b/test/T01Deployment.t.sol index ef053faf..cc8cc20e 100644 --- a/test/T01Deployment.t.sol +++ b/test/T01Deployment.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { StdStorage, stdStorage } from "forge-std/Test.sol"; import { Vm } from "forge-std/Vm.sol"; diff --git a/test/T01GovernanceUpgrades.t.sol b/test/T01GovernanceUpgrades.t.sol index c2f1f049..8cafb736 100644 --- a/test/T01GovernanceUpgrades.t.sol +++ b/test/T01GovernanceUpgrades.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { D03ProtocolDefaults, LC } from "./defaults/D03ProtocolDefaults.sol"; import { MockAccounts } from "test/utils/users/MockAccounts.sol"; diff --git a/test/T01LibERC20.t.sol b/test/T01LibERC20.t.sol index c6760061..c19346db 100644 --- a/test/T01LibERC20.t.sol +++ b/test/T01LibERC20.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; // solhint-disable no-global-import import { Vm } from "forge-std/Vm.sol"; diff --git a/test/T01LibHelpers.t.sol b/test/T01LibHelpers.t.sol index adfff01d..5809adec 100644 --- a/test/T01LibHelpers.t.sol +++ b/test/T01LibHelpers.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Test } from "forge-std/Test.sol"; import { Vm } from "forge-std/Vm.sol"; diff --git a/test/T02ACL.t.sol b/test/T02ACL.t.sol index d65c7af1..eba46e47 100644 --- a/test/T02ACL.t.sol +++ b/test/T02ACL.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { console2 } from "forge-std/console2.sol"; import { D03ProtocolDefaults, LibHelpers, LC } from "./defaults/D03ProtocolDefaults.sol"; import { MockAccounts } from "test/utils/users/MockAccounts.sol"; diff --git a/test/T02Access.t.sol b/test/T02Access.t.sol index ee2fcec0..4888ce9f 100644 --- a/test/T02Access.t.sol +++ b/test/T02Access.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; // import { c as c } from "forge-std/c.sol"; import { D03ProtocolDefaults, LibHelpers, LC, c } from "./defaults/D03ProtocolDefaults.sol"; import { Entity, SimplePolicy, Stakeholders } from "src/diamonds/nayms/interfaces/FreeStructs.sol"; diff --git a/test/T02Admin.t.sol b/test/T02Admin.t.sol index b6c16b99..aac36e6b 100644 --- a/test/T02Admin.t.sol +++ b/test/T02Admin.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { D03ProtocolDefaults, LibHelpers, LC } from "./defaults/D03ProtocolDefaults.sol"; diff --git a/test/T02User.t.sol b/test/T02User.t.sol index 6c850c5b..b3083407 100644 --- a/test/T02User.t.sol +++ b/test/T02User.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { D03ProtocolDefaults, LibHelpers, LC } from "./defaults/D03ProtocolDefaults.sol"; import { MockAccounts } from "test/utils/users/MockAccounts.sol"; diff --git a/test/T03NaymsOwnership.t.sol b/test/T03NaymsOwnership.t.sol index 0d05fe75..12435318 100644 --- a/test/T03NaymsOwnership.t.sol +++ b/test/T03NaymsOwnership.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { D03ProtocolDefaults, LibHelpers, LC } from "./defaults/D03ProtocolDefaults.sol"; import "src/diamonds/nayms/interfaces/CustomErrors.sol"; diff --git a/test/T03SystemFacet.t.sol b/test/T03SystemFacet.t.sol index d9459a92..c2549648 100644 --- a/test/T03SystemFacet.t.sol +++ b/test/T03SystemFacet.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { D03ProtocolDefaults, LibHelpers, LC } from "./defaults/D03ProtocolDefaults.sol"; diff --git a/test/T03TokenizedVault.t.sol b/test/T03TokenizedVault.t.sol index 06ea57a3..843f6f88 100644 --- a/test/T03TokenizedVault.t.sol +++ b/test/T03TokenizedVault.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { MockAccounts } from "./utils/users/MockAccounts.sol"; import { c, D03ProtocolDefaults, LibHelpers, LC } from "./defaults/D03ProtocolDefaults.sol"; diff --git a/test/T04Entity.t.sol b/test/T04Entity.t.sol index f844528d..543312fe 100644 --- a/test/T04Entity.t.sol +++ b/test/T04Entity.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Vm } from "forge-std/Vm.sol"; diff --git a/test/T04Market.t.sol b/test/T04Market.t.sol index 4b884392..81031009 100644 --- a/test/T04Market.t.sol +++ b/test/T04Market.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { D03ProtocolDefaults, LibHelpers, LC, c as c } from "./defaults/D03ProtocolDefaults.sol"; import { Vm } from "forge-std/Vm.sol"; diff --git a/test/T05TokenWrapper.t.sol b/test/T05TokenWrapper.t.sol index d31ad16f..50a2c10b 100644 --- a/test/T05TokenWrapper.t.sol +++ b/test/T05TokenWrapper.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Vm } from "forge-std/Vm.sol"; diff --git a/test/T99.t.sol b/test/T99.t.sol new file mode 100644 index 00000000..0c11b25d --- /dev/null +++ b/test/T99.t.sol @@ -0,0 +1,115 @@ +// // SPDX-License-Identifier: MIT +// pragma solidity 0.8.20; + +// import { D03ProtocolDefaults, c, LC, Entity } from "./defaults/D03ProtocolDefaults.sol"; + +// //Add this test function +// /* +// // initPolicyWithLimitAndAssetAndAttacker should be in the D03ProtocolDefaults.sol + +// function initPolicyWithLimitAndAssetAndAttacker(uint256 limitAmount, bytes32 assetId,NaymsAccount memory acc,NaymsAccount memory attacker) +// internal +// view +// returns (Stakeholders memory policyStakeholders, SimplePolicy memory policy) +// { +// bytes32[] memory roles = new bytes32[](1); +// roles[0] = LibHelpers._stringToBytes32(LC.GROUP_PAY_SIMPLE_PREMIUM); +// bytes32[] memory entityIds = new bytes32[](1); +// entityIds[0] = attacker.id; +// { +// bytes32[] memory commissionReceivers = new bytes32[](1); +// commissionReceivers[0]= acc.entityId; +// uint256[] memory commissions = new uint256[](1); +// commissions[0] = 0; +// policy.startDate = block.timestamp + 1000; +// policy.maturationDate = block.timestamp + 1000 + 2 days; +// policy.asset = assetId; +// policy.limit = limitAmount; +// policy.commissionReceivers = commissionReceivers; +// policy.commissionBasisPoints = commissions; +// } + +// { +// bytes[] memory signatures = new bytes[](1); +// bytes32 signingHash = nayms.getSigningHash( +// policy.startDate, policy.maturationDate, policy.asset, policy.limit, "offchain" +// ); + +// signatures[0]= initPolicySig(acc.pk,signingHash); +// //0xbb51ae847295104088b45a86e9ceb7dfabec7268e84a64243dfa8e653bc624db pk for attacker Backup + + +// policyStakeholders = Stakeholders(roles, entityIds, signatures); +// } +// } +// */ +// contract T99 is D03ProtocolDefaults { +// function testAttackWithFakeEntity() public { +// // attacker will make entity and start a policy +// vm.stopPrank(); +// vm.startPrank(sa.addr); + +// nayms.addSupportedExternalToken(usdcAddress); +// changePrank(sm.addr); +// Entity memory entityData = Entity({ assetId: usdcId, collateralRatio: 10_000, maxCapacity: 1_000_000e6, utilizedCapacity: 0, simplePolicyEnabled: true }); +// Entity memory entityFake = Entity({ assetId: usdcId, collateralRatio: 10_000, maxCapacity: 1_0006, utilizedCapacity: 0, simplePolicyEnabled: false }); +// uint256 usdc1m = 1_000_000; + +// NaymsAccount memory entityVictim = makeNaymsAcc("entityVictims"); + +// NaymsAccount memory attackerFakeEntity = makeNaymsAcc("attackersFakes"); +// NaymsAccount memory attackerRealEntity = makeNaymsAcc("attackerReals"); +// NaymsAccount memory attackerBackupAccount = makeNaymsAcc("attackerBackUps"); +// hCreateEntity(attackerRealEntity.entityId, attackerRealEntity.id, entityData, "attackerReals"); +// hCreateEntity(attackerFakeEntity.entityId, entityVictim.id, entityFake, "attackersFakes"); +// hCreateEntity(attackerFakeEntity.id, entityVictim.id, entityFake, "attackersFakesId"); +// hCreateEntity(entityVictim.entityId, entityVictim.id, entityData, "entityVictims"); +// hCreateEntity(attackerBackupAccount.entityId, attackerFakeEntity.id, entityData, "attackerBackUps"); +// // @attack million is chosen since its impact in the contract but it can be any token as long as it has internalBalance and policy can be created for it to work +// fundEntityUsdc(entityVictim, 1_000_000e6); +// //@attack funds can be flashloaned to make the attack cheaper +// fundEntityUsdc(attackerRealEntity, 1_000_000e6); +// uint256 internalBalance = nayms.internalBalanceOf(entityVictim.entityId, usdcId); +// c.log("victim balance before the attack", internalBalance); +// internalBalance = nayms.internalBalanceOf(attackerRealEntity.entityId, usdcId); +// c.log("attacker balance before the attack", internalBalance); +// vm.stopPrank(); +// vm.startPrank(sm.addr); +// // setting the parent @note the parent dosnt have to be done in the same tx as the attack +// nayms.setEntity(attackerBackupAccount.id, attackerFakeEntity.id); +// vm.stopPrank(); +// vm.startPrank(sa.addr); +// // admin dosnt know of the attack yet since it can another transaction a way and its regular action +// nayms.updateRoleAssigner(LC.GROUP_PAY_SIMPLE_PREMIUM, LC.GROUP_PAY_SIMPLE_PREMIUM); +// nayms.updateRoleGroup(LC.GROUP_PAY_SIMPLE_PREMIUM, LC.GROUP_PAY_SIMPLE_PREMIUM, true); +// // now we are going to create a policy for the attacker then we can drain the victim +// uint256 policyLimit = usdc1m; +// (Stakeholders memory stakeHolders, SimplePolicy memory simplePolicy) = initPolicyWithLimitAndAssetAndAttacker( +// policyLimit, +// usdcId, +// attackerBackupAccount, +// attackerFakeEntity +// ); +// vm.startPrank(su.addr); +// nayms.createSimplePolicy(bytes32("1"), attackerRealEntity.entityId, stakeHolders, simplePolicy, "offchain"); +// // now the attacker is going to drain the internal balance of usdc from the victim +// vm.startPrank(sm.addr); +// // @note this can be done not in the attack but is benifical or if its the biggest account +// nayms.setEntity(attackerFakeEntity.id, entityVictim.entityId); +// vm.startPrank(attackerFakeEntity.addr); +// nayms.paySimplePremium(bytes32("1"), 1_000_000e6); +// internalBalance = nayms.internalBalanceOf(entityVictim.entityId, usdcId); +// require(internalBalance == 0); +// c.log(internalBalance, "victim balance After the attack"); +// internalBalance = nayms.internalBalanceOf(attackerRealEntity.entityId, usdcId); +// c.log(internalBalance, "attacker balance after the attack"); +// // Now the attacker will withdraw since they will have no problems withdraws since its real entity and owned by the attacker +// vm.startPrank(su.addr); +// // @note attacker cancels their policy to get all their funds back +// nayms.cancelSimplePolicy(bytes32("1")); +// vm.startPrank(attackerRealEntity.addr); +// // we take all funds in the contract +// nayms.externalWithdrawFromEntity(attackerRealEntity.entityId, attackerRealEntity.addr, address(usdc), internalBalance); +// c.log(usdc.balanceOf(attackerRealEntity.addr), "funds stolen and limit!!!"); +// } +// } diff --git a/test/TNaymsToken.t.sol b/test/TNaymsToken.t.sol index 3a6ccb7d..0a8431b3 100644 --- a/test/TNaymsToken.t.sol +++ b/test/TNaymsToken.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Vm } from "forge-std/Vm.sol"; diff --git a/test/UpdateFees.t.sol b/test/UpdateFees.t.sol index 8f24e820..4ec92ba8 100644 --- a/test/UpdateFees.t.sol +++ b/test/UpdateFees.t.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; // import "forge-std/Test.sol"; diff --git a/test/defaults/D00GlobalDefaults.sol b/test/defaults/D00GlobalDefaults.sol index ad7da512..af1035db 100644 --- a/test/defaults/D00GlobalDefaults.sol +++ b/test/defaults/D00GlobalDefaults.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; // solhint-disable no-console // solhint-disable no-global-import diff --git a/test/defaults/D01Deployment.sol b/test/defaults/D01Deployment.sol index da4ab3b1..af967a60 100644 --- a/test/defaults/D01Deployment.sol +++ b/test/defaults/D01Deployment.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; // solhint-disable no-console // solhint-disable no-global-import diff --git a/test/defaults/D02TestSetup.sol b/test/defaults/D02TestSetup.sol index 2ecde65b..07077e1e 100644 --- a/test/defaults/D02TestSetup.sol +++ b/test/defaults/D02TestSetup.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { D01Deployment, LibHelpers, c } from "./D01Deployment.sol"; import { MockERC20 } from "solmate/test/utils/mocks/MockERC20.sol"; diff --git a/test/defaults/D03ProtocolDefaults.sol b/test/defaults/D03ProtocolDefaults.sol index 5ffd9b03..30bac5dc 100644 --- a/test/defaults/D03ProtocolDefaults.sol +++ b/test/defaults/D03ProtocolDefaults.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { D02TestSetup, LibHelpers, c } from "./D02TestSetup.sol"; import { Entity, SimplePolicy, Stakeholders, FeeSchedule } from "src/diamonds/nayms/interfaces/FreeStructs.sol"; diff --git a/test/fixtures/InitDiamondFixture.sol b/test/fixtures/InitDiamondFixture.sol index 2e4a3011..8f08afc1 100644 --- a/test/fixtures/InitDiamondFixture.sol +++ b/test/fixtures/InitDiamondFixture.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { InitDiamond } from "src/diamonds/nayms/InitDiamond.sol"; import { NaymsTokenFacet } from "src/diamonds/nayms/facets/NaymsTokenFacet.sol"; diff --git a/test/fixtures/LibERC20Fixture.sol b/test/fixtures/LibERC20Fixture.sol index ca41ebae..6a7302bb 100644 --- a/test/fixtures/LibERC20Fixture.sol +++ b/test/fixtures/LibERC20Fixture.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibERC20 } from "src/erc20/LibERC20.sol"; diff --git a/test/fixtures/LibFeeRouterFixture.sol b/test/fixtures/LibFeeRouterFixture.sol index 7e8a7ea0..16389392 100644 --- a/test/fixtures/LibFeeRouterFixture.sol +++ b/test/fixtures/LibFeeRouterFixture.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibConstants } from "src/diamonds/nayms/libs/LibConstants.sol"; import { LibFeeRouter, CalculatedFees, FeeAllocation, FeeSchedule } from "src/diamonds/nayms/libs/LibFeeRouter.sol"; diff --git a/test/fixtures/SimplePolicyFixture.sol b/test/fixtures/SimplePolicyFixture.sol index 14fcd87e..201177c1 100644 --- a/test/fixtures/SimplePolicyFixture.sol +++ b/test/fixtures/SimplePolicyFixture.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { AppStorage, LibAppStorage } from "src/diamonds/nayms/AppStorage.sol"; import { LibSimplePolicy } from "src/diamonds/nayms/libs/LibSimplePolicy.sol"; diff --git a/test/fixtures/TokenizedVaultFixture.sol b/test/fixtures/TokenizedVaultFixture.sol index 672c91a3..ba973751 100644 --- a/test/fixtures/TokenizedVaultFixture.sol +++ b/test/fixtures/TokenizedVaultFixture.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { LibTokenizedVaultIO } from "src/diamonds/nayms/libs/LibTokenizedVaultIO.sol"; import { LibAdmin } from "src/diamonds/nayms/libs/LibAdmin.sol"; diff --git a/test/utils/BadToken.sol b/test/utils/BadToken.sol index 35d3c3b3..6ad40ebd 100644 --- a/test/utils/BadToken.sol +++ b/test/utils/BadToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { IERC20 } from "src/erc20/IERC20.sol"; diff --git a/test/utils/DSILib.sol b/test/utils/DSILib.sol index b61814e2..cc039d3a 100644 --- a/test/utils/DSILib.sol +++ b/test/utils/DSILib.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { Vm } from "forge-std/Vm.sol"; diff --git a/test/utils/DummyToken.sol b/test/utils/DummyToken.sol index 06ce42be..e900ee6e 100644 --- a/test/utils/DummyToken.sol +++ b/test/utils/DummyToken.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; import { IERC20 } from "src/erc20/IERC20.sol"; diff --git a/test/utils/users/MockAccounts.sol b/test/utils/users/MockAccounts.sol index 42a03345..36c69717 100644 --- a/test/utils/users/MockAccounts.sol +++ b/test/utils/users/MockAccounts.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: MIT -pragma solidity 0.8.17; +pragma solidity 0.8.20; abstract contract MockAccounts { // address internal constant account0 = address(0xACC0); diff --git a/yarn.lock b/yarn.lock index 70d731f2..146c2954 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7244,10 +7244,10 @@ snapdragon@^0.8.1: source-map-resolve "^0.5.0" use "^3.1.0" -solc@0.8.17: - version "0.8.17" - resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.17.tgz#c748fec6a64bf029ec406aa9b37e75938d1115ae" - integrity sha512-Dtidk2XtTTmkB3IKdyeg6wLYopJnBVxdoykN8oP8VY3PQjN16BScYoUJTXFm2OP7P0hXNAqWiJNmmfuELtLf8g== +solc@0.8.20: + version "0.8.20" + resolved "https://registry.yarnpkg.com/solc/-/solc-0.8.20.tgz#b49151cf5ecc8de088d3d32b0afb607b3522ba8d" + integrity sha512-fPRnGspIEqmhu63RFO3pc79sLA7ZmzO0Uy0L5l6hEt2wAsq0o7UV6pXkAp3Mfv9IBhg7Px/oTu3a+y4gs3BWrQ== dependencies: command-exists "^1.2.8" commander "^8.1.0"