Skip to content

Commit 1838ed3

Browse files
add interfaces
1 parent 3923837 commit 1838ed3

File tree

5 files changed

+40
-2
lines changed

5 files changed

+40
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ out/
99

1010
# Dotenv file
1111
.env
12+
13+
# Coverage file
14+
lcov.info

src/MaglevBase.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ import {EVCUtil} from "evc/utils/EVCUtil.sol";
55
import {IEVC} from "evc/interfaces/IEthereumVaultConnector.sol";
66
import {IEVault, IERC20, IBorrowing, IERC4626, IRiskManager} from "evk/EVault/IEVault.sol";
77
import {IUniswapV2Callee} from "./interfaces/IUniswapV2Callee.sol";
8+
import {IMaglevBase} from "./interfaces/IMaglevBase.sol";
89

9-
abstract contract MaglevBase is EVCUtil {
10+
abstract contract MaglevBase is IMaglevBase, EVCUtil {
1011
address public immutable vault0;
1112
address public immutable vault1;
1213
address public immutable asset0;

src/MaglevEulerSwap.sol

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ pragma solidity ^0.8.27;
33

44
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
55
import {MaglevBase} from "./MaglevBase.sol";
6+
import {IMaglevEulerSwap} from "./interfaces/IMaglevEulerSwap.sol";
67

7-
contract MaglevEulerSwap is MaglevBase {
8+
contract MaglevEulerSwap is IMaglevEulerSwap, MaglevBase {
89
uint256 public immutable priceX;
910
uint256 public immutable priceY;
1011
uint256 public immutable concentrationX;

src/interfaces/IMaglevBase.sol

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity >=0.8.0;
3+
4+
interface IMaglevBase {
5+
function configure() external;
6+
function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external;
7+
function quoteExactInput(address tokenIn, address tokenOut, uint256 amountIn) external view returns (uint256);
8+
function quoteExactOutput(address tokenIn, address tokenOut, uint256 amountOut) external view returns (uint256);
9+
10+
function vault0() external view returns (address);
11+
function vault1() external view returns (address);
12+
function asset0() external view returns (address);
13+
function asset1() external view returns (address);
14+
function myAccount() external view returns (address);
15+
function debtLimit0() external view returns (uint112);
16+
function debtLimit1() external view returns (uint112);
17+
function feeMultiplier() external view returns (uint256);
18+
function reserve0() external view returns (uint112);
19+
function reserve1() external view returns (uint112);
20+
}

src/interfaces/IMaglevEulerSwap.sol

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// SPDX-License-Identifier: UNLICENSED
2+
pragma solidity >=0.8.0;
3+
4+
import {IMaglevBase} from "./IMaglevBase.sol";
5+
6+
interface IMaglevEulerSwap is IMaglevBase {
7+
function priceX() external view returns (uint256);
8+
function priceY() external view returns (uint256);
9+
function concentrationX() external view returns (uint256);
10+
function concentrationY() external view returns (uint256);
11+
function initialReserve0() external view returns (uint112);
12+
function initialReserve1() external view returns (uint112);
13+
}

0 commit comments

Comments
 (0)