Skip to content

Commit

Permalink
optimism?!
Browse files Browse the repository at this point in the history
  • Loading branch information
Astodialo committed Nov 5, 2024
1 parent 9640327 commit b68ea39
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
3 changes: 1 addition & 2 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
Expand Down Expand Up @@ -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"
'';
};
});
Expand Down
4 changes: 4 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
14 changes: 9 additions & 5 deletions test/Bread.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ 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;

function setUp() public {
vm.startPrank(admin);
address breadAddress = address(
new Bread(
0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063,
0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE,
0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1,
0x8619d80FB0141ba7F184CbF22fd724116D9f7ffC,
0x794a61358D6845594F94dc1DB02A252b5b4814aD,
0x929EC64c34a17401F460460D4B9390518E5B473e
)
Expand All @@ -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);
Expand All @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b68ea39

Please sign in to comment.