Skip to content

solana-program/memo

Repository files navigation

SPL Memo Program

[Docs.rs]

A simple program that validates a string of UTF-8 encoded characters and logs it in the transaction log. The program also verifies that any accounts provided are signers of the transaction, and if so, logs their addresses. It can be used to record a string on-chain, stored in the instruction data of a successful transaction, and optionally verify the originator.

This code was moved from the solana-program-library and is now maintained in this repo.

Full documentation is available at https://spl.solana.com/memo

Audit

The security-audits repo contains all past and present program audits.

Project setup

This repo uses a Makefile as its canonical command surface. Targets read the pinned nightly toolchain and Solana CLI version from Cargo.toml's [workspace.metadata] blocks via toml-cli, so you'll need it installed locally:

cargo install toml-cli

Then install NPM dependencies to make the Codama renderers and per-client tooling available:

pnpm install

Generating clients

The on-chain IDL is checked in at the repo root as idl.json. Regenerate the JS and Rust clients from it with:

make generate-clients

Managing clients

The following clients are available for the Memo program. You may use the following links to learn more about each client.

Building and testing the on-chain programs

The program and pinocchio folders each contain an on-chain Memo program. Build the SBF artifacts and run their tests with:

make build-sbf-program        # builds spl_memo.so into target/deploy/
make build-sbf-pinocchio      # builds p_memo.so into target/deploy/
make test-program             # runs the program crate's tests
make test-pinocchio           # runs the pinocchio crate's tests

The JS client tests (make test-js-clients-js) pick up target/deploy/spl_memo.so via LiteSVM, so building the program first is a prerequisite for running them locally.

The clients-js-legacy package's tests run against a live local validator. make test-js-clients-js-legacy starts one via scripts/restart-test-validator.sh, runs the tests, then stops it. You can also restart and stop the validator independently with make restart-test-validator and make stop-test-validator.

About

The Solana Memo program and its clients

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors