Solidity By Example
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
t4sk 92b75b6913
deploy
1 day ago
contracts transient storage 1 day ago
notes sol 0.8 notes 3 years ago
public cra to vite 11 months ago
scripts build 4 weeks ago
src deploy 1 day ago
.env.sample cra to vite 11 months ago
.gitattributes git attributes 5 years ago
.gitignore cra to vite 11 months ago
.prettierrc prettier 6 months ago
LICENSE home 5 years ago
README.md readme 3 weeks ago
index.html index 6 months ago
manifest.json publish 5 years ago
package.json update npm 4 weeks ago
tsconfig.json update npm 3 years ago
vite.config.ts cra to vite 11 months ago

README.md

solidity-by-example.github.io

Solidity By Example

License

MIT License

Development

npm i
npm start

Production

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

Memo

TODO: code split / dynamic imports

## 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.20
solc-select use 0.8.20

# 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"' {} \;

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