Default host: x86_64-unknown-linux-gnu
fuelup home: /home/shivam/.fuelup
installed toolchains
--------------------
latest-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
nightly-2024-04-12-x86_64-unknown-linux-gnu
active toolchain
----------------
nightly-x86_64-unknown-linux-gnu (default)
forc : 0.56.1+nightly.20240511.85b9d9755b
- forc-client
- forc-deploy : 0.56.1+nightly.20240511.85b9d9755b
- forc-run : 0.56.1+nightly.20240511.85b9d9755b
- forc-crypto : 0.56.1+nightly.20240511.85b9d9755b
- forc-debug : 0.56.1+nightly.20240511.85b9d9755b
- forc-doc : 0.56.1+nightly.20240511.85b9d9755b
- forc-explore : 0.28.1+nightly.20240511.4bb7392eed
- forc-fmt : 0.56.1+nightly.20240511.85b9d9755b
- forc-lsp : 0.56.1+nightly.20240511.85b9d9755b
- forc-tx : 0.56.1+nightly.20240511.85b9d9755b
- forc-wallet : 0.7.0+nightly.20240511.3576ae79c4
fuel-core : 0.26.0+nightly.20240511.32600dbfbd
fuel-core-keygen : not found
I believe the contract_id
method has been removed for a frame_ptr
based method.
Just ball parking this, I believe something like this should work:
use std::{call_frames::get_contract_id_from_call_frame, registers::frame_ptr};
fn contract_id() -> ContractId {
let current_call_frame = frame_ptr();
get_contract_id_from_call_frame(current_call_frame)
}
// or ContractId::this()
Shouldn’t the code base in master branch be updated with the latest library updates, library imports and code ??? @nick So that the reference for the code could be bit better.
All code should always be up to date with their respective published version.
Can you link to which code you are specifically talking about?
Also, I just learned of a shortcut for this method:
ContractId::this()
So that would be the preference, it’s referenced in the recent change log.