Skip to content

Commit

Permalink
fix compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
daopunk committed Dec 26, 2023
1 parent 734be13 commit 1c8addb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
11 changes: 9 additions & 2 deletions script/Common.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,23 @@ pragma solidity 0.7.6;
import '@script/Registry.s.sol';
import {Script} from 'forge-std/Script.sol';
import {IAuthorizable} from '@interfaces/utils/IAuthorizable.sol';
import {RelayerFactory} from '@contracts/factories/RelayerFactory.sol';
import {ChainlinkRelayerFactory} from '@contracts/factories/ChainlinkRelayerFactory.sol';
import {DenominatedOracleFactory} from '@contracts/factories/DenominatedOracleFactory.sol';

abstract contract Common is Script {
RelayerFactory public camelotRelayerFactory = RelayerFactory(CAMELOT_RELAYER_FACTORY);
ChainlinkRelayerFactory public chainlinkRelayerFactory = ChainlinkRelayerFactory(CHAINLINK_RELAYER_FACTORY);
DenominatedOracleFactory public denominatedOracleFactory = DenominatedOracleFactory(DENOMINATED_ORACLE_FACTORY);

function _revoke(IAuthorizable _contract, address _authorize, address _deauthorize) internal {
_contract.addAuthorization(_authorize);
_contract.removeAuthorization(_deauthorize);
}

function revokeFactories() external {
function revokeFactories() internal {
_revoke(IAuthorizable(address(camelotRelayerFactory)), TEST_GOVERNOR, vm.envAddress('ARB_SEPOLIA_DEPLOYER_PC'));
_revoke(IAuthorizable(address(chainlinkRelayerFactory)), TEST_GOVERNOR, vm.envAddress('ARB_SEPOLIA_DEPLOYER_PC'));
_revoke(IAuthorizable(address(densominatedOracleFactory)), TEST_GOVERNOR, vm.envAddress('ARB_SEPOLIA_DEPLOYER_PC'));
_revoke(IAuthorizable(address(denominatedOracleFactory)), TEST_GOVERNOR, vm.envAddress('ARB_SEPOLIA_DEPLOYER_PC'));
}
}
6 changes: 0 additions & 6 deletions script/postdeployment/SetupPostEnvironment.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import {IAlgebraFactory} from '@algebra-core/interfaces/IAlgebraFactory.sol';
import {IAlgebraPool} from '@algebra-core/interfaces/IAlgebraPool.sol';
import {IERC20Metadata} from '@algebra-periphery/interfaces/IERC20Metadata.sol';
import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol';
import {RelayerFactory} from '@contracts/factories/RelayerFactory.sol';
import {ChainlinkRelayerFactory} from '@contracts/factories/ChainlinkRelayerFactory.sol';
import {DenominatedOracleFactory} from '@contracts/factories/DenominatedOracleFactory.sol';
import {IAuthorizable} from '@interfaces/utils/IAuthorizable.sol';
import {MintableERC20} from '@contracts/for-test/MintableERC20.sol';

Expand All @@ -22,9 +19,6 @@ import {MintableERC20} from '@contracts/for-test/MintableERC20.sol';

contract SetupPostEnvironment is Common {
IAlgebraFactory public algebraFactory = IAlgebraFactory(SEPOLIA_ALGEBRA_FACTORY);
RelayerFactory public camelotRelayerFactory = RelayerFactory(CAMELOT_RELAYER_FACTORY);
ChainlinkRelayerFactory public chainlinkRelayerFactory = ChainlinkRelayerFactory(CHAINLINK_RELAYER_FACTORY);
DenominatedOracleFactory public denominatedOracleFactory = DenominatedOracleFactory(DENOMINATED_ORACLE_FACTORY);

function run() public {
vm.startBroadcast(vm.envUint('ARB_SEPOLIA_DEPLOYER_PK'));
Expand Down
6 changes: 3 additions & 3 deletions src/contracts/factories/RelayerChild.sol
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.7.6;

import {Relayer} from '@contracts/oracles/Relayer.sol';
import {CamelotRelayer} from '@contracts/oracles/CamelotRelayer.sol';
import {FactoryChild} from '@contracts/factories/FactoryChild.sol';

contract RelayerChild is Relayer, FactoryChild {
contract RelayerChild is CamelotRelayer, FactoryChild {
// --- Init ---
constructor(
address _algebraV3Factory,
address _baseToken,
address _quoteToken,
uint32 _quotePeriod
) Relayer(_algebraV3Factory, _baseToken, _quoteToken, _quotePeriod) {}
) CamelotRelayer(_algebraV3Factory, _baseToken, _quoteToken, _quotePeriod) {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {IAlgebraPool} from '@algebra-core/interfaces/IAlgebraPool.sol';
import {IDataStorageOperator} from '@algebra-core/interfaces/IDataStorageOperator.sol';
import {DataStorageLibrary} from '@algebra-periphery/libraries/DataStorageLibrary.sol';

contract Relayer {
contract CamelotRelayer {
address public algebraPool;
address public baseToken;
address public quoteToken;
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/SystemOracle.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ETH_ARB_POOL
} from '@script/Registry.s.sol';
import {DSTestPlus} from '@test/utils/DSTestPlus.t.sol';
import {Relayer} from '@contracts/oracles/Relayer.sol';
import {CamelotRelayer} from '@contracts/oracles/CamelotRelayer.sol';
import {IBaseOracle} from '@interfaces/oracles/IBaseOracle.sol';
import {IAlgebraFactory} from '@algebra-core/interfaces/IAlgebraFactory.sol';
import {ChainlinkRelayer} from '@contracts/oracles/ChainlinkRelayer.sol';
Expand Down Expand Up @@ -72,8 +72,8 @@ contract OracleSetup is DSTestPlus {
ethUsdPriceSource = IBaseOracle(address(new ChainlinkRelayer(CHAINLINK_ETH_USD_FEED, 1 days)));

// --- Camelot ---
arbEthPriceSource = IBaseOracle(address(new Relayer(MAINNET_ALGEBRA_FACTORY, ARB, ETH, 1 days))); // correct
ethArbPriceSource = IBaseOracle(address(new Relayer(MAINNET_ALGEBRA_FACTORY, ETH, ARB, 1 days))); // inverted
arbEthPriceSource = IBaseOracle(address(new CamelotRelayer(MAINNET_ALGEBRA_FACTORY, ARB, ETH, 1 days))); // correct
ethArbPriceSource = IBaseOracle(address(new CamelotRelayer(MAINNET_ALGEBRA_FACTORY, ETH, ARB, 1 days))); // inverted

// --- Denominated ---
arbUsdPriceSource = IDenominatedOracle(address(new DenominatedOracle(arbEthPriceSource, ethUsdPriceSource, false)));
Expand Down

0 comments on commit 1c8addb

Please sign in to comment.