code: def ToJson(self):
          
          parameters = self.ParameterList.hex()
          paramlist = [ToName(ContractParameterType.FromString(parameters[i:i + 2]).value) for i in range(0, len(parameters), 2)]
          return {
              'hash': self.ScriptHash().To0xString(),
              'script': self.Script.hex(),
              'parameters': paramlist,
              'returntype': ToName(self.ReturnType) if type(self.ReturnType) is int else ToName(int(self.ReturnType))
          }
docs: Convert object members to a dictionary that can be parsed as JSON.
  
          Returns:
               dict: