Quantcast
Channel: Active questions tagged rustc - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 42

Anchor build error: String is the wrong size

$
0
0

i am trying to build use anchor build, but come across an error:Error: String is the wrong size

I tried digging it on stack and asked AIs as well but no luck i can seem to get over it

It doesnt specify which directory or file i currently have only one contract so i guess not a big deal but stil

my rust file

use anchor_lang::prelude::*;use anchor_spl::token_interface::{Mint, TokenInterface};declare_id!("6n94E9pEixrcVfap2iF9GE7nuhPQ8Kf9rVhxwjYAksrp");#[program]pub mod furb {    use super::*;    pub fn initialize(ctx: Context<InitializeMint>) -> Result<()> {        msg!("Created Mint Account: {:?}", ctx.accounts.mint.key());        Ok(())    }}#[derive(Accounts)]pub struct InitializeMint<'info> {    #[account(mut)]    pub signer: Signer<'info>,    #[account(        init,        payer = signer,        mint::decimals = 6,        mint::authority = signer.key(),        mint::freeze_authority = signer.key(),    )]    pub mint: InterfaceAccount<'info, Mint>,    pub token_program: Interface<'info, TokenInterface>,    pub system_program: Program<'info, System>,}

Cargo.toml in program/furb/src/Cargo.toml

[package]name = "furb_token"version = "0.1.0"edition = "2021"[lib]crate-type = ["cdylib", "lib"]name = "furb_token"[features]default = []cpi = ["no-entrypoint"]no-entrypoint = []no-idl = []no-log-ix-name = []idl-build = ["anchor-lang/idl-build","anchor-spl/idl-build",][dependencies]anchor-lang = { workspace = true }anchor-spl = { workspace = true }solana-program ={ workspace = true }

anchor.toml:

[toolchain][features]resolution = trueskip-lint = false[programs.localnet]fur_eco_contract = "6n94E9pEixrcVfap2iF9GE7nuhPQ8Kf9rVhxwjYAksrp"furft_marketplace = "FurftMarket11111111111111111111111111111111"fur_p2e = "FurP2E11111111111111111111111111111111111"[registry]url = "https://api.apr.dev"[provider]cluster = "Localnet"wallet = "~/.config/solana/id.json"[scripts]test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

root cargo.toml:

[workspace]members = ["programs/*"]resolver = "2"[workspace.dependencies]anchor-lang = "0.30.1"anchor-spl = "0.30.1"solana-program = "2.2.1"spl-token = "7.0.0"[profile.release]overflow-checks = truelto = "fat"codegen-units = 1[profile.release.build-override]opt-level = 3incremental = falsecodegen-units = 1

active toolchain

stable-x86_64-unknown-linux-gnurustc 1.85.0 (4d91de4e4 2025-02-17)

solana-cli 2.1.15anchor-cli 0.30.1cargo 1.85.0 (d73d2caf9 2024-12-31)


Viewing all articles
Browse latest Browse all 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>