Commit 5eaac1de authored by smartcontracts's avatar smartcontracts Committed by GitHub

maint(ct): remove Kontrol interfaces (#12178)

We no longer need these interfaces now that we have the actual
interfaces.
parent b1dfd743
...@@ -45,29 +45,31 @@ EXCLUDE_CONTRACTS=( ...@@ -45,29 +45,31 @@ EXCLUDE_CONTRACTS=(
"ISchemaResolver" "ISchemaResolver"
"ISchemaRegistry" "ISchemaRegistry"
# Kontrol # TODO: Interfaces that need to be fixed are below this line
"KontrolCheatsBase" # ----------------------------------------------------------
# TODO: Interfaces that need to be fixed # Inlined interface, needs to be replaced.
"IOptimismSuperchainERC20"
"IOptimismMintableERC721"
"IOptimismMintableERC20"
"ILegacyMintableERC20"
"IInitializable" "IInitializable"
# Missing various functions.
"IPreimageOracle" "IPreimageOracle"
"ICrossL2Inbox" "ILegacyMintableERC20"
"IL2ToL2CrossDomainMessenger" "IOptimismMintableERC20"
"IOptimismMintableERC721"
"IOptimismSuperchainERC20"
# Doesn't start with "I"
"MintableAndBurnable" "MintableAndBurnable"
"KontrolCheatsBase"
# Currently inherit from interface, needs to be fixed.
"IWETH" "IWETH"
"IDelayedWETH" "IDelayedWETH"
"IResolvedDelegateProxy" "IL2ToL2CrossDomainMessenger"
"ICrossL2Inbox"
# TODO: Kontrol interfaces that need to be removed # Solidity complains about receive but contract doens't have it.
"IL1ERC721Bridge" "IResolvedDelegateProxy"
"IL1StandardBridge"
"IL1CrossDomainMessenger"
"ISuperchainConfig"
"IOptimismPortal"
) )
# Find all JSON files in the forge-artifacts folder # Find all JSON files in the forge-artifacts folder
......
...@@ -7,16 +7,16 @@ import { IOptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol"; ...@@ -7,16 +7,16 @@ import { IOptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol";
import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol"; import { ISystemConfig } from "src/L1/interfaces/ISystemConfig.sol";
interface IL1CrossDomainMessenger is ICrossDomainMessenger { interface IL1CrossDomainMessenger is ICrossDomainMessenger {
function PORTAL() external view returns (address); function PORTAL() external view returns (IOptimismPortal);
function initialize( function initialize(
ISuperchainConfig _superchainConfig, ISuperchainConfig _superchainConfig,
IOptimismPortal _portal, IOptimismPortal _portal,
ISystemConfig _systemConfig ISystemConfig _systemConfig
) )
external; external;
function portal() external view returns (address); function portal() external view returns (IOptimismPortal);
function superchainConfig() external view returns (address); function superchainConfig() external view returns (ISuperchainConfig);
function systemConfig() external view returns (address); function systemConfig() external view returns (ISystemConfig);
function version() external view returns (string memory); function version() external view returns (string memory);
function __constructor__() external; function __constructor__() external;
......
...@@ -122,23 +122,19 @@ The next step is to include tests for the newly included state updates in [`Depl ...@@ -122,23 +122,19 @@ The next step is to include tests for the newly included state updates in [`Depl
It might be necessary to set some of the existing tests from [`test`](../L1) as virtual because they can't be executed as is. See [`DeploymentSummary.t.sol`](deployment/DeploymentSummary.t.sol) for more concrete examples. It might be necessary to set some of the existing tests from [`test`](../L1) as virtual because they can't be executed as is. See [`DeploymentSummary.t.sol`](deployment/DeploymentSummary.t.sol) for more concrete examples.
#### Add function signatures to [`KontrolInterfaces`](./proofs/interfaces/KontrolInterfaces.sol)
So far we've got all the state updates ready to be added to the initial configuration of each proof, but we cannot yet write any proof about the function. We still need to add the relevant signatures into `KontrolInterfaces`. The reason for having `KontrolInterfaces` instead of using directly the contracts is to reduce the amount of compiled contracts by Kontrol.
In the future there might interfaces for all contracts under `contracts-bedrock`, which would imply the removal of `KontrolInterfaces`.
#### Write the proof #### Write the proof
Write your proof in a `.k.sol` file in the [`proofs`](./proofs/) folder, which is the `test` directory used by the `kprove` profile to run the proofs (see [Deployment Summary Process](#deployment-summary-process)). The name of the new proofs should start with `prove` (or `check`) instead of `test` to avoid `forge test` running them. The reason for this is that if Kontrol cheatcodes (see [Kontrol's own cheatcodes](https://github.com/runtimeverification/kontrol-cheatcodes/blob/master/src/KontrolCheats.sol)) are used in a test, it will not be runnable by `forge`. Currently, none of the tests are using custom Kontrol cheatcodes, but this is something to bear in mind. Write your proof in a `.k.sol` file in the [`proofs`](./proofs/) folder, which is the `test` directory used by the `kprove` profile to run the proofs (see [Deployment Summary Process](#deployment-summary-process)). The name of the new proofs should start with `prove` (or `check`) instead of `test` to avoid `forge test` running them. The reason for this is that if Kontrol cheatcodes (see [Kontrol's own cheatcodes](https://github.com/runtimeverification/kontrol-cheatcodes/blob/master/src/KontrolCheats.sol)) are used in a test, it will not be runnable by `forge`. Currently, none of the tests are using custom Kontrol cheatcodes, but this is something to bear in mind.
To reference the correct addresses for writing the tests, first import the signatures as in this example: To reference the correct addresses for writing the tests, first import the signatures as in this example:
```solidity ```solidity
import { import { IOptimismPortal as OptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol";
IOptimismPortal as OptimismPortal, import { ISuperchainConfig as SuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
ISuperchainConfig as SuperchainConfig
} from "./interfaces/KontrolInterfaces.sol";
``` ```
Declare the correspondent variables and cast the correct signatures to the correct addresses: Declare the correspondent variables and cast the correct signatures to the correct addresses:
```solidity ```solidity
OptimismPortal optimismPortal; OptimismPortal optimismPortal;
SuperchainConfig superchainConfig; SuperchainConfig superchainConfig;
...@@ -148,6 +144,7 @@ function setUp() public { ...@@ -148,6 +144,7 @@ function setUp() public {
superchainConfig = SuperchainConfig(superchainConfigProxyAddress); superchainConfig = SuperchainConfig(superchainConfigProxyAddress);
} }
``` ```
Note that the names of the addresses come from [`DeploymentSummary.t.sol`](deployment/DeploymentSummary.t.sol) and are automatically generated by the [`make-summary-deployment.sh`](./scripts/make-summary-deployment.sh) script. Note that the names of the addresses come from [`DeploymentSummary.t.sol`](deployment/DeploymentSummary.t.sol) and are automatically generated by the [`make-summary-deployment.sh`](./scripts/make-summary-deployment.sh) script.
#### Add your test to [`run-kontrol.sh`](./scripts/run-kontrol.sh) #### Add your test to [`run-kontrol.sh`](./scripts/run-kontrol.sh)
......
...@@ -3,10 +3,8 @@ pragma solidity ^0.8.13; ...@@ -3,10 +3,8 @@ pragma solidity ^0.8.13;
import { DeploymentSummary } from "./utils/DeploymentSummary.sol"; import { DeploymentSummary } from "./utils/DeploymentSummary.sol";
import { KontrolUtils } from "./utils/KontrolUtils.sol"; import { KontrolUtils } from "./utils/KontrolUtils.sol";
import { import { IL1CrossDomainMessenger as L1CrossDomainMessenger } from "src/L1/interfaces/IL1CrossDomainMessenger.sol";
IL1CrossDomainMessenger as L1CrossDomainMessenger, import { ISuperchainConfig as SuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
ISuperchainConfig as SuperchainConfig
} from "./interfaces/KontrolInterfaces.sol";
contract L1CrossDomainMessengerKontrol is DeploymentSummary, KontrolUtils { contract L1CrossDomainMessengerKontrol is DeploymentSummary, KontrolUtils {
L1CrossDomainMessenger l1CrossDomainMessenger; L1CrossDomainMessenger l1CrossDomainMessenger;
......
...@@ -4,11 +4,9 @@ pragma solidity ^0.8.13; ...@@ -4,11 +4,9 @@ pragma solidity ^0.8.13;
import { DeploymentSummary } from "./utils/DeploymentSummary.sol"; import { DeploymentSummary } from "./utils/DeploymentSummary.sol";
import { KontrolUtils } from "./utils/KontrolUtils.sol"; import { KontrolUtils } from "./utils/KontrolUtils.sol";
import { Types } from "src/libraries/Types.sol"; import { Types } from "src/libraries/Types.sol";
import { import { IL1ERC721Bridge as L1ERC721Bridge } from "src/L1/interfaces/IL1ERC721Bridge.sol";
IL1ERC721Bridge as L1ERC721Bridge, import { ISuperchainConfig as SuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
IL1CrossDomainMessenger as CrossDomainMessenger, import { ICrossDomainMessenger as CrossDomainMessenger } from "src/universal/interfaces/ICrossDomainMessenger.sol";
ISuperchainConfig as SuperchainConfig
} from "./interfaces/KontrolInterfaces.sol";
contract L1ERC721BridgeKontrol is DeploymentSummary, KontrolUtils { contract L1ERC721BridgeKontrol is DeploymentSummary, KontrolUtils {
L1ERC721Bridge l1ERC721Bridge; L1ERC721Bridge l1ERC721Bridge;
......
...@@ -4,11 +4,9 @@ pragma solidity ^0.8.13; ...@@ -4,11 +4,9 @@ pragma solidity ^0.8.13;
import { DeploymentSummary } from "./utils/DeploymentSummary.sol"; import { DeploymentSummary } from "./utils/DeploymentSummary.sol";
import { KontrolUtils } from "./utils/KontrolUtils.sol"; import { KontrolUtils } from "./utils/KontrolUtils.sol";
import { Types } from "src/libraries/Types.sol"; import { Types } from "src/libraries/Types.sol";
import { import { IL1StandardBridge as L1StandardBridge } from "src/L1/interfaces/IL1StandardBridge.sol";
IL1StandardBridge as L1StandardBridge, import { ISuperchainConfig as SuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
IL1CrossDomainMessenger as CrossDomainMessenger, import { ICrossDomainMessenger as CrossDomainMessenger } from "src/universal/interfaces/ICrossDomainMessenger.sol";
ISuperchainConfig as SuperchainConfig
} from "./interfaces/KontrolInterfaces.sol";
contract L1StandardBridgeKontrol is DeploymentSummary, KontrolUtils { contract L1StandardBridgeKontrol is DeploymentSummary, KontrolUtils {
L1StandardBridge l1standardBridge; L1StandardBridge l1standardBridge;
......
...@@ -4,10 +4,8 @@ pragma solidity ^0.8.13; ...@@ -4,10 +4,8 @@ pragma solidity ^0.8.13;
import { DeploymentSummary } from "./utils/DeploymentSummary.sol"; import { DeploymentSummary } from "./utils/DeploymentSummary.sol";
import { KontrolUtils } from "./utils/KontrolUtils.sol"; import { KontrolUtils } from "./utils/KontrolUtils.sol";
import { Types } from "src/libraries/Types.sol"; import { Types } from "src/libraries/Types.sol";
import { import { IOptimismPortal as OptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol";
IOptimismPortal as OptimismPortal, import { ISuperchainConfig as SuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
ISuperchainConfig as SuperchainConfig
} from "./interfaces/KontrolInterfaces.sol";
import "src/libraries/PortalErrors.sol"; import "src/libraries/PortalErrors.sol";
contract OptimismPortalKontrol is DeploymentSummary, KontrolUtils { contract OptimismPortalKontrol is DeploymentSummary, KontrolUtils {
......
...@@ -4,10 +4,8 @@ pragma solidity ^0.8.13; ...@@ -4,10 +4,8 @@ pragma solidity ^0.8.13;
import { DeploymentSummaryFaultProofs } from "./utils/DeploymentSummaryFaultProofs.sol"; import { DeploymentSummaryFaultProofs } from "./utils/DeploymentSummaryFaultProofs.sol";
import { KontrolUtils } from "./utils/KontrolUtils.sol"; import { KontrolUtils } from "./utils/KontrolUtils.sol";
import { Types } from "src/libraries/Types.sol"; import { Types } from "src/libraries/Types.sol";
import { import { IOptimismPortal as OptimismPortal } from "src/L1/interfaces/IOptimismPortal.sol";
IOptimismPortal as OptimismPortal, import { ISuperchainConfig as SuperchainConfig } from "src/L1/interfaces/ISuperchainConfig.sol";
ISuperchainConfig as SuperchainConfig
} from "./interfaces/KontrolInterfaces.sol";
import "src/libraries/PortalErrors.sol"; import "src/libraries/PortalErrors.sol";
contract OptimismPortal2Kontrol is DeploymentSummaryFaultProofs, KontrolUtils { contract OptimismPortal2Kontrol is DeploymentSummaryFaultProofs, KontrolUtils {
......
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import { Types } from "src/libraries/Types.sol";
interface IOptimismPortal {
function guardian() external view returns (address);
function paused() external view returns (bool paused_);
function proveWithdrawalTransaction(
Types.WithdrawalTransaction memory _tx,
uint256 _l2OutputIndex,
Types.OutputRootProof calldata _outputRootProof,
bytes[] calldata _withdrawalProof
)
external;
function finalizeWithdrawalTransaction(Types.WithdrawalTransaction memory _tx) external;
}
interface ISuperchainConfig {
function guardian() external view returns (address);
function paused() external view returns (bool paused_);
function pause(string memory _identifier) external;
function unpause() external;
}
interface IL1StandardBridge {
function paused() external view returns (bool);
function messenger() external view returns (IL1CrossDomainMessenger);
function otherBridge() external view returns (IL1StandardBridge);
function finalizeBridgeERC20(
address _localToken,
address _remoteToken,
address _from,
address _to,
uint256 _amount,
bytes calldata _extraData
)
external;
function finalizeBridgeETH(address _from, address _to, uint256 _amount, bytes calldata _extraData) external;
}
interface IL1ERC721Bridge {
function paused() external view returns (bool);
function messenger() external view returns (IL1CrossDomainMessenger);
function otherBridge() external view returns (IL1StandardBridge);
function finalizeBridgeERC721(
address _localToken,
address _remoteToken,
address _from,
address _to,
uint256 _amount,
bytes calldata _extraData
)
external;
}
interface IL1CrossDomainMessenger {
function relayMessage(
uint256 _nonce,
address _sender,
address _target,
uint256 _value,
uint256 _minGasLimit,
bytes calldata _message
)
external
payable;
function xDomainMessageSender() external view returns (address);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment