Skip to main content

🔶 Diagrams & Formulas

Cantina Code supports diagramming libraries such as Mermaid.js and MathJax for mathematical formula rendering. Paired with a well written finding or comment, these tools allow you to visually and efficiently communicate your point to the reader.

Mermaid Diagram

The following code block when introduced as a comment will display as illustrated in the image below. Sequence diagram shows smart contract reentrancy attack.

MathJax Formulas

Cantina Comments also render MathJax formulas. The following code block
$$
H_{f} = \frac {\sum Collateral_{i}\;in\;ETH  \times  Liquidation\;Threshold}{Total\;Collateral\;in\;ETH} 
$$
when introduced inside a comment will render as such ssue in Cantina Code with a mathematical formula using Mathjax, highlighting a potential error in implementation for Web3 security audits.