Skip to content

Commit

Permalink
Massive refactor
Browse files Browse the repository at this point in the history
 - expose more functions to testing (tests to come)
 - separate store, view, update, and operate functionalty and interfaces
  • Loading branch information
cliffhall committed Jan 29, 2022
1 parent 6f75db1 commit 4dc3cb9
Show file tree
Hide file tree
Showing 18 changed files with 1,045 additions and 811 deletions.
435 changes: 7 additions & 428 deletions contracts/Fismo.sol

Large diffs are not rendered by default.

323 changes: 0 additions & 323 deletions contracts/FismoLib.sol

This file was deleted.

28 changes: 28 additions & 0 deletions contracts/components/FismoAccess.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { FismoView } from "./FismoView.sol";
import { FismoStore } from "./FismoStore.sol";
import { FismoEvents } from "../domain/FismoEvents.sol";

/**
* @title FismoControl
*
* @notice Fismo access control
*
* @author Cliff Hall <[email protected]> (https://twitter.com/seaofarrows)
*/
contract FismoAccess is FismoView {

modifier onlyOwner() {
require(msg.sender == FismoStore.getStore().owner, "Only owner may call");
_;
}

modifier onlyOperator(bytes4 _machineId) {
Machine storage machine = getMachine(_machineId);
require(msg.sender == machine.operator, "Only operator may call");
_;
}

}
Loading

0 comments on commit 4dc3cb9

Please sign in to comment.