testnet
GitHub

PCL Dual-Track Transaction Model

mechanism compliance

Execute transactions in either an open, permissionless context or a regulated, compliant context.

Maroo's PCL enables a dual-track system for smart contract interactions. The 'Open Track' consists of standard, direct EVM calls that bypass PCL checks. The 'Regulated Track' is an opt-in model where interactions are routed through the IPcl.runOnPcl function, which enforces all applicable compliance policies before executing the intended logic. This provides developers with the flexibility to design applications with both permissionless and permissioned components.

The Open Track

This is the default behavior for any EVM-compatible chain. A direct call from an EOA or another contract (e.g., myToken.transfer(recipient, amount)) executes the function's code without any PCL intervention. This track is suitable for parts of an application that do not require regulatory oversight, such as interacting with a decentralized oracle or a public NFT marketplace.

The Regulated Track

To engage the PCL, a transaction must be explicitly routed through the Regulated Track. This is achieved by wrapping the original call within IPcl.runOnPcl. For example, instead of myToken.transfer(...), the caller would execute PCL_CONTRACT.runOnPcl(address(myToken), abi.encodeWithSignature("transfer(address,uint256)", recipient, amount), 0). This function call instructs the Maroo node to first perform all PCL checks associated with the myToken contract. If the checks pass, the node proceeds to execute the transfer call. If they fail, the transaction reverts.

Implementation Strategy

Compliant contracts are typically designed to enforce the use of the Regulated Track for sensitive functions. A common pattern is to make the core logic function (_transfer, for example) internal and expose a public wrapper function that can only be called by the contract itself. The main public function (transfer) would then contain the logic to call IPcl.runOnPcl, targeting itself and its own internal function. This ensures that external callers cannot bypass the PCL checks.
Source: maroo
ESC
Type to search