text: /*__________________________________________________________________________________________
  
              (c) Hash(BEGIN(Satoshi[2010]), END(Sunny[2012])) == Videlicet[2014] ++
  
              (c) Copyright The Nexus Developers 2014 - 2019
  
              Distributed under the MIT software license, see the accompanying
              file COPYING or http://www.opensource.org/licenses/mit-license.php.
  
              "ad vocem populi" - To the Voice of the People
  
  ____________________________________________________________________________________________*/
  
  #pragma once
  #ifndef NEXUS_TAO_OPERATION_INCLUDE_WRITE_H
  #define NEXUS_TAO_OPERATION_INCLUDE_WRITE_H
  
  #include <LLC/types/uint1024.h>
  
  /* Global TAO namespace. */
  namespace TAO
  {
  
      /* Register layer. */
      namespace Register
      {
          /* Forward declarations. */
          class State;
      }
  
  
      /* Operation Layer namespace. */
      namespace Operation
      {
  
          /* Forward declarations. */
          class Contract;
  
  
          /** Write
           *
           *  Namespace to contain main functions for OP::WRITE
           *
           **/
          namespace Write
          {
  
              /** Commit
               *
               *  Commit the final state to disk.
               *
               *  @param[in] state The state to commit.
               *  @param[in] hashAddress The register address to commit.
               *  @param[in] nFlags Flags to the LLD instance.
               *
               *  @return true if successful.
               *
               **/
              bool Commit(const TAO::Register::State& state, const uint256_t& hashAddress, const uint8_t nFlags);
  
  
              /** Execute
               *
               *  Execute a write operation to bring register into new state.
               *
               *  @param[out] state The state register to operate on.
               *  @param[in] vchData The data script to write into register.
               *  @param[in] nTimestamp The timestamp to update register to.
               *
               *  @return true if successful.
               *
               **/
              bool Execute(TAO::Register::State &state, const std::vector<uint8_t>& vchData, const uint64_t nTimestamp);
  
  
              /** Verify
               *
               *  Verify write validation rules and caller.
               *
               *  @param[in] contract The contract to verify.
               *
               *  @return true if successful.
               *
               **/
              bool Verify(const Contract& contract);
          }
      }
  }
  
  #endif
  