solana-program-library/token-swap
dependabot[bot] 4ade9b28b3
build(deps-dev): bump typescript from 4.6.2 to 4.9.5 in /token-swap/js (#4053)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-16 23:45:42 +00:00
..
js build(deps-dev): bump typescript from 4.6.2 to 4.9.5 in /token-swap/js (#4053) 2023-02-16 23:45:42 +00:00
program token-2022: Bump program, cli, and client for release (#4039) 2023-02-09 00:27:05 +01:00
proposals docs: Clarify audit status of all programs, no S word (#4046) 2023-02-13 22:05:49 +00:00
README.md docs: Clarify audit status of all programs, no S word (#4046) 2023-02-13 22:05:49 +00:00

README.md

Token Swap Program

A Uniswap-like exchange for the Token program on the Solana blockchain.

Full documentation is available at https://spl.solana.com/token-swap

JavaScript bindings are available in the ./js directory.

Audit

The repository README contains information about program audits.

Building master

To build a development version of the Token Swap program, you can use the normal build command for Solana programs:

cargo build-sbf

Testing

Unit tests

Run unit tests from ./program/ using:

cargo test

Fuzz tests

Using the Rust version of honggfuzz, we "fuzz" the Token Swap program every night. Install honggfuzz with:

cargo install honggfuzz

From there, run fuzzing from ./program/fuzz with:

cargo hfuzz run token-swap-instructions

If the program crashes or errors, honggfuzz dumps a .fuzz file in the workspace, so you can debug the failing input using:

cargo hfuzz run-debug token-swap-instructions hfuzz_workspace/token-swap-instructions/*fuzz

This command attaches a debugger to the test, allowing you to easily see the exact problem.

Integration tests

You can test the JavaScript bindings and on-chain interactions using solana-test-validator, included in the Solana Tool Suite. See the CLI installation instructions.

From ./js, install the required modules:

npm i

Then run all tests:

npm run start-with-test-validator