Skip to main content

MerkleGateFactory

Deployed contracts​

ModuleMainnet
CMv20xDdE99d63b352A665d04339D4792E6852Ce89d1B7
CSM0xc0f110Af6eA9119037a71C84D14506A22AE43DdE

MerkleGateFactory is an immutable supplementary contract that deploys and initializes Merkle-based gate instances behind OssifiableProxy, namely CuratedGate in CMv2 and VettedGate in CSM. 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.

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.