Skip to content

Commit

Permalink
feat(l1-contracts): remove remappings of @Aztec (#2797)
Browse files Browse the repository at this point in the history
Currently you can't use the npm package `@aztec/l1-contracts` due to
these remappings. `npx hardhat compile` would fail with `unable to find
module @aztec/core/package.json. Install it with npm`

I have left `@oz` remappings since that is only used in the tests. Happy
to remove it too though
  • Loading branch information
rahul-kothari authored Oct 11, 2023
1 parent c794533 commit aac8b37
Show file tree
Hide file tree
Showing 17 changed files with 87 additions and 91 deletions.
6 changes: 1 addition & 5 deletions l1-contracts/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ libs = ['lib']
solc = "0.8.21"

remappings = [
"@oz/=lib/openzeppelin-contracts/contracts/",
"@aztec/core/=src/core/",
"@aztec/periphery/=src/periphery/",
"@aztec/mock/=src/mock/",
"@aztec/verifier/=lib/aztec-verifier-contracts/src/"
"@oz/=lib/openzeppelin-contracts/contracts/"
]

# See more config options https://github.com/foundry-rs/foundry/tree/master/config
Expand Down
14 changes: 7 additions & 7 deletions l1-contracts/src/core/Rollup.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
pragma solidity >=0.8.18;

// Interfaces
import {IRollup} from "@aztec/core/interfaces/IRollup.sol";
import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol";
import {IOutbox} from "@aztec/core/interfaces/messagebridge/IOutbox.sol";
import {IRegistry} from "@aztec/core/interfaces/messagebridge/IRegistry.sol";
import {IRollup} from "./interfaces/IRollup.sol";
import {IInbox} from "./interfaces/messagebridge/IInbox.sol";
import {IOutbox} from "./interfaces/messagebridge/IOutbox.sol";
import {IRegistry} from "./interfaces/messagebridge/IRegistry.sol";

// Libraries
import {Decoder} from "@aztec/core/libraries/Decoder.sol";
import {Errors} from "@aztec/core/libraries/Errors.sol";
import {Decoder} from "./libraries/Decoder.sol";
import {Errors} from "./libraries/Errors.sol";

// Contracts
import {MockVerifier} from "@aztec/mock/MockVerifier.sol";
import {MockVerifier} from "../mock/MockVerifier.sol";

/**
* @title Rollup
Expand Down
2 changes: 1 addition & 1 deletion l1-contracts/src/core/interfaces/messagebridge/IInbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Copyright 2023 Aztec Labs.
pragma solidity >=0.8.18;

import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {DataStructures} from "../../libraries/DataStructures.sol";

/**
* @title Inbox
Expand Down
4 changes: 2 additions & 2 deletions l1-contracts/src/core/libraries/Decoder.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
pragma solidity >=0.8.18;

// Libraries
import {Constants} from "@aztec/core/libraries/ConstantsGen.sol";
import {Hash} from "@aztec/core/libraries/Hash.sol";
import {Constants} from "./ConstantsGen.sol";
import {Hash} from "./Hash.sol";

/**
* @title Decoder Library
Expand Down
14 changes: 7 additions & 7 deletions l1-contracts/src/core/messagebridge/Inbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
pragma solidity >=0.8.18;

// Interfaces
import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol";
import {IRegistry} from "@aztec/core/interfaces/messagebridge/IRegistry.sol";
import {IInbox} from "../interfaces/messagebridge/IInbox.sol";
import {IRegistry} from "../interfaces/messagebridge/IRegistry.sol";

// Libraries
import {Constants} from "@aztec/core/libraries/ConstantsGen.sol";
import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {Errors} from "@aztec/core/libraries/Errors.sol";
import {Hash} from "@aztec/core/libraries/Hash.sol";
import {MessageBox} from "@aztec/core/libraries/MessageBox.sol";
import {Constants} from "../libraries/ConstantsGen.sol";
import {DataStructures} from "../libraries/DataStructures.sol";
import {Errors} from "../libraries/Errors.sol";
import {Hash} from "../libraries/Hash.sol";
import {MessageBox} from "../libraries/MessageBox.sol";

/**
* @title Inbox
Expand Down
12 changes: 6 additions & 6 deletions l1-contracts/src/core/messagebridge/Outbox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
pragma solidity >=0.8.18;

// Interfaces
import {IOutbox} from "@aztec/core/interfaces/messagebridge/IOutbox.sol";
import {IRegistry} from "@aztec/core/interfaces/messagebridge/IRegistry.sol";
import {IOutbox} from "../interfaces/messagebridge/IOutbox.sol";
import {IRegistry} from "../interfaces/messagebridge/IRegistry.sol";

// Libraries
import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {Errors} from "@aztec/core/libraries/Errors.sol";
import {Hash} from "@aztec/core/libraries/Hash.sol";
import {MessageBox} from "@aztec/core/libraries/MessageBox.sol";
import {DataStructures} from "../libraries/DataStructures.sol";
import {Errors} from "../libraries/Errors.sol";
import {Hash} from "../libraries/Hash.sol";
import {MessageBox} from "../libraries/MessageBox.sol";

/**
* @title Outbox
Expand Down
12 changes: 6 additions & 6 deletions l1-contracts/src/core/messagebridge/Registry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
pragma solidity >=0.8.18;

// Interfaces
import {IRegistry} from "@aztec/core/interfaces/messagebridge/IRegistry.sol";
import {IRollup} from "@aztec/core/interfaces/IRollup.sol";
import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol";
import {IOutbox} from "@aztec/core/interfaces/messagebridge/IOutbox.sol";
import {IRegistry} from "../interfaces/messagebridge/IRegistry.sol";
import {IRollup} from "../interfaces/IRollup.sol";
import {IInbox} from "../interfaces/messagebridge/IInbox.sol";
import {IOutbox} from "../interfaces/messagebridge/IOutbox.sol";

// Libraries
import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {Errors} from "@aztec/core/libraries/Errors.sol";
import {DataStructures} from "../libraries/DataStructures.sol";
import {Errors} from "../libraries/Errors.sol";

/**
* @title Registry
Expand Down
12 changes: 6 additions & 6 deletions l1-contracts/test/Decoder.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ pragma solidity >=0.8.18;

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

import {Hash} from "@aztec/core/libraries/Hash.sol";
import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {Hash} from "../src/core/libraries/Hash.sol";
import {DataStructures} from "../src/core/libraries/DataStructures.sol";
import {DecoderHelper} from "./DecoderHelper.sol";
import {Registry} from "@aztec/core/messagebridge/Registry.sol";
import {Inbox} from "@aztec/core/messagebridge/Inbox.sol";
import {Outbox} from "@aztec/core/messagebridge/Outbox.sol";
import {Rollup} from "@aztec/core/Rollup.sol";
import {Registry} from "../src/core/messagebridge/Registry.sol";
import {Inbox} from "../src/core/messagebridge/Inbox.sol";
import {Outbox} from "../src/core/messagebridge/Outbox.sol";
import {Rollup} from "../src/core/Rollup.sol";

/**
* Blocks are generated using the `integration_l1_publisher.test.ts` tests.
Expand Down
4 changes: 2 additions & 2 deletions l1-contracts/test/DecoderHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Copyright 2023 Aztec Labs.
pragma solidity >=0.8.18;

import {Decoder} from "@aztec/core/libraries/Decoder.sol";
import {Rollup} from "@aztec/core/Rollup.sol";
import {Decoder} from "../src/core/libraries/Decoder.sol";
import {Rollup} from "../src/core/Rollup.sol";

contract DecoderHelper {
function decode(bytes calldata _l2Block)
Expand Down
16 changes: 8 additions & 8 deletions l1-contracts/test/Inbox.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
pragma solidity >=0.8.18;

import {Test} from "forge-std/Test.sol";
import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol";
import {Inbox} from "@aztec/core/messagebridge/Inbox.sol";
import {Registry} from "@aztec/core/messagebridge/Registry.sol";
import {Constants} from "@aztec/core/libraries/ConstantsGen.sol";
import {Errors} from "@aztec/core/libraries/Errors.sol";

import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {MessageBox} from "@aztec/core/libraries/MessageBox.sol";
import {IInbox} from "../src/core/interfaces/messagebridge/IInbox.sol";
import {Inbox} from "../src/core/messagebridge/Inbox.sol";
import {Registry} from "../src/core/messagebridge/Registry.sol";
import {Constants} from "../src/core/libraries/ConstantsGen.sol";
import {Errors} from "../src/core/libraries/Errors.sol";

import {DataStructures} from "../src/core/libraries/DataStructures.sol";
import {MessageBox} from "../src/core/libraries/MessageBox.sol";

contract InboxTest is Test {
event MessageAdded(
Expand Down
12 changes: 6 additions & 6 deletions l1-contracts/test/Outbox.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
pragma solidity >=0.8.18;

import {Test} from "forge-std/Test.sol";
import {IOutbox} from "@aztec/core/interfaces/messagebridge/IOutbox.sol";
import {Outbox} from "@aztec/core/messagebridge/Outbox.sol";
import {Registry} from "@aztec/core/messagebridge/Registry.sol";
import {Errors} from "@aztec/core/libraries/Errors.sol";
import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {MessageBox} from "@aztec/core/libraries/MessageBox.sol";
import {IOutbox} from "../src/core/interfaces/messagebridge/IOutbox.sol";
import {Outbox} from "../src/core/messagebridge/Outbox.sol";
import {Registry} from "../src/core/messagebridge/Registry.sol";
import {Errors} from "../src/core/libraries/Errors.sol";
import {DataStructures} from "../src/core/libraries/DataStructures.sol";
import {MessageBox} from "../src/core/libraries/MessageBox.sol";

contract OutboxTest is Test {
Registry internal registry;
Expand Down
12 changes: 6 additions & 6 deletions l1-contracts/test/Registry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
pragma solidity >=0.8.18;

import {Test} from "forge-std/Test.sol";
import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol";
import {Inbox} from "@aztec/core/messagebridge/Inbox.sol";
import {Registry} from "@aztec/core/messagebridge/Registry.sol";
import {Errors} from "@aztec/core/libraries/Errors.sol";
import {IInbox} from "../src/core/interfaces/messagebridge/IInbox.sol";
import {Inbox} from "../src/core/messagebridge/Inbox.sol";
import {Registry} from "../src/core/messagebridge/Registry.sol";
import {Errors} from "../src/core/libraries/Errors.sol";

import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {MessageBox} from "@aztec/core/libraries/MessageBox.sol";
import {DataStructures} from "../src/core/libraries/DataStructures.sol";
import {MessageBox} from "../src/core/libraries/MessageBox.sol";

contract RegistryTest is Test {
address internal constant DEAD = address(0xdead);
Expand Down
12 changes: 6 additions & 6 deletions l1-contracts/test/Rollup.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {Test} from "forge-std/Test.sol";

import {DecoderTest} from "./Decoder.t.sol";

import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {DataStructures} from "../src/core/libraries/DataStructures.sol";

import {Registry} from "@aztec/core/messagebridge/Registry.sol";
import {Inbox} from "@aztec/core/messagebridge/Inbox.sol";
import {Outbox} from "@aztec/core/messagebridge/Outbox.sol";
import {Errors} from "@aztec/core/libraries/Errors.sol";
import {Rollup} from "@aztec/core/Rollup.sol";
import {Registry} from "../src/core/messagebridge/Registry.sol";
import {Inbox} from "../src/core/messagebridge/Inbox.sol";
import {Outbox} from "../src/core/messagebridge/Outbox.sol";
import {Errors} from "../src/core/libraries/Errors.sol";
import {Rollup} from "../src/core/Rollup.sol";

/**
* Blocks are generated using the `integration_l1_publisher.test.ts` tests.
Expand Down
8 changes: 4 additions & 4 deletions l1-contracts/test/portals/TokenPortal.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import {IERC20} from "@oz/token/ERC20/IERC20.sol";
import {SafeERC20} from "@oz/token/ERC20/utils/SafeERC20.sol";

// Messaging
import {IRegistry} from "@aztec/core/interfaces/messagebridge/IRegistry.sol";
import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol";
import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {IRegistry} from "../../src/core/interfaces/messagebridge/IRegistry.sol";
import {IInbox} from "../../src/core/interfaces/messagebridge/IInbox.sol";
import {DataStructures} from "../../src/core/libraries/DataStructures.sol";
// docs:start:content_hash_sol_import
import {Hash} from "@aztec/core/libraries/Hash.sol";
import {Hash} from "../../src/core/libraries/Hash.sol";
// docs:end:content_hash_sol_import

contract TokenPortal {
Expand Down
18 changes: 9 additions & 9 deletions l1-contracts/test/portals/TokenPortal.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ pragma solidity >=0.8.18;
import "forge-std/Test.sol";

// Rollup Proccessor
import {Rollup} from "@aztec/core/Rollup.sol";
import {Inbox} from "@aztec/core/messagebridge/Inbox.sol";
import {Registry} from "@aztec/core/messagebridge/Registry.sol";
import {Outbox} from "@aztec/core/messagebridge/Outbox.sol";
import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {Hash} from "@aztec/core/libraries/Hash.sol";
import {Errors} from "@aztec/core/libraries/Errors.sol";
import {Rollup} from "../../src/core/Rollup.sol";
import {Inbox} from "../../src/core/messagebridge/Inbox.sol";
import {Registry} from "../../src/core/messagebridge/Registry.sol";
import {Outbox} from "../../src/core/messagebridge/Outbox.sol";
import {DataStructures} from "../../src/core/libraries/DataStructures.sol";
import {Hash} from "../../src/core/libraries/Hash.sol";
import {Errors} from "../../src/core/libraries/Errors.sol";

// Interfaces
import {IRegistry} from "@aztec/core/interfaces/messagebridge/IRegistry.sol";
import {IInbox} from "@aztec/core/interfaces/messagebridge/IInbox.sol";
import {IRegistry} from "../../src/core/interfaces/messagebridge/IRegistry.sol";
import {IInbox} from "../../src/core/interfaces/messagebridge/IInbox.sol";

// Portal tokens
import {TokenPortal} from "./TokenPortal.sol";
Expand Down
6 changes: 3 additions & 3 deletions l1-contracts/test/portals/UniswapPortal.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
pragma solidity >=0.8.18;

import {IERC20} from "@oz/token/ERC20/IERC20.sol";
import {IRegistry} from "@aztec/core/interfaces/messagebridge/IRegistry.sol";
import {IRegistry} from "../../src/core/interfaces/messagebridge/IRegistry.sol";

import {TokenPortal} from "./TokenPortal.sol";
import {ISwapRouter} from "../external/ISwapRouter.sol";
import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {Hash} from "@aztec/core/libraries/Hash.sol";
import {DataStructures} from "../../src/core/libraries/DataStructures.sol";
import {Hash} from "../../src/core/libraries/Hash.sol";

/**
* @title UniswapPortal
Expand Down
14 changes: 7 additions & 7 deletions l1-contracts/test/portals/UniswapPortal.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ pragma solidity >=0.8.18;
import "forge-std/Test.sol";

// Rollup Proccessor
import {Rollup} from "@aztec/core/Rollup.sol";
import {Inbox} from "@aztec/core/messagebridge/Inbox.sol";
import {Registry} from "@aztec/core/messagebridge/Registry.sol";
import {Outbox} from "@aztec/core/messagebridge/Outbox.sol";
import {DataStructures} from "@aztec/core/libraries/DataStructures.sol";
import {Hash} from "@aztec/core/libraries/Hash.sol";
import {Errors} from "@aztec/core/libraries/Errors.sol";
import {Rollup} from "../../src/core/Rollup.sol";
import {Inbox} from "../../src/core/messagebridge/Inbox.sol";
import {Registry} from "../../src/core/messagebridge/Registry.sol";
import {Outbox} from "../../src/core/messagebridge/Outbox.sol";
import {DataStructures} from "../../src/core/libraries/DataStructures.sol";
import {Hash} from "../../src/core/libraries/Hash.sol";
import {Errors} from "../../src/core/libraries/Errors.sol";

// Interfaces
import {IERC20} from "@oz/token/ERC20/IERC20.sol";
Expand Down

0 comments on commit aac8b37

Please sign in to comment.