From 0824521105e1ed1e9f9eff03e9f6a0fff3fff5f8 Mon Sep 17 00:00:00 2001 From: Guilherme Dantas Date: Tue, 30 May 2023 11:20:50 -0300 Subject: [PATCH] refactor(contracts)!: remove base portal and relay contracts/ifaces --- onchain/rollups/contracts/portals/IPortal.sol | 24 -------------- onchain/rollups/contracts/portals/Portal.sol | 33 ------------------- onchain/rollups/contracts/relays/IRelay.sol | 24 -------------- onchain/rollups/contracts/relays/Relay.sol | 33 ------------------- 4 files changed, 114 deletions(-) delete mode 100644 onchain/rollups/contracts/portals/IPortal.sol delete mode 100644 onchain/rollups/contracts/portals/Portal.sol delete mode 100644 onchain/rollups/contracts/relays/IRelay.sol delete mode 100644 onchain/rollups/contracts/relays/Relay.sol diff --git a/onchain/rollups/contracts/portals/IPortal.sol b/onchain/rollups/contracts/portals/IPortal.sol deleted file mode 100644 index 65614fbe..00000000 --- a/onchain/rollups/contracts/portals/IPortal.sol +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -pragma solidity ^0.8.8; - -import {IInputBox} from "../inputs/IInputBox.sol"; - -/// @title Portal interface -interface IPortal { - // Permissionless functions - - /// @notice Get the input box used by this portal. - /// @return The input box - function getInputBox() external view returns (IInputBox); -} diff --git a/onchain/rollups/contracts/portals/Portal.sol b/onchain/rollups/contracts/portals/Portal.sol deleted file mode 100644 index d214b399..00000000 --- a/onchain/rollups/contracts/portals/Portal.sol +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -pragma solidity ^0.8.8; - -import {IPortal} from "./IPortal.sol"; -import {IInputBox} from "../inputs/IInputBox.sol"; - -/// @title Portal -/// @notice This contract serves as a base for all the other portals. -contract Portal is IPortal { - /// @notice The input box used by the portal. - IInputBox internal immutable inputBox; - - /// @notice Constructs the portal. - /// @param _inputBox The input box used by the portal - constructor(IInputBox _inputBox) { - inputBox = _inputBox; - } - - function getInputBox() external view override returns (IInputBox) { - return inputBox; - } -} diff --git a/onchain/rollups/contracts/relays/IRelay.sol b/onchain/rollups/contracts/relays/IRelay.sol deleted file mode 100644 index 88808fb2..00000000 --- a/onchain/rollups/contracts/relays/IRelay.sol +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -pragma solidity ^0.8.8; - -import {IInputBox} from "../inputs/IInputBox.sol"; - -/// @title Relay interface -interface IRelay { - // Permissionless functions - - /// @notice Get the input box used by this relay. - /// @return The input box - function getInputBox() external view returns (IInputBox); -} diff --git a/onchain/rollups/contracts/relays/Relay.sol b/onchain/rollups/contracts/relays/Relay.sol deleted file mode 100644 index 7129b309..00000000 --- a/onchain/rollups/contracts/relays/Relay.sol +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright Cartesi Pte. Ltd. - -// SPDX-License-Identifier: Apache-2.0 -// Licensed under the Apache License, Version 2.0 (the "License"); you may not use -// this file except in compliance with the License. You may obtain a copy of the -// License at http://www.apache.org/licenses/LICENSE-2.0 - -// Unless required by applicable law or agreed to in writing, software distributed -// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -// CONDITIONS OF ANY KIND, either express or implied. See the License for the -// specific language governing permissions and limitations under the License. - -pragma solidity ^0.8.8; - -import {IRelay} from "./IRelay.sol"; -import {IInputBox} from "../inputs/IInputBox.sol"; - -/// @title Relay -/// @notice This contract serves as a base for all the other relays. -contract Relay is IRelay { - /// @notice The input box used by the relay. - IInputBox internal immutable inputBox; - - /// @notice Constructs the relay. - /// @param _inputBox The input box used by the relay - constructor(IInputBox _inputBox) { - inputBox = _inputBox; - } - - function getInputBox() external view override returns (IInputBox) { - return inputBox; - } -}