text: // Copyright (c) 2017-2020 The PIVX developers
  // Distributed under the MIT software license, see the accompanying
  // file COPYING or http://www.opensource.org/licenses/mit-license.php.
  
  #ifndef GAMEFRAG_STAKEINPUT_H
  #define GAMEFRAG_STAKEINPUT_H
  
  #include "chain.h"
  #include "streams.h"
  #include "uint256.h"
  
  class CKeyStore;
  class CWallet;
  class CWalletTx;
  
  class CStakeInput
  {
  protected:
      const CBlockIndex* pindexFrom = nullptr;
  
  public:
      CStakeInput(const CBlockIndex* _pindexFrom) : pindexFrom(_pindexFrom) {}
      virtual ~CStakeInput(){};
      virtual bool InitFromTxIn(const CTxIn& txin) = 0;
      virtual const CBlockIndex* GetIndexFrom() const = 0;
      virtual bool CreateTxIn(CWallet* pwallet, CTxIn& txIn, uint256 hashTxOut = UINT256_ZERO) = 0;
      virtual bool GetTxOutFrom(CTxOut& out) const = 0;
      virtual CAmount GetValue() const = 0;
      virtual bool CreateTxOuts(CWallet* pwallet, std::vector<CTxOut>& vout, CAmount nTotal, const bool onlyP2PK) = 0;
      virtual bool IsZFRAG() const = 0;
      virtual CDataStream GetUniqueness() const = 0;
      virtual bool ContextCheck(int nHeight, uint32_t nTime) = 0;
  };
  
  
  class CFragStake : public CStakeInput
  {
  private:
      const CTxOut outputFrom;
      const COutPoint outpointFrom;
  
  public:
      CFragStake(const CTxOut& _from, const COutPoint& _outPointFrom, const CBlockIndex* _pindexFrom) :
              CStakeInput(_pindexFrom), outputFrom(_from), outpointFrom(_outPointFrom) {}
  
      static CFragStake* NewFragStake(const CTxIn& txin);
  
      bool InitFromTxIn(const CTxIn& txin) override { return pindexFrom; }
      const CBlockIndex* GetIndexFrom() const override;
      bool GetTxOutFrom(CTxOut& out) const override;
      CAmount GetValue() const override;
      CDataStream GetUniqueness() const override;
      bool CreateTxIn(CWallet* pwallet, CTxIn& txIn, uint256 hashTxOut = UINT256_ZERO) override;
      bool CreateTxOuts(CWallet* pwallet, std::vector<CTxOut>& vout, CAmount nTotal, const bool onlyP2PK) override;
      bool IsZFRAG() const override { return false; }
      bool ContextCheck(int nHeight, uint32_t nTime) override;
  };
  
  
  #endif //GAMEFRAG_STAKEINPUT_H
  