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
FROM node:20-alpine AS base
# Install pnpm with corepack
RUN corepack enable && corepack prepare pnpm@latest --activate
# Enable `pnpm add --global` on Alpine Linux by setting
# home location environment variable to a location already in $PATH
# https://github.com/pnpm/pnpm/issues/784#issuecomment-1518582235
ENV PNPM_HOME=/usr/local/bin
# Add a global package
RUN pnpm add --global @upleveled/preflight@latest
RUN pnpm -g add turbo
@dalechyn
dalechyn / running-dockerized-subgraph.md
Created May 17, 2024 18:43
running-dockerized-subgraph.md

This readme describes how to run Abstract API via docker and how to pass custom network configurations.

Firstly, prepare a set of the networks you're planning to pass to the API instance. Such should conform the schema {[chainId]:{ rpc: string; versionControl: string }}.

In chainId parameter you must specify the chain id which will hold the following properties:

In rpc parameter you must specify network RPC URL. In versionControl parameter you must specify the address of Version Control contract deployed in that network.

I.e: { "phoenix-1": {"rpc":"https://rpc-proxy.abstract-os.workers.dev/phoenix-1/rpc","versionControl":"terra1hstp8gfjlg2reet90mgada3h8n9jf2d7tnd9r554h0d0q95lgq5q2fhp8v"}}

@dalechyn
dalechyn / anvil.ts
Last active May 14, 2024 19:31
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: