CloneFactory
This library provides functions for creating and checking clones of contracts.
Internal Functions
_createClone
_createClone
Creates a clone of the target contract by using the delegatecall
mechanism. It generates the clone's bytecode by combining the creation code and the runtime code.
Parameters
Name | Type | Description |
---|---|---|
target | address | The address of the target contract. |
Returns
Name | Type | Description |
---|---|---|
result | address | The address of the created clone. |
_isClone
_isClone
Checks if a given contract address is a clone of the target contract.
Parameters
Name | Type | Description |
---|---|---|
target | address | The address of the target contract. |
query | address | The address of the contract to check. |
Returns
Name | Type | Description |
---|---|---|
result | bool | A flag indicating if the queried contract is a clone of the target contract (true) or not (false). |
Last updated