44 lines
1.5 KiB
Solidity
44 lines
1.5 KiB
Solidity
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||
|
|
pragma solidity ^0.8.19;
|
||
|
|
|
||
|
|
import "forge-std/Test.sol";
|
||
|
|
import "../src/libraries/UniswapMath.sol";
|
||
|
|
import "../src/abstracts/PriceOracle.sol";
|
||
|
|
import "../src/abstracts/ThreePositionStrategy.sol";
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @title Modular Components Test
|
||
|
|
* @notice Quick validation that all modular components compile and basic functions work
|
||
|
|
*/
|
||
|
|
|
||
|
|
// Simple test implementations
|
||
|
|
contract TestUniswapMath is UniswapMath {
|
||
|
|
function testTickAtPrice(bool t0isWeth, uint256 tokenAmount, uint256 ethAmount) external pure returns (int24) {
|
||
|
|
return _tickAtPrice(t0isWeth, tokenAmount, ethAmount);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
contract ModularComponentsTest is Test {
|
||
|
|
TestUniswapMath testMath;
|
||
|
|
|
||
|
|
function setUp() public {
|
||
|
|
testMath = new TestUniswapMath();
|
||
|
|
}
|
||
|
|
|
||
|
|
function testUniswapMathCompilation() public {
|
||
|
|
// Test that mathematical utilities work
|
||
|
|
int24 tick = testMath.testTickAtPrice(true, 1 ether, 1 ether);
|
||
|
|
|
||
|
|
// Should get a reasonable tick for 1:1 ratio
|
||
|
|
assertGt(tick, -10000, "Tick should be reasonable");
|
||
|
|
assertLt(tick, 10000, "Tick should be reasonable");
|
||
|
|
|
||
|
|
console.log("UniswapMath component test passed");
|
||
|
|
}
|
||
|
|
|
||
|
|
function testModularArchitectureCompiles() public {
|
||
|
|
// If this test runs, it means all modular components compiled successfully
|
||
|
|
assertTrue(true, "Modular architecture compiles successfully");
|
||
|
|
console.log("All modular components compiled successfully");
|
||
|
|
}
|
||
|
|
}
|