From e604f138c9328c8e86209d62e5050cb1ba240412 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 3 Oct 2024 20:56:15 -0300 Subject: [PATCH 01/34] feat: remove newly added contracts from core storage change check workflow --- .../core-contracts-storage-check.yml | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/core-contracts-storage-check.yml b/.github/workflows/core-contracts-storage-check.yml index 085e4d3bb..088c9c3d9 100644 --- a/.github/workflows/core-contracts-storage-check.yml +++ b/.github/workflows/core-contracts-storage-check.yml @@ -4,6 +4,7 @@ on: push: branches: - development + - fix-core-contracts-storage-check pull_request: jobs: @@ -11,9 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 2 # Ensure the previous commit is available for comparison - name: Install Foundry uses: onbjerg/foundry-toolchain@v1 @@ -28,12 +30,26 @@ jobs: contracts: - packages/contracts/src/dollar/core/*.sol + - name: Remove newly added contracts from the list + id: filter-new-contracts + run: | + touch contracts.txt + CHANGED_CONTRACTS="${{ steps.changed-contracts.outputs.contracts_all_changed_files }}" + + # Iterate through changed contracts and check if they existed in the previous commit + for CONTRACT in $CHANGED_CONTRACTS; do + if git show HEAD~1:$CONTRACT > /dev/null 2>&1; then + # If the contract existed in the previous commit, add it to the list + echo ${CONTRACT} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/core/{}.sol:{} >> contracts.txt + else + echo "$CONTRACT is a new contract, skipping storage check." + fi + done + - name: Set contracts matrix id: set-matrix working-directory: packages/contracts if: steps.changed-contracts.outputs.contracts_any_changed == 'true' - env: - CHANGED_CONTRACTS: ${{ steps.changed-contracts.outputs.contracts_all_changed_files }} run: | for CONTRACT in "$CHANGED_CONTRACTS"; do echo ${CONTRACT} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/core/{}.sol:{} >> contracts.txt @@ -67,5 +83,4 @@ jobs: with: workingDirectory: packages/contracts contract: ${{ matrix.contract }} - failOnRemoval: true - + failOnRemoval: true \ No newline at end of file From d75ad0f7626b7b00185cad2554c6aac42126d80b Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 3 Oct 2024 21:01:12 -0300 Subject: [PATCH 02/34] feat: add a new contract to test core contracts storage check workflow --- packages/contracts/src/dollar/core/TestWorkflow.sol | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 packages/contracts/src/dollar/core/TestWorkflow.sol diff --git a/packages/contracts/src/dollar/core/TestWorkflow.sol b/packages/contracts/src/dollar/core/TestWorkflow.sol new file mode 100644 index 000000000..742b754de --- /dev/null +++ b/packages/contracts/src/dollar/core/TestWorkflow.sol @@ -0,0 +1,6 @@ +//SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +contract TestWorkflow { + uint256 public value; +} From be48114184059922a0b9caa5d21330813f764138 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 3 Oct 2024 21:02:02 -0300 Subject: [PATCH 03/34] feat: add a new variable with collision to test core contracts storage check workflow --- packages/contracts/src/dollar/core/TestWorkflow.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contracts/src/dollar/core/TestWorkflow.sol b/packages/contracts/src/dollar/core/TestWorkflow.sol index 742b754de..70bc20cc8 100644 --- a/packages/contracts/src/dollar/core/TestWorkflow.sol +++ b/packages/contracts/src/dollar/core/TestWorkflow.sol @@ -2,5 +2,6 @@ pragma solidity 0.8.19; contract TestWorkflow { + uint256 public value2; uint256 public value; } From 79c41d66ae6a28e11fae55fb3a5bae41e0e807d1 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 3 Oct 2024 21:07:54 -0300 Subject: [PATCH 04/34] feat: read env to set-matrix workflow step --- .github/workflows/core-contracts-storage-check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/core-contracts-storage-check.yml b/.github/workflows/core-contracts-storage-check.yml index 088c9c3d9..3a1e0dd68 100644 --- a/.github/workflows/core-contracts-storage-check.yml +++ b/.github/workflows/core-contracts-storage-check.yml @@ -50,6 +50,8 @@ jobs: id: set-matrix working-directory: packages/contracts if: steps.changed-contracts.outputs.contracts_any_changed == 'true' + env: + CHANGED_CONTRACTS: ${{ steps.changed-contracts.outputs.contracts_all_changed_files }} run: | for CONTRACT in "$CHANGED_CONTRACTS"; do echo ${CONTRACT} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/core/{}.sol:{} >> contracts.txt From 4911b86121a03a30b28525cab280e03041616552 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 3 Oct 2024 21:08:34 -0300 Subject: [PATCH 05/34] feat: add a new variable with collision to test workflow --- packages/contracts/src/dollar/core/TestWorkflow.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contracts/src/dollar/core/TestWorkflow.sol b/packages/contracts/src/dollar/core/TestWorkflow.sol index 70bc20cc8..9cdf1183c 100644 --- a/packages/contracts/src/dollar/core/TestWorkflow.sol +++ b/packages/contracts/src/dollar/core/TestWorkflow.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.19; contract TestWorkflow { + uint256 public value3; uint256 public value2; uint256 public value; } From 034c8b49f1449e708ddfd423247e01289765bc02 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 3 Oct 2024 21:10:53 -0300 Subject: [PATCH 06/34] feat: add a new variable without colision to test storage workflow --- packages/contracts/src/dollar/core/TestWorkflow.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contracts/src/dollar/core/TestWorkflow.sol b/packages/contracts/src/dollar/core/TestWorkflow.sol index 9cdf1183c..419ec935b 100644 --- a/packages/contracts/src/dollar/core/TestWorkflow.sol +++ b/packages/contracts/src/dollar/core/TestWorkflow.sol @@ -5,4 +5,5 @@ contract TestWorkflow { uint256 public value3; uint256 public value2; uint256 public value; + uint256 public value4; } From 486386e41becd91d669d0d8b77ae1e8178f562d5 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 3 Oct 2024 21:12:40 -0300 Subject: [PATCH 07/34] feat: add another variable with collision to check storage check workflow --- packages/contracts/src/dollar/core/TestWorkflow.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contracts/src/dollar/core/TestWorkflow.sol b/packages/contracts/src/dollar/core/TestWorkflow.sol index 419ec935b..1e5f304b8 100644 --- a/packages/contracts/src/dollar/core/TestWorkflow.sol +++ b/packages/contracts/src/dollar/core/TestWorkflow.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.19; contract TestWorkflow { + address public owner; uint256 public value3; uint256 public value2; uint256 public value; From 09bb1bfbd26432c430fd4f9056a7e62aeaa16a77 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 3 Oct 2024 21:26:15 -0300 Subject: [PATCH 08/34] feat: add random comments to test storage check workflow --- packages/contracts/src/dollar/core/TestWorkflow.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/contracts/src/dollar/core/TestWorkflow.sol b/packages/contracts/src/dollar/core/TestWorkflow.sol index 1e5f304b8..d5ab65766 100644 --- a/packages/contracts/src/dollar/core/TestWorkflow.sol +++ b/packages/contracts/src/dollar/core/TestWorkflow.sol @@ -2,9 +2,11 @@ pragma solidity 0.8.19; contract TestWorkflow { + // random comment address public owner; uint256 public value3; uint256 public value2; uint256 public value; + // random comment uint256 public value4; } From 76732cb6516dd865cff11a643cb358a64f4becf3 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 3 Oct 2024 21:35:57 -0300 Subject: [PATCH 09/34] chore: delete test workflow contract --- packages/contracts/src/dollar/core/TestWorkflow.sol | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 packages/contracts/src/dollar/core/TestWorkflow.sol diff --git a/packages/contracts/src/dollar/core/TestWorkflow.sol b/packages/contracts/src/dollar/core/TestWorkflow.sol deleted file mode 100644 index d5ab65766..000000000 --- a/packages/contracts/src/dollar/core/TestWorkflow.sol +++ /dev/null @@ -1,12 +0,0 @@ -//SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -contract TestWorkflow { - // random comment - address public owner; - uint256 public value3; - uint256 public value2; - uint256 public value; - // random comment - uint256 public value4; -} From 9559223a922c053592a07cd739924ce4e4f47500 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 3 Oct 2024 21:40:56 -0300 Subject: [PATCH 10/34] feat: remove fork branch from branches in workflow --- .github/workflows/core-contracts-storage-check.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/core-contracts-storage-check.yml b/.github/workflows/core-contracts-storage-check.yml index 3a1e0dd68..93914729c 100644 --- a/.github/workflows/core-contracts-storage-check.yml +++ b/.github/workflows/core-contracts-storage-check.yml @@ -4,7 +4,6 @@ on: push: branches: - development - - fix-core-contracts-storage-check pull_request: jobs: @@ -15,7 +14,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - fetch-depth: 2 # Ensure the previous commit is available for comparison + fetch-depth: 2 - name: Install Foundry uses: onbjerg/foundry-toolchain@v1 From 9ed317f8e9f83e9562e92933c1ee98c60f351db6 Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 19:29:44 -0300 Subject: [PATCH 11/34] feat: add new contract storage check should skip --- packages/contracts/src/dollar/core/TestStorageCheck.sol | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 packages/contracts/src/dollar/core/TestStorageCheck.sol diff --git a/packages/contracts/src/dollar/core/TestStorageCheck.sol b/packages/contracts/src/dollar/core/TestStorageCheck.sol new file mode 100644 index 000000000..b4564df17 --- /dev/null +++ b/packages/contracts/src/dollar/core/TestStorageCheck.sol @@ -0,0 +1,6 @@ +//SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +contract TestStorageCheck { + uint256 value; +} From 18623bbc28d39abfe9bb0b38143b77ec2f149ec1 Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 19:40:35 -0300 Subject: [PATCH 12/34] feat: fix storage check workflow to check against development branch --- .../core-contracts-storage-check.yml | 37 +++++++++---------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/core-contracts-storage-check.yml b/.github/workflows/core-contracts-storage-check.yml index 93914729c..9f2af63c7 100644 --- a/.github/workflows/core-contracts-storage-check.yml +++ b/.github/workflows/core-contracts-storage-check.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - fetch-depth: 2 + fetch-depth: 2 # Ensure we can access the previous commit - name: Install Foundry uses: onbjerg/foundry-toolchain@v1 @@ -29,33 +29,32 @@ jobs: contracts: - packages/contracts/src/dollar/core/*.sol - - name: Remove newly added contracts from the list - id: filter-new-contracts + - name: Set contracts matrix + id: set-matrix + working-directory: packages/contracts + if: steps.changed-contracts.outputs.contracts_any_changed == 'true' + env: + CHANGED_CONTRACTS: ${{ steps.changed-contracts.outputs.contracts_all_changed_files }} run: | touch contracts.txt - CHANGED_CONTRACTS="${{ steps.changed-contracts.outputs.contracts_all_changed_files }}" - - # Iterate through changed contracts and check if they existed in the previous commit + + # Fetch the latest state of the development branch to compare + git fetch origin development + + # Iterate through changed contracts and check if they existed in the development branch for CONTRACT in $CHANGED_CONTRACTS; do - if git show HEAD~1:$CONTRACT > /dev/null 2>&1; then - # If the contract existed in the previous commit, add it to the list + if git show origin/development:$CONTRACT > /dev/null 2>&1; then + # If the contract existed in the development branch, add it to the list for storage check echo ${CONTRACT} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/core/{}.sol:{} >> contracts.txt else echo "$CONTRACT is a new contract, skipping storage check." fi done - - name: Set contracts matrix - id: set-matrix - working-directory: packages/contracts - if: steps.changed-contracts.outputs.contracts_any_changed == 'true' - env: - CHANGED_CONTRACTS: ${{ steps.changed-contracts.outputs.contracts_all_changed_files }} - run: | - for CONTRACT in "$CHANGED_CONTRACTS"; do - echo ${CONTRACT} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/core/{}.sol:{} >> contracts.txt - done - echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + # Set the matrix only if there are contracts to check + if [ -s contracts.txt ]; then + echo "matrix=$(cat contracts.txt | jq -R -s -c 'split(\"\\n\")[:-1]')" >> $GITHUB_OUTPUT + fi outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} From a7e0375ac8085c2a2b2eeb7daeeb0ffd03ee2ad8 Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 19:41:08 -0300 Subject: [PATCH 13/34] chore: remove workflow test contract --- packages/contracts/src/dollar/core/TestStorageCheck.sol | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 packages/contracts/src/dollar/core/TestStorageCheck.sol diff --git a/packages/contracts/src/dollar/core/TestStorageCheck.sol b/packages/contracts/src/dollar/core/TestStorageCheck.sol deleted file mode 100644 index b4564df17..000000000 --- a/packages/contracts/src/dollar/core/TestStorageCheck.sol +++ /dev/null @@ -1,6 +0,0 @@ -//SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -contract TestStorageCheck { - uint256 value; -} From 7bb1c7bc1d009ec6fc62c94d48b6fa06034d070a Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 19:42:15 -0300 Subject: [PATCH 14/34] feat: test storage check workflow contract creation should skip --- packages/contracts/src/dollar/core/StorageCheckTest.sol | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 packages/contracts/src/dollar/core/StorageCheckTest.sol diff --git a/packages/contracts/src/dollar/core/StorageCheckTest.sol b/packages/contracts/src/dollar/core/StorageCheckTest.sol new file mode 100644 index 000000000..bb0e7f318 --- /dev/null +++ b/packages/contracts/src/dollar/core/StorageCheckTest.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +contract StorageCheckTest { + uint256 value1; +} From a6477bcd438a22aaef6c867dba92da226b7f51d8 Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 19:49:38 -0300 Subject: [PATCH 15/34] feat: add a new variable to new contract should skip --- packages/contracts/src/dollar/core/StorageCheckTest.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contracts/src/dollar/core/StorageCheckTest.sol b/packages/contracts/src/dollar/core/StorageCheckTest.sol index bb0e7f318..4a5444879 100644 --- a/packages/contracts/src/dollar/core/StorageCheckTest.sol +++ b/packages/contracts/src/dollar/core/StorageCheckTest.sol @@ -2,5 +2,6 @@ pragma solidity 0.8.19; contract StorageCheckTest { + uint256 value2; uint256 value1; } From 8113e5e2a030668c2ac2c364a0df516d4885ac72 Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 21:05:34 -0300 Subject: [PATCH 16/34] feat: modify a core contract to test storage check workflow should not pass with collision --- packages/contracts/src/dollar/core/UbiquityAmoMinter.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol index 2b97a0a54..2d52d2bf1 100644 --- a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol +++ b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol @@ -26,6 +26,7 @@ contract UbiquityAmoMinter is Ownable { uint256 public immutable collateralIndex; // Index of the collateral in the pool uint256 public immutable missingDecimals; int256 public collateralBorrowCap = int256(100_000e18); + uint256 public JUST_A_TEST = 0; /// @notice Mapping for tracking borrowed collateral balances per AMO mapping(address => int256) public collateralBorrowedBalances; From 58ca4e4eee3fbd34d774d23288f2fafd06668d3e Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 21:11:09 -0300 Subject: [PATCH 17/34] feat: fix char put out in workflow --- .github/workflows/core-contracts-storage-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/core-contracts-storage-check.yml b/.github/workflows/core-contracts-storage-check.yml index 9f2af63c7..8f952532c 100644 --- a/.github/workflows/core-contracts-storage-check.yml +++ b/.github/workflows/core-contracts-storage-check.yml @@ -53,7 +53,7 @@ jobs: # Set the matrix only if there are contracts to check if [ -s contracts.txt ]; then - echo "matrix=$(cat contracts.txt | jq -R -s -c 'split(\"\\n\")[:-1]')" >> $GITHUB_OUTPUT + echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT fi outputs: From 6513217889f0c4fc667f3b7619ef0062bcc5e983 Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 21:12:53 -0300 Subject: [PATCH 18/34] feat: modify a core contract with collision to test storage check workflow should not pass --- packages/contracts/src/dollar/core/UbiquityAmoMinter.sol | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol index 2d52d2bf1..7bda18f04 100644 --- a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol +++ b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol @@ -27,6 +27,7 @@ contract UbiquityAmoMinter is Ownable { uint256 public immutable missingDecimals; int256 public collateralBorrowCap = int256(100_000e18); uint256 public JUST_A_TEST = 0; + uint256 public JUST_A_TEST_1 = 10; /// @notice Mapping for tracking borrowed collateral balances per AMO mapping(address => int256) public collateralBorrowedBalances; From 6c698c9628d1472583e455660a64c75e4a98e7ff Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 21:15:25 -0300 Subject: [PATCH 19/34] feat: remove test workflow changes from core contract --- packages/contracts/src/dollar/core/UbiquityAmoMinter.sol | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol index 7bda18f04..2b97a0a54 100644 --- a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol +++ b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol @@ -26,8 +26,6 @@ contract UbiquityAmoMinter is Ownable { uint256 public immutable collateralIndex; // Index of the collateral in the pool uint256 public immutable missingDecimals; int256 public collateralBorrowCap = int256(100_000e18); - uint256 public JUST_A_TEST = 0; - uint256 public JUST_A_TEST_1 = 10; /// @notice Mapping for tracking borrowed collateral balances per AMO mapping(address => int256) public collateralBorrowedBalances; From f344231efe85c5212ff64c3bc7424829213a17d7 Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 21:16:08 -0300 Subject: [PATCH 20/34] feat: add a non colliding variable to core contract to test storage check workflow --- packages/contracts/src/dollar/core/UbiquityAmoMinter.sol | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol index 2b97a0a54..676082126 100644 --- a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol +++ b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol @@ -36,6 +36,8 @@ contract UbiquityAmoMinter is Ownable { /// @notice Mapping to track active AMOs mapping(address => bool) public Amos; + uint256 public TEST_VARIABLE; + /* ========== CONSTRUCTOR ========== */ /** From f217ecb83336255dd596317dee9ea5021364ae61 Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 21:19:28 -0300 Subject: [PATCH 21/34] feat: remove workflow test variable --- packages/contracts/src/dollar/core/UbiquityAmoMinter.sol | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol index 676082126..2b97a0a54 100644 --- a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol +++ b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol @@ -36,8 +36,6 @@ contract UbiquityAmoMinter is Ownable { /// @notice Mapping to track active AMOs mapping(address => bool) public Amos; - uint256 public TEST_VARIABLE; - /* ========== CONSTRUCTOR ========== */ /** From 6f1f50f394a06bf8081f96659814d7dadfb4e035 Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 21:20:25 -0300 Subject: [PATCH 22/34] feat: test storage check on no storage update --- .../contracts/src/dollar/core/UbiquityAmoMinter.sol | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol index 2b97a0a54..58543baaa 100644 --- a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol +++ b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol @@ -15,21 +15,31 @@ import {IUbiquityPool} from "../interfaces/IUbiquityPool.sol"; contract UbiquityAmoMinter is Ownable { using SafeERC20 for ERC20; + // TESTING STORAGE CHECK WORKFLOW + /// @notice Collateral token used by the AMO minter ERC20 public immutable collateralToken; + // TESTING STORAGE CHECK WORKFLOW + /// @notice Ubiquity pool interface IUbiquityPool public pool; + // TESTING STORAGE CHECK WORKFLOW + /// @notice Collateral-related properties address public immutable collateralAddress; uint256 public immutable collateralIndex; // Index of the collateral in the pool uint256 public immutable missingDecimals; int256 public collateralBorrowCap = int256(100_000e18); + // TESTING STORAGE CHECK WORKFLOW + /// @notice Mapping for tracking borrowed collateral balances per AMO mapping(address => int256) public collateralBorrowedBalances; + // TESTING STORAGE CHECK WORKFLOW + /// @notice Sum of all collateral borrowed across Amos int256 public collateralTotalBorrowedBalance = 0; From ed7f6564c4efa3b0af80af3c0bad3882ff2302ba Mon Sep 17 00:00:00 2001 From: zugdev Date: Fri, 4 Oct 2024 21:32:10 -0300 Subject: [PATCH 23/34] feat: remove testing comments --- .../contracts/src/dollar/core/UbiquityAmoMinter.sol | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol index 58543baaa..2b97a0a54 100644 --- a/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol +++ b/packages/contracts/src/dollar/core/UbiquityAmoMinter.sol @@ -15,31 +15,21 @@ import {IUbiquityPool} from "../interfaces/IUbiquityPool.sol"; contract UbiquityAmoMinter is Ownable { using SafeERC20 for ERC20; - // TESTING STORAGE CHECK WORKFLOW - /// @notice Collateral token used by the AMO minter ERC20 public immutable collateralToken; - // TESTING STORAGE CHECK WORKFLOW - /// @notice Ubiquity pool interface IUbiquityPool public pool; - // TESTING STORAGE CHECK WORKFLOW - /// @notice Collateral-related properties address public immutable collateralAddress; uint256 public immutable collateralIndex; // Index of the collateral in the pool uint256 public immutable missingDecimals; int256 public collateralBorrowCap = int256(100_000e18); - // TESTING STORAGE CHECK WORKFLOW - /// @notice Mapping for tracking borrowed collateral balances per AMO mapping(address => int256) public collateralBorrowedBalances; - // TESTING STORAGE CHECK WORKFLOW - /// @notice Sum of all collateral borrowed across Amos int256 public collateralTotalBorrowedBalance = 0; From 61bba9d16e8e30c127c34f88079dca8b1e123e30 Mon Sep 17 00:00:00 2001 From: zugdev Date: Wed, 16 Oct 2024 18:58:30 -0300 Subject: [PATCH 24/34] test: delete workflow testing contract --- packages/contracts/src/dollar/core/StorageCheckTest.sol | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 packages/contracts/src/dollar/core/StorageCheckTest.sol diff --git a/packages/contracts/src/dollar/core/StorageCheckTest.sol b/packages/contracts/src/dollar/core/StorageCheckTest.sol deleted file mode 100644 index 4a5444879..000000000 --- a/packages/contracts/src/dollar/core/StorageCheckTest.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -contract StorageCheckTest { - uint256 value2; - uint256 value1; -} From b601e977b70ddd9aef567b4ecb2a85aded537f58 Mon Sep 17 00:00:00 2001 From: zugdev Date: Wed, 16 Oct 2024 19:14:04 -0300 Subject: [PATCH 25/34] feat: skip new constracts in check diamond storage --- .../core-contracts-storage-check.yml | 1 + .github/workflows/diamond-storage-check.yml | 28 +++++++++++++++---- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.github/workflows/core-contracts-storage-check.yml b/.github/workflows/core-contracts-storage-check.yml index 8f952532c..09ab91a68 100644 --- a/.github/workflows/core-contracts-storage-check.yml +++ b/.github/workflows/core-contracts-storage-check.yml @@ -4,6 +4,7 @@ on: push: branches: - development + - fix-core-contracts-storage-check pull_request: jobs: diff --git a/.github/workflows/diamond-storage-check.yml b/.github/workflows/diamond-storage-check.yml index d4f869098..943ebd9c7 100644 --- a/.github/workflows/diamond-storage-check.yml +++ b/.github/workflows/diamond-storage-check.yml @@ -4,6 +4,7 @@ on: push: branches: - development + - fix-core-contracts-storage-check paths: - '**.sol' pull_request: @@ -15,9 +16,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive + fetch-depth: 2 - name: Install Foundry uses: onbjerg/foundry-toolchain@v1 @@ -39,10 +41,25 @@ jobs: env: CHANGED_LIBS: ${{ steps.changed-libraries.outputs.libraries_all_changed_files }} run: | - for DIAMOND_LIB in "$CHANGED_LIBS"; do - echo ${DIAMOND_LIB} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/libraries/{}.sol:{} >> contracts.txt + touch contracts.txt + + # Fetch the latest state of the development branch to compare + git fetch origin development + + # Iterate through changed libraries and check if they existed in the development branch + for DIAMOND_LIB in $CHANGED_LIBS; do + if git show origin/development:$DIAMOND_LIB > /dev/null 2>&1; then + # If the library existed in the development branch, add it to the list for storage check + echo ${DIAMOND_LIB} | xargs basename -a | cut -d'.' -f1 | xargs -I{} echo src/dollar/libraries/{}.sol:{} >> contracts.txt + else + echo "$DIAMOND_LIB is a new library, skipping storage check." + fi done - echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + + # Set the matrix only if there are libraries to check + if [ -s contracts.txt ]; then + echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + fi outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} @@ -71,5 +88,4 @@ jobs: with: workingDirectory: packages/contracts contract: ${{ matrix.contract }} - failOnRemoval: true - failOnLabelDiff: true + failOnRemoval: true \ No newline at end of file From 69d35e9c5a7b579c56b6a3ac8cf29b7a5aa65d74 Mon Sep 17 00:00:00 2001 From: zugdev Date: Wed, 16 Oct 2024 19:19:20 -0300 Subject: [PATCH 26/34] test(storage-workflows): should skip new contract and new lib --- packages/contracts/src/dollar/core/ThisIsATest.sol | 6 ++++++ .../contracts/src/dollar/libraries/LibThisIsATest.sol | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 packages/contracts/src/dollar/core/ThisIsATest.sol create mode 100644 packages/contracts/src/dollar/libraries/LibThisIsATest.sol diff --git a/packages/contracts/src/dollar/core/ThisIsATest.sol b/packages/contracts/src/dollar/core/ThisIsATest.sol new file mode 100644 index 000000000..5f2d6fee9 --- /dev/null +++ b/packages/contracts/src/dollar/core/ThisIsATest.sol @@ -0,0 +1,6 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +contract ThisIsATest { + address var1; +} diff --git a/packages/contracts/src/dollar/libraries/LibThisIsATest.sol b/packages/contracts/src/dollar/libraries/LibThisIsATest.sol new file mode 100644 index 000000000..982afd273 --- /dev/null +++ b/packages/contracts/src/dollar/libraries/LibThisIsATest.sol @@ -0,0 +1,9 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity 0.8.19; + +library ThisIsATest { + function test() external pure { + uint256 var1; + var1++; + } +} From 9c940e875568c15af5ed8ceeb86dcdcc6fd6c3ba Mon Sep 17 00:00:00 2001 From: zugdev Date: Wed, 16 Oct 2024 19:29:07 -0300 Subject: [PATCH 27/34] test(storage-workflows): should skip new contract even after first commit --- packages/contracts/src/dollar/core/ThisIsATest.sol | 1 + packages/contracts/src/dollar/libraries/LibThisIsATest.sol | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/contracts/src/dollar/core/ThisIsATest.sol b/packages/contracts/src/dollar/core/ThisIsATest.sol index 5f2d6fee9..752aa0bba 100644 --- a/packages/contracts/src/dollar/core/ThisIsATest.sol +++ b/packages/contracts/src/dollar/core/ThisIsATest.sol @@ -2,5 +2,6 @@ pragma solidity 0.8.19; contract ThisIsATest { + address var2; address var1; } diff --git a/packages/contracts/src/dollar/libraries/LibThisIsATest.sol b/packages/contracts/src/dollar/libraries/LibThisIsATest.sol index 982afd273..d3299b626 100644 --- a/packages/contracts/src/dollar/libraries/LibThisIsATest.sol +++ b/packages/contracts/src/dollar/libraries/LibThisIsATest.sol @@ -3,6 +3,7 @@ pragma solidity 0.8.19; library ThisIsATest { function test() external pure { + address var2; uint256 var1; var1++; } From 2953cb84b44d95dfa9da1b31223d91991794d229 Mon Sep 17 00:00:00 2001 From: zugdev Date: Wed, 16 Oct 2024 19:36:12 -0300 Subject: [PATCH 28/34] test(storage-workflow): should fail if core / diamond storage is changed with collision --- packages/contracts/src/dollar/core/ERC20Ubiquity.sol | 2 ++ packages/contracts/src/dollar/libraries/LibAppStorage.sol | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/contracts/src/dollar/core/ERC20Ubiquity.sol b/packages/contracts/src/dollar/core/ERC20Ubiquity.sol index e005cc262..847a00e8d 100644 --- a/packages/contracts/src/dollar/core/ERC20Ubiquity.sol +++ b/packages/contracts/src/dollar/core/ERC20Ubiquity.sol @@ -25,6 +25,8 @@ abstract contract ERC20Ubiquity is ERC20PermitUpgradeable, ERC20PausableUpgradeable { + address test; + /// @notice Token symbol string private _symbol; diff --git a/packages/contracts/src/dollar/libraries/LibAppStorage.sol b/packages/contracts/src/dollar/libraries/LibAppStorage.sol index e7b94dd4d..a5875d709 100644 --- a/packages/contracts/src/dollar/libraries/LibAppStorage.sol +++ b/packages/contracts/src/dollar/libraries/LibAppStorage.sol @@ -7,6 +7,7 @@ import "./Constants.sol"; /// @notice Shared struct used as a storage in the `LibAppStorage` library struct AppStorage { + address test; // reentrancy guard uint256 reentrancyStatus; // others From 88fa45931e6a3c467693b296454fff0271a0bee1 Mon Sep 17 00:00:00 2001 From: zugdev Date: Wed, 16 Oct 2024 19:48:02 -0300 Subject: [PATCH 29/34] test(storage-workflow): should fail if core / diamond storage is changed with collision --- packages/contracts/src/dollar/core/ERC20Ubiquity.sol | 2 -- packages/contracts/src/dollar/libraries/LibAppStorage.sol | 1 - 2 files changed, 3 deletions(-) diff --git a/packages/contracts/src/dollar/core/ERC20Ubiquity.sol b/packages/contracts/src/dollar/core/ERC20Ubiquity.sol index 847a00e8d..e005cc262 100644 --- a/packages/contracts/src/dollar/core/ERC20Ubiquity.sol +++ b/packages/contracts/src/dollar/core/ERC20Ubiquity.sol @@ -25,8 +25,6 @@ abstract contract ERC20Ubiquity is ERC20PermitUpgradeable, ERC20PausableUpgradeable { - address test; - /// @notice Token symbol string private _symbol; diff --git a/packages/contracts/src/dollar/libraries/LibAppStorage.sol b/packages/contracts/src/dollar/libraries/LibAppStorage.sol index a5875d709..e7b94dd4d 100644 --- a/packages/contracts/src/dollar/libraries/LibAppStorage.sol +++ b/packages/contracts/src/dollar/libraries/LibAppStorage.sol @@ -7,7 +7,6 @@ import "./Constants.sol"; /// @notice Shared struct used as a storage in the `LibAppStorage` library struct AppStorage { - address test; // reentrancy guard uint256 reentrancyStatus; // others From ad8b124b572c36a39ae9d84f5e2cba41e8531947 Mon Sep 17 00:00:00 2001 From: zugdev Date: Wed, 16 Oct 2024 20:15:26 -0300 Subject: [PATCH 30/34] test(storage-workflow): should fail if core / diamond storage is changed with collision --- packages/contracts/src/dollar/core/ERC20Ubiquity.sol | 2 +- packages/contracts/src/dollar/libraries/LibAppStorage.sol | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/contracts/src/dollar/core/ERC20Ubiquity.sol b/packages/contracts/src/dollar/core/ERC20Ubiquity.sol index e005cc262..87f6652ce 100644 --- a/packages/contracts/src/dollar/core/ERC20Ubiquity.sol +++ b/packages/contracts/src/dollar/core/ERC20Ubiquity.sol @@ -26,7 +26,7 @@ abstract contract ERC20Ubiquity is ERC20PausableUpgradeable { /// @notice Token symbol - string private _symbol; + string private test; // _symbol /// @notice Access control interface IAccessControl public accessControl; diff --git a/packages/contracts/src/dollar/libraries/LibAppStorage.sol b/packages/contracts/src/dollar/libraries/LibAppStorage.sol index e7b94dd4d..1d69aa98f 100644 --- a/packages/contracts/src/dollar/libraries/LibAppStorage.sol +++ b/packages/contracts/src/dollar/libraries/LibAppStorage.sol @@ -8,7 +8,7 @@ import "./Constants.sol"; /// @notice Shared struct used as a storage in the `LibAppStorage` library struct AppStorage { // reentrancy guard - uint256 reentrancyStatus; + uint256 test; //reentrancyStatus // others address dollarTokenAddress; address creditNftAddress; From f8b5c3fccc82d94178e08d3f8490b179ce512340 Mon Sep 17 00:00:00 2001 From: zugdev Date: Wed, 16 Oct 2024 21:09:06 -0300 Subject: [PATCH 31/34] test(storage-workflow): should pass if core / diamond storage is changed without collision --- packages/contracts/src/dollar/core/ERC20Ubiquity.sol | 4 +++- packages/contracts/src/dollar/libraries/LibAppStorage.sol | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/contracts/src/dollar/core/ERC20Ubiquity.sol b/packages/contracts/src/dollar/core/ERC20Ubiquity.sol index 87f6652ce..6389fb3ff 100644 --- a/packages/contracts/src/dollar/core/ERC20Ubiquity.sol +++ b/packages/contracts/src/dollar/core/ERC20Ubiquity.sol @@ -25,8 +25,10 @@ abstract contract ERC20Ubiquity is ERC20PermitUpgradeable, ERC20PausableUpgradeable { + // this is a non-colliding change + /// @notice Token symbol - string private test; // _symbol + string private _symbol; /// @notice Access control interface IAccessControl public accessControl; diff --git a/packages/contracts/src/dollar/libraries/LibAppStorage.sol b/packages/contracts/src/dollar/libraries/LibAppStorage.sol index 1d69aa98f..a4670bc1e 100644 --- a/packages/contracts/src/dollar/libraries/LibAppStorage.sol +++ b/packages/contracts/src/dollar/libraries/LibAppStorage.sol @@ -7,8 +7,10 @@ import "./Constants.sol"; /// @notice Shared struct used as a storage in the `LibAppStorage` library struct AppStorage { + // this is a non-colliding change + // reentrancy guard - uint256 test; //reentrancyStatus + uint256 reentrancyStatus; // others address dollarTokenAddress; address creditNftAddress; From 4bdfffa255e9aee14a2bca985a5cff3ec8106de5 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 17 Oct 2024 11:56:34 -0300 Subject: [PATCH 32/34] feat: add a workflow to generate storage artifacts --- .../workflows/generate-storage-artifacts.yml | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/generate-storage-artifacts.yml diff --git a/.github/workflows/generate-storage-artifacts.yml b/.github/workflows/generate-storage-artifacts.yml new file mode 100644 index 000000000..5a27ecd69 --- /dev/null +++ b/.github/workflows/generate-storage-artifacts.yml @@ -0,0 +1,59 @@ +name: Generate Storage Artifacts + +on: + workflow_dispatch + +jobs: + provide_contracts: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install Foundry + uses: onbjerg/foundry-toolchain@v1 + with: + version: nightly + + - name: Set contracts matrix for all matching contracts + id: set-matrix + working-directory: packages/contracts + run: | + # Find all contracts matching the patterns in core and libraries + find src/dollar/core -name '*.sol' > contracts.txt + find src/dollar/libraries -name 'Lib*.sol' >> contracts.txt + + # Generate the matrix from the list of contracts + if [ -s contracts.txt ]; then + echo "matrix=$(cat contracts.txt | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_OUTPUT + fi + + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + + check_storage_layout: + needs: provide_contracts + runs-on: ubuntu-latest + if: ${{ needs.provide_contracts.outputs.matrix != '[]' && needs.provide_contracts.outputs.matrix != '' }} + + strategy: + matrix: + contract: ${{ fromJSON(needs.provide_contracts.outputs.matrix) }} + + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Install Foundry + uses: onbjerg/foundry-toolchain@v1 + with: + version: nightly + + - name: Check For Core Contracts Storage Changes + uses: Rubilmax/foundry-storage-check@main + with: + workingDirectory: packages/contracts + contract: ${{ matrix.contract }} \ No newline at end of file From b44ea4640cd75a842b88760975ca50dd3932fe91 Mon Sep 17 00:00:00 2001 From: zugdev Date: Thu, 17 Oct 2024 14:52:10 -0300 Subject: [PATCH 33/34] fix: storage artifacts generation workflow --- .../workflows/generate-storage-artifacts.yml | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/generate-storage-artifacts.yml b/.github/workflows/generate-storage-artifacts.yml index 5a27ecd69..35a78a680 100644 --- a/.github/workflows/generate-storage-artifacts.yml +++ b/.github/workflows/generate-storage-artifacts.yml @@ -21,14 +21,19 @@ jobs: id: set-matrix working-directory: packages/contracts run: | - # Find all contracts matching the patterns in core and libraries - find src/dollar/core -name '*.sol' > contracts.txt - find src/dollar/libraries -name 'Lib*.sol' >> contracts.txt - - # Generate the matrix from the list of contracts - if [ -s contracts.txt ]; then - echo "matrix=$(cat contracts.txt | jq -R -s -c 'split(\"\n\")[:-1]')" >> $GITHUB_OUTPUT - fi + # Collect all contracts from core and libraries + CONTRACTS="$(find src/dollar/core/*.sol src/dollar/libraries/Lib*.sol -type f)" + + for CONTRACT in $CONTRACTS; do + # Extract the contract name without the .sol extension + CONTRACT_NAME=$(basename "$CONTRACT" .sol) + + # Write : to contracts.txt + echo "${CONTRACT}:${CONTRACT_NAME}" >> contracts.txt + done + + # Set the matrix output + echo "matrix=$(cat contracts.txt | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT outputs: matrix: ${{ steps.set-matrix.outputs.matrix }} From c95eaa09a0230c4b946078870e254eec0d0176b6 Mon Sep 17 00:00:00 2001 From: zugdev Date: Sat, 19 Oct 2024 14:36:23 -0300 Subject: [PATCH 34/34] feat: polish storage-check --- .github/workflows/core-contracts-storage-check.yml | 4 +--- .github/workflows/diamond-storage-check.yml | 2 -- packages/contracts/src/dollar/core/ERC20Ubiquity.sol | 2 -- packages/contracts/src/dollar/core/ThisIsATest.sol | 7 ------- .../contracts/src/dollar/libraries/LibAppStorage.sol | 2 -- .../contracts/src/dollar/libraries/LibThisIsATest.sol | 10 ---------- 6 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 packages/contracts/src/dollar/core/ThisIsATest.sol delete mode 100644 packages/contracts/src/dollar/libraries/LibThisIsATest.sol diff --git a/.github/workflows/core-contracts-storage-check.yml b/.github/workflows/core-contracts-storage-check.yml index 09ab91a68..917e14e95 100644 --- a/.github/workflows/core-contracts-storage-check.yml +++ b/.github/workflows/core-contracts-storage-check.yml @@ -4,7 +4,6 @@ on: push: branches: - development - - fix-core-contracts-storage-check pull_request: jobs: @@ -15,8 +14,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - fetch-depth: 2 # Ensure we can access the previous commit - + - name: Install Foundry uses: onbjerg/foundry-toolchain@v1 with: diff --git a/.github/workflows/diamond-storage-check.yml b/.github/workflows/diamond-storage-check.yml index 943ebd9c7..0626adf5f 100644 --- a/.github/workflows/diamond-storage-check.yml +++ b/.github/workflows/diamond-storage-check.yml @@ -4,7 +4,6 @@ on: push: branches: - development - - fix-core-contracts-storage-check paths: - '**.sol' pull_request: @@ -19,7 +18,6 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - fetch-depth: 2 - name: Install Foundry uses: onbjerg/foundry-toolchain@v1 diff --git a/packages/contracts/src/dollar/core/ERC20Ubiquity.sol b/packages/contracts/src/dollar/core/ERC20Ubiquity.sol index 6389fb3ff..e005cc262 100644 --- a/packages/contracts/src/dollar/core/ERC20Ubiquity.sol +++ b/packages/contracts/src/dollar/core/ERC20Ubiquity.sol @@ -25,8 +25,6 @@ abstract contract ERC20Ubiquity is ERC20PermitUpgradeable, ERC20PausableUpgradeable { - // this is a non-colliding change - /// @notice Token symbol string private _symbol; diff --git a/packages/contracts/src/dollar/core/ThisIsATest.sol b/packages/contracts/src/dollar/core/ThisIsATest.sol deleted file mode 100644 index 752aa0bba..000000000 --- a/packages/contracts/src/dollar/core/ThisIsATest.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -contract ThisIsATest { - address var2; - address var1; -} diff --git a/packages/contracts/src/dollar/libraries/LibAppStorage.sol b/packages/contracts/src/dollar/libraries/LibAppStorage.sol index a4670bc1e..e7b94dd4d 100644 --- a/packages/contracts/src/dollar/libraries/LibAppStorage.sol +++ b/packages/contracts/src/dollar/libraries/LibAppStorage.sol @@ -7,8 +7,6 @@ import "./Constants.sol"; /// @notice Shared struct used as a storage in the `LibAppStorage` library struct AppStorage { - // this is a non-colliding change - // reentrancy guard uint256 reentrancyStatus; // others diff --git a/packages/contracts/src/dollar/libraries/LibThisIsATest.sol b/packages/contracts/src/dollar/libraries/LibThisIsATest.sol deleted file mode 100644 index d3299b626..000000000 --- a/packages/contracts/src/dollar/libraries/LibThisIsATest.sol +++ /dev/null @@ -1,10 +0,0 @@ -// SPDX-License-Identifier: UNLICENSED -pragma solidity 0.8.19; - -library ThisIsATest { - function test() external pure { - address var2; - uint256 var1; - var1++; - } -}