Skip to main content

MerkleGateFactory

MerkleGateFactory.sol is a supplementary contract that deploys and initializes Merkle-based gate instances, such as VettedGate, behind OssifiableProxy. A factory is bound to a single gate implementation at deployment. Each new instance is configured with its bond curve, initial Merkle tree root and CID, name, and administrator. The factory itself is immutable, while each deployed gate is upgradeable through its proxy.

Upgradability​

The contract is immutable.

State Variables​

GATE_IMPL​

address public immutable GATE_IMPL

Functions​

constructor​

constructor(address gateImpl) ;

create​

Creates a new gate proxy for the predefined implementation and initializes it.

function create(uint256 curveId, bytes32 treeRoot, string calldata treeCid, string calldata name, address admin)
external
returns (address instance);

Parameters

NameTypeDescription
curveIduint256Bond curve id used by the gate.
treeRootbytes32Initial Merkle tree root.
treeCidstringInitial Merkle tree CID.
namestringHuman-readable gate name.
adminaddressAddress of the proxy admin and DEFAULT_ADMIN_ROLE holder.

Returns

NameTypeDescription
instanceaddressAddress of the created proxy instance.