Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/remove unused contracts #26

Merged
merged 3 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,11 @@ npx hardhat run scripts/tools/chain.ts --network <sepolia|localhost> # prints th

```
CanonicalStateChain.sol – Where the rollup chain is stored.
Treasury.sol – Where fees are stored and challenges can be reimbursed.
Challenge
└ ChallengeManager.sol – A Collection of the challenges below that can be called to rollback the chain if needed.
└ ChallengeBase.sol – Base contract for all challenges, allows getting and setting the challenge window, and the challenge fee.
└ ChallengeHeader.sol – Challenge a block header for validity.
└ ChallengeDataAvailability.sol – Claim that block data is unavailable.
└ ChallengeExecution.sol – Claim incorrect stateroot using mips.
└ mips – Contains MIPS contracts.
```

## Running locally
Expand Down
113 changes: 0 additions & 113 deletions contracts/Treasury.sol

This file was deleted.

12 changes: 1 addition & 11 deletions contracts/challenge/Challenge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,15 @@ contract Challenge is
ChallengeL2Header
{
/// @notice Initializes the Challenge contract.
/// @param _treasury - The address of the treasury contract.
/// @param _chain - The address of the chain contract.
/// @param _daOracle - The address of the data availability oracle.
/// @param _mipsChallenge - The address of the MIPS challenge contract.
/// @param _chainOracle - The address of the chain oracle contract.
function initialize(
address _treasury,
address _chain,
address _daOracle,
address _mipsChallenge,
address _chainOracle
) public initializer {
__ChallengeBase_init(
_treasury,
_chain,
_daOracle,
_mipsChallenge,
_chainOracle
);
__ChallengeBase_init(_chain, _daOracle, _chainOracle);

__ChallengeHeader_init();
}
Expand Down
18 changes: 2 additions & 16 deletions contracts/challenge/ChallengeBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ pragma solidity ^0.8.0;
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol";
import "../interfaces/ITreasury.sol";
import "../interfaces/IChainOracle.sol";
import "../interfaces/ICanonicalStateChain.sol";
import "./mips/IMipsChallenge.sol";
import "blobstream-contracts/src/IDAOracle.sol";

/// @title ChallengeBase
Expand Down Expand Up @@ -40,18 +38,12 @@ contract ChallengeBase is
/// @notice The address of the chain oracle.
IChainOracle public chainOracle;

/// @notice The address of the treasury to pay out challenges.
ITreasury public treasury;

/// @notice The address of the canonical state chain.
ICanonicalStateChain public chain;

/// @notice The address of the data availability oracle.
IDAOracle public daOracle;

/// @notice The address of the MIPS challenge contract.
IMipsChallenge public mipsChallenge;

/// @notice This function is a special internal function that's part of
/// the UUPS upgradeable contract's lifecycle. When you want to
/// upgrade the contract to a new version, _authorizeUpgrade is
Expand All @@ -60,18 +52,14 @@ contract ChallengeBase is
/// @dev Only the owner can call this function.
function _authorizeUpgrade(address) internal override onlyOwner {}

/// @notice Initializes the contract with the treasury, chain, daOracle,
/// mipsChallenge, and chainOracle addresses.
/// @param _treasury The address of the treasury.
/// @notice Initializes the contract with the chain, daOracle,
/// and chainOracle addresses.
/// @param _chain The address of the canonical state chain.
/// @param _daOracle The address of the data availability oracle.
/// @param _mipsChallenge The address of the MIPS challenge contract.
/// @param _chainOracle The address of the chain oracle.
function __ChallengeBase_init(
address _treasury,
address _chain,
address _daOracle,
address _mipsChallenge,
address _chainOracle
) internal {
__UUPSUpgradeable_init();
Expand All @@ -83,10 +71,8 @@ contract ChallengeBase is
challengeFee = 1.5 ether;
challengeReward = 0.2 ether; // unused.

treasury = ITreasury(_treasury); // TODO: remove
chain = ICanonicalStateChain(_chain);
daOracle = IDAOracle(_daOracle);
mipsChallenge = IMipsChallenge(_mipsChallenge);
chainOracle = IChainOracle(_chainOracle);
}

Expand Down
70 changes: 0 additions & 70 deletions contracts/challenge/ChallengeExecution.sol

This file was deleted.

Loading