@Override
  public Optional<Code> getSubContainer(final int index, final Bytes auxData, final EVM evm) {
    EOFLayout subcontainerLayout = eofLayout.getSubcontainer(index);
    Bytes codeToLoad;
    if (auxData != null && !auxData.isEmpty()) {
      codeToLoad = subcontainerLayout.writeContainer(auxData);
      if (codeToLoad == null) {
        return Optional.empty();
      }
    } else {
      // if no auxdata is added, we must validate data is not truncated separately
      if (subcontainerLayout.dataLength() != subcontainerLayout.data().size()) {
        return Optional.empty();
      }
      codeToLoad = subcontainerLayout.container();
    }

    Code subContainerCode = evm.getCodeUncached(codeToLoad);

    return subContainerCode.isValid() && subContainerCode.getEofVersion() > 0
        ? Optional.of(subContainerCode)
        : Optional.empty();
  }
Instantiates a new CodeV1.

@param eofLayout the layout
evm/src/main/java/org/hyperledger/besu/evm/code/CodeV1.java