我正试着从头开始建立一份明智的合同。我从cargo new my-contract开始。我连接了Elrond依赖项,现在货物运行没有抱怨。
现在当我运行erdpy contract build时
FileNotFoundError: Errno 2没有这样的文件或目录:‘/home/bogdan/工作区/sc-from/wasm’
当我查看其他模板时,我看到生成了这个wasm文件夹的内容。这是我的问题的相关提交:https://github.com/bogdan-marian/sc-from-scratch/commit/aa6f912e6bca413a91f18c9de52257390645b139
如何从wasm文件夹生成内容?
发布于 2022-04-04 13:00:13
事实证明,这个问题比我最初想象的要多得多。最后,我创建了一个关于如何从头创建智能契约的完整教程。短版
发布于 2022-01-16 13:44:36
在构建智能合同之前,您尝试过做cargo build吗?
它将安装依赖项,并生成适当的文件夹。如果它仍然没有创建wasm文件夹,那么您是否检查了cargo.toml文件中的依赖项?
你应该在这附近弄点东西:
[package]
name = "router"
version = "0.0.0"
authors = [ "you",]
edition = "2018"
publish = false
[lib]
path = "src/lib.rs"
[features]
wasm-output-mode = [
"elrond-wasm-node",
"token_send/wasm-output-mode",
]
[dependencies.token_send]
path = "../../common/modules/token_send"
[dependencies.elrond-wasm]
version = "0.21"
features = ["derive"]
[dependencies.elrond-wasm-derive]
version = "0.21"
[dependencies.elrond-wasm-node]
version = "0.21"
optional = true
[dev-dependencies.elrond-wasm-debug]
version = "0.21"
[dependencies.pair]
path = "../pair"发布于 2022-01-19 14:24:31
我建议从一个示例项目开始使用一个wasm文件夹,适用于您正在使用的elrond版本。
在较新的版本中,wasm/src/lib.rs的内容将由您应该拥有的元子项目生成。
通常,如果您使用erdpy新定义的模板之一(如描述的这里 ),您的生活会容易得多。
例如
erdpy contract new --template adderhttps://stackoverflow.com/questions/70729133
复制相似问题