DelegateEscrowFactory.sol
The DelegateEscrowFactory creates and tracks escrow contracts that hold delegated gOHM. Each delegate address gets a unique escrow contract, allowing positions to maintain voting power while being used as collateral in Cooler.
The factory uses the minimal proxy pattern to efficiently deploy new escrow contracts, with each escrow dedicated to a single delegate address.
Functions
constructor(address gohm_)
Creates implementation contract for future cloning
Sets gOHM token address
create(address delegate)
Creates new escrow for a delegate if none exists
Returns existing escrow if already created
Initializes escrow with delegate address
logDelegate(address caller, address onBehalfOf, int256 delegationAmountDelta)
Called by escrow contracts to emit delegation events
Records increases (positive delta) and decreases (negative delta)
Only callable by escrows created by factory
View Functions
escrowFor(address delegate)
Returns escrow contract address for a delegate
Returns zero address if none exists
created(address)
Validates if an address is a legitimate escrow created by factory
Last updated