contract ImmutablesAdminPostPage is ImmutablesAdmin {
    /// @dev GLOBAL VARIABLES
    /// @dev The fee paid to the contract to post an Immutables.
    uint256 public postingFee;
    /// @dev The fee paid into the contract to purchase a Page.
    uint256 public pageFee;

    /// @dev The basis point (1/10,000ths) percentage of value the contract gets
    ///      when payment made to a post.
    uint16 public contractTipPercentage;
    /// @dev The basis point (1/10,000ths) percentage of value the poster gets
    ///      when payment made to a post.
    uint16 public posterTipPercentage;

    /// @dev The basis point (1/10,000ths) percentage of value the poster gets
    ///      when payment made to a post.
    uint16 public contractSecondaryRoyaltyPercentage;

    /// @dev EVENTS
    event AddressPostedPageTagContent(
      address indexed poster,
      bytes32 indexed pageHash,
      bytes32 indexed tagHash,
      string page,
      string tag,
      string content
    );

    event AddressPaidPageTagValue(
      address indexed poster,
      bytes32 indexed pageHash,
      bytes32 indexed tagHash,
      string page,
      string tag,
      uint256 value
    );

    /// @dev HELPER FUNCTIONS

    /** @dev Determines if a string is a valid page (a-z|A-Z|0-9| |_|-) cannot start with 0
      * @param _str The proposed page name.
      * @return _ Whether the page contains only valid characters.
      */
    function isValidPageName(string calldata _str) public pure returns (bool) {
       bytes memory b = bytes(_str);
       require(b.length > 0, "can not be empty string");
       require(b[0] != 0x30 && b[0] != 0x20, "page cannot start with 0 or space");
       for(uint i; i < b.length; i++) {
            // if not 0-9, A-Z, a-z, space ' ', dash - or underscore _ return false
           if(!(((b[i] >= 0x30) && (b[i] <= 0x39)) || ((b[i] >= 0x41) && (b[i] <= 0x5A)) || ((b[i] >= 0x61) && (b[i] <= 0x7A)) || (b[i] == 0x20) || (b[i] == 0x2D) || (b[i] == 0x5F))) {
              return false;
            }
       }
       // otherwise, the string is OK to use as a page
       return true;
     }

    // @dev CONTRACT ADMINISTRATION

    /** @dev Allows the contract owner to update the posting fee.
      * @param _newPostingFee The new posting fee in Wei.
      */
    function contractOwnerUpdatePostingFee(uint256 _newPostingFee) external onlyOwner() {
      postingFee = _newPostingFee;
    }

    /** @dev Allows the contract owner to update the page fee.
      * @param _newPageFee The new posting fee in Wei.
      */
    function contractOwnerUpdatePageFee(uint256 _newPageFee) external onlyOwner() {
      pageFee = _newPageFee;
    }

    /** @dev Allows the contract owner to update the contractTipPercentage.
      * @param _newcontractTipPercentage The new contractTipPercentage fee in basis point (1/10,000th)s (e.g., 200 = 2.00%).
      */
    function contractOwnerUpdatecontractTipPercentage(uint16 _newcontractTipPercentage) external onlyOwner() {
      contractTipPercentage = _newcontractTipPercentage;
    }

    /** @dev Allows the contract owner to update the posterTipPercentage.
      * @param _newposterTipPercentage The new posterTipPercentage fee in basis point (1/10,000th)s (e.g., 1000 = 10.00%).
      */
    function contractOwnerUpdateposterTipPercentage(uint16 _newposterTipPercentage) external onlyOwner() {
      posterTipPercentage = _newposterTipPercentage;
    }

    /** @dev Allows the contract owner to update the contractSecondaryRoyaltyPercentage.
      * @param _newContractSecondaryRoyaltyPercentage The new contractSecondaryRoyaltyPercentage fee in basis point (1/10,000th)s (e.g., 20 = 10.0%).
      */
    function contractOwnerUpdateContractSecondaryRoyaltyPercentage(uint16 _newContractSecondaryRoyaltyPercentage) external onlyOwner() {
      require(_newContractSecondaryRoyaltyPercentage <= 1000, "too big");
      contractSecondaryRoyaltyPercentage = _newContractSecondaryRoyaltyPercentage;
    }
}
/// @author Gutenblock.eth
/// @title ImmutablesAdminPostPage
function contractOwnerUpdateContractSecondaryRoyaltyPercentage(uint16 _newContractSecondaryRoyaltyPercentage) external onlyOwner() {
  require(_newContractSecondaryRoyaltyPercentage <= 1000, "too big");
  contractSecondaryRoyaltyPercentage = _newContractSecondaryRoyaltyPercentage;
}

/** @dev Allows the contract owner to update the contractSecondaryRoyaltyPercentage.
 * @param _newContractSecondaryRoyaltyPercentage The new contractSecondaryRoyaltyPercentage fee in basis point (1/10,000th)s (e.g., 20 = 10.0%).
 */