Republican State Rep. Keiko Orrall, who is vying to unseat Democrat incumbent Deborah Goldberg as State Treasurer, criticized her opponent's handling of the office during a televised debate Wednesday night.

Meeting head-to-head for the first time on Greater Boston, the most contentious moments of the debate came when Orrall and Goldberg discussed the state’s lottery system, a primary function of the treasurer’s office.

“What I do as the treasurer is make sure we have record sales and record profits because, as the former chairman of the board of selectman in Brookline, I know how badly we need those funds,” Goldberg said.

“As far as the record sales, that has not been adjusted for inflation, and so that’s where I think we absolutely need to look at the lottery and the sales of the lottery because it’s actually been on the decline since the early 2000s,” Orrall responded, referencing a think-tank study. “Those numbers, those records that have been touted … that’s not a real number.”

Goldberg interrupted Orrall to defend her office’s handling of lottery funds and highlighted that revenue surpassed the $1 billion mark for the first time since the system started in the 1970s. Revenue from the lottery is redistributed across the Commonwealth’s cities and towns.

The two candidates also diverged on whether pension funds should divest from gun sellers and manufacturers. When asked whether the treasurer’s responsibility is to maximize profits or affect social change, Goldberg said she supports the latter.

“You absolutely have fiduciary duty take those actions,” Goldberg said. “It is incumbent upon you because these social actions impact the bottom lines of these companies and therefore their profits. So as an investor, you have a right to do that.”

Orrall said she does not support divesting from gun manufacturers because “we need to be looking at the best rate of return,” noting that manufacture Smith and Wesson is headquartered in Springfield. “That’s not the way we should be conducting the pension fund investments.”

On President Donald Trump, each candidate was asked to rate his time in office. Goldberg said she would give Trump a “D” for impacting our democracy “in the most negative ways.” Orrall, who also serves as the state Republican Party’s national committeewoman, did not offer a specific grade telling Braude she would “give him a much higher rating.” She added that if Trump were up for reelection in 2020, she would support the president.

The general election is November 6.