프로젝트
GitHub에서 보기
RareSkills/gas-puzzles
소개
가스 최적화를 연습하기 위한 스마트 계약 모음입니다. RareSkills.io와 Udemy Gas Optimization Course의 실습 과제로 사용됩니다.
학습 및 교육측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- -1
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalRareSkills Gas Puzzles
If you want to learn about gas optimization, take the Udemy gas optimization course!
Puzzles that are ready for you
- Distribute (hard)
- Array Sum (easy)
- Mint150 (hard)
- ERC165 (low level programming required)
- Array Sort (medium)
- Security101 (easy/medium)
- Escrow
- EscrowV2
- Mint
- Presale
- Vote (easy)
- Require (easy)
- Staking
Contributors
DO NOT COMMIT SOLUTIONS, BE SURE TO PUT ANSWERS IN contracts/contracts_optimized to ensure they fall into the .gitignore
Players
Your goal is to optimize the contracts such that they reach the target efficiency.
Rules
- you may not change the optimizer level
- you may not change the solidity version
- you may refactor functionality as long as you don't break the business logic
- you may make reasonable assumptions about what variable sizes are necessary to get things done
- you may remove unnecessary or redundant logic (some have been intentionally added)
- because making functions
payableis a controversial optimization, you do not need to make functionspayableto reach the gas target unless the function needs to be payable to fulfill its business logic
Testing
As mentioned above, optimized contracts should be created in their own sub-folder to prevent committing them publicly.
The file structure should look similar to this:
- GasPuzzles
|_
contracts
|_
contracts_optimized
| |_
| ArraySum.sol
| Distribute.sol
| ..
| ...
|
ArraySum.sol
Distribute.sol
..
...
Within the contracts that are optimized be sure to follow the following naming convention to ensure tests run smoothly:
contract OptimizedArraySum {
...
contract OptimizedDistribute {
...
npx hardhat test
npx hardhat test test/ArraySum
npx prettier --write *
관련 프로젝트 살펴보기
불러오는 중…