Thanks to visit codestin.com
Credit goes to lib.rs

4 releases

Uses new Rust 2024

new 0.3.1 Dec 30, 2025
0.3.0 Sep 30, 2025
0.2.1 Aug 18, 2025
0.2.0 Jun 26, 2025

#5 in #miri

Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App Codestin Search App

177 downloads per month
Used in 8 crates (7 directly)

MIT/Apache

730KB
18K SLoC

Tycho VM and Executor

Rust implementation of the TON Virtual Machine and executor.

[!NOTE] This crate tries to be as close to the original implementation as possible. However, its main purpose is to be a core of tycho, so there may be some differences.

VM usage

let code = Boc::decode(tvmasm!("ACCEPT"))?;
let data = Cell::empty_cell();

let addr = "0:0000000000000000000000000000000000000000000000000000000000000000"
    .parse::<IntAddr>()?;

let smc_info = SmcInfoBase::new()
    .with_now(1733142533)
    .with_block_lt(50899537000013)
    .with_tx_lt(50899537000013)
    .with_account_balance(CurrencyCollection::new(1931553923))
    .with_account_addr(addr.clone())
    .require_ton_v4();

let mut vm_state = VmState::builder()
    .with_smc_info(smc_info)
    .with_stack(tuple![
        slice CellBuilder::build_from(&addr).map(OwnedCellSlice::new_allow_exotic)?,
        int 103289,
    ])
    .with_code(code)
    .with_data(data)
    .with_gas(GasParams::getter())
    .build();

let exit_code = vm_state.run();

Development

How to bench

cargo bench --bench dex_pair
cargo bench --bench ever_wallet
cargo bench --bench jetton

How to miri check

# Add Miri component
rustup +nightly component add miri

# Run all tests with Miri
cargo +nightly miri test

How to fuzz

# Install fuzzer
cargo install cargo-fuzz

# Run any of the fuzzer targets
cargo +nightly fuzz run action_phase_real -j 12
cargo +nightly fuzz run action_phase_surreal -j 12
cargo +nightly fuzz run vm_only_code -j 12

Contributing

We welcome contributions to the project! If you notice any issues or errors, feel free to open an issue or submit a pull request.

AI Documentation

Ask DeepWiki

License

Licensed under either of

at your option.

Dependencies

~5.5–9MB
~167K SLoC