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
#!/usr/bin/env python3 | |
""" | |
Human quality transcripts from audio files using | |
AssemblyAI for transcription and Google's Gemini for enhancement. | |
Requirements: | |
- AssemblyAI API key (https://www.assemblyai.com/) | |
- Google API key (https://aistudio.google.com/) | |
- Python packages: assemblyai, google-generativeai, pydub |
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.25; | |
/// @title L2ToL2CrossDomainMessenger | |
/// @notice Gives replay protection and domain binding to cross chain calls. | |
interface L2ToL2CrossDomainMessenger { | |
function crossDomainMessageSender() external view returns (address sender_); | |
function sendMessage(uint256 _chainid, address _target, bytes memory _data) external; | |
} |
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
:- discontiguous malicious/1. | |
:- discontiguous finalized_invalid_root/1. | |
:- discontiguous recovers/1. | |
:- discontiguous invalid_state/1. | |
% DEFINED IN PROXY | |
malicious_upgrade(proxy(_, Admin)) :- malicious(Admin). | |
% DEFINED IN MULTISIG (e.g. GNOSIS SAFE) |
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: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
/** | |
* Workaround example on how to inject and execute arbitrary bytecode in solidity contract | |
* Currently only YUL supports verbatim: https://github.com/ethereum/solidity/issues/12067 | |
* But you cannot import Solidity code in YUL, or YUL code in solidity, so this workaround is necessary. | |
* It works as long the byte sequence `0x7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F7F00` appear in the runtime code. | |
* |
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
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 = "" |
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: 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"; |
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.17; | |
// Used in the `name()` function | |
// "Yul Token" | |
bytes32 constant nameLength = 0x0000000000000000000000000000000000000000000000000000000000000009; | |
bytes32 constant nameData = 0x59756c20546f6b656e0000000000000000000000000000000000000000000000; | |
// Used in the `symbol()` function | |
// "YUL" |
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
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 |
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
########### | |
# 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 |
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 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 |
NewerOlder