Skip to content

Commit

Permalink
fix: use relative imports instead of absolute imports
Browse files Browse the repository at this point in the history
  • Loading branch information
xenide committed Jun 28, 2024
1 parent 891bcdf commit 90ca7da
Show file tree
Hide file tree
Showing 19 changed files with 68 additions and 68 deletions.
8 changes: 4 additions & 4 deletions script/optimized-deployer-meta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"constant_product_hash": "0x356ae496acb4119a46481b3326102cb38281aad285e579d14598f6c5bb76f5e2",
"factory_hash": "0xae59efa1baf1113957e748f189c8eb9271c4a0d919c8af03d26ae4fbddb51e81",
"oracle_caller_hash": "0xf130f5cb7eebcf57bac9f5d273fd8cc18dfb1b3f48d114a5e6a8230440d50e0f",
"stable_hash": "0xa4bb872f2e22f611d0fd1ff88d960edc58283528282cb20aab4fbe14da557300"
"constant_product_hash": "0x4739360c120de343e27371fb26bee80e693de6cc69a8bb001f66925a11b13269",
"factory_hash": "0xb545749c9209990dd695389d11cb58ec24771d4e015a0b03503ba25b64443a8a",
"oracle_caller_hash": "0x3da0bbb0172c3a0309ef5ce1b93bb3a1da1a29dfa56702cbabf4d031c8c329b9",
"stable_hash": "0x6dcaf26be4fb51c169f50f3ea7b81a693b29cf70ff37c6b81be21270f875e423"
}
6 changes: 3 additions & 3 deletions src/GenericFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { Address } from "@openzeppelin/utils/Address.sol";
import { SSTORE2 } from "solady/utils/SSTORE2.sol";
import { Owned } from "solmate/auth/Owned.sol";

import { Bytes32Lib } from "src/libraries/Bytes32.sol";
import { Bytes32Lib } from "./libraries/Bytes32.sol";

import { IGenericFactory, IERC20 } from "src/interfaces/IGenericFactory.sol";
import { StableMintBurn } from "src/curve/stable/StableMintBurn.sol";
import { IGenericFactory, IERC20 } from "./interfaces/IGenericFactory.sol";
import { StableMintBurn } from "./curve/stable/StableMintBurn.sol";

uint256 constant MAX_SSTORE_SIZE = 0x6000 - 1;

Expand Down
16 changes: 8 additions & 8 deletions src/ReservoirDeployer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ pragma solidity ^0.8.0;

import { Address } from "@openzeppelin/utils/Address.sol";

import { FactoryStoreLib } from "src/libraries/FactoryStore.sol";
import { Constants } from "src/Constants.sol";
import { FactoryStoreLib } from "./libraries/FactoryStore.sol";
import { Constants } from "./Constants.sol";

import { OracleCaller } from "src/oracle/OracleCaller.sol";
import { GenericFactory } from "src/GenericFactory.sol";
import { OracleCaller } from "./oracle/OracleCaller.sol";
import { GenericFactory } from "./GenericFactory.sol";

contract ReservoirDeployer {
using FactoryStoreLib for GenericFactory;
Expand All @@ -17,12 +17,12 @@ contract ReservoirDeployer {
uint256 public step = 0;

// Bytecode hashes.
bytes32 public constant FACTORY_HASH = bytes32(0xae59efa1baf1113957e748f189c8eb9271c4a0d919c8af03d26ae4fbddb51e81);
bytes32 public constant FACTORY_HASH = bytes32(0xb545749c9209990dd695389d11cb58ec24771d4e015a0b03503ba25b64443a8a);
bytes32 public constant CONSTANT_PRODUCT_HASH =
bytes32(0x356ae496acb4119a46481b3326102cb38281aad285e579d14598f6c5bb76f5e2);
bytes32 public constant STABLE_HASH = bytes32(0xa4bb872f2e22f611d0fd1ff88d960edc58283528282cb20aab4fbe14da557300);
bytes32(0x4739360c120de343e27371fb26bee80e693de6cc69a8bb001f66925a11b13269);
bytes32 public constant STABLE_HASH = bytes32(0x6dcaf26be4fb51c169f50f3ea7b81a693b29cf70ff37c6b81be21270f875e423);
bytes32 public constant ORACLE_CALLER_HASH =
bytes32(0xf130f5cb7eebcf57bac9f5d273fd8cc18dfb1b3f48d114a5e6a8230440d50e0f);
bytes32(0x3da0bbb0172c3a0309ef5ce1b93bb3a1da1a29dfa56702cbabf4d031c8c329b9);

// Deployment addresses.
GenericFactory public factory;
Expand Down
26 changes: 13 additions & 13 deletions src/ReservoirPair.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import { SafeCast } from "@openzeppelin/utils/math/SafeCast.sol";
import { FixedPointMathLib } from "solady/utils/FixedPointMathLib.sol";
import { SafeTransferLib } from "solady/utils/SafeTransferLib.sol";

import { StdMath } from "src/libraries/StdMath.sol";
import { FactoryStoreLib } from "src/libraries/FactoryStore.sol";
import { Bytes32Lib } from "src/libraries/Bytes32.sol";
import { LogCompression } from "src/libraries/LogCompression.sol";
import { Buffer } from "src/libraries/Buffer.sol";

import { IAssetManager, IERC20 } from "src/interfaces/IAssetManager.sol";
import { IAssetManagedPair } from "src/interfaces/IAssetManagedPair.sol";
import { IGenericFactory } from "src/interfaces/IGenericFactory.sol";

import { Observation } from "src/structs/Observation.sol";
import { Slot0 } from "src/structs/Slot0.sol";
import { ReservoirERC20 } from "src/ReservoirERC20.sol";
import { StdMath } from "./libraries/StdMath.sol";
import { FactoryStoreLib } from "./libraries/FactoryStore.sol";
import { Bytes32Lib } from "./libraries/Bytes32.sol";
import { LogCompression } from "./libraries/LogCompression.sol";
import { Buffer } from "./libraries/Buffer.sol";

import { IAssetManager, IERC20 } from "./interfaces/IAssetManager.sol";
import { IAssetManagedPair } from "./interfaces/IAssetManagedPair.sol";
import { IGenericFactory } from "./interfaces/IGenericFactory.sol";

import { Observation } from "./structs/Observation.sol";
import { Slot0 } from "./structs/Slot0.sol";
import { ReservoirERC20 } from "./ReservoirERC20.sol";

abstract contract ReservoirPair is IAssetManagedPair, ReservoirERC20 {
using FactoryStoreLib for IGenericFactory;
Expand Down
6 changes: 3 additions & 3 deletions src/ReservoirTimelock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ pragma solidity ^0.8.0;

import { CompTimelock } from "@openzeppelin/mocks/compound/CompTimelock.sol";

import { GenericFactory } from "src/GenericFactory.sol";
import { ReservoirPair } from "src/ReservoirPair.sol";
import { StablePair } from "src/curve/stable/StablePair.sol";
import { GenericFactory } from "./GenericFactory.sol";
import { ReservoirPair } from "./ReservoirPair.sol";
import { StablePair } from "./curve/stable/StablePair.sol";

contract ReservoirTimelock is CompTimelock(msg.sender, 7 days) {
modifier onlyAdmin() {
Expand Down
12 changes: 6 additions & 6 deletions src/asset-management/AaveManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import { SafeTransferLib } from "solady/utils/SafeTransferLib.sol";
import { SafeCast } from "@openzeppelin/utils/math/SafeCast.sol";
import { Address } from "@openzeppelin/utils/Address.sol";

import { IAssetManagedPair } from "src/interfaces/IAssetManagedPair.sol";
import { IAssetManager, IERC20 } from "src/interfaces/IAssetManager.sol";
import { IPoolAddressesProvider } from "src/interfaces/aave/IPoolAddressesProvider.sol";
import { IPool } from "src/interfaces/aave/IPool.sol";
import { IAaveProtocolDataProvider } from "src/interfaces/aave/IAaveProtocolDataProvider.sol";
import { IRewardsController } from "src/interfaces/aave/IRewardsController.sol";
import { IAssetManagedPair } from "../interfaces/IAssetManagedPair.sol";
import { IAssetManager, IERC20 } from "../interfaces/IAssetManager.sol";
import { IPoolAddressesProvider } from "../interfaces/aave/IPoolAddressesProvider.sol";
import { IPool } from "../interfaces/aave/IPool.sol";
import { IAaveProtocolDataProvider } from "../interfaces/aave/IAaveProtocolDataProvider.sol";
import { IRewardsController } from "../interfaces/aave/IRewardsController.sol";

contract AaveManager is IAssetManager, Owned(msg.sender), ReentrancyGuard {
using FixedPointMathLib for uint256;
Expand Down
16 changes: 8 additions & 8 deletions src/curve/constant-product/ConstantProductPair.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ pragma solidity ^0.8.0;
import { Math } from "@openzeppelin/utils/math/Math.sol";
import { FixedPointMathLib } from "solady/utils/FixedPointMathLib.sol";

import { Bytes32Lib } from "src/libraries/Bytes32.sol";
import { FactoryStoreLib } from "src/libraries/FactoryStore.sol";
import { ConstantProductMath } from "src/libraries/ConstantProductMath.sol";
import { ConstantProductOracleMath } from "src/libraries/ConstantProductOracleMath.sol";
import { IReservoirCallee } from "src/interfaces/IReservoirCallee.sol";
import { IGenericFactory, IERC20 } from "src/interfaces/IGenericFactory.sol";

import { ReservoirPair, Slot0, Observation } from "src/ReservoirPair.sol";
import { Bytes32Lib } from "../../libraries/Bytes32.sol";
import { FactoryStoreLib } from "../../libraries/FactoryStore.sol";
import { ConstantProductMath } from "../../libraries/ConstantProductMath.sol";
import { ConstantProductOracleMath } from "../../libraries/ConstantProductOracleMath.sol";
import { IReservoirCallee } from "../../interfaces/IReservoirCallee.sol";
import { IGenericFactory, IERC20 } from "../../interfaces/IGenericFactory.sol";

import { ReservoirPair, Slot0, Observation } from "../../ReservoirPair.sol";

contract ConstantProductPair is ReservoirPair {
using FactoryStoreLib for IGenericFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/curve/stable/StableMintBurn.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
IGenericFactory,
StablePair,
Slot0
} from "src/curve/stable/StablePair.sol";
} from "./StablePair.sol";

contract StableMintBurn is StablePair {
using FactoryStoreLib for IGenericFactory;
Expand Down
18 changes: 9 additions & 9 deletions src/curve/stable/StablePair.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

import { IReservoirCallee } from "src/interfaces/IReservoirCallee.sol";
import { IGenericFactory } from "src/interfaces/IGenericFactory.sol";
import { IReservoirCallee } from "../../interfaces/IReservoirCallee.sol";
import { IGenericFactory } from "../../interfaces/IGenericFactory.sol";

import { Bytes32Lib } from "src/libraries/Bytes32.sol";
import { FactoryStoreLib } from "src/libraries/FactoryStore.sol";
import { Bytes32Lib } from "../../libraries/Bytes32.sol";
import { FactoryStoreLib } from "../../libraries/FactoryStore.sol";

import { ReservoirPair, Slot0, Observation, IERC20 } from "src/ReservoirPair.sol";
import { StableMath } from "src/libraries/StableMath.sol";
import { StableOracleMath } from "src/libraries/StableOracleMath.sol";
import { ConstantProductOracleMath } from "src/libraries/ConstantProductOracleMath.sol";
import { ReservoirPair, Slot0, Observation, IERC20 } from "../../ReservoirPair.sol";
import { StableMath } from "../../libraries/StableMath.sol";
import { StableOracleMath } from "../../libraries/StableOracleMath.sol";
import { ConstantProductOracleMath } from "../../libraries/ConstantProductOracleMath.sol";

import { AmplificationData } from "src/structs/AmplificationData.sol";
import { AmplificationData } from "../../structs/AmplificationData.sol";

contract StablePair is ReservoirPair {
using FactoryStoreLib for IGenericFactory;
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IAssetManagedPair.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

import { IERC20 } from "forge-std/interfaces/IERC20.sol";

import { IAssetManager } from "src/interfaces/IAssetManager.sol";
import { IAssetManager } from "./IAssetManager.sol";

interface IAssetManagedPair {
event AssetManager(IAssetManager manager);
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IAssetManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

import { IERC20 } from "forge-std/interfaces/IERC20.sol";

import { IAssetManagedPair } from "src/interfaces/IAssetManagedPair.sol";
import { IAssetManagedPair } from "./IAssetManagedPair.sol";

interface IAssetManager {
function getBalance(IAssetManagedPair owner, IERC20 token) external returns (uint256 tokenBalance);
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/IGenericFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

import { IERC20 } from "forge-std/interfaces/IERC20.sol";

import { StableMintBurn } from "src/curve/stable/StableMintBurn.sol";
import { StableMintBurn } from "../curve/stable/StableMintBurn.sol";

interface IGenericFactory {
function stableMintBurn() external view returns (StableMintBurn);
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/aave/IPool.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0
pragma solidity ^0.8.0;

import { IPoolAddressesProvider } from "src/interfaces/aave/IPoolAddressesProvider.sol";
import { IPoolAddressesProvider } from "./IPoolAddressesProvider.sol";

/**
* @title IPool
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/ConstantProductOracleMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pragma solidity ^0.8.0;

import { FixedPointMathLib } from "solady/utils/FixedPointMathLib.sol";

import { LogCompression } from "src/libraries/LogCompression.sol";
import { LogCompression } from "./LogCompression.sol";

library ConstantProductOracleMath {
using FixedPointMathLib for uint256;
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/FactoryStore.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

import { IGenericFactory } from "src/interfaces/IGenericFactory.sol";
import { Bytes32Lib } from "src/libraries/Bytes32.sol";
import { IGenericFactory } from "../interfaces/IGenericFactory.sol";
import { Bytes32Lib } from "./Bytes32.sol";

library FactoryStoreLib {
using Bytes32Lib for bool;
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/LogCompression.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

pragma solidity ^0.8.0;

import "src/libraries/LogExpMath.sol";
import { LogExpMath } from "./LogExpMath.sol";

/**
* @dev Library for encoding and decoding values stored inside a 256 bit word. Typically used to pack multiple values in
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/StableMath.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity ^0.8.0;

import { MathUtils } from "src/libraries/MathUtils.sol";
import { StdMath } from "src/libraries/StdMath.sol";
import { MathUtils } from "./MathUtils.sol";
import { StdMath } from "./StdMath.sol";
import { FixedPointMathLib } from "solady/utils/FixedPointMathLib.sol";

library StableMath {
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/StableOracleMath.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ pragma solidity ^0.8.0;

import { FixedPointMathLib } from "solady/utils/FixedPointMathLib.sol";

import { LogCompression } from "src/libraries/LogCompression.sol";
import { StableMath } from "src/libraries/StableMath.sol";
import { LogCompression } from "./LogCompression.sol";
import { StableMath } from "./StableMath.sol";

// adapted from Balancer's impl at https://github.com/balancer/balancer-v2-monorepo/blob/903d34e491a5e9c5d59dabf512c7addf1ccf9bbd/pkg/pool-stable/contracts/meta/StableOracleMath.sol
library StableOracleMath {
Expand Down
2 changes: 1 addition & 1 deletion src/oracle/OracleCaller.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity ^0.8.0;

import { Owned } from "solmate/auth/Owned.sol";

import { Observation, ReservoirPair } from "src/ReservoirPair.sol";
import { Observation, ReservoirPair } from "../ReservoirPair.sol";

contract OracleCaller is Owned(msg.sender) {
event WhitelistChanged(address caller, bool whitelist);
Expand Down

0 comments on commit 90ca7da

Please sign in to comment.