  We present results from two {\it Chandra} observations of the 16.6 d
X-ray/$\gamma$-ray high-mass binary 1FGL J1018.6$-$5856 located at the center
of the supernova remnant G284.3$-$1.8. The binary spectra, separated by 0.25 in
binary phase, are fit with an absorbed power-law model with
$\Gamma\approx1.7-1.8$ for both observations (the flux during the second
observation is a factor of 1.7 smaller). In the high-resolution ACIS-I image we
found a hint of extended emission $\approx2''$--$3''$ southeast of the binary,
significant at the $3\sigma$ level. Binary evolution codes reproduce the
system's observed properties with two massive stars with an initial 18-day
period, undergoing mass transfer and leaving behind a heavy $\approx2$ $\msun$
neutron star. The initial mass of the progenitor star in this scenario is 27
$\pm 4$ $\msun$. \emph{Chandra} and {\it XMM-Newton} images of the remnant show
it has a relatively low X-ray surface brightness. The two brightest regions of
extended X-ray emission, with luminosities $\sim10^{33}$ erg s$^{-1}$ for $d=5$
kpc, lie in the northern and western portions and show significantly different
spectra. The northern patch is consistent with shocked ISM, with a low
temperature and long ionization timescale. However, the western patch is
dominated by ejecta, and shows significantly enhanced Mg content relative to
other ejecta products. The abundance ratios inferred resemble those from the
Large Magellanic Cloud remnant N49B. To our knowledge, this is only the second
case of such Mg-rich ejecta found in an SNR. Nucleosynthesis models for
core-collapse SNe predict Mg-rich ejecta from very massive progenitors of $>25$
$\msun$.
