Unable to Find Derive Macro `StateClone` in Scope

Hi Support Team,

I’m encountering an issue while working with my Rust project. The following error is appearing when I try to build the project:

error: cannot find derive macro `StateClone` in this scope
 --> src\state.rs:71:10
  |
71 | #[derive(StateClone, Serial, DeserialWithState)]
  |          ^^^^^^^^^^

It seems that the StateClone derive macro from concordium-std is not being recognized in the current scope. I’ve already tried importing it as follows, but the issue persists:

use concordium_std::StateClone;

Here are the details of the project:

  • Project Path: C:\Users\CBM\Projects\Testing\concordium-contracts\cis2-auctions
  • Cargo Version: cargo 1.81.0 (2dbb1af80 2024-08-20)
  • OS: Windows 11
  • Error Message: “cannot find derive macro StateClone in this scope.”

Could you please assist in resolving this issue? Any guidance would be greatly appreciated.

Thank you!

Hi there

StateClone was deprecated and removed in concordium-std 8.0.0+.
Its main purpose was tied to unit testing using older version of the deprecated testing_infrastructure, so simply removing it should work.

You can have a look at this PR which removed the StateClone from all our smart contract examples.

Thanks I have done that and Initialize the contract also but when trying to do bid having error same all time while I do everything correct.
this is the link where I was trying

https://sctools.mainnet.concordium.software/?__hstc=206253644.9e573ad0dcf77e4d730f208e53ab0481.1736862510663.1737015924307.1737026584228.5&__hssc=206253644.4.1737026584228&__hsfp=706028811

and the contract index is 10559 and sub-index is 0 its name is auction

It would be good with a bit more context on what you are doing and the error you see :slight_smile:

I am Biding with the amount
using this UI for contract intraction give me this error


and I have take this contract from this link

When i am trying to make a bid it is giving me the error that I have mention contract index is 10563,0

It’s the 5th error in your Error enum.
Here more on the custom errors from documentation: Custom errors — Concordium documentation

1 Like