// Copyright (C) 2020 Cartesi Pte. Ltd. // SPDX-License-Identifier: GPL-3.0-only // This program is free software: you can redistribute it and/or modify it under // the terms of the GNU General Public License as published by the Free Software // Foundation, either version 3 of the License, or (at your option) any later // version. // This program is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A // PARTICULAR PURPOSE. See the GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see . // Note: This component currently has dependencies that are licensed under the GNU // GPL, version 3, and so you should treat this component as a whole as being under // the GPL version 3. But all Cartesi-written code in this component is licensed // under the Apache License, version 2, or a compatible permissive license, and can // be used independently under the Apache v2 license. After this component is // rewritten, the entire component will be released under the Apache v2 license. /// @title Interface for memory manager instantiator pragma solidity ^0.7.0; import "@cartesi/util/contracts/Instantiator.sol"; interface MMInterface is Instantiator { enum state {WaitingProofs, WaitingReplay, FinishedReplay} function getCurrentState(uint256 _index) external view returns (bytes32); function instantiate( address _owner, address _provider, bytes32 _initialHash ) external returns (uint256); function newHash(uint256 _index) external view returns (bytes32); function finishProofPhase(uint256 _index) external; function finishReplayPhase(uint256 _index) external; function getRWArrays( uint256 _index ) external view returns ( uint64[] memory, bytes8[] memory, bool[] memory ); function stateIsWaitingProofs(uint256 _index) external view returns (bool); function stateIsWaitingReplay(uint256 _index) external view returns (bool); function stateIsFinishedReplay(uint256 _index) external view returns (bool); function getCurrentStateDeadline( uint256 _index, uint256 _roundDuration, uint256 _timeToStartMachine ) external view returns (uint256); function getMaxInstanceDuration( uint256 _roundDuration, uint256 _timeToStartMachine ) external view returns (uint256); }