diff --git a/nekoton-contracts/src/jetton/mod.rs b/nekoton-contracts/src/jetton/mod.rs index 457dc0a7..0d024649 100644 --- a/nekoton-contracts/src/jetton/mod.rs +++ b/nekoton-contracts/src/jetton/mod.rs @@ -302,4 +302,24 @@ mod tests { Ok(()) } + + #[test] + fn mintless_points_token_wallet_contract() -> anyhow::Result<()> { + let cell = + ton_types::deserialize_tree_of_cells(&mut base64::decode("te6ccgEBAwEAyQACbIAMC6d7f4iHKlXHXBfufxF6w/5pIENHdpy1yJnyM+lsrQQNAl2Gc+Ll0AABc7gAAbghs2ElpgIBANQFAlQL5ACADZRqTnEksRaYvpXRMbgzB92SzFv/19WbfQQgdDo7lYwQA+mfQx3OTMfvDyPCOAYxl9HdjYWqWkQCtdgoLLcHjaDKvtRVlwuLLP8LwzhcDJNm1TPewFBFqmlIYet7ln0NupwfCEICDvGeG/QPK6SS/KrDhu7KWb9oJ6OFBwjZ/NmttoOrwzY=").unwrap().as_slice()) + .unwrap(); + let mut state = nekoton_utils::deserialize_account_stuff(cell)?; + + jetton::update_library_cell(&mut state.storage.state)?; + + let contract = jetton::TokenWalletContract(ExecutionContext { + clock: &SimpleClock, + account_stuff: &state, + }); + + let data = contract.get_details()?; + assert_eq!(data.balance.to_u128().unwrap(), 10000000000); + + Ok(()) + } } diff --git a/nekoton-contracts/src/wallets/code/jetton_wallet.boc b/nekoton-contracts/src/wallets/code/jetton_wallet.boc new file mode 100644 index 00000000..09f021b5 Binary files /dev/null and b/nekoton-contracts/src/wallets/code/jetton_wallet.boc differ diff --git a/nekoton-contracts/src/wallets/code/mod.rs b/nekoton-contracts/src/wallets/code/mod.rs index 309189d5..3fb3de93 100644 --- a/nekoton-contracts/src/wallets/code/mod.rs +++ b/nekoton-contracts/src/wallets/code/mod.rs @@ -26,8 +26,9 @@ declare_tvc! { wallet_v5r1 => "./wallet_v5r1_code.boc" (WALLET_V5R1_CODE), highload_wallet_v2 => "./highload_wallet_v2_code.boc" (HIGHLOAD_WALLET_V2_CODE), ever_wallet => "./ever_wallet_code.boc" (EVER_WALLET_CODE), - jetton_wallet_governed => "./jetton_wallet_governed.boc" (JETTON_WALLET_GOVERNED), + jetton_wallet => "./jetton_wallet.boc" (JETTON_WALLET), jetton_wallet_v2 => "./jetton_wallet_v2.boc" (JETTON_WALLET_V2), + jetton_wallet_governed => "./jetton_wallet_governed.boc" (JETTON_WALLET_GOVERNED), } fn load(mut data: &[u8]) -> Cell { @@ -38,7 +39,11 @@ static JETTON_LIBRARY_CELLS: once_cell::sync::Lazy> = once_cell::sync::Lazy::new(|| { let mut m = HashMap::new(); - let codes = [jetton_wallet_governed(), jetton_wallet_v2()]; + let codes = [ + jetton_wallet(), + jetton_wallet_v2(), + jetton_wallet_governed(), + ]; for code in codes { m.insert(code.repr_hash(), code); diff --git a/nekoton-jetton/Cargo.toml b/nekoton-jetton/Cargo.toml index f3a4d5b6..8bae8aa6 100644 --- a/nekoton-jetton/Cargo.toml +++ b/nekoton-jetton/Cargo.toml @@ -20,8 +20,8 @@ ton_types = { git = "https://github.com/broxus/ton-labs-types.git" } ton_abi = { git = "https://github.com/broxus/ton-labs-abi" } nekoton-utils = { path = "../nekoton-utils" } -num-bigint = "0.4.6" -num-traits = "0.2.19" +num-bigint = "0.4" +num-traits = "0.2" [features] web = ["ton_abi/web"]