百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
E

ethers-simple-storage-fcc

> 编程语言
开源

更新: 请前往 Cyfrin Updraft ℹ️ 重要提示: 此仓库不再维护;我们邀请所有学习 Solidity 的人前往 Cyfrin Updraft 学习。

98 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

更新: 请前往 Cyfrin Updraft ℹ️ 重要提示: 此仓库不再维护;我们邀请所有学习 Solidity 的人前往 Cyfrin Updraft 学习。

Update: Head to Cyfrin Updraft

ℹ️ Important: This repo is no longer maintained; we invite all people learning Solidity to head to Cyfrin Updraft! The 100% free #1 smart contract education platform on earth. Developed with love by Patrick & Cyfrin Note: You'll notice in our package.json we are using "solc": "0.8.7-fixed". Usually, you'll just be able to do "solc": "0.8.7" to get a specific version, but there was a bit of an issue with that one... You'll find out why we use 0.8.7

Typescript

If you like typescript, run git checkout typescript then run yarn

Usage

  1. Run your ganache local chain, by hitting quickstart on your ganache application

Save the workspace. This way, next time you open ganache you can start the workspace you've created, otherwise you'll have to redo all the steps below.

  1. Copy the RPC SERVER sting in your ganache CLI, and place it into your .env file similar to what's in .env.example.

.env Example:

RPC_URL=http://0.0.0.0:8545
  1. Hit the key on one of the accounts, and copy the key you see and place it into your .env file, similar to what you see in .env.example.

.env Example:

PRIVATE_KEY=11ee3108a03081fe260ecdc106554d09d9d1209bcafd46942b10e02943effc4a

  1. Compile your code

Run

bash
yarn compile

You'll see files SimpleStorage_sol_SimpleStorage.abi and SimpleStorage_sol_SimpleStorage.bin be created.

  1. Run your application
bash
node deploy.js

For WSL users

  1. Run
bash
yarn add ganache
  1. Change Server settings in Ganache

Settings > Server > Host Name

Change Host Name to vEthernet (WSL)

  1. Run your application
bash
node deploy.js

Deploying to a testnet

Make sure you have a metamask or other wallet, and export the private key.

IMPORTANT

USE A METAMASK THAT DOESNT HAVE ANY REAL FUNDS IN IT. Just in case you accidentally push your private key to a public place. I highly recommend you use a different metamask or wallet when developing.

  1. Export your private key and place it in your .env file, as done above.

  2. Go to Alchemy and create a new project on the testnet of choice (ie, Sepolia)

  3. Grab your URL associated with the testnet, and place it into your .env file.

  4. Make sure you have testnet ETH in your account. You can get some here. You should get testnet ETH for the same testnet that you made a project in Alchemy (ie, Sepolia)

  5. Run

bash
node deploy.js

Troubleshooting: Ethers 6.X.X instability

javascript
const provider = new ethers.providers.JsonRpcProvider(process.env.RPC_URL)
                                      ^

TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider')

If you are experiencing issues with the latest version of Ethers, ethers ^6.0.2, try

javascript
const provider = new ethers.JsonRpcProvider(process.env.RPC_URL)

as providers were migrated to ethers.* in version 6 (previously ethers.providers.*). reference: https://docs.ethers.org/v6/migrating/#migrate-providers

Or you can easily solve the problem by downgrading to a previous version of Ethers, such as ethers 5.7.2.

To downgrade to ethers 5.7.2, run either of the following commands on your command line interface, depending on your package manager:

For npm:

bash
npm install [email protected]

For yarn:

bash
yarn add [email protected]

Thank you!

If you appreciated this, feel free to follow me or donate!

ETH/Polygon/Avalanche/etc Address: 0x9680201d9c93d65a3603d2088d125e955c73BD65

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

JavaScript

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言