solidity-by-example.github.io:基于 Solidity 的学习示例项目

Solidity By Example

Branch2Tags0
FilesLast commitLast update
1 year ago
5 years ago
3 years ago
1 year ago
9 months ago
3 years ago
7 years ago
3 years ago
3 years ago
7 years ago
1 year ago
3 years ago
7 years ago
1 year ago
5 years ago
2 years ago

solidity-by-example.github.io

Solidity By Example

许可协议

MIT 许可协议

开发

npm i
npm start

生产环境

npm run build
# Preview production
npm run preview
# Deploy
npm run deploy

备忘录

待办事项:代码拆分 / 动态导入

## Deploy ##
# copy files from contracts
npx ts-node scripts/copy.ts
# md to react
npx ts-node --project ./scripts/tsconfig.json scripts/md-to-react.ts src/pages/array

# md to react all pages
find src/pages -type d -not -path "*/__snapshots__" -exec npx ts-node --project ./scripts/tsconfig.json scripts/md-to-react.ts {} \;

# build routes
npx ts-node --project ./scripts/tsconfig.json scripts/build-routes.ts

# build search index
npx ts-node --project ./scripts/tsconfig.json scripts/build-search-index.ts

## Compile Solidity ##
solc-select install 0.8.26
solc-select use 0.8.26

# compile single file
solc src/pages/hello-world/HelloWorld.sol

# find and compile sol
find src/pages/hacks -name "*.sol" solc {} \;
find src/pages -type f -name "*.sol" -exec sh -c 'solc "$0"' {} \;

## Misc ##
# rename files
find . -type f -name "index.test.js" -exec sh -c 'mv "$0" "${0%.test.js}.test.tsx"' {} \;

Introduction

Solidity By Example

Customize your domain
15681243Visit GitHub