Red Hat sort of did that when they had their IPO. They allowed contributors to the open source they used to buy Red Hat shares during their IPO at the IPO price.
They were remarkably generous in who they considered to be a contributor for this. For example, I found a bug in trn that caused it to trash .newsrc files on Red Hat. I spent about 30 minutes figuring out what was going on, and submitted a patch to Red Hat to fix it. It was a very simple patch, merely changing a declaration of one variable from char to unsigned int [1].
This was enough for Red Hat to classify me as a contributor and invite me to participate in the IPO. I bought $2000 worth of their stock at the IPO price on the morning of the IPO, and sold it that afternoon for $9000.
[1] There was some function or macro that given a character returned a set of flags indicating if the character was upper case, lower case, numeric, etc., and apparently on all other systems the flags that trn cared about where in the lower 8 bits, and so storing the flags in a char worked. On the then newest Red Hat, that was not true.