From eaea79e04bb1a21fa93252a1fd42706fd40ccdba Mon Sep 17 00:00:00 2001 From: Krisztian Pinter Date: Thu, 26 Sep 2024 16:42:31 +0200 Subject: [PATCH] Remove unused SC Param fields --- CHANGELOG.md | 1 + offchain/README.md | 14 ------ offchain/config.example.json | 5 --- offchain/src/Main.purs | 23 ++-------- .../src/TrustlessSidechain/ConfigFile.purs | 7 +-- .../TrustlessSidechain/ConfigFile/Codecs.purs | 13 +----- .../TrustlessSidechain/Options/Parsers.purs | 22 ---------- .../src/TrustlessSidechain/Options/Specs.purs | 43 +------------------ .../src/TrustlessSidechain/Options/Types.purs | 8 +--- .../src/TrustlessSidechain/RawScripts.purs | 16 +++---- .../TrustlessSidechain/SidechainParams.purs | 34 +++------------ .../src/TrustlessSidechain/Utils/Codecs.purs | 37 +--------------- offchain/test/Test/ConfigFile.purs | 4 +- offchain/test/Test/DParameter.purs | 5 +-- offchain/test/Test/Data.purs | 10 +---- .../test/Test/IlliquidCirculationSupply.purs | 5 +-- .../CandidatePermissionToken.purs | 6 +-- .../test/Test/InitSidechain/TokensMint.purs | 6 +-- .../test/Test/PermissionedCandidates.purs | 6 +-- offchain/test/Test/Reserve.purs | 5 +-- offchain/test/Test/Utils.purs | 5 +-- offchain/test/Test/Versioning.purs | 21 ++------- onchain/app/gen-signatures/GenOutput.hs | 8 +--- onchain/app/gen-signatures/GetOpts.hs | 33 +------------- onchain/src/TrustlessSidechain/OffChain.hs | 10 ----- onchain/src/TrustlessSidechain/Types.hs | 9 +--- .../src/TrustlessSidechain/Types/Unsafe.hs | 3 -- .../Test/TrustlessSidechain/Golden/Types.hs | 10 +---- .../BlockProducerRegistrationMsg-cbor.golden | 2 +- ...BlockProducerRegistrationMsg-isdata.golden | 2 +- .../test/golden/SidechainParams-cbor.golden | 2 +- .../test/golden/SidechainParams-isdata.golden | 2 +- onchain/test/roundtrip/Main.hs | 16 ++----- onchain/test/script-size/Main.hs | 10 ++--- 34 files changed, 53 insertions(+), 350 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 194d7a65..3f0202d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ Changelog](https://keepachangelog.com/en/1.1.0). * Removed `claim-v1` and `claim-v2` commands * Removed `save-root`, `committee-hash`, `committee-handover` and `collect-garbage` commands * Removed `init-checkpoint`, `init-fuel`, `save-checkpoint`, `cbor-update-committee-message`, `cbor-merkle-root-insertion-message`, `cbor-merkle-tree-entry`, `cbor-merkle-tree`, `cbor-combined-merkle-proof`, and `cbor-plain-aggregate-public-keys` commands + * Removed `--chainId`, `--threshold-numerator` and `--threshold-denominator` ## Fixed * CLI now returns non-zero exit code on failure diff --git a/offchain/README.md b/offchain/README.md index be3f77eb..e227edb7 100644 --- a/offchain/README.md +++ b/offchain/README.md @@ -85,12 +85,7 @@ file `$CWD/config.json` in the following format: ```json "sidechainParameters": { - "chainId": 123, "genesisUtxo": "3824c3a7c4437cc6ca4f893cd1519ae1dbe77862304e14d910ddc1f32de69b60#1", - "threshold": { - "numerator": 2, - "denominator": 3 - }, "governanceAuthority": "4f2d6145e1700ad11dc074cad9f4194cc53b0dbab6bd25dfea6c501a" }, "runtimeConfig": { @@ -115,10 +110,7 @@ file `$CWD/config.json` in the following format: This allows to shorten a CLI call from: ``` nix run .#pc-contracts-cli -- deregister \ - --sidechain-id 123 \ --genesis-committee-hash-utxo 3824c3a7c4437cc6ca4f893cd1519ae1dbe77862304e14d910ddc1f32de69b60#1 \ - --threshold-numerator 2 \ - --threshold-denominator 3 \ --governance-authority 4f2d6145e1700ad11dc074cad9f4194cc53b0dbab6bd25dfea6c501c \ --network testnet \ --ogmios-host localhost \ @@ -563,16 +555,10 @@ nix run .#pc-contracts-cli -- utils sign schnorr-secp256k1 \ The result corresponds to `BlockProducerRegistrationMsg` type in the code. Available options: - - `-i,--sidechain-id` \ - Sidechain ID - `-c,--genesis-committee-hash-utxo TX_ID#TX_IDX` \ Input UTxO to be spent with the first committee hash setup - `-g,--governance-authority PUB_KEY_HASH` \ Public key hash of governance authority - - `--threshold-numerator INT` \ - The numerator for the ratio of the threshold - - `--threshold-denominator INT` \ - The denominator for the ratio of the threshold - `--sidechain-public-key SIDECHAIN_PUB_KEY` \ Sidechain public key - `--input-utxo TX_ID#TX_IDX` \ diff --git a/offchain/config.example.json b/offchain/config.example.json index ebb61957..907e7ebe 100644 --- a/offchain/config.example.json +++ b/offchain/config.example.json @@ -1,11 +1,6 @@ { "sidechainParameters": { - "chainId": 123, "genesisUtxo": "3824c3a7c4437cc6ca4f893cd1519ae1dbe77862304e14d910ddc1f32de69b60#1", - "threshold": { - "numerator": 2, - "denominator": 3 - }, "governanceAuthority": "4f2d6145e1700ad11dc074cad9f4194cc53b0dbab6bd25dfea6c501a" }, "runtimeConfig": { diff --git a/offchain/src/Main.purs b/offchain/src/Main.purs index efd06f67..beadc08f 100644 --- a/offchain/src/Main.purs +++ b/offchain/src/Main.purs @@ -127,22 +127,6 @@ main = do -- Do some validation on the CLI options ----------------------- - let numerator = (unwrap scParams).thresholdNumerator - let denominator = (unwrap scParams).thresholdDenominator - unless (gcd numerator denominator == one) $ failWith - $ "Threshold numerator and denominator are not coprime.\n" - <> "Numerator: " - <> BigInt.toString numerator - <> "\nDenominator: " - <> BigInt.toString denominator - - unless (numerator <= denominator) $ failWith - $ "Threshold numerator is greater than denominator.\n" - <> "Numerator: " - <> BigInt.toString numerator - <> "\nDenominator: " - <> BigInt.toString denominator - let governance = Just $ MultiSig $ MultiSigGovParams { governanceMembers: @@ -160,7 +144,9 @@ main = do liftEffect $ case endpointResp of Right resp -> printEndpointResp resp - Left e -> failWith $ show e + Left e -> do + log $ show e + exit 1 UtilsOptions opts -> do endpointResp <- runUtilsEndpoint opts.utilsOptions @@ -168,9 +154,6 @@ main = do CLIVersion -> log versionString -failWith :: String -> Effect Unit -failWith errStr = log errStr *> exit 1 - -- | Reads configuration file from `./config.json`, then -- | parses CLI arguments. CLI arguments override the config files. getOptions :: Effect Options diff --git a/offchain/src/TrustlessSidechain/ConfigFile.purs b/offchain/src/TrustlessSidechain/ConfigFile.purs index a3394875..baf89ef1 100644 --- a/offchain/src/TrustlessSidechain/ConfigFile.purs +++ b/offchain/src/TrustlessSidechain/ConfigFile.purs @@ -36,8 +36,7 @@ import Type.Row (type (+)) optExample :: Config optExample = { sidechainParameters: Just - { chainId: Just 1 - , genesisUtxo: Just $ TransactionInput + { genesisUtxo: Just $ TransactionInput { transactionId: ( wrap $ unsafePartial $ fromJust $ fromBytes ( hexToByteArrayUnsafe @@ -46,10 +45,6 @@ optExample = ) , index: UInt.fromInt 2 } - , threshold: Just - { numerator: 2 - , denominator: 3 - } , governanceAuthority: Just $ hexToByteArrayUnsafe "123456789abcdef0" } , paymentSigningKeyFile: Just "/absolute/path/to/payment.skey" diff --git a/offchain/src/TrustlessSidechain/ConfigFile/Codecs.purs b/offchain/src/TrustlessSidechain/ConfigFile/Codecs.purs index 7088f874..6846ecbb 100644 --- a/offchain/src/TrustlessSidechain/ConfigFile/Codecs.purs +++ b/offchain/src/TrustlessSidechain/ConfigFile/Codecs.purs @@ -22,7 +22,6 @@ import Data.UInt as UInt import TrustlessSidechain.Options.Types (Config) import TrustlessSidechain.Utils.Codecs ( byteArrayCodec - , thresholdCodec , transactionInputCodec ) import TrustlessSidechain.Utils.Crypto @@ -46,20 +45,12 @@ configCodec = where scParamsCodec :: CA.JsonCodec - { chainId :: Maybe Int - , genesisUtxo :: Maybe TransactionInput - , threshold :: - Maybe - { denominator :: Int - , numerator :: Int - } + { genesisUtxo :: Maybe TransactionInput , governanceAuthority :: Maybe ByteArray } scParamsCodec = ( CAR.object "sidechainParameters" - { chainId: CAC.maybe CA.int - , genesisUtxo: CAC.maybe transactionInputCodec - , threshold: CAC.maybe thresholdCodec + { genesisUtxo: CAC.maybe transactionInputCodec , governanceAuthority: CAC.maybe byteArrayCodec } ) diff --git a/offchain/src/TrustlessSidechain/Options/Parsers.purs b/offchain/src/TrustlessSidechain/Options/Parsers.purs index 1d58a1f2..21c8f272 100644 --- a/offchain/src/TrustlessSidechain/Options/Parsers.purs +++ b/offchain/src/TrustlessSidechain/Options/Parsers.purs @@ -9,13 +9,11 @@ module TrustlessSidechain.Options.Parsers , cborEncodedAddressParser , committeeSignature , currencySymbolParser - , denominator , ecdsaSecp256k1PrivateKey , ecdsaSecp256k1PublicKey , epoch , governanceAuthority , mkCurrencySymbol - , numerator , parsePubKeyAndSignature , parsePubKeyBytesAndSignatureBytes , parseAssetName @@ -252,26 +250,6 @@ registeredCandidatesCount = eitherReader Nothing -> Left "failed to parse int registered-candidates-count" ) --- | Parse a numerator in the threshold. -numerator :: ReadM BigInt -numerator = eitherReader - ( \str -> case BigInt.fromString str of - Just i - | i >= zero -> pure i - | otherwise -> Left "numerator must be non-negative" - Nothing -> Left "failed to parse int numerator" - ) - --- | Parse a denominator in the threshold. -denominator :: ReadM BigInt -denominator = eitherReader - ( \str -> case BigInt.fromString str of - Just i - | i > zero -> pure i - | otherwise -> Left "denominator must be positive" - Nothing -> Left "failed to parse int denominator" - ) - -- | Parse an epoch. epoch :: ReadM BigInt epoch = eitherReader diff --git a/offchain/src/TrustlessSidechain/Options/Specs.purs b/offchain/src/TrustlessSidechain/Options/Specs.purs index 501e2079..c5db29d3 100644 --- a/offchain/src/TrustlessSidechain/Options/Specs.purs +++ b/offchain/src/TrustlessSidechain/Options/Specs.purs @@ -66,11 +66,9 @@ import TrustlessSidechain.NativeTokenManagement.Types import TrustlessSidechain.Options.Parsers ( bigInt , byteArray - , denominator , ecdsaSecp256k1PrivateKey , governanceAuthority , networkId - , numerator , permissionedCandidateKeys , registrationSidechainKeys , schnorrSecp256k1PrivateKey @@ -397,15 +395,6 @@ serverConfigSpec sidechainParamsSpec :: Maybe Config -> Parser SidechainParams sidechainParamsSpec maybeConfig = ado - chainId <- option int $ fold - [ short 'i' - , long "sidechain-id" - , metavar "1" - , help "Sidechain ID" - , maybe mempty value - (maybeConfig >>= _.sidechainParameters >>= _.chainId) - ] - genesisUtxo <- option Parsers.transactionInput $ fold [ short 'c' , long "genesis-committee-hash-utxo" @@ -429,40 +418,10 @@ sidechainParamsSpec maybeConfig = ado ) ) ] - - { thresholdNumerator, thresholdDenominator } <- - let - thresholdNumeratorDenominatorOption = ado - thresholdNumerator <- option numerator $ fold - [ long "threshold-numerator" - , metavar "INT" - , help "The numerator for the ratio of the threshold" - , maybe mempty value - $ map (BigInt.fromInt <<< _.numerator) - ( maybeConfig >>= _.sidechainParameters >>= - _.threshold - ) - ] - thresholdDenominator <- option denominator $ fold - [ long "threshold-denominator" - , metavar "INT" - , help "The denominator for the ratio of the threshold" - , maybe mempty value - $ map (BigInt.fromInt <<< _.denominator) - ( maybeConfig >>= _.sidechainParameters >>= - _.threshold - ) - ] - in { thresholdNumerator, thresholdDenominator } - in - thresholdNumeratorDenominatorOption in SidechainParams - { chainId: BigInt.fromInt chainId - , genesisUtxo + { genesisUtxo , governanceAuthority - , thresholdNumerator - , thresholdDenominator } -- | SidechainParams CLI parser diff --git a/offchain/src/TrustlessSidechain/Options/Types.purs b/offchain/src/TrustlessSidechain/Options/Types.purs index 9988eb19..71d733a8 100644 --- a/offchain/src/TrustlessSidechain/Options/Types.purs +++ b/offchain/src/TrustlessSidechain/Options/Types.purs @@ -70,13 +70,7 @@ type Config = { -- | Sidechain parameters (defining the sidechain which we will interact with) sidechainParameters :: Maybe - { chainId :: Maybe Int - , genesisUtxo :: Maybe TransactionInput - , threshold :: - Maybe - { numerator :: Int - , denominator :: Int - } + { genesisUtxo :: Maybe TransactionInput -- governanceAuthority should really be a PubKeyHash but there's no -- (easy) way of pulling a dummy PubKeyHash value out of thin air in -- TrustlessSidechain.ConfigFile.optExample diff --git a/offchain/src/TrustlessSidechain/RawScripts.purs b/offchain/src/TrustlessSidechain/RawScripts.purs index 581a95bb..d08d234d 100644 --- a/offchain/src/TrustlessSidechain/RawScripts.purs +++ b/offchain/src/TrustlessSidechain/RawScripts.purs @@ -46,7 +46,7 @@ rawCandidatePermissionPolicy = rawInitTokenPolicy :: Tuple ScriptId String rawInitTokenPolicy = ( InitTokenPolicy /\ - """{"cborHex":"59032359032001000032332232332232323322323232323232322225335532335325333573466e1d2000001112200115333573466e1d2002001112200216375a00626464a66aa66a6a600666004600244002900111299a8008a808110a99a8008a999ab9a3370e9000002098098010a809110a80a1098081bae0011500e21330114901144552524f522d494e49542d544f4b454e532d3032003012325335330192253350011501222135002225335333573466e3c00802006c0684c05c0044c01800cc8c8cc004c005d6801119118011bab001301b2233335573e002403a46466a03a660286eb8d55ce80098029aab9e0013004357440066ae84008044cc010d4c014cc010c00c880052000220014802084c0080044060c88c008004c0388d4004880044c0292401144552524f522d494e49542d544f4b454e532d30330053002003500613232533553353530033300230012200148008894cd4004540408854cd400454ccd5cd19b87480000104c04c0085404888540508405040484cc0412401144552524f522d494e49542d544f4b454e532d303100323301822533500110152215333573466ebc01400840604c010004cc0388cc010d4c0140048800520003015300a3758660066a600866006600444002900011000a4000660046a600600c440029001098052481144552524f522d494e49542d544f4b454e532d3033005300200350062323300b35573a002600c6aae78004dd5000880409803a49035054350030102233335573e0024024466a0226ae84008c00cd5d100124c26444a666ae68cdc4000a40002600a9210350543600133003001002300f22253350011300549103505437002215333573466e1d200000410021330053370200890010009807111999aab9f0012010233500f3574200460066ae880092623263357380020042400244246600200600446446004002601644a66a002201844266a01a600a004600800242446004006224400244a66a002200a266ae70008010c018894cd400440108854ccd5cd19b880024800040184c010004488008488004c00c894cd40044010884cd4014008c010004488008488488cc00401000c8c8c00400488cc00cc008008005","description":"","type":"PlutusScriptV2"}""" + """{"cborHex":"59032359032001000032332232332232323322323232323232322225335532335325333573466e1d2000001112200115333573466e1d2002001112200216375a00626464a66aa66a6a600666004600244002900111299a8008a808110a99a8008a999ab9a3370e9000002098098010a809110a80a1098081bae0011500e21330114901144552524f522d494e49542d544f4b454e532d3032003012325335330192253350011501222135002225335333573466e3c00802006c0684c05c0044c01800cc8c8cc004c005d6801119118011bab001301b2233335573e002403a46466a03a660286eb8d55ce80098029aab9e0013004357440066ae84008044cc010d4c014cc010c00c880052000220014802084c0080044060c88c008004c0388d4004880044c0292401144552524f522d494e49542d544f4b454e532d30330053002003500613232533553353530033300230012200148008894cd4004540408854cd400454ccd5cd19b87480000104c04c0085404888540508405040484cc0412401144552524f522d494e49542d544f4b454e532d303100323301822533500110152215333573466ebc01400840604c010004cc0388cc010d4c0140048800520003015300a3758660066a600866006600444002900011000a4000660046a600600c440029000098052481144552524f522d494e49542d544f4b454e532d3033005300200350062323300b35573a002600c6aae78004dd5000880409803a49035054350030102233335573e0024024466a0226ae84008c00cd5d100124c26444a666ae68cdc4000a40002600a9210350543600133003001002300f22253350011300549103505437002215333573466e1d200000410021330053370200890010009807111999aab9f0012010233500f3574200460066ae880092623263357380020042400244246600200600446446004002601644a66a002201844266a01a600a004600800242446004006224400244a66a002200a266ae70008010c018894cd400440108854ccd5cd19b880024800040184c010004488008488004c00c894cd40044010884cd4014008c010004488008488488cc00401000c8c8c00400488cc00cc008008005","description":"","type":"PlutusScriptV2"}""" ) rawScriptCache :: Tuple ScriptId String @@ -58,13 +58,13 @@ rawScriptCache = rawVersionOraclePolicy :: Tuple ScriptId String rawVersionOraclePolicy = ( VersionOraclePolicy /\ - """{"cborHex":"590c35590c32010000323322323233223232323232323232323232323232323232323322323232323232323222222533532323232323232323232323233353232325333573466e1d2000002133221222330020050043019357420026eb8d5d09aba200115333573466e1d2002002133221222330010050043019357420026eb8d5d09aba200115333573466e1d2004002132122230030043019357420022605a9201035054310035573c0046aae74004dd50071191919299a99812a481174552524f522d56455253494f4e2d504f4c4943592d30370033038225335001103922132350032235001222253335002100721535005223501b2233532335005233500425333573466e3c0080045400c40c480c48cd401080c494ccd5cd19b8f002001150031031153350032153350022133500223350022335002233500223303200200120342335002203423303200200122203422233500420342225333573466e1c01800c54ccd5cd19b8700500213303500400110361036102f153350012102f102f133048225335001100e221325335003213500122535002223501e22335533533039004002133039003001103a1533533039333025014502748810e56657273696f6e206f7261636c6500480084cd41480ec020402040204004c010004c8cd411c004120ccccccd5d2002928219282191919981a1bac0070012253353333333574800440084008466606e6eb000c010894cd4c0dc00884ccc0e800801c894cd4c0e800884ccc0f4008c138cc0fc01000488030402440188010801011484ccc0dc008010894cd4cccccc0e000888020801c801c801c8c12c00484ccc0e8008c12ccc0ec010004880244018400d410c9410c9410c104403084020c010004c0a4c0a0c05cdd619801180091000a40002a66a6600c921174552524f522d56455253494f4e2d504f4c4943592d3038005335330382253350011039221325333573466e24ccc038c080cc01cd4c04400c88005200250104890e56657273696f6e206f7261636c65004800040044cd40ec0d8004c010004c0d4c05cdd619801180091000a4008203e44204026600c921174552524f522d56455253494f4e2d504f4c4943592d303900330050033501022222001101e101e5300b00250165007225335330044901174552524f522d56455253494f4e2d504f4c4943592d30310032323232333573466e1d200133300b004002001021020300222001300122002500d30193233501735300b0012200148021402054cd4cc08d2401174552524f522d56455253494f4e2d504f4c4943592d30320033006002001133004491174552524f522d56455253494f4e2d504f4c4943592d3033005005101c101c22533533023491174552524f522d56455253494f4e2d504f4c4943592d303400330060020011533533004491174552524f522d56455253494f4e2d504f4c4943592d3035003300350083500e222220011330044901174552524f522d56455253494f4e2d504f4c4943592d3036005005101c101c2233035225335001101d2215333573466e3c014dd7001081009802000980b180a1bac3350153530090022200148040894cd4004406c4cd5ce00100d09980b199801180a1919a8091a980300091000a4010a006a00891010e56657273696f6e206f7261636c65004800888cc0c8894cd400440cc884c8d400c88894ccd40084014854cd4008854d401888d405088cd4c8cd40148cd401094ccd5cd19b8f00200115003102a202a2335004202a25333573466e3c0080045400c40a854cd400c854cd400884cd40088cd40088cd40088cd40088cc0ac00800480b48cd400880b48cc0ac0080048880b4888cd401080b48894ccd5cd19b8700600315333573466e1c0140084cc0b801000440bc40bc40a054cd4004840a040a04cc104894cd40044034884c94cd400c84d4004894d400888d406c88cd54cd4cc0c80100084cc0c800c00440cc54cd4cc0c404407054cd4cc0c8ccc07805540812210e56657273696f6e206f7261636c6500480084cd412c0d00204020402040204004c010004c8cd4100004104ccccccd5d20031281e1281e1191998169bac008001225335333333357480044008400846660606eb000c010894cd4c0c000884ccc0cc00801c894cd4c0cc00884ccc0d8008c11ccc0e00100048803040244018801080100f884ccc0c0008010894cd4cccccc0c400888020801c801c801c8c11000484ccc0cc008c110cc0d0010004880244018400d40f0940f0940f00e8402c401884018c010004c084c8c084c048dd619a8099a980380091000a4008a008444646606644a66a002290001109a801112999ab9a3371e0040122600e0022600c006008606444a66a002290001109a801112999ab9a3371e00400e20022600c006266a01c6a600400e4400290000a99aa99a9a980099a8069a980080311000a400444a66a0022a052442a66a0022a666ae68cdc3a4000008260580042a056442a05a4260526eb80045409c840044c08d2401164552524f522d4f5241434c452d504f4c4943592d3130002323302a35573a00260186aae78004dd5000980f803191909198008010019bae357420046eb8d5d09aba2001375800a646464a666ae68cdc3a400000426464646666644444246666600200c00a0080060046eb4d5d080218101aba1003375a6ae84008dd69aba1001375c6ae84d5d10009aba2001357440026ae880044c0852401035054310035573c0046aae74004dd500288108980f249035054350030222233335573e0024048466a0466ae84008c00cd5d100124c6042446666aae7c004808c8cd4088d5d080118019aba20024984c8894ccd5cd19b88001480004c06524010350543600133003001002302022253350011301949103505437002215333573466e1d20000041002133005337020089001000980f91299a800881011099a8108011802000919198061bad357420026eb4d5d09aba20013758002466602ceb9405400488ccd5cd19b8f00200100500422333573466e1c00800401000c4880084880048cccccc00800489405494050940508c05400494050888888ccccccd5d2003119198039aab9d00135573c0026ea801c8c014dd5803918021bac00723003375a00e460046eb801c058888cccd55cf80190019198011aba10043574400802444246600200600444246600200600444a66a00226016004442a66a0022004442601e00c602444a66a002202644266a0280046008002602244a66a002202444266a02660100046008002602044a66a002202244266a0240046008002601e44a66a002202044266a022646464a666ae68cdc3a400000426644246600200600460106ae84004c024d5d09aba20011300c4901035054310035573c0046aae74004dd5001180200091919192999ab9a3370e90000010999109198008018011919192999ab9a3370e900000109bae35742002260169201035054310035573c0046aae74004dd51aba1001375a6ae84d5d1000898042481035054310035573c0046aae74004dd500091919192999ab9a3370e9000001099191999911109199980080280200180118039aba100333300b75ca0146ae84008c8c8c94ccd5cd19b87480000084488800c54ccd5cd19b87480080084c84888c004010dd71aba100115333573466e1d20040021321222300200435742002260189201035054310035573c0046aae74004dd51aba10013300875c6ae84d5d10009aba2001357440022600e9201035054310035573c0046aae74004dd500091919192999ab9a3370e90000010991991091980080180118009aba10023300623232325333573466e1d200000213212230020033005357420022a666ae68cdc3a400400426466644424466600200a0080066eb4d5d08011bad357420026eb4d5d09aba200135744002260169201035054310035573c0046aae74004dd50009aba1357440044646464a666ae68cdc3a400000426424460040066eb8d5d08008a999ab9a3370e900100109909118008019bae3574200226014921035054310035573c0046aae74004dd500089803249035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010a8050a999ab9a3370e90000010980598029aba1001130064901035054310035573c0046aae74004dd5000919319ab9c00100413300175ceb488c88c008dd58009805111999aab9f001200c23233500c3300a300635573a002600a6aae78004c010d5d10019aba100200512001212230020031122001221233001003002300322533500110042213350050023004001122002122122330010040032323001001223300330020020011","description":"","type":"PlutusScriptV2"}""" + """{"cborHex":"590c08590c05010000323322323233223232323232323232323232323232323232323322323232323232323222222533532323232323232323232323233353232325333573466e1d2000002133221222330020050043019357420026eb8d5d09aba200115333573466e1d2002002133221222330010050043019357420026eb8d5d09aba200115333573466e1d2004002132122230030043019357420022605a9201035054310035573c0046aae74004dd50071191919299a99812a481174552524f522d56455253494f4e2d504f4c4943592d30370033038225335001103922132350032235001222253335002100721535005223501b2233532335005233500425333573466e3c0080045400c40c480c48cd401080c494ccd5cd19b8f002001150031031153350032153350022133500223350022335002233500223303200200120342335002203423303200200122203422233500420342225333573466e1c01800c54ccd5cd19b8700500213303500400110361036102f153350012102f102f133048225335001100e221325335003213500122535002223501e22335533533039004002133039003001103a1533533039333025014502748810e56657273696f6e206f7261636c6500480084cd41480ec020402040204004c010004c8cd411c004120ccccccd5d2002928219282191919981a1bac0070012253353333333574800440084008466606e6eb000c010894cd4c0dc00884ccc0e800801c894cd4c0e800884ccc0f4008c138cc0fc01000488030402440188010801011484ccc0dc008010894cd4cccccc0e000888020801c801c801c8c12c00484ccc0e8008c12ccc0ec010004880244018400d410c9410c9410c104403084020c010004c0a4c0a0c05cdd619801180091000a40002a66a6600c921174552524f522d56455253494f4e2d504f4c4943592d3038005335330382253350011039221325333573466e24ccc038c080cc01cd4c04400c88005200250104890e56657273696f6e206f7261636c65004800040044cd40ec0d8004c010004c0d4c05cdd619801180091000a4008203e44204026600c921174552524f522d56455253494f4e2d504f4c4943592d303900330050033501022001101e101e5300b0025016500722533533004491174552524f522d56455253494f4e2d504f4c4943592d30310032323232333573466e1d200133300b004002001021020300222001300122002500d30193233501735300b0012200148021402054cd4cc08d2401174552524f522d56455253494f4e2d504f4c4943592d30320033006002001133004491174552524f522d56455253494f4e2d504f4c4943592d3033005005101c101c22533533023491174552524f522d56455253494f4e2d504f4c4943592d303400330060020011533533004491174552524f522d56455253494f4e2d504f4c4943592d3035003300350083500e22001133004491174552524f522d56455253494f4e2d504f4c4943592d3036005005101c101c2233035225335001101d2215333573466e3c014dd7001081009802000980b180a1bac3350153530090022200148040894cd4004406c4cd5ce00100d09980b199801180a1919a8091a980300091000a4010a006a00891010e56657273696f6e206f7261636c65004800888cc0c8894cd400440cc884c8d400c88894ccd40084014854cd4008854d401888d405088cd4c8cd40148cd401094ccd5cd19b8f00200115003102a202a2335004202a25333573466e3c0080045400c40a854cd400c854cd400884cd40088cd40088cd40088cd40088cc0ac00800480b48cd400880b48cc0ac0080048880b4888cd401080b48894ccd5cd19b8700600315333573466e1c0140084cc0b801000440bc40bc40a054cd4004840a040a04cc104894cd40044034884c94cd400c84d4004894d400888d406c88cd54cd4cc0c80100084cc0c800c00440cc54cd4cc0c404407054cd4cc0c8ccc07805540812210e56657273696f6e206f7261636c6500480084cd412c0d00204020402040204004c010004c8cd4100004104ccccccd5d20031281e1281e1191998169bac008001225335333333357480044008400846660606eb000c010894cd4c0c000884ccc0cc00801c894cd4c0cc00884ccc0d8008c11ccc0e00100048803040244018801080100f884ccc0c0008010894cd4cccccc0c400888020801c801c801c8c11000484ccc0cc008c110cc0d0010004880244018400d40f0940f0940f00e8402c401884018c010004c084c8c084c048dd619a8099a980380091000a4008a008444646606644a66a002290001109a801112999ab9a3371e0040122600e0022600c006008606444a66a002290001109a801112999ab9a3371e00400e20022600c006266a01c6a600400e4400290000a99aa99a9a980099a8069a980080311000a400444a66a0022a052442a66a0022a666ae68cdc3a4000008260580042a056442a05a4260526eb80045409c840044c08d2401164552524f522d4f5241434c452d504f4c4943592d3130002323302a35573a00260186aae78004dd5000980f803191909198008010019bae357420046eb8d5d09aba2001375800a646464a666ae68cdc3a4000004266442466002006004603a6ae84004dd71aba135744002260429201035054310035573c0046aae74004dd500288108980f249035054350030222233335573e0024048466a0466ae84008c00cd5d100124c6042446666aae7c004808c8cd4088d5d080118019aba20024984c8894ccd5cd19b88001480004c06524010350543600133003001002302022253350011301949103505437002215333573466e1d20000041002133005337020089001000980f91299a800881011099a8108011802000919198061bad357420026eb4d5d09aba20013758002466602ceb9405400488ccd5cd19b8f00200100500422333573466e1c00800401000c4880084880048cccccc00800489405494050940508c05400494050888888ccccccd5d2003119198039aab9d00135573c0026ea801c8c014dd5803918021bac00723003375a00e460046eb801c058888cccd55cf80190019198011aba10043574400802444246600200600444246600200600444a66a00226016004442a66a0022004442601e00c602444a66a002202644266a0280046008002602244a66a002202444266a02660100046008002602044a66a002202244266a0240046008002601e44a66a002202044266a022646464a666ae68cdc3a400000426644246600200600460106ae84004c024d5d09aba20011300c4901035054310035573c0046aae74004dd5001180200091919192999ab9a3370e90000010999109198008018011919192999ab9a3370e900000109bae35742002260169201035054310035573c0046aae74004dd51aba1001375a6ae84d5d1000898042481035054310035573c0046aae74004dd500091919192999ab9a3370e9000001099191999911109199980080280200180118039aba100333300b75ca0146ae84008c8c8c94ccd5cd19b87480000084488800c54ccd5cd19b87480080084c84888c004010dd71aba100115333573466e1d20040021321222300200435742002260189201035054310035573c0046aae74004dd51aba10013300875c6ae84d5d10009aba2001357440022600e9201035054310035573c0046aae74004dd500091919192999ab9a3370e90000010991991091980080180118009aba10023300623232325333573466e1d200000213212230020033005357420022a666ae68cdc3a400400426466644424466600200a0080066eb4d5d08011bad357420026eb4d5d09aba200135744002260169201035054310035573c0046aae74004dd50009aba1357440044646464a666ae68cdc3a400000426424460040066eb8d5d08008a999ab9a3370e900100109909118008019bae3574200226014921035054310035573c0046aae74004dd500089803249035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010a8050a999ab9a3370e90000010980598029aba1001130064901035054310035573c0046aae74004dd5000919319ab9c00100413300175ceb488c88c008dd58009805111999aab9f001200c23233500c3300a300635573a002600a6aae78004c010d5d10019aba100200512001212230020031122001221233001003002300322533500110042213350050023004001122002122122330010040032323001001223300330020020011","description":"","type":"PlutusScriptV2"}""" ) rawVersionOracleValidator :: Tuple ScriptId String rawVersionOracleValidator = ( VersionOracleValidator /\ - """{"cborHex":"5903a75903a401000032323322323232323232323222225335332232323232350022232323232323253355335323301f22533500110102215333573466e3c014dd7001080989802000980c980a1bac330043530060022200148040d4030888880044038403454cd54d402088d402c88cd54ccd5cd19b870040021333573466e1c00c00404804440444048404454cd54cd54cd4cc078894cd40044078884c94ccd5cd19b893009323233001300175a004464460046eac004c09488cccd55cf800901311919a813198141bae35573a002600a6aae78004c010d5d10019aba10020203300835300a003220014800920001001133502001c0013004001301930133758660066a600a0024400290020807110807880708068a99aa99a99299a991980410008009aab9e0011016221533500115333573466e1d200235573a0062244600400820304420346ea8cc00cc0088800520022100f100d100e100d100d100d100d33002300122001480014c00c034c8894ccd5cd19b88001480004c05924010350543600133003001002301b22253350011301649103505437002215333573466e1d20000041002133005337020089001000980d11299a8008a40004426a00444a666ae68cdc78010048980e000898030019191980d1aab9d0013233004200100135573c0026ea80048c88c008004c06488cccd55cf800900d119a80c98021aba10023003357440049318058039991091980080180118051aba1001375c6ae84d5d10009bac0063232325333573466e1d2000002132323233333222221233333001006005004003002375a6ae84010c8c8c94ccd5cd19b87480000084cc8848cc00400c008c8c8c94ccd5cd19b87480000084dd71aba100113016491035054310035573c0046aae74004dd51aba1001375a6ae84d5d100089809a481035054310035573c0046aae74004dd51aba1003375a6ae84008dd69aba1001375c6ae84d5d10009aba2001357440026ae880044c035241035054310035573c0046aae74004dd50030910010910008804898042490350543500300b2233335573e0024018466a0166ae84008c00cd5d100124c464664424660020060046eb4d5d08009bad357426ae88004dd6000891000919319ab9c001002120013006225335001100622133500700230040013005225335001100522133500600230040013004225335001148000884d4008894ccd5cd19b8f4890e56657273696f6e206f7261636c65000021001130060031220021221223300100400322123300100300223230010012233003300200200101","description":"","type":"PlutusScriptV2"}""" + """{"cborHex":"59037d59037a01000032323322323232323232323222225335332232323232350022232323232323253355335323301f22533500110102215333573466e3c014dd7001080989802000980c980a1bac330043530060022200148040d4030880044038403454cd54d402088d402c88cd54ccd5cd19b870040021333573466e1c00c00404804440444048404454cd54cd54cd4cc078894cd40044078884c94ccd5cd19b893009323233001300175a004464460046eac004c09488cccd55cf800901311919a813198141bae35573a002600a6aae78004c010d5d10019aba10020203300835300a003220014800920001001133502001c0013004001301930133758660066a600a0024400290020807110807880708068a99aa99a99299a991980410008009aab9e0011016221533500115333573466e1d200235573a0062244600400820304420346ea8cc00cc0088800520022100f100d100e100d100d100d100d33002300122001480014c00c034c8894ccd5cd19b88001480004c0592410350543600133003001002301b22253350011301649103505437002215333573466e1d20000041002133005337020089001000980d11299a8008a40004426a00444a666ae68cdc78010048980e000898030019191980d1aab9d0013233004200100135573c0026ea80048c88c008004c06488cccd55cf800900d119a80c98021aba10023003357440049318058039991091980080180118051aba1001375c6ae84d5d10009bac0063232325333573466e1d20000021332212330010030023232325333573466e1d20000021332212330010030023232325333573466e1d20000021375c6ae840044c04d2401035054310035573c0046aae74004dd51aba1001375a6ae84d5d1000898082481035054310035573c0046aae74004dd51aba1001375c6ae84d5d100089806a481035054310035573c0046aae74004dd50030910010910008804898042490350543500300b2233335573e0024018466a0166ae84008c00cd5d100124c464664424660020060046eb4d5d08009bad357426ae88004dd6000891000919319ab9c001002120013006225335001100622133500700230040013005225335001100522133500600230040013004225335001148000884d4008894ccd5cd19b8f4890e56657273696f6e206f7261636c65000021001130060031220021221223300100400322123300100300223230010012233003300200200101","description":"","type":"PlutusScriptV2"}""" ) rawMultiSigPolicy :: Tuple ScriptId String @@ -76,25 +76,25 @@ rawMultiSigPolicy = rawDParameterPolicy :: Tuple ScriptId String rawDParameterPolicy = ( DParameterPolicy /\ - """{"cborHex":"5903d85903d5010000323322323232323232323233223233223232322222533532533232323553353530033300230012200148008894cd4004540388854cd400454ccd5cd19b87480000104c04400854040885404884c038dd70008a80610a9991a9980824811a4552524f522d44504152414d455445522d504f4c4943592d303100323301e22533500110142215333573466e3c014dd7001080b89802000980c98069bac330053530060022200148040d4018888880044c8cc04524011a4552524f522d44504152414d455445522d504f4c4943592d303200333573466e1ccc038c058cc014c00488005200800333232322300200130202253350011003221330060023004001301b22001301a220023301e225335001101f22132325333573466ebccc02cc00488005200001013233502300100333014301c3300b3001220014800802440094c02c00cc010004c06cc034dd619802980091000a4008026024a600a00266006600444002900008082980100219112999ab9a337100029000098092490350543600133003001002301922253350011301249103505437002215333573466e1d200000410021330053370200890010009191980a1aab9d001300835573c0026ea80044c03924011a4552524f522d44504152414d455445522d504f4c4943592d3033003232325333573466e1d2000002132323233333222221233333001006005004003002375a6ae84010c8c8c94ccd5cd19b87480000084cc8848cc00400c008c8c8c94ccd5cd19b87480000084dd71aba100113019491035054310035573c0046aae74004dd51aba1001375a6ae84d5d10008980b2481035054310035573c0046aae74004dd51aba1003375a6ae84008dd69aba1001375c6ae84d5d10009aba2001357440026ae880044c041241035054310035573c0046aae74004dd5002080809806a49035054350030122233335573e0024028466a0266ae84008c00cd5d100124c6022446666aae7c004804c8cd4048d5d080118019aba200249888c8cc04c894cd40044c00d4018884d4008894ccd5cd19b8f00200813007300b0011300600300323350012300b001480008488c00800c4488004894cd400440104cd5ce001001891001091000919319ab9c0010043009225335001148000884d400888cdc00009803001919918009800bad2322300237560026014446666aae7c00480308c8cd4030cc020dd71aab9d001300535573c00260086ae8800cd5d080100280089000910919800801801180291299a800880311099a80380118020009198009119b8000200148000c00c894cd40044010884cd4014008c010004488008488488cc00401000c8c8c00400488cc00cc008008005","description":"","type":"PlutusScriptV2"}""" + """{"cborHex":"5903ae5903ab010000323322323232323232323233223233223232322222533532533232323553353530033300230012200148008894cd4004540388854cd400454ccd5cd19b87480000104c04400854040885404884c038dd70008a80610a9991a9980824811a4552524f522d44504152414d455445522d504f4c4943592d303100323301e22533500110142215333573466e3c014dd7001080b89802000980c98069bac330053530060022200148040d4018880044c8cc0452411a4552524f522d44504152414d455445522d504f4c4943592d303200333573466e1ccc038c058cc014c00488005200800333232322300200130202253350011003221330060023004001301b22001301a220023301e225335001101f22132325333573466ebccc02cc00488005200001013233502300100333014301c3300b3001220014800802440094c02c00cc010004c06cc034dd619802980091000a4008026024a600a00266006600444002900008082980100219112999ab9a337100029000098092490350543600133003001002301922253350011301249103505437002215333573466e1d200000410021330053370200890010009191980a1aab9d001300835573c0026ea80044c03924011a4552524f522d44504152414d455445522d504f4c4943592d3033003232325333573466e1d20000021332212330010030023232325333573466e1d20000021332212330010030023232325333573466e1d20000021375c6ae840044c0592401035054310035573c0046aae74004dd51aba1001375a6ae84d5d100089809a481035054310035573c0046aae74004dd51aba1001375c6ae84d5d1000898082481035054310035573c0046aae74004dd5002080809806a49035054350030122233335573e0024028466a0266ae84008c00cd5d100124c6022446666aae7c004804c8cd4048d5d080118019aba200249888c8cc04c894cd40044c00d4018884d4008894ccd5cd19b8f00200813007300b0011300600300323350012300b001480008488c00800c4488004894cd400440104cd5ce001001891001091000919319ab9c0010043009225335001148000884d400888cdc00009803001919918009800bad2322300237560026014446666aae7c00480308c8cd4030cc020dd71aab9d001300535573c00260086ae8800cd5d080100280089000910919800801801180291299a800880311099a80380118020009198009119b8000200148000c00c894cd40044010884cd4014008c010004488008488488cc00401000c8c8c00400488cc00cc008008005","description":"","type":"PlutusScriptV2"}""" ) rawDParameterValidator :: Tuple ScriptId String rawDParameterValidator = ( DParameterValidator /\ - """{"cborHex":"5901f25901ef0100003233223233223232323222225335325335323232323301322533500110102215333573466e3c014dd7001080989802000980818059bac330033530040022200148040d401088888004cc004d4c00801088005200032225333573466e2000520001300c49010350543600133003001002301022253350011300c49103505437002215333573466e1d20000041002133005337020089001000919199109198008018011aab9d001300835573c0026ea8004402c4028c8c8c94ccd5cd19b87480000084c8c8c8ccccc8888848ccccc00401801401000c008dd69aba10043232325333573466e1d20000021332212330010030023232325333573466e1d20000021375c6ae840044c04d2401035054310035573c0046aae74004dd51aba1001375a6ae84d5d1000898082481035054310035573c0046aae74004dd51aba1003375a6ae84008dd69aba1001375c6ae84d5d10009aba2001357440026ae880044c029241035054310035573c0046aae74004dd5002080409803a49035054350030092233335573e0024016466a0146ae84008c00cd5d100124c6010446666aae7c00480288cd4024d5d080118019aba20024988c98cd5ce00080109000891001091000980191299a800880211099a80280118020008910010910911980080200191918008009119801980100100081","description":"","type":"PlutusScriptV2"}""" + """{"cborHex":"5901c75901c40100003233223233223232323222225335325335323232323301322533500110102215333573466e3c014dd7001080989802000980818059bac330033530040022200148040d401088004cc004d4c00801088005200032225333573466e2000520001300c4910350543600133003001002301022253350011300c49103505437002215333573466e1d20000041002133005337020089001000919199109198008018011aab9d001300835573c0026ea8004402c4028c8c8c94ccd5cd19b87480000084cc8848cc00400c008c8c8c94ccd5cd19b87480000084cc8848cc00400c008c8c8c94ccd5cd19b87480000084dd71aba1001130104901035054310035573c0046aae74004dd51aba1001375a6ae84d5d100089806a481035054310035573c0046aae74004dd51aba1001375c6ae84d5d1000898052481035054310035573c0046aae74004dd5002080409803a49035054350030092233335573e0024016466a0146ae84008c00cd5d100124c6010446666aae7c00480288cd4024d5d080118019aba20024988c98cd5ce00080109000891001091000980191299a800880211099a80280118020008910010910911980080200191918008009119801980100100081","description":"","type":"PlutusScriptV2"}""" ) rawPermissionedCandidatesPolicy :: Tuple ScriptId String rawPermissionedCandidatesPolicy = ( PermissionedCandidatesPolicy /\ - """{"cborHex":"5908005907fd01000032323322323232323322323232323232323233223232323232323232222253353232532323232335325333573466e1d2000001112200115333573466e1d2002001112200216375a01026464a66aa66a6a600866004600244002900111299a8008a813910a99a8008a999ab9a3370e9000002098150010a814910a8159098139bae001150252153323533008491274552524f522d5045524d495353494f4e45442d43414e444944415445532d504f4c4943592d303300330050013500a22222001133008491274552524f522d5045524d495353494f4e45442d43414e444944415445532d504f4c4943592d3034003301633300711223223002001302c22533500110032213300600230040010193302a2253350011024221323500322223233502b0010063301c00300b3004001301b301a30103758660086a600c00244002900224000660066004440029000080b09811a481274552524f522d5045524d495353494f4e45442d43414e444944415445532d504f4c4943592d30350053003008500d13232533553353530043300230012200148008894cd40045409c8854cd400454ccd5cd19b87480000104c0a8008540a488540ac84c09cdd70008a81290a9991a998042491a4552524f522d44504152414d455445522d504f4c4943592d303100330050013500a2222200113233009491274552524f522d5045524d495353494f4e45442d43414e444944415445532d504f4c4943592d30320033017330143233302275ca0420026600a600244002900400199980408911911801000981691299a800880191099803001180200080d1981591299a8008812910991a801911129a802111a80a9119a9919a802919a80212999ab9a3371e0040022a00620504050466a00840504a666ae68cdc78010008a80188140a99a80190a99a8011099a801119a801119a801119a8011198148010009015919a801101591981480100091101591119a80210159112999ab9a3370e00c0062a666ae68cdc38028010998160020008816881688130a99a80090813081309919a8180008051981080380808049802000980f180e98089bac33005300122001480114c018004cc00cc008880052000101613023491274552524f522d5045524d495353494f4e45442d43414e444944415445532d504f4c4943592d30350053003008500d223302722533500110162215333573466e3c014dd7001080c89802000980798069bac33500e35300300222001480408c8cc094d55ce80098059aab9e0013754002446466aa006600244004600244002a00244a66a0022024266ae70008044c068010c8c8c94ccd5cd19b87480000084c8c8c8ccccc8888848ccccc00401801401000c008dd69aba10043232325333573466e1d20000021332212330010030023232325333573466e1d20000021375c6ae840044c09d241035054310035573c0046aae74004dd51aba1001375a6ae84d5d1000898122481035054310035573c0046aae74004dd51aba1003375a6ae84008dd69aba1001375c6ae84d5d10009aba2001357440026ae880044c079241035054310035573c0046aae74004dd5002080e0980da490350543500301b2233335573e002402c466a02a6ae84008c00cd5d100124c6034446666aae7c00480548cd4050d5d080118019aba20024984c8894ccd5cd19b88001480004c05d24010350543600133003001002301922253350011301749103505437002215333573466e1d20000041002133005337020089001000980c11299a800880911099a809801180200091191980d11299a80089801a80c9109a801112999ab9a3371e0040102600e603c0022600c006006466a0024600a0029000180b11299a8008a40004426a0044466e00004c01800c88ccd5cd19b8f00200100500422333573466e1c00800401000c48800848800448cc00488cdc0001000a4000602044a66a002201444266a0160046008002601e44a66a002201244266a014600e0046008002601c44a66a002201044266a0120046008002601a44a66a002200e44266a010600a00460080024646464a666ae68cdc3a4000004264646666444424666600200a00800600460166ae8400cccc021d728039aba10023232325333573466e1d20000021122200315333573466e1d200200213212223001004375c6ae8400454ccd5cd19b87480100084c84888c008010d5d0800898082481035054310035573c0046aae74004dd51aba10013300c75c6ae84d5d10009aba200135744002260169201035054310035573c0046aae74004dd5000899800bae75a4464460046eac004c03088cccd55cf800900391919a8039980798031aab9d001300535573c00260086ae8800cd5d08010050910010910911980080200191919192999ab9a3370e90000010991991091980080180118009aba10023300623232325333573466e1d200000213212230020033005357420022a666ae68cdc3a400400426466644424466600200a0080066eb4d5d08011bad357420026eb4d5d09aba200135744002260169201035054310035573c0046aae74004dd50009aba1357440044646464a666ae68cdc3a400000426424460040066eb8d5d08008a999ab9a3370e900100109909118008019bae3574200226014921035054310035573c0046aae74004dd500089803249035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010a8040a999ab9a3370e90000010980498029aba1001130064901035054310035573c0046aae74004dd5000919319ab9c001002120012122300200311220012212330010030022323001001223300330020020011","description":"","type":"PlutusScriptV2"}""" + """{"cborHex":"5907d55907d201000032323322323232323322323232323232323233223232323232323232222253353232532323232335325333573466e1d2000001112200115333573466e1d2002001112200216375a01026464a66aa66a6a600866004600244002900111299a8008a813910a99a8008a999ab9a3370e9000002098150010a814910a8159098139bae001150252153323533008491274552524f522d5045524d495353494f4e45442d43414e444944415445532d504f4c4943592d303300330050013500a220011330084901274552524f522d5045524d495353494f4e45442d43414e444944415445532d504f4c4943592d3034003301633300711223223002001302c22533500110032213300600230040010193302a2253350011024221323500322223233502b0010063301c00300b3004001301b301a30103758660086a600c00244002900224000660066004440029000080b09811a481274552524f522d5045524d495353494f4e45442d43414e444944415445532d504f4c4943592d30350053003008500d13232533553353530043300230012200148008894cd40045409c8854cd400454ccd5cd19b87480000104c0a8008540a488540ac84c09cdd70008a81290a9991a998042491a4552524f522d44504152414d455445522d504f4c4943592d303100330050013500a22001132330094901274552524f522d5045524d495353494f4e45442d43414e444944415445532d504f4c4943592d30320033017330143233302275ca0420026600a600244002900400199980408911911801000981691299a800880191099803001180200080d1981591299a8008812910991a801911129a802111a80a9119a9919a802919a80212999ab9a3371e0040022a00620504050466a00840504a666ae68cdc78010008a80188140a99a80190a99a8011099a801119a801119a801119a8011198148010009015919a801101591981480100091101591119a80210159112999ab9a3370e00c0062a666ae68cdc38028010998160020008816881688130a99a80090813081309919a8180008051981080380808049802000980f180e98089bac33005300122001480114c018004cc00cc008880052000101613023491274552524f522d5045524d495353494f4e45442d43414e444944415445532d504f4c4943592d30350053003008500d223302722533500110162215333573466e3c014dd7001080c89802000980798069bac33500e35300300222001480408c8cc094d55ce80098059aab9e0013754002446466aa006600244004600244002a00244a66a0022024266ae70008044c068010c8c8c94ccd5cd19b87480000084cc8848cc00400c008c8c8c94ccd5cd19b87480000084cc8848cc00400c008c8c8c94ccd5cd19b87480000084dd71aba100113024491035054310035573c0046aae74004dd51aba1001375a6ae84d5d100089810a481035054310035573c0046aae74004dd51aba1001375c6ae84d5d10008980f2481035054310035573c0046aae74004dd5002080e0980da490350543500301b2233335573e002402c466a02a6ae84008c00cd5d100124c6034446666aae7c00480548cd4050d5d080118019aba20024984c8894ccd5cd19b88001480004c05d24010350543600133003001002301922253350011301749103505437002215333573466e1d20000041002133005337020089001000980c11299a800880911099a809801180200091191980d11299a80089801a80c9109a801112999ab9a3371e0040102600e603c0022600c006006466a0024600a0029000180b11299a8008a40004426a0044466e00004c01800c88ccd5cd19b8f00200100500422333573466e1c00800401000c48800848800448cc00488cdc0001000a4000602044a66a002201444266a0160046008002601e44a66a002201244266a014600e0046008002601c44a66a002201044266a0120046008002601a44a66a002200e44266a010600a00460080024646464a666ae68cdc3a4000004264646666444424666600200a00800600460166ae8400cccc021d728039aba10023232325333573466e1d20000021122200315333573466e1d200200213212223001004375c6ae8400454ccd5cd19b87480100084c84888c008010d5d0800898082481035054310035573c0046aae74004dd51aba10013300c75c6ae84d5d10009aba200135744002260169201035054310035573c0046aae74004dd5000899800bae75a4464460046eac004c03088cccd55cf800900391919a8039980798031aab9d001300535573c00260086ae8800cd5d08010050910010910911980080200191919192999ab9a3370e90000010991991091980080180118009aba10023300623232325333573466e1d200000213212230020033005357420022a666ae68cdc3a400400426466644424466600200a0080066eb4d5d08011bad357420026eb4d5d09aba200135744002260169201035054310035573c0046aae74004dd50009aba1357440044646464a666ae68cdc3a400000426424460040066eb8d5d08008a999ab9a3370e900100109909118008019bae3574200226014921035054310035573c0046aae74004dd500089803249035054310035573c0046aae74004dd5000911919192999ab9a3370e90010010a8040a999ab9a3370e90000010980498029aba1001130064901035054310035573c0046aae74004dd5000919319ab9c001002120012122300200311220012212330010030022323001001223300330020020011","description":"","type":"PlutusScriptV2"}""" ) rawPermissionedCandidatesValidator :: Tuple ScriptId String rawPermissionedCandidatesValidator = ( PermissionedCandidatesValidator /\ - """{"cborHex":"5902355902320100003233223233223232323232222253353253232335325333573466e1d2000001112200115333573466e1d2002001112200216375a00a2a66a6600266a0146a60040084400290001a80191111000880708068a99a9980099a8051a980100211000a40006a00644444002201c201a446602644a66a0022020442a666ae68cdc78029bae0021013130040013010300a375866a0166a6006004440029008119199109198008018011aab9d001300835573c0026ea8004c8c8c94ccd5cd19b87480000084c8c8c8ccccc8888848ccccc00401801401000c008dd69aba10043232325333573466e1d20000021332212330010030023232325333573466e1d20000021375c6ae840044c0512401035054310035573c0046aae74004dd51aba1001375a6ae84d5d100089808a481035054310035573c0046aae74004dd51aba1003375a6ae84008dd69aba1001375c6ae84d5d10009aba2001357440026ae880044c02d241035054310035573c0046aae74004dd50020804898042490350543500300a2233335573e0024018466a0166ae84008c00cd5d100124c6012446666aae7c004802c8cd4028d5d080118019aba20024984c8894ccd5cd19b88001480004c01124010350543600133003001002300822253350011300449103505437002215333573466e1d20000041002133005337020089001000919319ab9c00100212001122002122001300322533500110042213350050023004001122002122122330010040032323001001223300330020020011","description":"","type":"PlutusScriptV2"}""" + """{"cborHex":"5902095902060100003233223233223232323232222253353253232335325333573466e1d2000001112200115333573466e1d2002001112200216375a00a2a66a6600266a0146a60040084400290001a80191000880708068a99a9980099a8051a980100211000a40006a00644002201c201a446602644a66a0022020442a666ae68cdc78029bae0021013130040013010300a375866a0166a6006004440029008119199109198008018011aab9d001300835573c0026ea8004c8c8c94ccd5cd19b87480000084cc8848cc00400c008c8c8c94ccd5cd19b87480000084cc8848cc00400c008c8c8c94ccd5cd19b87480000084dd71aba1001130114901035054310035573c0046aae74004dd51aba1001375a6ae84d5d1000898072481035054310035573c0046aae74004dd51aba1001375c6ae84d5d100089805a481035054310035573c0046aae74004dd50020804898042490350543500300a2233335573e0024018466a0166ae84008c00cd5d100124c6012446666aae7c004802c8cd4028d5d080118019aba20024984c8894ccd5cd19b88001480004c01124010350543600133003001002300822253350011300449103505437002215333573466e1d20000041002133005337020089001000919319ab9c00100212001122002122001300322533500110042213350050023004001122002122122330010040032323001001223300330020020011","description":"","type":"PlutusScriptV2"}""" ) rawReserveValidator :: Tuple ScriptId String @@ -118,7 +118,7 @@ rawIlliquidCirculationSupplyValidator = rawOnlyMintMintingPolicy :: Tuple ScriptId String rawOnlyMintMintingPolicy = ( OnlyMintMintingPolicy /\ - """{"cborHex":"590793590790010000323322322332233223232323232225335330033232325333573466e1d2000002100a13009491035054310035573c0046aae74004dd50011919192999ab9a3370e9000001099191919199109198008018011919192999ab9a3370e9000001099191919191919191919199191919991999991999199199111111111110919999999999980080680600580500480400380300280200180118009aba101230013574202260064646464a666ae68cdc3a400000426644246600200600460446ae84004c014d5d09aba2001130244901035054310035573c0046aae74004dd5000998018009aba100f23232325333573466e1d20000021323232333322221233330010050040030023232325333573466e1d20000021332212330010030023020357420026600803e6ae84d5d100089814a481035054310035573c0046aae74004dd51aba1004300835742006646464a666ae68cdc3a4000004224440062a666ae68cdc3a4004004264244460020086eb8d5d08008a999ab9a3370e9002001099091118010021aba100113029491035054310035573c0046aae74004dd51aba10023300175c6ae84d5d1001111919192999ab9a3370e90010010a8160a999ab9a3370e90000010981698029aba10011302a491035054310035573c0046aae74004dd50009aba20013574400226046921035054310035573c0046aae74004dd500098009aba100d30013574201860046004eb4cc00404cd5d080519980200a3ad35742012646464a666ae68cdc3a40000042646466442466002006004646464a666ae68cdc3a40000042664424660020060046600aeb4d5d080098021aba1357440022604c921035054310035573c0046aae74004dd51aba10033232325333573466e1d20000021332212330010030023300575a6ae84004c010d5d09aba2001130264901035054310035573c0046aae74004dd51aba1357440064646464a666ae68cdc3a400000420542a666ae68cdc3a400400420562604c921035054310035573c0046aae74004dd5000911919192999ab9a3370e9000001089110010a999ab9a3370e90010010990911180180218029aba100115333573466e1d20040021122200113026491035054310035573c0046aae74004dd500089810a49035054310035573c0046aae74004dd51aba10083300175c6ae8401c8c88c008dd60009814111999aab9f001202a233502930043574200460066ae88008084ccc00c044008d5d0802998008011aba1004300275c40024464460046eac004c09888cccd55cf800901411919a8141991091980080180118031aab9d001300535573c00260086ae8800cd5d080100f980c9aba1357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d100089808249035054310035573c0046aae74004dd51aba10053001357426ae880148c8c8c94ccd5cd19b87480000084c848888c00c014dd71aba100115333573466e1d2002002132122223001005300e357420022a666ae68cdc3a400800426424444600400a600c6ae8400454ccd5cd19b87480180084c848888c010014c014d5d080089808249035054310035573c0046aae74004dd500091919192999ab9a3370e900000109909111111180280418029aba100115333573466e1d20020021321222222230070083005357420022a666ae68cdc3a400800426644244444446600c012010600a6ae84004dd71aba1357440022a666ae68cdc3a400c0042664424444444660040120106eb8d5d08009bae357426ae8800454ccd5cd19b87480200084cc8848888888cc004024020dd71aba1001375a6ae84d5d10008a999ab9a3370e90050010891111110020a999ab9a3370e900600108911111100189807a49035054310035573c0046aae74004dd500091919192999ab9a3370e9000001099091180100198029aba100115333573466e1d2002002132333222122333001005004003375a6ae84008dd69aba1001375a6ae84d5d10009aba20011300e4901035054310035573c0046aae74004dd500091919192999ab9a3370e900000109909118010019bae357420022a666ae68cdc3a400400426424460020066eb8d5d080089806a481035054310035573c0046aae74004dd500089804a49035054310035573c0046aae74004dd500088038980324903505435003222350012233335001200d2325333573466e24cc050894cd40044c00d4038884d4008894ccd5cd19b8f0020081300730130011300600335004222222222222008480004038403c8cd40048c0480052000200d200d3232325333573466e1d2000002132323233333222221233333001006005004003002375a6ae84010c01cd5d08019bad357420046eb4d5d08009bae357426ae88004d5d10009aba2001357440022600c921035054310035573c0046aae74004dd500491919192999ab9a3370e900000109991091980080180118029aba1001375a6ae84d5d1000898032481035054310035573c0046aae74004dd500091919192999ab9a3370e900000109bae357420022600a921035054310035573c0046aae74004dd5000919319ab9c001002120012122300200311220011220021220013003225335001148000884d400888cdc000098030018910010910911980080200191918008009119801980100100081","description":"","type":"PlutusScriptV2"}""" + """{"cborHex":"59076a590767010000323322322332233223232323232225335330033232325333573466e1d2000002100a13009491035054310035573c0046aae74004dd50011919192999ab9a3370e9000001099191919199109198008018011919192999ab9a3370e9000001099191919191919191919199191919991999991999199199111111111110919999999999980080680600580500480400380300280200180118009aba101230013574202260064646464a666ae68cdc3a400000426644246600200600460446ae84004c014d5d09aba2001130244901035054310035573c0046aae74004dd5000998018009aba100f23232325333573466e1d20000021323232333322221233330010050040030023232325333573466e1d20000021332212330010030023020357420026600803e6ae84d5d100089814a481035054310035573c0046aae74004dd51aba1004300835742006646464a666ae68cdc3a4000004224440062a666ae68cdc3a4004004264244460020086eb8d5d08008a999ab9a3370e9002001099091118010021aba100113029491035054310035573c0046aae74004dd51aba10023300175c6ae84d5d1001111919192999ab9a3370e90010010a8160a999ab9a3370e90000010981698029aba10011302a491035054310035573c0046aae74004dd50009aba20013574400226046921035054310035573c0046aae74004dd500098009aba100d30013574201860046004eb4cc00404cd5d080519980200a3ad35742012646464a666ae68cdc3a40000042646466442466002006004646464a666ae68cdc3a40000042664424660020060046600aeb4d5d080098021aba1357440022604c921035054310035573c0046aae74004dd51aba10033232325333573466e1d20000021332212330010030023300575a6ae84004c010d5d09aba2001130264901035054310035573c0046aae74004dd51aba1357440064646464a666ae68cdc3a400000420542a666ae68cdc3a400400420562604c921035054310035573c0046aae74004dd5000911919192999ab9a3370e9000001089110010a999ab9a3370e90010010990911180180218029aba100115333573466e1d20040021122200113026491035054310035573c0046aae74004dd500089810a49035054310035573c0046aae74004dd51aba10083300175c6ae8401c8c88c008dd60009814111999aab9f001202a233502930043574200460066ae88008084ccc00c044008d5d0802998008011aba1004300275c40024464460046eac004c09888cccd55cf800901411919a8141991091980080180118031aab9d001300535573c00260086ae8800cd5d080100f980c9aba1357440026ae88004d5d10009aba2001357440026ae88004d5d10009aba2001357440026ae88004d5d100089808249035054310035573c0046aae74004dd51aba10053001357426ae880148c8c8c94ccd5cd19b87480000084c848888c00c014dd71aba100115333573466e1d2002002132122223001005300e357420022a666ae68cdc3a400800426424444600400a600c6ae8400454ccd5cd19b87480180084c848888c010014c014d5d080089808249035054310035573c0046aae74004dd500091919192999ab9a3370e900000109909111111180280418029aba100115333573466e1d20020021321222222230070083005357420022a666ae68cdc3a400800426644244444446600c012010600a6ae84004dd71aba1357440022a666ae68cdc3a400c0042664424444444660040120106eb8d5d08009bae357426ae8800454ccd5cd19b87480200084cc8848888888cc004024020dd71aba1001375a6ae84d5d10008a999ab9a3370e90050010891111110020a999ab9a3370e900600108911111100189807a49035054310035573c0046aae74004dd500091919192999ab9a3370e9000001099091180100198029aba100115333573466e1d2002002132333222122333001005004003375a6ae84008dd69aba1001375a6ae84d5d10009aba20011300e4901035054310035573c0046aae74004dd500091919192999ab9a3370e900000109909118010019bae357420022a666ae68cdc3a400400426424460020066eb8d5d080089806a481035054310035573c0046aae74004dd500089804a49035054310035573c0046aae74004dd500088038980324903505435003222350012233335001200d2325333573466e24cc050894cd40044c00d4038884d4008894ccd5cd19b8f0020081300730130011300600335004222222222222008480004038403c8cd40048c0480052000200d200d3232325333573466e1d20000021332212330010030023004357420026eb8d5d09aba200113006491035054310035573c0046aae74004dd500491919192999ab9a3370e900000109991091980080180118029aba1001375a6ae84d5d1000898032481035054310035573c0046aae74004dd500091919192999ab9a3370e900000109bae357420022600a921035054310035573c0046aae74004dd5000919319ab9c001002120012122300200311220011220021220013003225335001148000884d400888cdc000098030018910010910911980080200191918008009119801980100100081","description":"","type":"PlutusScriptV2"}""" ) rawAlwaysPassingValidator :: Tuple ScriptId String diff --git a/offchain/src/TrustlessSidechain/SidechainParams.purs b/offchain/src/TrustlessSidechain/SidechainParams.purs index 931d9dc9..093e8604 100644 --- a/offchain/src/TrustlessSidechain/SidechainParams.purs +++ b/offchain/src/TrustlessSidechain/SidechainParams.purs @@ -12,22 +12,10 @@ import Contract.PlutusData ) import Contract.Transaction (TransactionInput) import Control.Alternative (guard) -import JS.BigInt (BigInt) import TrustlessSidechain.Governance.Admin as Governance newtype SidechainParams = SidechainParams - { chainId :: BigInt - , genesisUtxo :: TransactionInput - , - -- `thresholdNumerator` is the numerator of the ratio required for the - -- committee to verify that committee has signed something (e.g. when - -- updating the committee hash, or saving a new merkle root). - thresholdNumerator :: BigInt - , - -- `thresholdDenominator` is the denominator of the ratio required for the - -- committee to verify that committee has signed something (e.g. when - -- updating the committee hash, or saving a new merkle root). - thresholdDenominator :: BigInt + { genesisUtxo :: TransactionInput , -- Governance mechanism. We temporarily rely on using a single master key -- that can authorize any action requiring permission from the governing -- committee. @@ -43,35 +31,23 @@ derive newtype instance Eq SidechainParams instance ToData SidechainParams where toData ( SidechainParams - { chainId - , genesisUtxo - , thresholdNumerator - , thresholdDenominator + { genesisUtxo , governanceAuthority } ) = Constr (BigNum.fromInt 0) - [ toData chainId - , toData genesisUtxo - , toData thresholdNumerator - , toData thresholdDenominator + [ toData genesisUtxo , toData governanceAuthority ] instance FromData SidechainParams where fromData = case _ of - Constr ix [ cid, gu, tn, td, ga ] -> do + Constr ix [ gu, ga ] -> do guard (ix == BigNum.fromInt 0) - chainId <- fromData cid genesisUtxo <- fromData gu - thresholdNumerator <- fromData tn - thresholdDenominator <- fromData td governanceAuthority <- fromData ga pure $ SidechainParams - { chainId - , genesisUtxo - , thresholdNumerator - , thresholdDenominator + { genesisUtxo , governanceAuthority } _ -> Nothing diff --git a/offchain/src/TrustlessSidechain/Utils/Codecs.purs b/offchain/src/TrustlessSidechain/Utils/Codecs.purs index 1e070146..3d1fc602 100644 --- a/offchain/src/TrustlessSidechain/Utils/Codecs.purs +++ b/offchain/src/TrustlessSidechain/Utils/Codecs.purs @@ -1,7 +1,6 @@ module TrustlessSidechain.Utils.Codecs ( byteArrayCodec , transactionInputCodec - , thresholdCodec , scParamsCodec , pubKeyHashCodec , encodeInitTokenStatusData @@ -36,8 +35,6 @@ import Data.Profunctor (wrapIso) import Data.String (Pattern(Pattern), split) import Data.UInt as UInt import Foreign.Object as Object -import JS.BigInt (BigInt) -import JS.BigInt as BigInt import Partial.Unsafe (unsafePartial) import TrustlessSidechain.Governance.Admin ( GovernanceAuthority @@ -87,16 +84,6 @@ transactionInputCodec = indexStr = UInt.toString txIn.index txHashStr = byteArrayToHex $ unwrap $ encodeCbor $ txIn.transactionId --- | `thresholdCodec` is the codec for the threshold in `Options.Types.Config`. --- | Note that this codec has no relation to the `thresholdNumerator` and --- | `thresholdDenominator` fields in `SidechainParams`. -thresholdCodec :: CA.JsonCodec { numerator :: Int, denominator :: Int } -thresholdCodec = CA.object "threshold" $ - CAR.record - { numerator: CA.int - , denominator: CA.int - } - -- | JSON codec for PubKeyHash. governanceAuthorityCodec :: CA.JsonCodec GovernanceAuthority governanceAuthorityCodec = CA.prismaticCodec "GovernanceAuthority" @@ -109,18 +96,7 @@ scParamsCodec :: CA.JsonCodec SidechainParams scParamsCodec = wrapIso SidechainParams $ ( CAR.object "sidechainParameters" - { chainId: bigIntCodec - , genesisUtxo: transactionInputCodec - , thresholdNumerator: - CA.prismaticCodec "thresholdNumerator" - (Just <<< BigInt.fromInt) - unsafeToInt - CA.int - , thresholdDenominator: - CA.prismaticCodec "thresholdDenominator" - (Just <<< BigInt.fromInt) - unsafeToInt - CA.int + { genesisUtxo: transactionInputCodec , governanceAuthority: governanceAuthorityCodec } ) @@ -155,14 +131,6 @@ encodeInitTokenStatusData = J.fromObject <<< Object.fromFoldable <<< toKvs (Array.fromFoldable $ Map.keys m) (Array.fromFoldable $ Map.values m) --- | JSON codec for `BigInt`. --- | See Note [BigInt values and JSON] -bigIntCodec :: CA.JsonCodec BigInt -bigIntCodec = CA.prismaticCodec "BigInt" - (Just <<< BigInt.fromInt) - unsafeToInt - CA.int - -- | JSON codec for `BigInt`. -- | See Note [BigInt values and JSON] bigNumCodec :: CA.JsonCodec BigNum @@ -170,6 +138,3 @@ bigNumCodec = CA.prismaticCodec "BigInt" (Just <<< BigNum.fromInt) (BigNum.toInt >>> unsafePartial fromJust) CA.int - -unsafeToInt :: BigInt -> Int -unsafeToInt x = unsafePartial $ fromJust $ BigInt.toInt x diff --git a/offchain/test/Test/ConfigFile.purs b/offchain/test/Test/ConfigFile.purs index 3889eeab..573eb879 100644 --- a/offchain/test/Test/ConfigFile.purs +++ b/offchain/test/Test/ConfigFile.purs @@ -55,8 +55,7 @@ test1 = ) , sidechainParameters: ( Just - { chainId: (Just 123) - , genesisUtxo: + { genesisUtxo: ( Just ( TransactionInput { index: UInt.fromInt 1 @@ -69,7 +68,6 @@ test1 = } ) ) - , threshold: (Just { denominator: 3, numerator: 2 }) , governanceAuthority: hexToByteArray "4f2d6145e1700ad11dc074cad9f4194cc53b0dbab6bd25dfea6c501a" } diff --git a/offchain/test/Test/DParameter.purs b/offchain/test/Test/DParameter.purs index 3faab835..e5e44fc4 100644 --- a/offchain/test/Test/DParameter.purs +++ b/offchain/test/Test/DParameter.purs @@ -41,10 +41,7 @@ testScenario = let sidechainParams = SidechainParams - { chainId: BigInt.fromInt 1 - , genesisUtxo - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 + { genesisUtxo , governanceAuthority: Governance.mkGovernanceAuthority pkh } diff --git a/offchain/test/Test/Data.purs b/offchain/test/Test/Data.purs index a3217ce5..dc634e2e 100644 --- a/offchain/test/Test/Data.purs +++ b/offchain/test/Test/Data.purs @@ -28,8 +28,6 @@ import Test.Utils.QuickCheck , ArbitraryScriptHash(ArbitraryScriptHash) , ArbitrarySignature(ArbitrarySignature) , ArbitraryTransactionInput(ArbitraryTransactionInput) - , NonNegative(NonNegative) - , Positive(Positive) , suchThatMap ) import TrustlessSidechain.CommitteeCandidateValidator @@ -309,16 +307,10 @@ genPK = suchThatMap (genByteArrayLen 33) ecdsaSecp256k1PubKey genSP :: Gen SidechainParams genSP = do - NonNegative (ArbitraryBigInt chainId) <- arbitrary ArbitraryTransactionInput genesisUtxo <- arbitrary - Positive (ArbitraryBigInt thresholdNumerator) <- arbitrary - Positive (ArbitraryBigInt thresholdDenominator) <- arbitrary governanceAuthority <- genGA pure $ SidechainParams - { chainId - , genesisUtxo - , thresholdNumerator - , thresholdDenominator + { genesisUtxo , governanceAuthority } diff --git a/offchain/test/Test/IlliquidCirculationSupply.purs b/offchain/test/Test/IlliquidCirculationSupply.purs index ea66bbac..91972ec7 100644 --- a/offchain/test/Test/IlliquidCirculationSupply.purs +++ b/offchain/test/Test/IlliquidCirculationSupply.purs @@ -87,10 +87,7 @@ dummyInitialiseSidechain pkh = do let sidechainParams = SidechainParams - { chainId: BigInt.fromInt 69_420 - , genesisUtxo - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 + { genesisUtxo , governanceAuthority: Governance.mkGovernanceAuthority pkh } diff --git a/offchain/test/Test/InitSidechain/CandidatePermissionToken.purs b/offchain/test/Test/InitSidechain/CandidatePermissionToken.purs index 13997492..c3d59dc0 100644 --- a/offchain/test/Test/InitSidechain/CandidatePermissionToken.purs +++ b/offchain/test/Test/InitSidechain/CandidatePermissionToken.purs @@ -6,7 +6,6 @@ import Cardano.Types.BigNum as BigNum import Contract.Log as Log import Contract.Wallet as Wallet import JS.BigInt (fromInt) -import JS.BigInt as BigInt import Mote.Monad as Mote.Monad import Test.InitSidechain.Utils (failMsg) import Test.TestnetTest (TestnetTest) @@ -57,10 +56,7 @@ testInitCandidatePermissionTokenIdempotent = version = 1 initCandidatePermissionTokenMintInfo = Just (fromInt 1) sidechainParams = SidechainParams.SidechainParams - { chainId: BigInt.fromInt 9 - , genesisUtxo: genesisUtxo - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 + { genesisUtxo: genesisUtxo , governanceAuthority: initGovernanceAuthority } diff --git a/offchain/test/Test/InitSidechain/TokensMint.purs b/offchain/test/Test/InitSidechain/TokensMint.purs index e7de6248..2bdb3613 100644 --- a/offchain/test/Test/InitSidechain/TokensMint.purs +++ b/offchain/test/Test/InitSidechain/TokensMint.purs @@ -6,7 +6,6 @@ import Contract.Prelude import Cardano.Types.BigNum as BigNum import Contract.Wallet as Wallet -import JS.BigInt as BigInt import Mote.Monad as Mote.Monad import Test.InitSidechain.Utils (expectedInitTokens, failMsg, unorderedEq) import Test.TestnetTest (TestnetTest) @@ -59,10 +58,7 @@ initTokensMintIdempotent = let version = 1 sidechainParams = SidechainParams.SidechainParams - { chainId: BigInt.fromInt 9 - , genesisUtxo: genesisUtxo - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 + { genesisUtxo: genesisUtxo , governanceAuthority: initGovernanceAuthority } diff --git a/offchain/test/Test/PermissionedCandidates.purs b/offchain/test/Test/PermissionedCandidates.purs index 25b030ad..f6fbdc4b 100644 --- a/offchain/test/Test/PermissionedCandidates.purs +++ b/offchain/test/Test/PermissionedCandidates.purs @@ -5,7 +5,6 @@ import Contract.Prelude import Cardano.Types.BigNum as BigNum import Contract.Prim.ByteArray (hexToByteArrayUnsafe) import Contract.Wallet as Wallet -import JS.BigInt as BigInt import Mote.Monad as Mote.Monad import Test.TestnetTest (TestnetTest) import Test.TestnetTest as Test.TestnetTest @@ -43,10 +42,7 @@ testScenario = let sidechainParams = SidechainParams - { chainId: BigInt.fromInt 1 - , genesisUtxo - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 + { genesisUtxo , governanceAuthority: Governance.mkGovernanceAuthority pkh } diff --git a/offchain/test/Test/Reserve.purs b/offchain/test/Test/Reserve.purs index 75074dc2..49b3cf0a 100644 --- a/offchain/test/Test/Reserve.purs +++ b/offchain/test/Test/Reserve.purs @@ -119,10 +119,7 @@ dummyInitialiseSidechain pkh = do let sidechainParams = SidechainParams - { chainId: BigInt.fromInt 1 - , genesisUtxo - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 + { genesisUtxo , governanceAuthority: Governance.mkGovernanceAuthority pkh } diff --git a/offchain/test/Test/Utils.purs b/offchain/test/Test/Utils.purs index 850b28da..59858317 100644 --- a/offchain/test/Test/Utils.purs +++ b/offchain/test/Test/Utils.purs @@ -301,12 +301,9 @@ assertHasOutputWithAsset txId addr cs tn = do -- | helpful when creating tests. dummySidechainParams :: SidechainParams dummySidechainParams = SidechainParams - { chainId: BigInt.fromInt 69 - , genesisUtxo: toTxIn + { genesisUtxo: toTxIn "211307be24c471d42012c5ebd7d98c83f349c612023ce365f9fb5e3e758d0779" 1 - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 , governanceAuthority: Unsafe.unsafePartial $ fromJust $ fromData $ Bytes $ hexToByteArrayUnsafe "4f2d6145e1700ad11dc074cad9f4194cc53b0dbab6bd25dfea6c501a" diff --git a/offchain/test/Test/Versioning.purs b/offchain/test/Test/Versioning.purs index 3a72cb48..8e9da9a1 100644 --- a/offchain/test/Test/Versioning.purs +++ b/offchain/test/Test/Versioning.purs @@ -5,7 +5,6 @@ import Contract.Prelude import Cardano.Types.BigNum as BigNum import Contract.Wallet as Wallet import Data.List as List -import JS.BigInt as BigInt import Mote.Monad as Mote.Monad import Run (AFF, EFFECT, Run) import Run.Except (EXCEPT) @@ -73,10 +72,7 @@ testInsertAndInvalidateSuccessScenario = let sidechainParams = SidechainParams - { chainId: BigInt.fromInt 1 - , genesisUtxo - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 + { genesisUtxo , governanceAuthority: Governance.mkGovernanceAuthority pkh } @@ -149,10 +145,7 @@ testInsertSameScriptTwiceSuccessScenario = let sidechainParams = SidechainParams - { chainId: BigInt.fromInt 1 - , genesisUtxo - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 + { genesisUtxo , governanceAuthority: Governance.mkGovernanceAuthority pkh } @@ -203,10 +196,7 @@ testInsertUnversionedScriptSuccessScenario = let sidechainParams = SidechainParams - { chainId: BigInt.fromInt 1 - , genesisUtxo - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 + { genesisUtxo , governanceAuthority: Governance.mkGovernanceAuthority pkh } @@ -252,10 +242,7 @@ testRemovingTwiceSameScriptFailScenario = let sidechainParams = SidechainParams - { chainId: BigInt.fromInt 1 - , genesisUtxo - , thresholdNumerator: BigInt.fromInt 2 - , thresholdDenominator: BigInt.fromInt 3 + { genesisUtxo , governanceAuthority: Governance.mkGovernanceAuthority pkh } diff --git a/onchain/app/gen-signatures/GenOutput.hs b/onchain/app/gen-signatures/GenOutput.hs index a506415c..f24b330a 100644 --- a/onchain/app/gen-signatures/GenOutput.hs +++ b/onchain/app/gen-signatures/GenOutput.hs @@ -42,10 +42,7 @@ import TrustlessSidechain.Types ( EcdsaSecp256k1PubKey (getEcdsaSecp256k1PubKey), SidechainParams ( SidechainParams, - chainId, - genesisUtxo, - thresholdDenominator, - thresholdNumerator + genesisUtxo ), ) @@ -72,9 +69,6 @@ genCliCommand signingKeyFile scParams@SidechainParams {..} cliCommand = sidechainParamFlags = [ ["--payment-signing-key-file", ByteString.Char8.pack signingKeyFile] , ["--genesis-committee-hash-utxo", OffChain.encodeTxOutRef genesisUtxo] - , ["--sidechain-id", bytesFromShow chainId] - , ["--threshold-numerator", bytesFromShow thresholdNumerator] - , ["--threshold-denominator", bytesFromShow thresholdDenominator] ] in ByteString.Char8.intercalate " \\\n" $ fmap ByteString.Char8.unwords diff --git a/onchain/app/gen-signatures/GetOpts.hs b/onchain/app/gen-signatures/GetOpts.hs index cc75f349..3f0865ed 100644 --- a/onchain/app/gen-signatures/GetOpts.hs +++ b/onchain/app/gen-signatures/GetOpts.hs @@ -19,7 +19,7 @@ import Cardano.Crypto.DSIGN.Class ( ) import Cardano.Crypto.Seed (mkSeedFromBytes) import Control.Exception (ioError) -import Control.Monad (MonadPlus (mzero), guard, join, return) +import Control.Monad (MonadPlus (mzero), join, return) import Crypto.Secp256k1 qualified as SECP import Data.Aeson qualified as Aeson import Data.Attoparsec.Text (Parser, char, decimal, parseOnly, takeWhile) @@ -195,20 +195,6 @@ parseTxOutRef = txIx <- decimal pure $ TxOutRef txId txIx --- | 'parseThreshold' parses the CLI flag value --- > UINT/UINT --- where the second UINT must satisfy > 0. -parseThreshold :: OptParse.ReadM (Integer, Integer) -parseThreshold = eitherReader $ parseOnly thresholdParser . Text.pack - where - thresholdParser :: Parser (Integer, Integer) - thresholdParser = do - numerator <- decimal - void (char '/') - denominator <- decimal - Control.Monad.guard $ denominator > 0 - pure (numerator, denominator) - -- | 'parseSpoPrivKey' parses the CLI flag value which is an SPO private key parseSpoPrivKey :: OptParse.ReadM (SignKeyDSIGN Ed25519DSIGN) parseSpoPrivKey = eitherReader toSpoPrivKey @@ -354,15 +340,6 @@ initCommitteePublicKeysParser = -- | CLI parser for gathering the 'SidechainParams' sidechainParamsParser :: OptParse.Parser SidechainParams sidechainParamsParser = do - chainId <- - option auto - $ mconcat - [ short 'i' - , long "sidechain-id" - , metavar "1" - , help "Sidechain ID" - ] - genesisUtxo <- option parseTxOutRef $ mconcat @@ -381,14 +358,6 @@ sidechainParamsParser = do , help "Public key hash of governance authority" ] - (thresholdNumerator, thresholdDenominator) <- - option parseThreshold - $ mconcat - [ long "threshold" - , metavar "UINT/UINT" - , help "Threshold ratio for the required number of signatures" - ] - pure SidechainParams {..} signingKeyFileParser :: OptParse.Parser FilePath diff --git a/onchain/src/TrustlessSidechain/OffChain.hs b/onchain/src/TrustlessSidechain/OffChain.hs index 4f0d3222..22e2dc0a 100644 --- a/onchain/src/TrustlessSidechain/OffChain.hs +++ b/onchain/src/TrustlessSidechain/OffChain.hs @@ -13,7 +13,6 @@ module TrustlessSidechain.OffChain ( encodeTxOutRef, encodeHexBuiltinBS, encodeScPubKeyAndSig, - showThreshold, encodeHexSecpPrivKey, encodeHexOfCborBuiltinData, toSpoPubKey, @@ -345,15 +344,6 @@ encodeScPubKeyAndSig sckey sig = , Plutus.bytes $ getSignature sig ] --- | 'showThreshold' shows integers @n@ and @m@ as --- > n/m --- Importantly, this is compatible with the purescript parser format -showThreshold :: - Integer -> - Integer -> - Text -showThreshold n m = Text.pack (show n) <> "/" <> Text.pack (show m) - -- | 'encodeHexOfCborBuiltinData' shows the hex of the cbor serialized -- BuiltinData representation of the given argument. -- diff --git a/onchain/src/TrustlessSidechain/Types.hs b/onchain/src/TrustlessSidechain/Types.hs index 285285cd..85e7e18b 100644 --- a/onchain/src/TrustlessSidechain/Types.hs +++ b/onchain/src/TrustlessSidechain/Types.hs @@ -68,16 +68,9 @@ PlutusTx.makeLift ''GovernanceAuthority -- -- The 'Data' serializations for this type /cannot/ change. data SidechainParams = SidechainParams - { chainId :: Integer - , genesisUtxo :: TxOutRef + { genesisUtxo :: TxOutRef -- ^ 'genesisUtxo' is a 'TxOutRef' used to initialize the internal -- policies in the side chain (e.g. for the 'UpdateCommitteeHash' endpoint) - , thresholdNumerator :: Integer - -- ^ 'thresholdNumerator' is the numerator for the ratio of the committee - -- needed to sign off committee handovers / merkle roots - , thresholdDenominator :: Integer - -- ^ 'thresholdDenominator' is the denominator for the ratio of the - -- committee needed to sign off committee handovers / merkle roots , governanceAuthority :: GovernanceAuthority -- ^ 'governanceAuthority' stores credentials of a governing body allowed to -- make updates to versioned scripts. For now we just use a master public diff --git a/onchain/src/TrustlessSidechain/Types/Unsafe.hs b/onchain/src/TrustlessSidechain/Types/Unsafe.hs index ac02c58a..a266ba3a 100644 --- a/onchain/src/TrustlessSidechain/Types/Unsafe.hs +++ b/onchain/src/TrustlessSidechain/Types/Unsafe.hs @@ -19,11 +19,8 @@ module TrustlessSidechain.Types.Unsafe ( stakeOwnership, GovernanceAuthority (..), SidechainParams (..), - chainId, genesisUtxo, governanceAuthority, - thresholdDenominator, - thresholdNumerator, Signature (..), StakeOwnership (..), -- | From Plutus.V2.Ledger.Api diff --git a/onchain/test/Test/TrustlessSidechain/Golden/Types.hs b/onchain/test/Test/TrustlessSidechain/Golden/Types.hs index fa1fd28d..707726d7 100644 --- a/onchain/test/Test/TrustlessSidechain/Golden/Types.hs +++ b/onchain/test/Test/TrustlessSidechain/Golden/Types.hs @@ -84,11 +84,8 @@ import TrustlessSidechain.Types ( ReserveStats (ReserveStats), SidechainParams ( SidechainParams, - chainId, genesisUtxo, - governanceAuthority, - thresholdDenominator, - thresholdNumerator + governanceAuthority ), StakeOwnership (AdaBasedStaking, TokenBasedStaking), ) @@ -138,11 +135,8 @@ sampleTxOutRef = TxOutRef "e41c9b57841e582c207bb68d5e9736fb48c7af5f1ec29ade00692 sampleSidechainParams :: SidechainParams sampleSidechainParams = SidechainParams - { chainId = 11 - , genesisUtxo = sampleTxOutRef + { genesisUtxo = sampleTxOutRef , governanceAuthority = mkGovernanceAuthority "4f2d6145e1700ad11dc074cad9f4194cc53b0dbab6bd25dfea6c501a" - , thresholdNumerator = 2 - , thresholdDenominator = 3 } sampleBlockProducerRegistration1 :: BlockProducerRegistration diff --git a/onchain/test/golden/BlockProducerRegistrationMsg-cbor.golden b/onchain/test/golden/BlockProducerRegistrationMsg-cbor.golden index f5dadc61..86aa4b91 100644 --- a/onchain/test/golden/BlockProducerRegistrationMsg-cbor.golden +++ b/onchain/test/golden/BlockProducerRegistrationMsg-cbor.golden @@ -1 +1 @@ -d8799fd8799f0bd8799fd8799f5820e41c9b57841e582c207bb68d5e9736fb48c7af5f1ec29ade00692fa5e0e47efaff04ff0203581c4f2d6145e1700ad11dc074cad9f4194cc53b0dbab6bd25dfea6c501aff582102dbfc8b66c22f931a6647fd86db2fc073dd564b99837226a1bdfe7a99578854ecd8799fd8799f5820e41c9b57841e582c207bb68d5e9736fb48c7af5f1ec29ade00692fa5e0e47efaff04ffff \ No newline at end of file +d8799fd8799fd8799fd8799f5820e41c9b57841e582c207bb68d5e9736fb48c7af5f1ec29ade00692fa5e0e47efaff04ff581c4f2d6145e1700ad11dc074cad9f4194cc53b0dbab6bd25dfea6c501aff582102dbfc8b66c22f931a6647fd86db2fc073dd564b99837226a1bdfe7a99578854ecd8799fd8799f5820e41c9b57841e582c207bb68d5e9736fb48c7af5f1ec29ade00692fa5e0e47efaff04ffff \ No newline at end of file diff --git a/onchain/test/golden/BlockProducerRegistrationMsg-isdata.golden b/onchain/test/golden/BlockProducerRegistrationMsg-isdata.golden index 5e671951..93dd1aef 100644 --- a/onchain/test/golden/BlockProducerRegistrationMsg-isdata.golden +++ b/onchain/test/golden/BlockProducerRegistrationMsg-isdata.golden @@ -1 +1 @@ -Constr 0 [Constr 0 [I 11,Constr 0 [Constr 0 [B "\228\FS\155W\132\RSX, {\182\141^\151\&6\251H\199\175_\RS\194\154\222\NULi/\165\224\228~\250"],I 4],I 2,I 3,B "O-aE\225p\n\209\GS\192t\202\217\244\EML\197;\r\186\182\189%\223\234lP\SUB"],B "\STX\219\252\139f\194/\147\SUBfG\253\134\219/\192s\221VK\153\131r&\161\189\254z\153W\136T\236",Constr 0 [Constr 0 [B "\228\FS\155W\132\RSX, {\182\141^\151\&6\251H\199\175_\RS\194\154\222\NULi/\165\224\228~\250"],I 4]] \ No newline at end of file +Constr 0 [Constr 0 [Constr 0 [Constr 0 [B "\228\FS\155W\132\RSX, {\182\141^\151\&6\251H\199\175_\RS\194\154\222\NULi/\165\224\228~\250"],I 4],B "O-aE\225p\n\209\GS\192t\202\217\244\EML\197;\r\186\182\189%\223\234lP\SUB"],B "\STX\219\252\139f\194/\147\SUBfG\253\134\219/\192s\221VK\153\131r&\161\189\254z\153W\136T\236",Constr 0 [Constr 0 [B "\228\FS\155W\132\RSX, {\182\141^\151\&6\251H\199\175_\RS\194\154\222\NULi/\165\224\228~\250"],I 4]] \ No newline at end of file diff --git a/onchain/test/golden/SidechainParams-cbor.golden b/onchain/test/golden/SidechainParams-cbor.golden index 0d2a3455..e9c54e93 100644 --- a/onchain/test/golden/SidechainParams-cbor.golden +++ b/onchain/test/golden/SidechainParams-cbor.golden @@ -1 +1 @@ -d8799f0bd8799fd8799f5820e41c9b57841e582c207bb68d5e9736fb48c7af5f1ec29ade00692fa5e0e47efaff04ff0203581c4f2d6145e1700ad11dc074cad9f4194cc53b0dbab6bd25dfea6c501aff \ No newline at end of file +d8799fd8799fd8799f5820e41c9b57841e582c207bb68d5e9736fb48c7af5f1ec29ade00692fa5e0e47efaff04ff581c4f2d6145e1700ad11dc074cad9f4194cc53b0dbab6bd25dfea6c501aff \ No newline at end of file diff --git a/onchain/test/golden/SidechainParams-isdata.golden b/onchain/test/golden/SidechainParams-isdata.golden index e6a31a4c..8412fa7b 100644 --- a/onchain/test/golden/SidechainParams-isdata.golden +++ b/onchain/test/golden/SidechainParams-isdata.golden @@ -1 +1 @@ -Constr 0 [I 11,Constr 0 [Constr 0 [B "\228\FS\155W\132\RSX, {\182\141^\151\&6\251H\199\175_\RS\194\154\222\NULi/\165\224\228~\250"],I 4],I 2,I 3,B "O-aE\225p\n\209\GS\192t\202\217\244\EML\197;\r\186\182\189%\223\234lP\SUB"] \ No newline at end of file +Constr 0 [Constr 0 [Constr 0 [B "\228\FS\155W\132\RSX, {\182\141^\151\&6\251H\199\175_\RS\194\154\222\NULi/\165\224\228~\250"],I 4],B "O-aE\225p\n\209\GS\192t\202\217\244\EML\197;\r\186\182\189%\223\234lP\SUB"] \ No newline at end of file diff --git a/onchain/test/roundtrip/Main.hs b/onchain/test/roundtrip/Main.hs index b9dd9ff8..4ccfc5ae 100644 --- a/onchain/test/roundtrip/Main.hs +++ b/onchain/test/roundtrip/Main.hs @@ -14,8 +14,6 @@ import System.IO.Unsafe (unsafePerformIO) import Test.QuickCheck ( Arbitrary (arbitrary, shrink), Gen, - NonNegative (NonNegative), - Positive (Positive), arbitrary, chooseInteger, liftArbitrary, @@ -80,11 +78,8 @@ import TrustlessSidechain.Types ( ReserveStats (ReserveStats), SidechainParams ( SidechainParams, - chainId, genesisUtxo, - governanceAuthority, - thresholdDenominator, - thresholdNumerator + governanceAuthority ), Signature (Signature), StakeOwnership (AdaBasedStaking, TokenBasedStaking), @@ -291,12 +286,9 @@ genGA = do genSP :: Gen SidechainParams genSP = do - NonNegative cid <- arbitrary ArbitraryTxOutRef gu <- arbitrary - Positive n <- arbitrary - Positive d <- arbitrary ga <- genGA - pure . SidechainParams cid gu n d $ ga + pure . SidechainParams gu $ ga genITR :: Gen InitTokenRedeemer genITR = oneof [pure MintInitToken, pure BurnInitToken] @@ -407,12 +399,10 @@ shrinkGA (GovernanceAuthority pkh) = do shrinkSP :: SidechainParams -> [SidechainParams] shrinkSP (SidechainParams {..}) = do - NonNegative cid' <- shrink . NonNegative $ chainId ArbitraryTxOutRef gu' <- shrink . ArbitraryTxOutRef $ genesisUtxo - Positive n' <- shrink . Positive $ thresholdNumerator ga <- shrinkGA governanceAuthority -- We don't shrink the denominator, as this could make the result _bigger_. - pure . SidechainParams cid' gu' n' thresholdDenominator $ ga + pure . SidechainParams gu' $ ga shrinkITR :: InitTokenRedeemer -> [InitTokenRedeemer] shrinkITR = const [] diff --git a/onchain/test/script-size/Main.hs b/onchain/test/script-size/Main.hs index 59eb3ba2..9762d3fb 100644 --- a/onchain/test/script-size/Main.hs +++ b/onchain/test/script-size/Main.hs @@ -58,11 +58,11 @@ main = , scriptFitsInto "mkDParameterValidatorCode (DParameter) serialized" DParameter.serialisableValidator - 498 + 455 , scriptFitsInto "mkDParameterPolicyCode (DParameter) serialized" DParameter.serialisableMintingPolicy - 984 + 942 , scriptFitsInto "mkPermissionedCandidatePolicyCode (PermissionedCandidates) serialized" PermissionedCandidates.serialisableCandidatePermissionMintingPolicy @@ -70,15 +70,15 @@ main = , scriptFitsInto "mkPermissionedCandidatesValidatorCode (PermissionedCandidates) serialized" PermissionedCandidates.serialisableValidator - 565 + 521 , scriptFitsInto "mkVersionOraclePolicyCode (Versioning) serialized" Versioning.serialisableVersionOraclePolicy - 3_125 + 3_080 , scriptFitsInto "mkVersionOracleValidatorCode (Versioning) serialized" Versioning.serialisableVersionOracleValidator - 935 + 893 , scriptFitsInto "mkInitTokenPolicy (InitToken) serialized" InitToken.serialisableInitTokenPolicy