Nearprotocol 在区块链附近使用未声明的类型或模块
在尝试编译接近智能合约时,但仅在编译到wasm目标时,我遇到以下错误Nearprotocol 在区块链附近使用未声明的类型或模块,nearprotocol,Nearprotocol,在尝试编译接近智能合约时,但仅在编译到wasm目标时,我遇到以下错误 Compiling nep9000 v0.1.0 (/Users/mikkoohtamaa/code/advanced-fungible-token/contract) error[E0433]: failed to resolve: use of undeclared type or module `near_blockchain` --> src/token.rs:144:1 | 144 | #[
Compiling nep9000 v0.1.0 (/Users/mikkoohtamaa/code/advanced-fungible-token/contract)
error[E0433]: failed to resolve: use of undeclared type or module `near_blockchain`
--> src/token.rs:144:1
|
144 | #[near_bindgen]
| ^^^^^^^^^^^^^^^ use of undeclared type or module `near_blockchain```
正常的
cargo build
是可以的。看起来你需要在合同的struct
和impl
上声明。impl
仅仅是不够的
#[靠近_bindgen]
#[派生(BorshDeserialize,BorshSerialize)]
发布结构令牌{
...
}
#[近宾根]
impl令牌{
...
}
但不确定为什么我只在wasm目标上出现此错误。