From ddbef853106c40625bf5c2857d1d91c7719a7987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Thu, 28 Nov 2024 08:12:51 +0700 Subject: [PATCH 1/3] adds a playground testfile to gitignore so Daniel has his own playground :) --- .../workflows/protectSecurityRelevantCode.yml | 3 +- .gitignore | 1 + test/solidity/Facets/TestPlayground.t.sol | 54 +++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 test/solidity/Facets/TestPlayground.t.sol diff --git a/.github/workflows/protectSecurityRelevantCode.yml b/.github/workflows/protectSecurityRelevantCode.yml index 44e3b193e..163a2746d 100644 --- a/.github/workflows/protectSecurityRelevantCode.yml +++ b/.github/workflows/protectSecurityRelevantCode.yml @@ -8,7 +8,8 @@ name: Protect security-critical code/system on: pull_request: types: [opened, synchronize, reopened, ready_for_review] - + pull_request_review: + types: [submitted] jobs: protect-critical-code: if: ${{ github.event.pull_request.draft == false }} diff --git a/.gitignore b/.gitignore index d61a39609..e156cd5ec 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,4 @@ test/logs # Bash Script Stuff script/config.sh script/playground.sh +test/solidity/TestPlayground.t.sol diff --git a/test/solidity/Facets/TestPlayground.t.sol b/test/solidity/Facets/TestPlayground.t.sol new file mode 100644 index 000000000..8e6b9e58f --- /dev/null +++ b/test/solidity/Facets/TestPlayground.t.sol @@ -0,0 +1,54 @@ +// SPDX-License-Identifier: Unlicense +pragma solidity ^0.8.17; + +import { console, ERC20 } from "../utils/TestBaseFacet.sol"; +import { Test } from "forge-std/Test.sol"; + +interface Pac { + function withdrawERC20( + address asset, + uint256 amount, + address wallet + ) external; + + function withdrawETH(uint256 amount, address wallet) external; +} + +contract TestPlayground is Test { + address public constant WALLET = + 0x021b8D868A589Aad0Dd1297Dce136D31b23BdFE7; + + uint256 testAmount = 168729168935; + uint256 depositAmount = 249871101462317036585; + address public constant O_ETHER = + 0x0872b71EFC37CB8DdE22B2118De3d800427fdba0; + address public constant AO_ETHER = + 0x68915399201380f392019555947491e5b3eDFa0e; + address public constant PAC_FINANCE = + 0xfDe98aB7a6602ad55462297D952CE25b58743140; + + // ----- + + function setUp() public { + vm.createSelectFork(vm.envString("ETH_NODE_URI_BLAST"), 11972309); + + vm.label(WALLET, "WALLET"); + vm.label(AO_ETHER, "AO_ETHER"); + vm.label(PAC_FINANCE, "PAC_FINANCE"); + } + + function test_Ali() public { + vm.startPrank(WALLET); + ERC20 token = ERC20(AO_ETHER); + + uint256 balanceAO = token.balanceOf(WALLET); + console.log("balance wallet: ", balanceAO); + + token.approve(PAC_FINANCE, type(uint256).max); + + // Pac(PAC_FINANCE).withdrawERC20(O_ETHER, type(uint256).max, WALLET); + Pac(PAC_FINANCE).withdrawERC20(O_ETHER, testAmount, WALLET); + + // Pac(PAC_FINANCE).withdrawETH(testAmount, WALLET); + } +} From c205b29459d223271d4ad1f7d0b390a676e30c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Thu, 28 Nov 2024 08:16:06 +0700 Subject: [PATCH 2/3] adjustments --- .../workflows/protectSecurityRelevantCode.yml | 3 +- test/solidity/Facets/TestPlayground.t.sol | 54 ------------------- 2 files changed, 1 insertion(+), 56 deletions(-) delete mode 100644 test/solidity/Facets/TestPlayground.t.sol diff --git a/.github/workflows/protectSecurityRelevantCode.yml b/.github/workflows/protectSecurityRelevantCode.yml index 163a2746d..44e3b193e 100644 --- a/.github/workflows/protectSecurityRelevantCode.yml +++ b/.github/workflows/protectSecurityRelevantCode.yml @@ -8,8 +8,7 @@ name: Protect security-critical code/system on: pull_request: types: [opened, synchronize, reopened, ready_for_review] - pull_request_review: - types: [submitted] + jobs: protect-critical-code: if: ${{ github.event.pull_request.draft == false }} diff --git a/test/solidity/Facets/TestPlayground.t.sol b/test/solidity/Facets/TestPlayground.t.sol deleted file mode 100644 index 8e6b9e58f..000000000 --- a/test/solidity/Facets/TestPlayground.t.sol +++ /dev/null @@ -1,54 +0,0 @@ -// SPDX-License-Identifier: Unlicense -pragma solidity ^0.8.17; - -import { console, ERC20 } from "../utils/TestBaseFacet.sol"; -import { Test } from "forge-std/Test.sol"; - -interface Pac { - function withdrawERC20( - address asset, - uint256 amount, - address wallet - ) external; - - function withdrawETH(uint256 amount, address wallet) external; -} - -contract TestPlayground is Test { - address public constant WALLET = - 0x021b8D868A589Aad0Dd1297Dce136D31b23BdFE7; - - uint256 testAmount = 168729168935; - uint256 depositAmount = 249871101462317036585; - address public constant O_ETHER = - 0x0872b71EFC37CB8DdE22B2118De3d800427fdba0; - address public constant AO_ETHER = - 0x68915399201380f392019555947491e5b3eDFa0e; - address public constant PAC_FINANCE = - 0xfDe98aB7a6602ad55462297D952CE25b58743140; - - // ----- - - function setUp() public { - vm.createSelectFork(vm.envString("ETH_NODE_URI_BLAST"), 11972309); - - vm.label(WALLET, "WALLET"); - vm.label(AO_ETHER, "AO_ETHER"); - vm.label(PAC_FINANCE, "PAC_FINANCE"); - } - - function test_Ali() public { - vm.startPrank(WALLET); - ERC20 token = ERC20(AO_ETHER); - - uint256 balanceAO = token.balanceOf(WALLET); - console.log("balance wallet: ", balanceAO); - - token.approve(PAC_FINANCE, type(uint256).max); - - // Pac(PAC_FINANCE).withdrawERC20(O_ETHER, type(uint256).max, WALLET); - Pac(PAC_FINANCE).withdrawERC20(O_ETHER, testAmount, WALLET); - - // Pac(PAC_FINANCE).withdrawETH(testAmount, WALLET); - } -} From 6ff9454c483fce98b4d7830781190cbf6cedf3cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Bl=C3=A4cker?= Date: Thu, 28 Nov 2024 08:42:29 +0700 Subject: [PATCH 3/3] bugfix --- .github/workflows/types.yaml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/types.yaml b/.github/workflows/types.yaml index 3cc5ab3a5..e169f5171 100644 --- a/.github/workflows/types.yaml +++ b/.github/workflows/types.yaml @@ -57,10 +57,16 @@ jobs: # Step 9: Copy generated types and ABI into the lifi-contract-types repo - name: Copy Type Bindings and ABI run: | - rm -r lifi-contract-types/src/ - mv typechain lifi-contract-types/src + rm -rf lifi-contract-types/src/ + mkdir -p lifi-contract-types/src + cp -r typechain/* lifi-contract-types/src/ cp diamond.json lifi-contract-types/dist/ + - name: Verify File Status (for debugging) + run: | + cd lifi-contract-types + git status + # Step 10: Build the lifi-contract-types project - name: Build Contract Types run: cd lifi-contract-types && yarn install && yarn build @@ -167,9 +173,11 @@ jobs: git config user.name github-actions git config user.email github-actions@github.com echo "Updating version from $LATEST_TAG to $NEW_VERSION" - git add src/* - git add dist/* - git add package.json + # git add src/* + # git add dist/* + # git add package.json + git add -A # Stage all changes, including deletions + git commit -m "actions: new contracts version $NEW_VERSION" # Annotate and push the new tag