I'm making a simple storage contract in stylus, but I'm confused as to why I can't import alloc
like I can other imports.
I have two kinds of imports
// the extern
extern crate alloc;
// The classic use import
use stylus_sdk::{
alloy_primitives::U256,
prelude::{entrypoint, external, sol_storage},
};
But the following doesn't compile for me:
use std::alloc
Because it gives me errors with entrypoint
sol_storage! {
#[entrypoint]
pub struct SimpleStorage {
uint256 my_favorite_number;
}
}
error[E0433]: failed to resolve: could not find `vec` in `alloc`
--> src/main.rs:20:5
|
20 | #[entrypoint]
| ^^^^^^^^^^^^^ could not find `vec` in `alloc`