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
| class LMStudioResponse(BaseModel): | |
| """Model for LM Studio response""" | |
| content: str = Field(..., description="The content of the response") | |
| class LMStudioAgent: | |
| model:lms.LLM = None | |
| def __init__( | |
| self, |
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
| from typing import Sequence | |
| import requests | |
| import os | |
| from pydantic import BaseModel, Field, ValidationError | |
| import json | |
| # load the environment file with py-dotenv | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| from openai import OpenAI |
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
| const SwapFormEnabled = ({config, signer}) => { | |
| // Contract addresses | |
| const DAI_ADDRESS = config.DAI_ADDRESS; | |
| const POOKA_ADDRESS = config.POOKA_ADDRESS; | |
| const SWAP_ROUTER_ADDRESS = config.UNIVERSAL_ROUTER_V2_ADDRESS; | |
| const POOKA_HOOK_ADDRESS = config.POOKA_HOOK_ADDRESS; | |
| const STATE_VIEW_ADDRESS = config.STATE_VIEW_ADDRESS; | |
| const [swapFrom, setSwapFrom] = useState(""); |
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
| { | |
| "DAI_ADDRESS":"0xFF34B3d4Aee8ddCd6F9AFFFB6Fe49bD371b8a357", | |
| "POOKA_ADDRESS":"0xAb01f22e992D01f5453057dA2F73833221E57848", | |
| "POOKA_HOOK_ADDRESS":"0x6a5ab2649B3606452be27A06b541Bd2A09Dc8080", | |
| "UNISWAP_V4_POOL_MANAGER":"0xE03A1074c86CFeDd5C142C4F04F1a1536e203543", | |
| "UNISWAP_V4_SWAP_ROUTER":"0x3bFA4769FB09eefC5a80d6E87c3B9C650f7Ae48E", | |
| "UNIVERSAL_ROUTER_V2_ADDRESS":"0x3a9d48ab9751398bbfa63ad67599bb04e4bdf98b" | |
| } |
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.26; | |
| // lib/v4-core/src/interfaces/IHooks.sol | |
| import {IHooks} from "v4-core/interfaces/IHooks.sol"; | |
| import {Hooks} from "v4-core/libraries/Hooks.sol"; | |
| import {BaseHook} from "v4-periphery/base/hooks/BaseHook.sol"; | |
| import {BalanceDelta} from "v4-core/types/BalanceDelta.sol"; | |
| import {BeforeSwapDelta, BeforeSwapDeltaLibrary} from "v4-core/types/BeforeSwapDelta.sol"; | |
| import {TickMath} from "v4-core/libraries/TickMath.sol"; |
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: GPL-2.0-or-later | |
| pragma solidity = 0.7.6; | |
| pragma abicoder v2; | |
| // import '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol'; | |
| import '@uniswap/swap-router-contracts/contracts/interfaces/ISwapRouter02.sol'; | |
| interface IERC20 { | |
| function balanceOf(address account) external view returns (uint256); |
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
| async function estimateTransactionCost(provider, contract) { | |
| // Set up provider and contract | |
| // const provider = new ethers.providers.InfuraProvider("sepolia", "YOUR_INFURA_PROJECT_ID"); | |
| // const wallet = new ethers.Wallet("YOUR_PRIVATE_KEY", provider); | |
| // const contract = new ethers.Contract("CONTRACT_ADDRESS", contractAbi, wallet); | |
| try { | |
| // Estimate gas for the function | |
| //const gasLimitMax = ethers.utils.parseUnits("10", "gwei"); | |
| const gasLimitMax = 500000; |
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
| /** | |
| RPC_ENDPOINT_ETHERS = "https://mainnet.infura.io/v3/<secret>" | |
| BUILDER_RPC = "https://rpc.titanbuilder.xyz" | |
| ETH_NETWORK = "mainnet" | |
| */ | |
| const ethers = require('ethers'); | |
| const { | |
| FlashbotsBundleProvider, | |
| } = require("@flashbots/ethers-provider-bundle"); |
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
| const ethers = require('ethers'); | |
| const { | |
| FlashbotsBundleProvider, | |
| } = require("@flashbots/ethers-provider-bundle"); | |
| const dotenv = require("dotenv"); | |
| dotenv.config({ path: './config/.env.fbbundle.sepolia' }); | |
| const { | |
| ETH_NETWORK, |
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
| update_PS1 () { | |
| VENV_PROMPT="(${VIRTUAL_ENV##*/})" | |
| if [ $VENV_PROMPT == "()" ]; then | |
| VENV_PROMPT="" | |
| fi | |
| PS1="\[$(tput bold)\]\[\033[38;5;214m\]\u\[$(tput sgr0)\]\[$(tput sgr0)\]\[\033[38;5;76m\]@\[$(tput sgr0)\]\[\033[38;5;82m\]\h\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]\[\033[38;5;226m\]\W\[$(tput sgr0)\]\[\033[38;5;15m\]:\[$(tput sgr0)\]" | |
| PS1="$PS1$(__git_ps1 "\[\e[32m\][%s]\[\e[0m\]") $VENV_PROMPT $ " | |
| } | |
| shopt -u promptvars |
NewerOlder