block-quote On this pagechevron-down
copy Copy chevron-down
DEX.DO chevron-right Smart Contract Interfaces RootPN (Work in progress) RootPrivateNote Contract Interface Documentation
RootPN is the system root contract responsible for deploying and managing PrivateNote contracts.
It also stores and manages the canonical contract code for related system components, including Pari Mutuel Pool, Oracles, and Nullifiers.
The contract acts as a trusted entry point for:
zero-knowledge–verified deposits
deterministic deployment of PrivateNote
system-wide code upgrades
PrivateNoteDeployed
Emitted when a new PrivateNote contract is deployed.
Copy event PrivateNoteDeployed (
uint256 depositIdentifierHash ,
address noteAddress ,
uint128 initialBalance
); Meaning:
A PrivateNote was successfully deployed
The address is deterministically derived from the deposit identifier
NullifierDeployed
Emitted when a Nullifier contract is deployed.
Meaning:
A nullifier was created to prevent double-spending
Funds were transferred to the associated PrivateNote
Public & External Interface
sendEccShellToPrivateNote
Sends ECC Shell tokens to a PrivateNote after zero-knowledge proof verification.
Parameters:
proof — zero-knowledge proof validating the deposit
nullifier_hash — unique nullifier preventing double spend
deposit_identifier_hash — deposit identifier hash
value — amount of ECC Shell tokens to mint and transfer
Behavior:
Verifies the proof using zkhalo2verify
Deploys a Nullifier contract
Forwards minted tokens to the corresponding PrivateNote
deployPrivateNote
Deploys a new PrivateNote contract after ZK verification.
Parameters:
zkproof — zero-knowledge proof of deposit validity
deposit_identifier_hash — unique deposit identifier
ethemeral_pubkey — public key for the note
value — initial token balance
token_type — token type identifier
Behavior:
Validates the deposit via zero-knowledge proof
Computes deterministic PrivateNote address
Deploys the PrivateNote contract
Emits PrivateNoteDeployed
privateNoteDeployed
Records the deployment of a PrivateNote.
Access Control:
Callable only by the corresponding PrivateNote contract
Behavior:
Updates internal accounting of deployed values by token type
getPrivateNoteCode
Returns the salted PrivateNote contract code.
Returns:
privateNoteCode — salted code cell
privateNoteHash — hash of the salted code
Returns core RootPN state information.
Returns:
Returns version information for the RootPN contract.
Returns:
contract identifier: "RootPN"
Last updated 6 minutes ago