javascript - 部署到以太坊 Ropsten 测试网失败
问题描述
我在这里尝试freecodecamp项目: https ://www.freecodecamp.org/news/how-to-make-an-nft/
我被这一步困住了
node ./scripts/deploy.js
但它未能部署到 Ropsten 测试网络。我是 NFT 和以太坊的初学者,我不知道如何调试它。
现在的错误信息是资金不足。但我现在在 Metamask 钱包中获得了 10 多个以太坊。
Error: insufficient funds for intrinsic transaction cost (error={"name":"ProviderError","code":-32000,"_isProviderError":true}, method="sendTransaction", transaction=undefined, code=INSUFFICIENT_FUNDS, version=providers/5.5.0)
我怎样才能知道我需要多少以太坊?我希望它就足够了,但当然不确定。失败的真正原因是什么?
这里是部署脚本:
// ethereum/scripts/deploy.js
async function main() {
const EmotionalShapes = await ethers.getContractFactory("EmotionalShapes");
const emotionalShapes = await EmotionalShapes.deploy();
console.log("EmotionalShapes deployed:", emotionalShapes.address);
}
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error);
process.exit(1);
});
解决方案
推荐阅读
- rust - 构建 rust Rocket api 时出现“root 中没有'Json'”错误
- reactjs - react-i18next:字符串未翻译
- pagination - 十一(11ty)数据分页 - 来自数据的标题
- c - 使用 C 中的预处理器检查三个变量的最大值
- python - 如何按原样保存表格(熊猫)
- ruby - 使用 'Each' 方法在 do 循环中创建一个新数组
- javascript - Datatable JS 中的 API 数据
- php - MySQL 数据库中存储的值错误
- regex - 使用 DF、Grep、Awk 列出卷 | 重击壳
- javascript - Gatsby.js 中的 Polyfills - String.prototype.matchAll