> For the complete documentation index, see [llms.txt](https://elektro.gitbook.io/elektro-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://elektro.gitbook.io/elektro-protocol/smart-contracts/natspec-technical-documentation/proxy-pattern-base-logic/delegator.md).

# Delegator

View Source: @nomisma/elektro-protocol-aux/contracts/delegate/Delegator.sol

**↘ Derived Contracts: ElektroEventEmitterRouter, ElektroRegistryAdmin, ElektroRegistryRouter, FundLockRouter, FundLockStorage, TokenManagerAdmin**

**Delegator**

Contract contains extracted common logic for call delegation. Contracts that are delegating calls are extending Delegator contract

## Functions

* [delegate(address calleeContract, bytes parameters, string errorMsg)](broken://pages/HFQqrUUKtCj6zLpaX5sS)

### delegate

Delegates call to specified contract. If delegatecall fails, transaction is reverted Additional check is done to verify that contract to call exists

```js
function delegate(address calleeContract, bytes parameters, string errorMsg) internal nonpayable
returns(bytes)
```

**Returns**

result of delegatecall as bytes array. Those bytes can be used in contract that is delegating call

**Arguments**

| Name           | Type    | Description                                                      |
| -------------- | ------- | ---------------------------------------------------------------- |
| calleeContract | address | address of contract to delegate call to                          |
| parameters     | bytes   | function signature and parameters encoded to bytes               |
| errorMsg       | string  | error message to revert in case of failed delegatecall execution |
