import "../types/structs.scrypt"; import "txUtils.scrypt"; import "contextUtils.scrypt"; import "txUtils.scrypt"; import "../types/structs.scrypt"; import "contextUtils.scrypt"; contract _opcat_labs_scrypt_ts_opcat_4_0_0__rs__Genesis { constructor() { } public function checkDeploy(_opcat_labs_scrypt_ts_opcat_4_0_0__rs__TxOut[6] outputs, int outputCount, _opcat_labs_scrypt_ts_opcat_4_0_0__rs__SHPreimage __scrypt_ts_shPreimage, Sig __scrypt_ts_preimageSig, bytes __scrypt_ts_spentAmounts, bytes __scrypt_ts_spentScriptHashes) { require(__scrypt_ts_shPreimage.sigHashType == 1); require(__scrypt_ts_preimageSig[len(__scrypt_ts_preimageSig) - 1 : ] == num2bin(__scrypt_ts_shPreimage.sigHashType, 2)[0 : 1] && num2bin(__scrypt_ts_shPreimage.sigHashType, 2)[1 : ] == b'00' && checkDataSig(Sig(__scrypt_ts_preimageSig[0 : len(__scrypt_ts_preimageSig) - 1]), sha256(_opcat_labs_scrypt_ts_opcat_4_0_0__rs__ContextUtils.serializeSHPreimage(__scrypt_ts_shPreimage)), _opcat_labs_scrypt_ts_opcat_4_0_0__rs__ContextUtils.pubKey) && checkSig(__scrypt_ts_preimageSig, _opcat_labs_scrypt_ts_opcat_4_0_0__rs__ContextUtils.pubKey)); int __scrypt_ts_inputCount = _opcat_labs_scrypt_ts_opcat_4_0_0__rs__ContextUtils.checkSpentAmounts(__scrypt_ts_spentAmounts, __scrypt_ts_shPreimage.hashSpentAmounts); _opcat_labs_scrypt_ts_opcat_4_0_0__rs__ContextUtils.checkSpentScripts(__scrypt_ts_spentScriptHashes, __scrypt_ts_shPreimage.hashSpentScriptHashes, __scrypt_ts_inputCount); require(__scrypt_ts_shPreimage.inputIndex == 0); require(__scrypt_ts_inputCount <= (6)); require(outputCount > 0 && outputCount <= (6)); bytes output0ScriptHash = outputs[0].scriptHash; bytes outputBytes = b''; loop (6) : index { _opcat_labs_scrypt_ts_opcat_4_0_0__rs__TxOut _output = outputs[index]; if(index < outputCount) { require(len(_output.scriptHash) > 0); outputBytes += _opcat_labs_scrypt_ts_opcat_4_0_0__rs__TxUtils.buildDataOutput(_output.scriptHash, _output.satoshis, _output.dataHash); if(index > 0) { require(output0ScriptHash != _output.scriptHash); } } } loop (6) : index { if(index < __scrypt_ts_inputCount) { bytes inputScriptHash = _opcat_labs_scrypt_ts_opcat_4_0_0__rs__ContextUtils.getSpentScriptHash(__scrypt_ts_spentScriptHashes, (index)); require(output0ScriptHash != inputScriptHash); } } require(hash256(outputBytes) == __scrypt_ts_shPreimage.hashOutputs); } }