decred.org/dcrdex@v1.0.5/dex/networks/zcl/params.go (about)

     1  // This code is available on the terms of the project LICENSE.md file,
     2  // also available online at https://blueoakcouncil.org
     3  
     4  package zcl
     5  
     6  import (
     7  	"decred.org/dcrdex/dex"
     8  	"decred.org/dcrdex/dex/networks/btc"
     9  	"github.com/btcsuite/btcd/chaincfg"
    10  )
    11  
    12  var (
    13  	UnitInfo = dex.UnitInfo{
    14  		AtomicUnit: "zats",
    15  		Conventional: dex.Denomination{
    16  			Unit:             "ZCL",
    17  			ConversionFactor: 1e8,
    18  		},
    19  		Alternatives: []dex.Denomination{
    20  			{
    21  				Unit:             "mZCL",
    22  				ConversionFactor: 1e5,
    23  			},
    24  			{
    25  				Unit:             "µZCL",
    26  				ConversionFactor: 1e2,
    27  			},
    28  		},
    29  		FeeRateDenom: "B",
    30  	}
    31  
    32  	// MainNetParams are the clone parameters for mainnet. Zcash,
    33  	// like Decred, uses two bytes for their address IDs. We will convert
    34  	// between address types on the fly and use these spoof parameters
    35  	// internally.
    36  	MainNetParams = btc.ReadCloneParams(&btc.CloneParams{
    37  		Name:             "mainnet",
    38  		ScriptHashAddrID: 0xBD,
    39  		PubKeyHashAddrID: 0xB8,
    40  		CoinbaseMaturity: 100,
    41  		Net:              0xfe2d578a, // random
    42  	})
    43  	// TestNet4Params are the clone parameters for testnet.
    44  	TestNet4Params = btc.ReadCloneParams(&btc.CloneParams{
    45  		Name:             "testnet4",
    46  		PubKeyHashAddrID: 0x25,
    47  		ScriptHashAddrID: 0xBA,
    48  		CoinbaseMaturity: 100,
    49  		Net:              0xea3102f7, // random
    50  	})
    51  	// RegressionNetParams are the clone parameters for simnet.
    52  	RegressionNetParams = btc.ReadCloneParams(&btc.CloneParams{
    53  		Name:             "regtest",
    54  		PubKeyHashAddrID: 0x25,
    55  		ScriptHashAddrID: 0xBA,
    56  		CoinbaseMaturity: 100,
    57  		Net:              0x4b7b0349, // random
    58  	})
    59  )
    60  
    61  func init() {
    62  	for _, params := range []*chaincfg.Params{MainNetParams, TestNet4Params, RegressionNetParams} {
    63  		err := chaincfg.Register(params)
    64  		if err != nil {
    65  			panic("failed to register zec parameters: " + err.Error())
    66  		}
    67  	}
    68  }