Assuming that the entity that you've invested in that owns property A is a QOZB, then you should be able to form a QOF or use an existing QOF to make that investment using the gains from your property B if you do it timely. There shouldn't be anything necessary in the purchase agreement for property B when you sell it.