{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module Cardano.Api.ProtocolParameters (ProtocolParameters) where

import Cardano.Api.Shelley
import Data.Default (Default, def)
import Data.Map (fromList)
import Data.Ratio ((%))

instance Default ProtocolParameters where
    def :: ProtocolParameters
def = ProtocolParameters :: (Natural, Natural)
-> Rational
-> Maybe PraosNonce
-> Natural
-> Natural
-> Natural
-> Natural
-> Natural
-> Maybe Lovelace
-> Lovelace
-> Lovelace
-> Lovelace
-> EpochNo
-> Natural
-> Rational
-> Rational
-> Rational
-> Maybe Lovelace
-> Map AnyPlutusScriptVersion CostModel
-> Maybe ExecutionUnitPrices
-> Maybe ExecutionUnits
-> Maybe ExecutionUnits
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> ProtocolParameters
ProtocolParameters
        { protocolParamProtocolVersion :: (Natural, Natural)
protocolParamProtocolVersion = (Natural
5,Natural
0)
        , protocolParamDecentralization :: Rational
protocolParamDecentralization = Integer
3 Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
5
        , protocolParamExtraPraosEntropy :: Maybe PraosNonce
protocolParamExtraPraosEntropy = Maybe PraosNonce
forall a. Maybe a
Nothing
        , protocolParamMaxBlockHeaderSize :: Natural
protocolParamMaxBlockHeaderSize = Natural
1100
        , protocolParamMaxBlockBodySize :: Natural
protocolParamMaxBlockBodySize = Natural
65536
        , protocolParamMaxTxSize :: Natural
protocolParamMaxTxSize = Natural
16384
        , protocolParamTxFeeFixed :: Natural
protocolParamTxFeeFixed = Natural
155381
        , protocolParamTxFeePerByte :: Natural
protocolParamTxFeePerByte = Natural
44
        , protocolParamMinUTxOValue :: Maybe Lovelace
protocolParamMinUTxOValue = Maybe Lovelace
forall a. Maybe a
Nothing
        , protocolParamStakeAddressDeposit :: Lovelace
protocolParamStakeAddressDeposit = Integer -> Lovelace
Lovelace Integer
2000000
        , protocolParamStakePoolDeposit :: Lovelace
protocolParamStakePoolDeposit = Integer -> Lovelace
Lovelace Integer
500000000
        , protocolParamMinPoolCost :: Lovelace
protocolParamMinPoolCost = Integer -> Lovelace
Lovelace Integer
340000000
        , protocolParamPoolRetireMaxEpoch :: EpochNo
protocolParamPoolRetireMaxEpoch = Word64 -> EpochNo
EpochNo Word64
18
        , protocolParamStakePoolTargetNum :: Natural
protocolParamStakePoolTargetNum = Natural
150
        , protocolParamPoolPledgeInfluence :: Rational
protocolParamPoolPledgeInfluence = Integer
3 Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
10
        , protocolParamMonetaryExpansion :: Rational
protocolParamMonetaryExpansion = Integer
3 Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1000
        , protocolParamTreasuryCut :: Rational
protocolParamTreasuryCut = Integer
1 Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
5
        , protocolParamUTxOCostPerWord :: Maybe Lovelace
protocolParamUTxOCostPerWord = Lovelace -> Maybe Lovelace
forall a. a -> Maybe a
Just (Integer -> Lovelace
Lovelace Integer
1)
        , protocolParamCostModels :: Map AnyPlutusScriptVersion CostModel
protocolParamCostModels = [(AnyPlutusScriptVersion, CostModel)]
-> Map AnyPlutusScriptVersion CostModel
forall k a. Ord k => [(k, a)] -> Map k a
fromList
            [ (PlutusScriptVersion PlutusScriptV1 -> AnyPlutusScriptVersion
forall lang. PlutusScriptVersion lang -> AnyPlutusScriptVersion
AnyPlutusScriptVersion PlutusScriptVersion PlutusScriptV1
PlutusScriptV1, Map Text Integer -> CostModel
CostModel ([(Text, Integer)] -> Map Text Integer
forall k a. Ord k => [(k, a)] -> Map k a
fromList
                [(Text
"add_integer-cpu-arguments-intercept",Integer
235735)
                ,(Text
"add_integer-cpu-arguments-slope",Integer
1722)
                ,(Text
"add_integer-memory-arguments-intercept",Integer
1)
                ,(Text
"add_integer-memory-arguments-slope",Integer
1)
                ,(Text
"cek_apply_cost-_ex_budget_cpu",Integer
39000)
                ,(Text
"cek_apply_cost-_ex_budget_memory",Integer
10)
                ,(Text
"cek_builtin_cost-_ex_budget_cpu",Integer
39000)
                ,(Text
"cek_builtin_cost-_ex_budget_memory",Integer
10)
                ,(Text
"cek_const_cost-_ex_budget_cpu",Integer
39000)
                ,(Text
"cek_const_cost-_ex_budget_memory",Integer
10)
                ,(Text
"cek_delay_cost-_ex_budget_cpu",Integer
39000)
                ,(Text
"cek_delay_cost-_ex_budget_memory",Integer
10)
                ,(Text
"cek_force_cost-_ex_budget_cpu",Integer
39000)
                ,(Text
"cek_force_cost-_ex_budget_memory",Integer
10)
                ,(Text
"cek_lam_cost-_ex_budget_cpu",Integer
39000)
                ,(Text
"cek_lam_cost-_ex_budget_memory",Integer
10)
                ,(Text
"cek_startup_cost-_ex_budget_cpu",Integer
1000000)
                ,(Text
"cek_startup_cost-_ex_budget_memory",Integer
0)
                ,(Text
"cek_var_cost-_ex_budget_cpu",Integer
39000)
                ,(Text
"cek_var_cost-_ex_budget_memory",Integer
10)
                ,(Text
"concatenate-cpu-arguments-intercept",Integer
420084)
                ,(Text
"concatenate-cpu-arguments-slope",Integer
515)
                ,(Text
"concatenate-memory-arguments-intercept",Integer
0)
                ,(Text
"concatenate-memory-arguments-slope",Integer
1)
                ,(Text
"divide_integer-cpu-arguments-model_split_const_intercept",Integer
330895)
                ,(Text
"divide_integer-cpu-arguments-model_split_const_slope",Integer
427)
                ,(Text
"divide_integer-memory-arguments-intercept",Integer
0)
                ,(Text
"divide_integer-memory-arguments-minimum",Integer
1)
                ,(Text
"divide_integer-memory-arguments-slope",Integer
1)
                ,(Text
"drop_byte_string-cpu-arguments",Integer
3418326)
                ,(Text
"drop_byte_string-memory-arguments",Integer
2)
                ,(Text
"eq_byte_string-cpu-arguments-intercept",Integer
188562)
                ,(Text
"eq_byte_string-cpu-arguments-slope",Integer
246)
                ,(Text
"eq_byte_string-memory-arguments",Integer
1)
                ,(Text
"eq_integer-cpu-arguments-intercept",Integer
211716)
                ,(Text
"eq_integer-cpu-arguments-slope",Integer
867)
                ,(Text
"eq_integer-memory-arguments",Integer
1)
                ,(Text
"greater_than_eq_integer-cpu-arguments-intercept",Integer
216015)
                ,(Text
"greater_than_eq_integer-cpu-arguments-slope",Integer
699)
                ,(Text
"greater_than_eq_integer-memory-arguments",Integer
1)
                ,(Text
"greater_than_integer-cpu-arguments-intercept",Integer
187278)
                ,(Text
"greater_than_integer-cpu-arguments-slope",Integer
980)
                ,(Text
"greater_than_integer-memory-arguments",Integer
1)
                ,(Text
"gt_byte_string-cpu-arguments-intercept",Integer
204537)
                ,(Text
"gt_byte_string-cpu-arguments-slope",Integer
227)
                ,(Text
"gt_byte_string-memory-arguments",Integer
1)
                ,(Text
"if_then_else-cpu-arguments",Integer
0)
                ,(Text
"if_then_else-memory-arguments",Integer
0)
                ,(Text
"less_than_eq_integer-cpu-arguments-intercept",Integer
216015)
                ,(Text
"less_than_eq_integer-cpu-arguments-slope",Integer
699)
                ,(Text
"less_than_eq_integer-memory-arguments",Integer
1)
                ,(Text
"less_than_integer-cpu-arguments-intercept",Integer
187278)
                ,(Text
"less_than_integer-cpu-arguments-slope",Integer
980)
                ,(Text
"less_than_integer-memory-arguments",Integer
1)
                ,(Text
"lt_byte_string-cpu-arguments-intercept",Integer
204537)
                ,(Text
"lt_byte_string-cpu-arguments-slope",Integer
227)
                ,(Text
"lt_byte_string-memory-arguments",Integer
1)
                ,(Text
"mod_integer-cpu-arguments-model_split_const_intercept",Integer
330895)
                ,(Text
"mod_integer-cpu-arguments-model_split_const_slope",Integer
427)
                ,(Text
"mod_integer-memory-arguments-intercept",Integer
0)
                ,(Text
"mod_integer-memory-arguments-minimum",Integer
1)
                ,(Text
"mod_integer-memory-arguments-slope",Integer
1)
                ,(Text
"multiply_integer-cpu-arguments-intercept",Integer
78642)
                ,(Text
"multiply_integer-cpu-arguments-slope",Integer
11464)
                ,(Text
"multiply_integer-memory-arguments-intercept",Integer
0)
                ,(Text
"multiply_integer-memory-arguments-slope",Integer
1)
                ,(Text
"quotient_integer-cpu-arguments-model_split_const_intercept",Integer
330895)
                ,(Text
"quotient_integer-cpu-arguments-model_split_const_slope",Integer
427)
                ,(Text
"quotient_integer-memory-arguments-intercept",Integer
0)
                ,(Text
"quotient_integer-memory-arguments-slope",Integer
1)
                ,(Text
"remainder_integer-cpu-arguments-model_split_const_intercept",Integer
330895)
                ,(Text
"remainder_integer-cpu-arguments-model_split_const_slope",Integer
427)
                ,(Text
"remainder_integer-memory-arguments-intercept",Integer
0)
                ,(Text
"remainder_integer-memory-arguments-slope",Integer
1)
                ,(Text
"sha2-cpu-arguments-intercept",Integer
2267819)
                ,(Text
"sha2-cpu-arguments-slope",Integer
28904)
                ,(Text
"sha2-memory-arguments",Integer
4)
                ,(Text
"sha3-cpu-arguments-intercept",Integer
1260296)
                ,(Text
"sha3-cpu-arguments-slope",Integer
81356)
                ,(Text
"sha3-memory-arguments",Integer
4)
                ,(Text
"subtract_integer-cpu-arguments-intercept",Integer
251934)
                ,(Text
"subtract_integer-cpu-arguments-slope",Integer
1194)
                ,(Text
"subtract_integer-memory-arguments-intercept",Integer
1)
                ,(Text
"subtract_integer-memory-arguments-slope",Integer
1)
                ,(Text
"take_byte_string-cpu-arguments",Integer
3420288)
                ,(Text
"take_byte_string-memory-arguments",Integer
20)
                ,(Text
"verify_signature-cpu-arguments",Integer
5082989)
                ,(Text
"verify_signature-memory-arguments",Integer
1)
                ]))
            ]
        , protocolParamPrices :: Maybe ExecutionUnitPrices
protocolParamPrices = ExecutionUnitPrices -> Maybe ExecutionUnitPrices
forall a. a -> Maybe a
Just (ExecutionUnitPrices :: Rational -> Rational -> ExecutionUnitPrices
ExecutionUnitPrices {priceExecutionSteps :: Rational
priceExecutionSteps = Integer
1 Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1, priceExecutionMemory :: Rational
priceExecutionMemory = Integer
1 Integer -> Integer -> Rational
forall a. Integral a => a -> a -> Ratio a
% Integer
1})
        , protocolParamMaxTxExUnits :: Maybe ExecutionUnits
protocolParamMaxTxExUnits = ExecutionUnits -> Maybe ExecutionUnits
forall a. a -> Maybe a
Just (ExecutionUnits :: Natural -> Natural -> ExecutionUnits
ExecutionUnits {executionSteps :: Natural
executionSteps = Natural
500000000000, executionMemory :: Natural
executionMemory = Natural
500000000000})
        , protocolParamMaxBlockExUnits :: Maybe ExecutionUnits
protocolParamMaxBlockExUnits = ExecutionUnits -> Maybe ExecutionUnits
forall a. a -> Maybe a
Just (ExecutionUnits :: Natural -> Natural -> ExecutionUnits
ExecutionUnits {executionSteps :: Natural
executionSteps = Natural
500000000000, executionMemory :: Natural
executionMemory = Natural
500000000000})
        , protocolParamMaxValueSize :: Maybe Natural
protocolParamMaxValueSize = Natural -> Maybe Natural
forall a. a -> Maybe a
Just Natural
5000
        , protocolParamCollateralPercent :: Maybe Natural
protocolParamCollateralPercent = Natural -> Maybe Natural
forall a. a -> Maybe a
Just Natural
1
        , protocolParamMaxCollateralInputs :: Maybe Natural
protocolParamMaxCollateralInputs = Natural -> Maybe Natural
forall a. a -> Maybe a
Just Natural
5
        }