-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed unnecessary receive function
- Loading branch information
1 parent
42bad08
commit 28be5ef
Showing
4 changed files
with
5 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,20 +9,11 @@ import "@openzeppelin/[email protected]/token/ERC20/extensions/ERC20FlashMint.sol" | |
abstract contract XRC20 is ERC20, ERC20Permit, ERC20Votes, ERC20FlashMint { | ||
// The following functions are overrides required by Solidity. | ||
|
||
function _update(address from, address to, uint256 value) | ||
internal | ||
override(ERC20, ERC20Votes) | ||
{ | ||
function _update(address from, address to, uint256 value) internal override(ERC20, ERC20Votes) { | ||
super._update(from, to, value); | ||
} | ||
|
||
function nonces(address owner) | ||
public | ||
view | ||
override(ERC20Permit, Nonces) | ||
returns (uint256) | ||
{ | ||
function nonces(address owner) public view override(ERC20Permit, Nonces) returns (uint256) { | ||
return super.nonces(owner); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,6 @@ pragma solidity ^0.8.24; | |
import {IERC4626} from "@openzeppelin/[email protected]/interfaces/IERC4626.sol"; | ||
import {UD60x18} from "@prb/[email protected]/src/UD60x18.sol"; | ||
|
||
error PayableErr(); | ||
error Undersupply(); | ||
error CannotBeZero(); | ||
error SlippageError(); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,11 +3,11 @@ pragma solidity ^0.8.19; | |
|
||
import {Test} from "forge-std/Test.sol"; | ||
import {Solaxy} from "../src/Solaxy.sol"; | ||
import {PayableErr, RequiresM3ter} from "../src/interfaces/ISolaxy.sol"; | ||
import {RequiresM3ter} from "../src/interfaces/ISolaxy.sol"; | ||
import {IERC20} from "@openzeppelin/[email protected]/interfaces/IERC20.sol"; | ||
import {IERC721} from "@openzeppelin/[email protected]/interfaces/IERC721.sol"; | ||
|
||
contract SolaxyTestWithoutM3ter is Test { | ||
contract SolaxyUnitTest is Test { | ||
Solaxy public SLX; | ||
IERC20 public sDAI; | ||
address public here; | ||
|
@@ -41,26 +41,22 @@ contract SolaxyTestWithoutM3ter is Test { | |
} | ||
|
||
function testSendEtherToContract() public { | ||
vm.expectRevert(PayableErr.selector); // expect a transaction revert during test. | ||
vm.expectRevert(); // expect a transaction revert during test. | ||
payable(SLX_address).transfer(1 ether); // Sending 1 Ether to the contract | ||
assertEq(SLX_address.balance, 0 ether, "asset ether balance is still equal to zero"); | ||
} | ||
|
||
function testNonM3terHolder() public { | ||
vm.expectRevert(RequiresM3ter.selector); | ||
// Deposit sDAI to Solaxy contract | ||
SLX.deposit(sDAI_amountDeposited, here); | ||
|
||
vm.expectRevert(RequiresM3ter.selector); | ||
// Withdraw sDAI from Solaxy contract | ||
SLX.withdraw(sDAI_amountWithdrawn, here, here); | ||
|
||
vm.expectRevert(RequiresM3ter.selector); | ||
// Mint new SLX tokens | ||
SLX.mint(SLX_amountMinted, here); | ||
|
||
vm.expectRevert(RequiresM3ter.selector); | ||
// Redeem SLX tokens | ||
SLX.redeem(SLX_amountIn, here, here); | ||
} | ||
|
||
|