Commit 892c77e0 authored by clabby's avatar clabby

Add constructor to `MIPS.sol`

parent 58a2d894
This diff is collapsed.
This diff is collapsed.
......@@ -32,6 +32,7 @@ import { Predeploys } from "src/libraries/Predeploys.sol";
import { Chains } from "./Chains.sol";
import { IBigStepper } from "src/dispute/interfaces/IBigStepper.sol";
import { IPreimageOracle } from "src/cannon/interfaces/IPreimageOracle.sol";
import { AlphabetVM } from "../test/FaultDisputeGame.t.sol";
import "src/libraries/DisputeTypes.sol";
......@@ -386,7 +387,7 @@ contract Deploy is Deployer {
/// @notice Deploy Mips
function deployMips() onlyDevnet broadcast() public returns (address) {
MIPS mips = new MIPS();
MIPS mips = new MIPS(IPreimageOracle(mustGetAddress("PreimageOracle")));
save("Mips", address(mips));
console.log("MIPS deployed at %s", address(mips));
......
......@@ -53,9 +53,14 @@ contract MIPS {
uint32 constant EBADF = 0x9;
uint32 constant EINVAL = 0x16;
/// @notice The pre-image oracle.
/// @notice The preimage oracle contract.
IPreimageOracle public oracle;
/// @param _oracle The address of the preimage oracle contract.
constructor(IPreimageOracle _oracle) {
oracle = _oracle;
}
/// @notice Extends the value leftwards with its most significant bit (sign extension).
function SE(uint32 _dat, uint32 _idx) internal pure returns (uint32) {
unchecked {
......
......@@ -11,7 +11,7 @@ contract MIPS_Test is Test {
function setUp() public {
oracle = new PreimageOracle();
mips = new MIPS();
mips = new MIPS(oracle);
vm.store(address(mips), 0x0, bytes32(abi.encode(address(oracle))));
vm.label(address(oracle), "PreimageOracle");
vm.label(address(mips), "MIPS");
......
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