Skip to main content

MerkleGateFactory

MerkleGateFactory is an immutable supplementary contract that deploys and initializes CuratedGate instances behind OssifiableProxy. Each new proxy is initialized with its bond curve, Merkle tree root and CID, name, and administrator.

The factory is bound to one gate implementation at deployment. The factory and implementation are immutable, while each gate instance is an independently upgradeable proxy.

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.