$ cast --version
cast 0.2.0 (8f20631 2023-07-10T00:04:29.812703538Z)
$ cast 4bd 0x128acb08
Error:
No signatures found
$ cast si "function swap(address,bool,int256,uint160,bytes) returns (int256,int256)"
0x128acb08
$ cast ups "function swap(address,bool,int256,uint160,bytes) returns (int256,int256)"
Duplicated: Function swap(address,bool,int256,uint160,bytes): 0x128acb08
This file contains hidden or 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 | |
| from sys import argv | |
| from typing import Optional | |
| from dataclasses import dataclass | |
| from datetime import datetime | |
| from bs4 import BeautifulSoup | |
| from urllib import request | |
This file contains hidden or 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; | |
| #[repr(C)] | |
| pub struct Foo { | |
| a: u128, | |
| b: u128, | |
| } | |
| fn main() { | |
| let xs: [Foo; 8] = [ |
This file contains hidden or 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
| curl -H "0x-api-key: 5377b882-05cf-4814-a66d-102a86974012" "https://api.0x.org/swap/v1/quote?sellAmount=1000000000&buyToken=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&sellToken=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" | jq |
This file contains hidden or 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
| SELECT | |
| blockchain, | |
| project, | |
| version, | |
| SUM(amount_usd) AS cumvol | |
| FROM dex.trades | |
| WHERE | |
| block_date > CURRENT_TIMESTAMP - INTERVAL '12' month | |
| GROUP BY | |
| blockchain, |
This file contains hidden or 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 | |
| from sys import argv | |
| N = 5 | |
| def f(xs): | |
| return list(filter(lambda x: x < N, xs)) | |
| def main(): |
This file contains hidden or 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/bash | |
| BUILD_DIR=_site | |
| REMOTE_HOST=example.com | |
| TAG_LEN=7 | |
| TAG=$(git rev-parse HEAD | head -c "$TAG_LEN") | |
| tar -cvf "$TAG".tar "$BUILD_DIR"/* | |
| gzip "$TAG".tar "$TAG".tar.gz |
This file contains hidden or 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
| digraph backfill_sync_fsa { | |
| fontname="Helvetica,Arial,sans-serif" | |
| node [fontname="Helvetica,Arial,sans-serif"] | |
| edge [fontname="Helvetica,Arial,sans-serif"] | |
| node [shape = doublecircle]; Completed Failed NotRequired; | |
| node [shape = circle]; | |
| Syncing -> Syncing [label = "BackFillSync::start"]; | |
| Paused -> Paused [label = "BackFillSync::start, no peers"]; | |
| Failed -> Completed [label = "BackFillSync::start, ResetEpochError::SyncCompleted"]; | |
| Failed -> NotRequired [label = "BackFillSync::start, ResetEpochError::NotRequired"]; |
This file contains hidden or 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.0; | |
| import "src/CoinFlip.sol"; | |
| contract Frontend { | |
| uint256 FACTOR = 57896044618658097711785492504343953926634992332820282019728792003956564819968; | |
| function step(CoinFlip flipper) public returns (uint256) { | |
| require( |
This file contains hidden or 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
| /// This test checks that a block that is valid from both a gossip and consensus perspective but that equivocates **late** is rejected when using `broadcast_validation=consensus_and_equivocation`. | |
| /// | |
| /// This test is unique in that we can't actually test the HTTP API directly, but instead have to hook into the `publish_blocks` code manually. This is in order to handle the late equivocation case. | |
| #[tokio::test(flavor = "multi_thread", worker_threads = 2)] | |
| pub async fn blinded_equivocation_consensus_late_equivocation() { | |
| /* this test targets gossip-level validation */ | |
| let validation_level: Option<BroadcastValidation> = Some(BroadcastValidation::Consensus); | |
| // Validator count needs to be at least 32 or proposer boost gets set to 0 when computing | |
| // `validator_count // 32`. |