BribeFactory

Description:

A simple factory contract designed to deploy new instances of the Bribe contract. Crucially, when it deploys a Bribe, it passes the address that called createBribe (msg.sender, which is expected to be the Voter contract) as the _factory parameter to the new Bribe's constructor.


createBribe

function createBribe() external returns (address)

Description:

Deploys a new Bribe contract instance. The caller (msg.sender) of this function becomes the factory address within the newly created Bribe contract, granting it permission to call _deposit, _withdraw, and getRewardForOwner. Stores the address of the deployed bribe in last_gauge.

Return Value:

Type
Description

address

The address of the newly deployed Bribe contract.


Last updated