Skip to content

Commit

Permalink
Move Uptime feeds contracts to a new folder (#10404)
Browse files Browse the repository at this point in the history
* Move Uptime feeds contract to a new folder

* Updated tests path for l2ep contracts

* fix right path

* moved l2ep folder 1 up

* Moved AcController to shared/access

* removed duplicate interfaces

* moved AC interface to shared
  • Loading branch information
simsonraj authored Sep 1, 2023
1 parent 4292b6a commit 08096d2
Show file tree
Hide file tree
Showing 37 changed files with 79 additions and 79 deletions.
4 changes: 2 additions & 2 deletions contracts/src/v0.8/Flags.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./SimpleReadAccessController.sol";
import "./interfaces/AccessControllerInterface.sol";
import "./shared/access/SimpleReadAccessController.sol";
import "./shared/interfaces/AccessControllerInterface.sol";
import "./interfaces/FlagsInterface.sol";

/**
Expand Down
4 changes: 2 additions & 2 deletions contracts/src/v0.8/dev/Flags.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;

import "../SimpleReadAccessController.sol";
import "../interfaces/AccessControllerInterface.sol";
import "../shared/access/SimpleReadAccessController.sol";
import "../shared/interfaces/AccessControllerInterface.sol";
import "../interfaces/TypeAndVersionInterface.sol";

/* dev dependencies - to be re/moved after audit */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../shared/access/ConfirmedOwner.sol";
import "../../shared/access/ConfirmedOwner.sol";
import "./interfaces/CrossDomainOwnableInterface.sol";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../interfaces/TypeAndVersionInterface.sol";
import "./../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol";
import "../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";
import "./CrossDomainForwarder.sol";
import "../../../interfaces/TypeAndVersionInterface.sol";
import "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol";
import "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";
import "../CrossDomainForwarder.sol";

/**
* @title ArbitrumCrossDomainForwarder - L1 xDomain account representation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./interfaces/DelegateForwarderInterface.sol";
import "./../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol";
import "../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";
import "../interfaces/DelegateForwarderInterface.sol";
import "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol";
import "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";
import "./ArbitrumCrossDomainForwarder.sol";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import {AddressAliasHelper} from "./../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol";
import {ForwarderInterface} from "./interfaces/ForwarderInterface.sol";
import {AggregatorInterface} from "../interfaces/AggregatorInterface.sol";
import {AggregatorV3Interface} from "../interfaces/AggregatorV3Interface.sol";
import {AggregatorV2V3Interface} from "../interfaces/AggregatorV2V3Interface.sol";
import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol";
import {FlagsInterface} from "./interfaces/FlagsInterface.sol";
import {ArbitrumSequencerUptimeFeedInterface} from "./interfaces/ArbitrumSequencerUptimeFeedInterface.sol";
import {SimpleReadAccessController} from "../SimpleReadAccessController.sol";
import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol";
import {AddressAliasHelper} from "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol";
import {ForwarderInterface} from "./../interfaces/ForwarderInterface.sol";
import {AggregatorInterface} from "../../../interfaces/AggregatorInterface.sol";
import {AggregatorV3Interface} from "../../../interfaces/AggregatorV3Interface.sol";
import {AggregatorV2V3Interface} from "../../../interfaces/AggregatorV2V3Interface.sol";
import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol";
import {FlagsInterface} from "./../../../dev/interfaces/FlagsInterface.sol";
import {ArbitrumSequencerUptimeFeedInterface} from "../interfaces/ArbitrumSequencerUptimeFeedInterface.sol";
import {SimpleReadAccessController} from "../../../shared/access/SimpleReadAccessController.sol";
import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol";

/**
* @title ArbitrumSequencerUptimeFeed - L2 sequencer uptime status aggregator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../interfaces/AggregatorValidatorInterface.sol";
import "../interfaces/TypeAndVersionInterface.sol";
import "../interfaces/AccessControllerInterface.sol";
import "../interfaces/AggregatorV3Interface.sol";
import "../SimpleWriteAccessController.sol";
import "../../../interfaces/AggregatorValidatorInterface.sol";
import "../../../interfaces/TypeAndVersionInterface.sol";
import "../../../shared/interfaces/AccessControllerInterface.sol";
import "../../../interfaces/AggregatorV3Interface.sol";
import "../../../shared/access/SimpleWriteAccessController.sol";

/* ./dev dependencies - to be moved from ./dev after audit */
import "./interfaces/ArbitrumSequencerUptimeFeedInterface.sol";
import "./interfaces/FlagsInterface.sol";
import "./interfaces/IArbitrumDelayedInbox.sol";
import "./../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol";
import "../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol";
import "../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";
import "../interfaces/ArbitrumSequencerUptimeFeedInterface.sol";
import "../../../dev/interfaces/FlagsInterface.sol";
import "../interfaces/IArbitrumDelayedInbox.sol";
import "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/libraries/AddressAliasHelper.sol";
import "../../../vendor/@arbitrum/nitro-contracts/src/precompiles/ArbSys.sol";
import "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";

/**
* @title ArbitrumValidator - makes xDomain L2 Flags contract call (using L2 xDomain Forwarder contract)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/bridge/interfaces/IInbox.sol";
import "../../../vendor/arb-bridge-eth/v0.8.0-custom/contracts/bridge/interfaces/IInbox.sol";

/**
* @notice This interface extends Arbitrum's IInbox interface to include
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../interfaces/TypeAndVersionInterface.sol";
import "../../../interfaces/TypeAndVersionInterface.sol";

/* ./dev dependencies - to be moved from ./dev after audit */
import "./CrossDomainForwarder.sol";
import "../vendor/@eth-optimism/contracts/0.4.7/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_CrossDomainMessenger.sol";
import "../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";
import "../CrossDomainForwarder.sol";
import "../../../vendor/@eth-optimism/contracts/0.4.7/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_CrossDomainMessenger.sol";
import "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";

/**
* @title OptimismCrossDomainForwarder - L1 xDomain account representation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./interfaces/DelegateForwarderInterface.sol";
import "../vendor/@eth-optimism/contracts/0.4.7/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_CrossDomainMessenger.sol";
import "../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";
import "../interfaces/DelegateForwarderInterface.sol";
import "../../../vendor/@eth-optimism/contracts/0.4.7/contracts/optimistic-ethereum/iOVM/bridge/messaging/iOVM_CrossDomainMessenger.sol";
import "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";
import "./OptimismCrossDomainForwarder.sol";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;

import {AggregatorInterface} from "../interfaces/AggregatorInterface.sol";
import {AggregatorV3Interface} from "../interfaces/AggregatorV3Interface.sol";
import {AggregatorV2V3Interface} from "../interfaces/AggregatorV2V3Interface.sol";
import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol";
import {OptimismSequencerUptimeFeedInterface} from "./interfaces/OptimismSequencerUptimeFeedInterface.sol";
import {SimpleReadAccessController} from "../SimpleReadAccessController.sol";
import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol";
import {AggregatorInterface} from "../../../interfaces/AggregatorInterface.sol";
import {AggregatorV3Interface} from "../../../interfaces/AggregatorV3Interface.sol";
import {AggregatorV2V3Interface} from "../../../interfaces/AggregatorV2V3Interface.sol";
import {TypeAndVersionInterface} from "../../../interfaces/TypeAndVersionInterface.sol";
import {OptimismSequencerUptimeFeedInterface} from "./../interfaces/OptimismSequencerUptimeFeedInterface.sol";
import {SimpleReadAccessController} from "../../../shared/access/SimpleReadAccessController.sol";
import {ConfirmedOwner} from "../../../shared/access/ConfirmedOwner.sol";
import {IL2CrossDomainMessenger} from "@eth-optimism/contracts/L2/messaging/IL2CrossDomainMessenger.sol";

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "../interfaces/AggregatorValidatorInterface.sol";
import "../interfaces/TypeAndVersionInterface.sol";
import "../interfaces/AccessControllerInterface.sol";
import "../interfaces/AggregatorV3Interface.sol";
import "../SimpleWriteAccessController.sol";
import "../../../interfaces/AggregatorValidatorInterface.sol";
import "../../../interfaces/TypeAndVersionInterface.sol";
import "../../../shared/interfaces/AccessControllerInterface.sol";
import "../../../interfaces/AggregatorV3Interface.sol";
import "../../../shared/access/SimpleWriteAccessController.sol";

import "./interfaces/OptimismSequencerUptimeFeedInterface.sol";
import "./../interfaces/OptimismSequencerUptimeFeedInterface.sol";
import "@eth-optimism/contracts/L1/messaging/IL1CrossDomainMessenger.sol";
import "../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";
import "../../../vendor/openzeppelin-solidity/v4.7.3/contracts/utils/Address.sol";

/**
* @title OptimismValidator - makes cross chain call to update the Sequencer Uptime Feed on L2
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/v0.8/llo-feeds/VerifierProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {ConfirmedOwner} from "../shared/access/ConfirmedOwner.sol";
import {IVerifierProxy} from "./interfaces/IVerifierProxy.sol";
import {IVerifier} from "./interfaces/IVerifier.sol";
import {TypeAndVersionInterface} from "../interfaces/TypeAndVersionInterface.sol";
import {AccessControllerInterface} from "../interfaces/AccessControllerInterface.sol";
import {AccessControllerInterface} from "../shared/interfaces/AccessControllerInterface.sol";
import {IERC165} from "../vendor/openzeppelin-solidity/v4.8.0/contracts/interfaces/IERC165.sol";
import {IVerifierFeeManager} from "./interfaces/IVerifierFeeManager.sol";
import {Common} from "../libraries/Common.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/src/v0.8/llo-feeds/interfaces/IVerifierProxy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.16;

import {Common} from "../../libraries/Common.sol";
import {AccessControllerInterface} from "../../interfaces/AccessControllerInterface.sol";
import {AccessControllerInterface} from "../../shared/interfaces/AccessControllerInterface.sol";
import {IVerifierFeeManager} from "./IVerifierFeeManager.sol";

interface IVerifierProxy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity 0.8.16;

import {BaseTest, BaseTestWithConfiguredVerifierAndFeeManager} from "../verifier/BaseVerifierTest.t.sol";
import {Verifier} from "../../Verifier.sol";
import {SimpleWriteAccessController} from "../../../SimpleWriteAccessController.sol";
import {SimpleWriteAccessController} from "../../../shared/access/SimpleWriteAccessController.sol";
import {Common} from "../../../libraries/Common.sol";
import {IRewardManager} from "../../dev/interfaces/IRewardManager.sol";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "./shared/access/ConfirmedOwner.sol";
import "./interfaces/AccessControllerInterface.sol";
import "./ConfirmedOwner.sol";
import "../interfaces/AccessControllerInterface.sol";

/**
* @title SimpleWriteAccessController
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/v0.8/Flags.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let consumer: Contract
before(async () => {
personas = (await getUsers()).personas
controllerFactory = await ethers.getContractFactory(
'src/v0.8/SimpleWriteAccessController.sol:SimpleWriteAccessController',
'src/v0.8/shared/access/SimpleWriteAccessController.sol:SimpleWriteAccessController',
personas.Nelly,
)
consumerFactory = await ethers.getContractFactory(
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/v0.8/SimpleReadAccessController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let controller: Contract
before(async () => {
personas = (await getUsers()).personas
controllerFactory = await ethers.getContractFactory(
'src/v0.8/SimpleReadAccessController.sol:SimpleReadAccessController',
'src/v0.8/shared/access/SimpleReadAccessController.sol:SimpleReadAccessController',
personas.Carol,
)
})
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/v0.8/SimpleWriteAccessController.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ let controller: Contract
before(async () => {
personas = (await getUsers()).personas
controllerFactory = await ethers.getContractFactory(
'src/v0.8/SimpleWriteAccessController.sol:SimpleWriteAccessController',
'src/v0.8/shared/access/SimpleWriteAccessController.sol:SimpleWriteAccessController',
personas.Carol,
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ before(async () => {

// Contract factories
forwarderFactory = await ethers.getContractFactory(
'src/v0.8/dev/ArbitrumCrossDomainForwarder.sol:ArbitrumCrossDomainForwarder',
'src/v0.8/l2ep/dev/arbitrum/ArbitrumCrossDomainForwarder.sol:ArbitrumCrossDomainForwarder',
owner,
)
greeterFactory = await ethers.getContractFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ before(async () => {

// Contract factories
governorFactory = await ethers.getContractFactory(
'src/v0.8/dev/ArbitrumCrossDomainGovernor.sol:ArbitrumCrossDomainGovernor',
'src/v0.8/l2ep/dev/arbitrum/ArbitrumCrossDomainGovernor.sol:ArbitrumCrossDomainGovernor',
owner,
)
greeterFactory = await ethers.getContractFactory(
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/v0.8/dev/ArbitrumSequencerUptimeFeed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('ArbitrumSequencerUptimeFeed', () => {

beforeEach(async () => {
const accessControllerFactory = await ethers.getContractFactory(
'src/v0.8/SimpleWriteAccessController.sol:SimpleWriteAccessController',
'src/v0.8/shared/access/SimpleWriteAccessController.sol:SimpleWriteAccessController',
deployer,
)
accessController = await accessControllerFactory.deploy()
Expand All @@ -55,7 +55,7 @@ describe('ArbitrumSequencerUptimeFeed', () => {

const arbitrumSequencerStatusRecorderFactory =
await ethers.getContractFactory(
'src/v0.8/dev/ArbitrumSequencerUptimeFeed.sol:ArbitrumSequencerUptimeFeed',
'src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol:ArbitrumSequencerUptimeFeed',
deployer,
)
arbitrumSequencerUptimeFeed =
Expand Down
10 changes: 5 additions & 5 deletions contracts/test/v0.8/dev/ArbitrumValidator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
} from '@ethereum-waffle/mock-contract'
/// Pick ABIs from compilation
// @ts-ignore
import { abi as arbitrumSequencerStatusRecorderAbi } from '../../../artifacts/src/v0.8/dev/ArbitrumSequencerUptimeFeed.sol/ArbitrumSequencerUptimeFeed.json'
import { abi as arbitrumSequencerStatusRecorderAbi } from '../../../artifacts/src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol/ArbitrumSequencerUptimeFeed.json'
// @ts-ignore
import { abi as arbitrumInboxAbi } from '../../../artifacts/src/v0.8/dev/vendor/arb-bridge-eth/v0.8.0-custom/contracts/bridge/interfaces/IInbox.sol/IInbox.json'
import { abi as arbitrumInboxAbi } from '../../../artifacts/src/v0.8/vendor/arb-bridge-eth/v0.8.0-custom/contracts/bridge/interfaces/IInbox.sol/IInbox.json'
// @ts-ignore
import { abi as aggregatorAbi } from '../../../artifacts/src/v0.8/interfaces/AggregatorV2V3Interface.sol/AggregatorV2V3Interface.json'

Expand Down Expand Up @@ -50,14 +50,14 @@ describe('ArbitrumValidator', () => {

beforeEach(async () => {
const accessControllerFactory = await ethers.getContractFactory(
'src/v0.8/SimpleWriteAccessController.sol:SimpleWriteAccessController',
'src/v0.8/shared/access/SimpleWriteAccessController.sol:SimpleWriteAccessController',
deployer,
)
accessController = await accessControllerFactory.deploy()

// Required for building the calldata
arbitrumSequencerStatusRecorderFactory = await ethers.getContractFactory(
'src/v0.8/dev/ArbitrumSequencerUptimeFeed.sol:ArbitrumSequencerUptimeFeed',
'src/v0.8/l2ep/dev/arbitrum/ArbitrumSequencerUptimeFeed.sol:ArbitrumSequencerUptimeFeed',
deployer,
)
l1GasFeed = await deployMockContract(deployer as any, aggregatorAbi)
Expand All @@ -76,7 +76,7 @@ describe('ArbitrumValidator', () => {

// Contract under test
const arbitrumValidatorFactory = await ethers.getContractFactory(
'src/v0.8/dev/ArbitrumValidator.sol:ArbitrumValidator',
'src/v0.8/l2ep/dev/arbitrum/ArbitrumValidator.sol:ArbitrumValidator',
deployer,
)
arbitrumValidator = await arbitrumValidatorFactory.deploy(
Expand Down
2 changes: 1 addition & 1 deletion contracts/test/v0.8/dev/CrossDomainOwnable.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ before(async () => {

// Contract factories
ownableFactory = await ethers.getContractFactory(
'src/v0.8/dev/CrossDomainOwnable.sol:CrossDomainOwnable',
'src/v0.8/l2ep/dev/CrossDomainOwnable.sol:CrossDomainOwnable',
owner,
)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ before(async () => {

// Contract factories
forwarderFactory = await ethers.getContractFactory(
'src/v0.8/dev/OptimismCrossDomainForwarder.sol:OptimismCrossDomainForwarder',
'src/v0.8/l2ep/dev/optimism/OptimismCrossDomainForwarder.sol:OptimismCrossDomainForwarder',
owner,
)
greeterFactory = await ethers.getContractFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ before(async () => {

// Contract factories
governorFactory = await ethers.getContractFactory(
'src/v0.8/dev/OptimismCrossDomainGovernor.sol:OptimismCrossDomainGovernor',
'src/v0.8/l2ep/dev/optimism/OptimismCrossDomainGovernor.sol:OptimismCrossDomainGovernor',
owner,
)
greeterFactory = await ethers.getContractFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe('OptimismSequencerUptimeFeed', () => {
beforeEach(async () => {
const optimismSequencerStatusRecorderFactory =
await ethers.getContractFactory(
'src/v0.8/dev/OptimismSequencerUptimeFeed.sol:OptimismSequencerUptimeFeed',
'src/v0.8/l2ep/dev/optimism/OptimismSequencerUptimeFeed.sol:OptimismSequencerUptimeFeed',
deployer,
)
optimismUptimeFeed = await optimismSequencerStatusRecorderFactory.deploy(
Expand Down
Loading

0 comments on commit 08096d2

Please sign in to comment.