Skip to content

Instantly share code, notes, and snippets.

View Aviksaikat's full-sized avatar
💭
I tell people secrets, it makes them like me

Saikat Karmakar Aviksaikat

💭
I tell people secrets, it makes them like me
View GitHub Profile
@Aviksaikat
Aviksaikat / ledger-live-desktop.desktop
Created March 5, 2024 19:05
Ledger Live Desktop App `.desktop` file for linux
[Desktop Entry]
Name=Ledger Live Desktop
Comment=Ledger Live Desktop App
Exec=/home/avik/tools/ledger-live-desktop-2.77.2-linux-x86_64.AppImage
Icon=/home/avik/tools/icons-for-appImage/ledger.webp
Type=Application
Terminal=false
Categories=Development;
@Aviksaikat
Aviksaikat / remove_old_snap.sh
Created January 20, 2024 14:27
remove old versions of snap packages
#!/bin/bash
# Removes old revisions of snaps
# CLOSE ALL SNAPS BEFORE RUNNING THIS
echo "Size before cleanup"
du -h /var/lib/snapd/snaps
set -eu
snap list --all | awk '/disabled/{print $1, $3}' |
while read snapname revision;
from typing import (Tuple) # noqa: F401
import numpy as np
from web3 import Web3
from web3.auto import w3
from eth_account.messages import encode_defunct, _hash_eip191_message
from eth_keys import keys
from eth_keys.backends.native.ecdsa import (
@Aviksaikat
Aviksaikat / ICurvePool.sol
Created November 30, 2023 00:10
Interface for the curve pool contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface ICurvePool {
function get_virtual_price() external returns (uint256 out);
function add_liquidity(uint256[2] calldata amounts, uint256 deadline) external;
function get_dy(int128 i, int128 j, uint256 dx) external returns (uint256 out);
@Aviksaikat
Aviksaikat / ape-config.yaml
Created October 30, 2023 20:52
Interact with custom RPC URL using APE. Ideal for CTFs, local node testing
name: Project-Name
plugins:
- name: solidity
- name: alchemy
- name: foundry
- name: infura
- name: etherscan
ethereum:
default_network: mainnet-fork
mainnet_fork:
@Aviksaikat
Aviksaikat / deploy.sh
Created October 28, 2023 19:12
Deploy script to local nodes for testing challenges of paradigm CTF 2023
#!/bin/bash
ANVIL_RPC_URL="http://127.0.0.1:8545"
# make it background
anvil --fork-url $WEB3_INFURA_RPC --auto-impersonate &
cd challenge/project && forge script --rpc-url "$ANVIL_RPC_URL" script/Deploy.s.sol:Deploy --broadcast --unlocked --sender $(cast az)
@Aviksaikat
Aviksaikat / pyproject.toml
Created August 20, 2023 00:38
poetry config
[tool.poetry]
name = "Flash_loan_arbritage"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
readme = "README.md"
packages = [{include = "Flash_loan_arbritage"}]
[tool.poetry.dependencies]
python = ">=3.10,<3.11"
@Aviksaikat
Aviksaikat / ape-config.yaml
Created August 20, 2023 00:37
uniswap ape-config
name: flash_loan_arbritage
plugins:
- name: solidity
- name: alchemy
- name: foundry
- name: infura
- name: etherscan
ethereum:
default_network: mainnet-fork
mainnet_fork:
@Aviksaikat
Aviksaikat / getEvents.py
Created August 20, 2023 00:36
Get contract events using ape
from ape import project
address = "0xdead"
#contract = project.ContractName.at(address)
contract = project.IUniswapV2Factory.at(address)
for logs in contract.PairCreated:
print(logs)
@Aviksaikat
Aviksaikat / loadInterfacesApe.py
Created August 16, 2023 20:29
Load a contract using interface in ape
# create a interfaces folder inside the contracts folder & put the interfaces inside them
from ape import project
contract = project.contractName.at(contract_address)
# ex
uniswap_v2_router = project.ISwapV2Router02.at(Uniswap_V2_Router_address)