Trigger Mod: Building Permissionless Pathways by Extending the Capped Minter Framework
Contributors:
Factory Labs:
Introduction
The ZKsync ecosystem is continuously evolving to enhance efficiency, security, and decentralisation. A key aspect of this evolution is the management and distribution of tokens through Token Programme Proposals (TPPs). The “Trigger Mod” (primarily embodied by the ZkMinterModTriggerV1.sol contract) represents a significant architectural advancement within this framework. It offers a robust solution to automate and secure token flows, bridging the gap between the Capped Minter system and various on-chain applications. This report details the Trigger Mod’s architecture, functionality, benefits, and its role in building permissionless, trust-minimised pathways for token distribution.
1. Context: The Challenge in Token Programme Execution
Overall ZKsync Governance & TPP Framework
ZKsync governance relies on TPPs, approved by the Token Governor (or Token Assembly), to guide initiatives and allocate resources. Central to this is the Capped Minter framework, which empowers the Token Governor to grant specific contracts capped minting rights for defined purposes. This ensures controlled token supply and usage.
Problem Statement: Inefficiencies in Early TPPs
Early TPPs, such as the “Ignite” programme, exposed operational challenges:
- Manual Friction & Delays: Token distributions often involved manual interventions by Steering Committees (SteerCos) using multisig wallets.
- Custody Risks: Tokens were frequently held in intermediary SteerCo multisigs.
- Complexity for Signers: Non-technical multisig signers faced opaque transaction payloads.
- Lack of Direct Automation: A gap existed in directly connecting Capped Minters to diverse distribution contracts.
2. Goals of the Trigger Mod
The Trigger Mod was designed to address these challenges with the following objectives:
- Trust Minimisation: Reduce reliance on human intervention.
- Automation: Enable direct, programmatic, “just-in-time” token flows.
- Efficiency: Accelerate distributions and reduce operational overhead.
- Reduced Custody: Eliminate intermediary token holding.
- Enhanced Security: Minimise attack surfaces by streamlining token flows.
3. Core Concepts & Terminology
Understanding the Trigger Mod requires familiarity with these key concepts:
- Token Governor / Token Assembly: The governance body approving TPPs and setting rules for token programmes.
- Capped Minter (e.g.,
ZkCappedMinterV2.sol): A contract minting tokens up to a cap, withZkMinterModTriggerV1.solholdingMINTER_ROLE. - Steering Committee (SteerCo): Group previously handling manual TPP execution.
- Permissionless Pathways: Automated token flows once configured.
- “Mint on Demand” / “Just-in-Time Minting”:
ZkMinterModTriggerV1.solmints tokens only when needed by theTargetContract. Minting rights represent the potential to create tokens, which are only converted into actual, liquid ERC20 tokens (governed by the ZK token contract) at the precise moment they are required for use by a target application. The Trigger Mod facilitates this conversion and immediate direction of tokens. - Automaton:
ZkMinterModTriggerV1.solas a self-operating mechanism. - Target Contract: Any contract receiving tokens from
ZkMinterModTriggerV1.sol.ZkMinterModTargetExampleV1.solis an illustrative example.
4. “Trigger Mod” Solution Architecture
The Trigger Mod is an architectural pattern with ZkMinterModTriggerV1.sol (the “trigger” contract) as its reference implementation. It’s an intermediary connecting a ZkCappedMinterV2 to a TargetContract.
Key Components & Roles
ZkMinterModTriggerV1.sol(The “Trigger Mod” Contract):- Role: The central orchestrator. Holds
MINTER_ROLEon aZkCappedMinterV2. - Configuration: Initialised with an
adminaddress, thetokenaddress,targetcontract address, thefunctionSignature, andcallDatafor the target function. Theminteraddress is configured post-deployment viasetMinter()by theadmin. - Core Functionality -
initiateCall():- Determines the amount of tokens available to mint (up to the
minter’s cap) and mints these tokens fromminterto itself. - Approves the
targetcontract to spend these minted tokens. - Constructs the full call data by combining
functionSignatureandcallData, then calls the specified function on thetargetwith this data.
- Determines the amount of tokens available to mint (up to the
- Role: The central orchestrator. Holds
ZkCappedMinterV2.sol:- Role: The ultimate source of tokens, enforcing TPP caps set by the Token Governor. Grants
MINTER_ROLEtoZkMinterModTriggerV1.sol.
- Role: The ultimate source of tokens, enforcing TPP caps set by the Token Governor. Grants
Understanding Target Contracts: ZkMinterModTargetExampleV1.sol and MerkleDropFactory.sol
The power of ZkMinterModTriggerV1.sol lies in its ability to interact with any contract designed to receive tokens. We’ll explore two examples: ZkMinterModTargetExampleV1.sol as a generic template, and MerkleDropFactory.sol as a specific, practical application.
ZkMinterModTargetExampleV1.sol(Illustrative Generic Target):- Purpose: This contract serves as a clear, simple template demonstrating the pattern a target contract follows when interacting with
ZkMinterModTriggerV1.sol. It’s not meant for a single specific use case but rather to show the fundamental mechanics. - Interaction Flow:
ZkMinterModTriggerV1.sol, after minting and approving tokens, calls a designated function onZkMinterModTargetExampleV1.sol(e.g.,executeTransferAndLogic).- Inside
executeTransferAndLogic,ZkMinterModTargetExampleV1.soluses the standard ERC20transferFromfunction to pull the tokens thatZkMinterModTriggerV1.solhas made available (ZkMinterModTriggerV1.solismsg.senderin this call). Thefromaddress intransferFromis effectivelyaddress(ZkMinterModTriggerV1). - After securing the tokens,
ZkMinterModTargetExampleV1.solcan then execute its own specific business logic (represented by aperformLogic()function). This logic is placeholder and would be implemented by developers for their specific needs (e.g., recording a deposit, updating state, forwarding funds).
- Diagram:
ZkMinterModTriggerV1withZkMinterModTargetExampleV1
- Purpose: This contract serves as a clear, simple template demonstrating the pattern a target contract follows when interacting with
- Significance:
ZkMinterModTargetExampleV1.solclarifies the “pull” part of the interaction. It shows that target contracts don’t need to be minter-aware; they just need a way to receive an approved token transfer.
MerkleDropFactory.sol(Concrete Target Example - Airdrop Funding):- Purpose: This is a real-world example of a target contract. A
MerkleDropFactoryis used to create and manage Merkle tree-based airdrops, allowing efficient distribution of tokens to many recipients. - Interaction Flow:
ZkMinterModTriggerV1.solis configured with theMerkleDropFactory’s address and the specific function signature for depositing tokens (e.g.,depositTokens(bytes32 treeId, uint256 amount)).- When
initiateCall()is triggered,ZkMinterModTriggerV1.solmints the required tokenamountand approves theMerkleDropFactorycontract. ZkMinterModTriggerV1.solthen callsMerkleDropFactory.depositTokens(...), passing thetreeIdfor the airdrop and theamountof tokens.- The
MerkleDropFactorywould then internally usetransferFromto pull the approved tokens fromZkMinterModTriggerV1.soland credit them to the specified Merkle tree, making them available for claiming by eligible airdrop recipients.
- Diagram:
ZkMinterModTriggerV1withMerkleDropFactory
- Purpose: This is a real-world example of a target contract. A
- Significance: This illustrates how
ZkMinterModTriggerV1.solautomates the funding of complex applications like airdrops, removing manual treasury management steps and reducing custodial risk for the funds allocated to the airdrop.
Overall Token and Control Flow
The general interaction managed by ZkMinterModTriggerV1.sol remains consistent:
Custody Flow
ZkMinterModTriggerV1.sol ensures tokens bypass intermediary custodial wallets:
Access Control
- ZkMinterModTriggerV1.sol Configuration: Restricted to the
admin. - Triggering initiateCall(): Flexible (permissionless or role-restricted).
- Overall Programme Control: Via ZkCappedMinterV2 by the Token Governor.
5. Benefits & Outcomes
The Trigger Mod pattern is a minter mod that aims to be part of the design language for TPPs, it enables:
- Reduced Custody Risk
- Significant Automation Possibilities
- Increased Efficiency & Speed
- Composability & Reusability
- Enhanced Programme Auditability
- “Mint on Demand”
- Improved Operational Security
6. Use Cases & Examples
The trigger mod enables a very broad use case set, limited only by the functionality of the target smart contract. Some examples of potential use cases include:
- Automated Airdrop Funding (e.g., MerkleDropFactory.sol and distribution systems such as Merkl).
- Automated Service Provider Payments.
- Staking/Liquidity Pool Funding.
- TPP DeFi integration
7. Conclusion: Paving the Way for Advanced Governance Operations
The Trigger Mod is a strategic enabler for ZKsync Token Programmes. It is an incremental step towards more trust minimised and automated “permissionless pathways”.
Learning from Ignite, the mechanism cuts down on custodial risk and operational drag, unlocking new possibilities for TPPs by facilitating token minting directly to target smart contracts.
N.B. This post will be updated with repo links and contract addresses as deployment happens.



