This repository contains all the smart contracts that underpin the XMTP decentralized network.
The project is built with the Foundry
framework, and dependency management is handled using native git submodules.
Additionally, it uses slither
for static analysis.
Optionally, install yarn or any other preferred JS package manager.
Initialize the project dependencies:
yarn install # if using yarn
Initialize foundry:
forge update
The following can be run using npm
, yarn
and similar JS package managers.
# Forge scripts
build: Builds the contracts.
test: Tests the contracts.
clean: Cleans the forge environment.
coverage: Shows the test coverage.
gas-report: Shows the gas costs.
doc: Serves the project documentation at http://localhost:4000
# Static analysis
slither: Runs slither static analysis.
# Linters
solhint: Runs solhint.
solhint-fix: Runs solhint in fix mode, potentially modifying files.
lint-staged: Runs linters only on files that are staged in git.
# Formatters
prettier: Runs prettier in write mode, potentially modifying files.
prettier-check: Runs prettier in check mode.
The Foundry book can be found hosted on the contracts documentation page.
To dive deeper into the protocol and its architecture, read the architecture documentation.