Skip to content

Instantly share code, notes, and snippets.

@maurelian
Created January 4, 2022 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maurelian/e2aa4169f42d399e92b22bb96da1cf96 to your computer and use it in GitHub Desktop.
Save maurelian/e2aa4169f42d399e92b22bb96da1cf96 to your computer and use it in GitHub Desktop.

1. How many (non-library) contracts are in the scope?

Just our MerkleTrie contracts. The bulk of it is this Lib_MerkleTrie.sol (https://github.com/ethereum-optimism/optimism/blob/88eb324e8648a1b5edabb8d817d0ccf8631a8bc9/packages/contracts/contracts/libraries/trie/Lib_MerkleTrie.sol). But also this wrapper for it: https://github.com/ethereum-optimism/optimism/blob/88eb324e8648a1b5edabb8d817d0ccf8631a8bc9/packages/contracts/contracts/libraries/trie/Lib_SecureMerkleTrie.sol

And these three libs found here: https://github.com/ethereum-optimism/optimism/blob/88eb324e8648a1b5edabb8d817d0ccf8631a8bc9/packages/contracts/contracts/libraries/utils

import { Lib_BytesUtils } from "./Lib_BytesUtils.sol";
import { Lib_RLPReader } from "./Lib_RLPReader.sol";
import { Lib_RLPWriter } from "./Lib_RLPWriter.sol";

2. Total sLoC in these contracts? 694

       5 text files.
       5 unique files.
       0 files ignored.

github.com/AlDanial/cloc v 1.88  T=0.01 s (778.8 files/s, 199535.9 lines/s)
--------------------------------------------------------------------------------
File                                         blank        comment           code
--------------------------------------------------------------------------------
trie/Lib_MerkleTrie.sol                         79            289            462
utils/Lib_MerkleTree.sol                        29             45            101
utils/Lib_BytesUtils.sol                        24             28             75
trie/Lib_SecureMerkleTrie.sol                    8             53             41
utils/Lib_Bytes32Utils.sol                       5             27             15
--------------------------------------------------------------------------------
SUM:                                           145            442            694
--------------------------------------------------------------------------------```


**3. How many library dependencies?**

Just the internal ones above. 

**4. How many external calls?**

None.

**5. Does it use an oracle?**

no

**6. Does the token conform to the ERC20 standard?**

N/A

**7. Is there any novel or unique curve logic or mathematical models?**

No, but it's a complex data structure.

**8. Do it use a timelock function?**
**9. Is it an NFT?**
**10. Does it have an AMM?**
**10a. If yes, is it a univ2 fork?**
**10b. If yes, does it add features or customization?**

No to all of the above.

**11. Does it use rollups?**
**12. Is it multichain?**
**13. Does it use a sidechain?**
**13a. If yes, is the sidechain evm-compatible?**

It's in a rollup, but it runs on the EVM (Mainnet).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment