* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-using System;
-using System.Diagnostics.Contracts;
-
namespace Novacoin
{
- public class CScriptID : Hash160
+ /// <summary>
+ /// Represents the script identifier. Internal value is calculated as Hash160(script).
+ /// </summary>
+ public class CScriptID : uint160
{
- public CScriptID(Hash160 scriptHash)
+ #region Constructors
+ public CScriptID() : base()
+ {
+ }
+
+ public CScriptID(CScriptID KeyID) : base(KeyID as uint160)
{
- _hashBytes = scriptHash;
}
- internal CScriptID(byte[] hashBytes)
+ public CScriptID(uint160 pubKeyHash) : base(pubKeyHash)
{
- Contract.Requires<ArgumentException>(hashBytes.Length == 20, "Your data doesn't seem like a hash160 of some value.");
+ }
- _hashBytes = hashBytes;
+ public CScriptID(byte[] hashBytes) : base(hashBytes)
+ {
}
+ #endregion
+ /// <summary>
+ /// Generate Pay-to-ScriptHash address
+ /// </summary>
+ /// <returns>Base58 formatted novacoin address</returns>
public override string ToString()
{
return (new CNovacoinAddress(this)).ToString();