Below is a simple pool lottery contract template that allows you to ensure that everyone receives their fair share of winnings…