From b68ea3988a7d9c2fc255293502ba860401097391 Mon Sep 17 00:00:00 2001 From: astodialo Date: Tue, 5 Nov 2024 18:37:45 +0100 Subject: [PATCH] optimism?! --- flake.nix | 3 +-- foundry.toml | 4 ++++ test/Bread.t.sol | 14 +++++++++----- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/flake.nix b/flake.nix index 6f5a868..fd551b8 100644 --- a/flake.nix +++ b/flake.nix @@ -1,4 +1,3 @@ -# flake.nix { inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; @@ -38,7 +37,7 @@ # Decorative prompt override so we know when we're in a dev shell shellHook = '' - alias test="forge test --fork-url https://polygon-rpc.com" + alias test="forge test --fork-url https://mainnet.optimism.io" ''; }; }); diff --git a/foundry.toml b/foundry.toml index 73ccf4c..9bb37be 100644 --- a/foundry.toml +++ b/foundry.toml @@ -4,6 +4,10 @@ out = "out" libs = ["dependencies"] evm_version = "shanghai" +[rpc_endpoints] +optimism = "https://mainnet.optimism.io" # Mainnet RPC URL +optimismGoerli = "https://goerli.optimism.io" # Optimism Goerli testnet + # See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options [dependencies] forge-std = { version = "1.9.4", url = "https://soldeer-revisions.s3.amazonaws.com/forge-std/1_9_4_25-10-2024_14:36:59_forge-std-1.9.zip" } diff --git a/test/Bread.t.sol b/test/Bread.t.sol index fccf13e..b6a1766 100644 --- a/test/Bread.t.sol +++ b/test/Bread.t.sol @@ -17,7 +17,7 @@ contract BreadTest is Test { IERC20 public aDai; address public constant admin = 0x6A148b997e6651237F2fCfc9E30330a6480519f0; address public constant signer = 0x4B5BaD436CcA8df3bD39A095b84991fAc9A226F1; - address public constant DAI_HOLDER = 0x5Fc0c8BeACfD0a0259B656eabcfE5b39fDe834cc; + address public constant DAI_HOLDER = 0x48A63097E1Ac123b1f5A8bbfFafA4afa8192FaB0; EIP173Proxy public breadProxy; Bread public bread; @@ -25,8 +25,8 @@ contract BreadTest is Test { vm.startPrank(admin); address breadAddress = address( new Bread( - 0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063, - 0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE, + 0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1, + 0x8619d80FB0141ba7F184CbF22fd724116D9f7ffC, 0x794a61358D6845594F94dc1DB02A252b5b4814aD, 0x929EC64c34a17401F460460D4B9390518E5B473e ) @@ -43,8 +43,8 @@ contract BreadTest is Test { vm.prank(proxyAdmin); breadProxy.transferProxyAdmin(admin); - dai = IERC20(0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063); - aDai = IERC20(0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE); + dai = IERC20(0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1); + aDai = IERC20(0x8619d80FB0141ba7F184CbF22fd724116D9f7ffC); // get some DAI from some acct vm.startPrank(DAI_HOLDER); @@ -53,6 +53,8 @@ contract BreadTest is Test { dai.transfer(signer, daiHolderBalance / 4); vm.stopPrank(); + emit log_uint(dai.balanceOf(signer)); + vm.deal(admin, 10 ether); } @@ -95,6 +97,8 @@ contract BreadTest is Test { assertEq(breadFinal, breadAfter + (daiBeforeAdmin - daiAfterAdmin)); vm.stopPrank(); + uint256 aaDaiBalance = aDai.balanceOf(address(bread)); + emit log_uint(aaDaiBalance); // burn uint256 aDaiBalance = aDai.balanceOf(address(bread)); assertGt(aDaiBalance, 0);