- OP Stack Documentation
- Optimism Bedrock Specs, relevant parts are:
- Overview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//! ```cargo | |
//! [dependencies] | |
//! bech32 = "0.9" | |
//! bip32 = "0.5" | |
//! dialoguer = "0.10" | |
//! hex = "0.4" | |
//! k256 = "0.13" | |
//! ripemd = "0.1" | |
//! thiserror = "1" | |
//! ``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python3 | |
import sys | |
import pyperclip | |
def main(): | |
args = sys.argv | |
if len(args) != 2: | |
raise ValueError(f'Invalid argument count {len(args)} expected 2') | |
word = args[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.13; | |
library Iterators { | |
// Function types: | |
// https://docs.soliditylang.org/en/latest/types.html#function-types | |
function map(uint256[] memory input, function (uint256) internal pure returns (uint256) f) | |
internal | |
pure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import cvxpy as cp | |
import itertools | |
# Problem data | |
global_indices = list(range(4)) | |
# 0 = TOKEN-0 | |
# 1 = TOKEN-1 | |
# 2 = TOKEN-2 |
When runing forge test -m testGas --gas-report -vv
, it shows the cost of calling x is 261:
╭──────────────────────────────────┬─────────────────┬─────┬────────┬─────┬─────────╮
│ contracts/Gas.sol:Store contract ┆ ┆ ┆ ┆ ┆ │
╞══════════════════════════════════╪═════════════════╪═════╪════════╪═════╪═════════╡
│ Deployment Cost ┆ Deployment Size ┆ ┆ ┆ ┆ │
├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌┼╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function factorial_Yul_For(uint256 x) public pure returns(uint256){ | |
assembly{ | |
let result := 1 | |
for {} iszero(iszero(x)) { x := sub(x, 1)} { | |
result := mul(result, x) | |
} | |
mstore(0,result) | |
return(0,0x20) | |
} | |
} |
You can use these commands and rules to search for exploitation attempts against log4j RCE vulnerability CVE-2021-44228
This command searches for exploitation attempts in uncompressed files in folder /var/log
and all sub folders
sudo egrep -I -i -r '\$(\{|%7B)jndi:(ldap[s]?|rmi|dns|nis|iiop|corba|nds|http):/[^\n]+' /var/log
Using newer compiler versions and the optimizer gives gas optimizations and additional safety checks for free!
The advantages of versions 0.8.*
over <0.8.0
are:
- Safemath by default from
0.8.0
(can be more gas efficient than some library based safemath). - Low level inliner from
0.8.2
, leads to cheaper runtime gas. Especially relevant when the contract has small functions. For
Moved into a GitHub repository: cheatsheet.sol🔗
NewerOlder