storing [ 10, 11, 12, 13, 14, 15, 16, 17, 18 ]
:
...
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:
0.8.0
(can be more gas efficient than some
library based safemath).0.8.2
, leads to cheaper runtime gas.
Especially relevant when the contract has small functions. For// UNTESTED! | |
object "BribeContract" { | |
code { | |
let size := datasize("BribeRuntime") | |
codecopy(0, dataoffset("BribeRuntime"), size) | |
return(0, size) | |
} | |
object "BribeRuntime" { | |
code { | |
// Bribe by sending ETH. To try and claim, send a tx without ETH. Assumes that a tx with |
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.13; | |
library InsertionSort { | |
function sort(uint256[] memory list) internal pure { | |
// Algorithm: | |
// | |
// for i = 2 to n do | |
// for j = 1 to i − 1 do // NOTE: we init do an extra sub instead of <= | |
// if A[i] < A[j] then |
########### | |
# Imports # | |
########### | |
# the RPCs file should include RPC URLs and Etherscan API Keys for relevant networks | |
# (in a separate file so they don't get committed) | |
source "$(dirname "$0")/rpcs.sh" | |
# any useful addresses for various networks for easy reference | |
source "$(dirname "$0")/addresses.sh" | |
# any useful functions and definitions for interacting with Seaport |
coverage_report: | |
name: Generate coverage report | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Foundry | |
uses: onbjerg/foundry-toolchain@v1 | |
with: | |
version: nightly |
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.17; | |
// Used in the `name()` function | |
// "Yul Token" | |
bytes32 constant nameLength = 0x0000000000000000000000000000000000000000000000000000000000000009; | |
bytes32 constant nameData = 0x59756c20546f6b656e0000000000000000000000000000000000000000000000; | |
// Used in the `symbol()` function | |
// "YUL" |
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity ^0.8.15; | |
import "forge-std/Script.sol"; | |
// L1 | |
import { L1CrossDomainMessenger } from "../L1/L1CrossDomainMessenger.sol"; | |
import { L1ERC721Bridge } from "../L1/L1ERC721Bridge.sol"; | |
import { L1StandardBridge } from "../L1/L1StandardBridge.sol"; | |
import { L2OutputOracle } from "../L1/L2OutputOracle.sol"; |
from slither import Slither | |
from slither.slithir.operations import InternalCall, SolidityCall | |
from slither.core.expressions.super_call_expression import SuperCallExpression | |
sl = Slither("MyContract.sol") | |
c = sl.get_contract_from_name("MyContract")[0] | |
def get_super_calls(x): | |
super_call_content = "" |