Skip to content

Commit

Permalink
burn test bruh?
Browse files Browse the repository at this point in the history
  • Loading branch information
Astodialo committed Nov 5, 2024
1 parent 4e3ea97 commit 8a23c0e
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
6 changes: 2 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@
nodePackages.ts-node
nodePackages.pnpm

solc_0_4_26
solc_0_7_6
solc_0_8_19
(solc.mkDefault pkgs solc_0_7_6)
solc_0_8_13
(solc.mkDefault pkgs solc_0_8_13)

];

Expand Down
2 changes: 1 addition & 1 deletion src/Bread.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
pragma solidity ^0.8.15;


// Bread - An ERC20 stablecoin fully collateralized by DAI
Expand Down
21 changes: 21 additions & 0 deletions test/Bread.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,27 @@ contract BreadTest is Test {
vm.prank(admin);
bread.rescueToken(address(aDai), 1);
}
function test_protect_owner_functions() public {
vm.prank(signer);
vm.expectRevert();
bread.rescueToken(address(aDai), 1);
}
function test_resecue() public {
uint256 bb_before = dai.balanceOf(address(bread));
uint256 signerDai = dai.balanceOf(signer);
vm.prank(signer);
dai.transfer(address(bread), signerDai);
uint256 bb_after = dai.balanceOf(address(bread));
assertEq(bb_before, 0);
assertGt(bb_after, bb_before);

uint256 admin_before = dai.balanceOf(admin);
vm.prank(admin);
bread.rescueToken(address(dai), bb_after);
uint256 admin_after = dai.balanceOf(admin);
assertGt(admin_after, admin_before);
assertEq(admin_after, admin_before + bb_after);
}
function test_upgradeablity() public {
vm.prank(signer);
vm.expectRevert("NOT_AUTHORIZED");
Expand Down

0 comments on commit 8a23c0e

Please sign in to comment.