mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-27 04:11:08 +00:00
Programs now report AccountDiff/AccountDiffOutput instead of full post-states; balance changes are applied via apply_balance_diff's checked arithmetic at the protocol level rather than checked in-guest, and data changes are materialized through a new update_from_diff guest entrypoint (trusted execution for public transactions, proven via a recursive receipt for the privacy-preserving circuit). All 15 production programs and test/example guest programs are converted; attack-surface guest programs that are now structurally impossible (nonce/program_owner mutation) or redundant (manual balance-sufficiency bypass) are moved to a dormant/ directory rather than deleted outright.
24 lines
638 B
Rust
24 lines
638 B
Rust
//! The Token Program implementation.
|
|
|
|
use std::convert::Infallible;
|
|
|
|
use lee_core::account::{Account, Data};
|
|
|
|
pub use token_core as core;
|
|
|
|
pub mod burn;
|
|
pub mod initialize;
|
|
pub mod mint;
|
|
pub mod new_definition;
|
|
pub mod print_nft;
|
|
pub mod transfer;
|
|
|
|
mod tests;
|
|
|
|
/// Every data write in this program replaces the account's data wholesale with an
|
|
/// already-fully-computed encoding (`TokenDefinition`/`TokenHolding`/`TokenMetadata`), so
|
|
/// `diff_data` already *is* the new data verbatim — materializing it is a passthrough.
|
|
pub fn update_from_diff(_pre_state: Account, diff_data: Data) -> Result<Data, Infallible> {
|
|
Ok(diff_data)
|
|
}
|