Skip to content

Commit

Permalink
adds a playground testfile to gitignore so Daniel has his own playgro…
Browse files Browse the repository at this point in the history
…und :)
  • Loading branch information
0xDEnYO committed Nov 28, 2024
1 parent 207f863 commit ddbef85
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/protectSecurityRelevantCode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ test/logs
# Bash Script Stuff
script/config.sh
script/playground.sh
test/solidity/TestPlayground.t.sol
54 changes: 54 additions & 0 deletions test/solidity/Facets/TestPlayground.t.sol
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit ddbef85

Please sign in to comment.