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 bash | |
set -euo pipefail | |
rm -rf ~/.local/{bin/nvim,lib/nvim,share/nvim,share/man/man1/nvim.1,share/icons/hicolor/128x128/apps/nvim.png} | |
xattr -c nvim-macos-arm64.tar.gz | |
tar xzf nvim-macos-arm64.tar.gz --strip-components 1 -C ~/.local/ | |
rm nvim-macos-arm64.tar.gz |
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
code main : 0 -> ! { | |
push0 | |
push0 | |
callf other | |
stop | |
} | |
code other : 2 -> 1 { | |
rjumpi end | |
pop |
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
@frangio: is there a list of all the consistency/security checks abi coder v2 | |
does? e.g. that offsets are within bounds | |
@ekpyron: We're currently lacking exhaustive documentation on it, unfortunately | |
- it came up a few times recently and we want to improve docs around it, | |
though. But as a brief informal summary: Calldata validation involves at least | |
(I may be missing something else myself out of my head) range-checks for | |
values, bounds-checks and size-checks for arrays and bounds checks against | |
overall calldata size. In particular, what's lacking documentation is indeed | |
when precisely it happens. For performance reasons, we don't necessarily |
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
use std::mem::MaybeUninit; | |
pub struct Buffered<I: Iterator, const N: usize> { | |
iter: I, | |
count: usize, | |
next: usize, | |
buf: [MaybeUninit<I::Item>; N], | |
} | |
impl<I: Iterator, const N: usize> Buffered<I, N> { |
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
ef000101000402000100110400200000000003365f5f37365fd10000f93d5f5f3e5f3df3 |
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.28; | |
struct PackedUserOperation { | |
address sender; | |
uint256 nonce; | |
bytes initCode; | |
bytes callData; | |
bytes32 accountGasLimits; | |
uint256 preVerificationGas; |
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.13; | |
import {Test} from "forge-std/Test.sol"; | |
contract SwapTest is Test { | |
event Gasused(uint); | |
event Swap( | |
bytes32 indexed id, |
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 Std.Data.Nat.Lemmas | |
import Std.Tactic.Omega | |
import Std.Tactic.Simpa | |
def fib (n : Nat) := | |
match n with | |
| 0 | 1 => n | |
| n' + 2 => fib (n' + 1) + fib n' | |
def fastfib (n : Nat) := loop n 1 0 |
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
"use strict"; | |
const defaultOptions = { | |
reverse: true, | |
python: false | |
} | |
function merge(sequences) { | |
let result = []; | |
sequences = sequences.map(s => s.slice()); |
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; | |
function isAsciiPrintableShortString(string memory str) pure returns (bool) { | |
unchecked { | |
uint256 b = uint256(bytes32(hex"0101010101010101010101010101010101010101010101010101010101010101")); | |
bytes32 chars = bytes32(bytes(str)); | |
uint256 len = bytes(str).length; |
NewerOlder