// SPDX-License-Identifier: MIT

pragma solidity ^0.8.15;

contract protected {
    mapping (address => bool) is_auth;
    function authorized(address addy) public view returns(bool) {
        return is_auth[addy];
    }
    function set_authorized(address addy, bool booly) public onlyAuth {
        is_auth[addy] = booly;
    }
    modifier onlyAuth() {
        require( is_auth[msg.sender] || msg.sender==owner, "not owner");
        _;
    }
    address owner;
    modifier onlyOwner() {
        require(msg.sender==owner, "not owner");
        _;
    }
    bool locked;
    modifier safe() {
        require(!locked, "reentrant");
        locked = true;
        _;
        locked = false;
    }
    function change_owner(address new_owner) public onlyAuth {
        owner = new_owner;
    }
    receive() external payable {}
    fallback() external payable {}
}

contract OOOBoard is protected {

    constructor() {
        owner = msg.sender;
        is_auth[msg.sender] = true;
    }

    string[] posts;

    function get_posts() public view returns(string[] memory) {
        return posts;
    }

    function post(string memory _msg) public onlyAuth {
        posts.push(_msg);
    }

}