-
High - 100xp
-
Medium - 20xp
-
Low - 2xp
-
Starts: January 25, 2024 Noon UTC
-
Ends: February 02, 2024 Noon UTC
- nSLOC: 46
- Complexity Score: 276
This codebase was inspired by the solady, obront.eth, and solmate codebases. Huge thanks to karma for the help on FV with Halmos.... which may be a hint.
We will teach how to do Formal Verification and assembly in the upcoming Cyfrin Updraft course.
Welcome to the future of web3! We, the math MASTERS are titans of the algebraic and gas efficient. We have created a small library called MathMasters
where we have the following functions/terms defined:
WAD
: fixed point decimal with 18 decimals (for basic quantities, e.g. balances)mulWad
: Equivalent to(x * y) / WAD
rounded down.mulWadUp
: Equivalent to(x * y) / WAD
rounded up.sqrt
: Returns the square root ofx
.
We hope that people will use our hype optimized functions to make better codebases.
We are especially concerned with any function doing something "weird" at the EVM/assembly level. We would consider any of the following a valid LOW severity rating:
- Incorrect storage slot packaging
- Overriding the solidity free memory pointer
- Any out of gas errors
- Incorrect use of function selectors
We expect any solidity project using version ^0.8.3
or above should be able to use our codebase. If not, that should be considered a vulnerability as well.
This is a great chance to test out your fuzzing and Formal Verification skills.
- git
- You'll know you did it right if you can run
git --version
and you see a response likegit version x.x.x
- You'll know you did it right if you can run
- foundry
- You'll know you did it right if you can run
forge --version
and you see a response likeforge 0.2.0 (816e00b 2023-03-16T00:05:26.396218Z)
- You'll know you did it right if you can run
- Halmos
- To know you've installed it run
halmos --version
and you should see something like `halmos 0.1.0 (816e00b 2023-03-16T00:05:26.396218Z)
- To know you've installed it run
git clone https://github.com/Cyfrin/2024-01-math-master
cd 2024-01-math-master
make
forge test
forge coverage
and for coverage based testing:
forge coverage --report debug
- Commit Hash:
- In Scope: (For this contest, just use the main branch)
Hash:
- Solc Version:
0.8.3 < 0.9.0
- Chain(s) to deploy contract to:
- Ethereum
- Tokens:
- None
None
None