CloneFactory

This library provides functions for creating and checking clones of contracts.

Internal Functions

_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

NameTypeDescription

target

address

The address of the target contract.

Returns

NameTypeDescription

result

address

The address of the created clone.

_isClone

Checks if a given contract address is a clone of the target contract.

Parameters

NameTypeDescription

target

address

The address of the target contract.

query

address

The address of the contract to check.

Returns

NameTypeDescription

result

bool

A flag indicating if the queried contract is a clone of the target contract (true) or not (false).

Last updated