Skip to content

Instantly share code, notes, and snippets.

View dalechyn's full-sized avatar
🏠
Working from home

Vladyslav Dalechyn dalechyn

🏠
Working from home
View GitHub Profile
@dalechyn
dalechyn / anvil.ts
Last active August 13, 2024 14:10
Start an anvil and otterscan with bun
import { createAnvil } from "@viem/anvil";
// import fs from "fs";
import "dotenv/config";
import { $ } from "bun";
import path from "path";
import z from "zod";
import { fromError } from "zod-validation-error";
//////////////////////
@dalechyn
dalechyn / frog-base.d.ts
Last active April 18, 2024 17:55
frog-base.js
import { Hono } from 'hono';
import type { HonoOptions } from 'hono/hono-base';
import type { Schema } from 'hono/types';
import type { Env } from './types/env.js';
import type { FrameImageAspectRatio, FrameResponse, ImageOptions } from './types/frame.js';
import type { Hub } from './types/hub.js';
import type { HandlerInterface, MiddlewareHandlerInterface } from './types/routes.js';
import type { Vars } from './ui/vars.js';
export type FrogConstructorParameters<env extends Env = Env, basePath extends string = '/', _state = env['State']> = Pick<FrameResponse, 'browserLocation'> & {
/**
@dalechyn
dalechyn / alligator-roast.md
Last active February 17, 2023 12:05
Alligator Roast 🔥

Note Thanks for the chance to work on something interesting!

Source: https://github.com/w1nt3r-eth/liquid-delegator

🦭 Overall architecture:

  • Test Coverage is unknown as foundry coverage fails with the next error:
    Compiler run failed
    

CompilerError: Stack too deep when compiling inline assembly: Variable value0 is 1 slot(s) too deep inside the stack.

@dalechyn
dalechyn / docs.yml
Last active February 14, 2023 11:55
Everything you need for your Foundry repository to generate sdk package with @wagmi/cli + docs as the bonus
# Workflow for deploying the `forge doc` site to GitHub Pages
name: Docs
on:
# Runs on pushes targeting the default branch
push:
# In the GitHub Actions Marketplace template, we can use $default-branch
# However, $default-branch functions in templates but not in workflows
# branches: [ $default-branch ]
@dalechyn
dalechyn / Sausage.sol
Last active February 9, 2023 16:23
Sausage ABI. Is the input function or bytes24?
// SPDX-License-Identifier: Unlicensed
pragma solidity 0.8.18;
contract Sausage {
function testxxx(
function(
function(
function(
function(
@dalechyn
dalechyn / foundry-coverage-report.md
Last active November 19, 2022 11:58
Readable Foundry Coverage Report

Make sure lcov is installed with foundry.

$ forge coverage --report lcov
$ genhtml lcov.info -o report --branch-coverage 
$ open report/index.html
@dalechyn
dalechyn / spearbit-writing-exercise-report.md
Created August 28, 2022 21:13
Writing Exercise Spearbit

Dangerous delegatecall in Implementation contract

Severity: High

SWC-112 & SWC-106 vulnerable.

Context: Implementation.sol#L18

delegatecallContract function should be restricted with a whitelist, or access-control.

@dalechyn
dalechyn / keybase.md
Created September 14, 2019 15:50
keybase.md

Keybase proof

I hereby claim:

  • I am h0tw4t3r on github.
  • I am vladik2738 (https://keybase.io/vladik2738) on keybase.
  • I have a public key ASB7kMIlOmIP6WlLUKxgLLqkZ_zEThCPxTE2Aku49PyEcAo

To claim this, I am signing this object: