DelegateEscrow.sol

DelegateEscrow is a proxy contract that holds gOHM and delegates it to a single address (since gOHM only allows one delegation per address). As such, each delegate gets their own escrow contract created by DelegateEscrowFactory. The escrow keeps track of how much gOHM each caller (like MonoCooler) has delegated on behalf of various users.

The key mechanic is that only the original caller can withdraw the gOHM they deposited.

Functions

initialize()

  • Called once by factory after creation

  • Delegates all gOHM to the target delegate address

delegate(address onBehalfOf, uint256 gohmAmount)

  • Caller deposits gOHM to be delegated

  • Tracks amount deposited for (caller, onBehalfOf) pair

  • gOHM voting power automatically goes to delegate

rescindDelegation(address onBehalfOf, uint256 gohmAmount)

  • Caller withdraws their previously delegated gOHM

  • Can only withdraw up to their deposited amount

  • Returns remaining delegated amount

View Functions

delegateAccount()

  • Returns the address that this escrow delegates to

factory()

  • Returns the factory that created this escrow

delegations(address caller, address onBehalfOf)

  • Returns how much gOHM a caller has delegated for an account

Last updated