Skip to content

Instantly share code, notes, and snippets.

View Signor1's full-sized avatar

Signor Dev Signor1

View GitHub Profile
@Signor1
Signor1 / IERC20.sol
Created August 9, 2025 17:11
Mainnet Forking
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
interface IERC20 {
function approve(address _spender, uint256 _value) external;
function balanceOf(address who) external view returns (uint256 balance);
}
import { useState } from "react";
import abi from "./abi.json";
import { ethers } from "ethers";
const contractAddress = "0x9D1eb059977D71E1A21BdebD1F700d4A39744A70";
function App() {
const [text, setText] = useState("");
async function requestAccount() {
@Signor1
Signor1 / lib.rs
Created July 20, 2025 22:07
Campaign Marketing
use std::collections::HashMap;
#[derive(PartialEq, Debug)]
pub enum CampaignStatus {
Inactive,
Active,
Completed,
}
#[derive(Debug)]
@Signor1
Signor1 / README.md
Created June 25, 2025 14:34
Implementing ERC20 Permit

React Hooks (JavaScript)

  1. useERC20Permit Hook

For tokens that already inherit ERC20Permit (EIP-2612) Single transaction: No need for separate approve + transferFrom Functions:

generatePermitSignature() - Creates the permit signature depositWithPermit() - Deposits in one transaction

@Signor1
Signor1 / example.md
Last active May 7, 2025 13:02
Proposed Transaction Fee Formula for Strimz

(Example: If N = 10, Fee = $0.30 + ($0.15 × 3.16) ≈ $0.77)


Real-World EVM Example

Assume:

  • Base Fee = $0.30 (covers gas for 1 contract call).
  • Variable Fee = $0.15 (your profit margin).
@Signor1
Signor1 / a.md
Last active April 22, 2025 11:36
BondCraft Launchpad

Bonding Curve Explained
A bonding curve is a mathematical model that defines the price relationship of a token based on its supply. It determines how the token's price increases as more tokens are bought (minting) and decreases when tokens are sold back (burning). This creates a transparent, algorithmic market maker where:

  • Early buyers get lower prices.
  • Later buyers pay progressively higher prices.
  • Liquidity is programmatically managed.

BondCraft’s Bonding Curve

BondCraft uses a linear bonding curve with the formula:

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import {Test} from "forge-std/Test.sol";
import {Deployers} from "@uniswap/v4-core/test/utils/Deployers.sol";
import {LotteryPool} from "../src/LotteryPool.sol";
import {PoolPlayHook} from "../src/PoolPlayHook.sol";
import {PoolPlayRouter} from "../src/PoolPlayRouter.sol";
import {MockERC20} from "./mocks/MockERC20.sol";
import {LinkToken} from "chainlink-brownie-contracts/contracts/src/v0.8/shared/token/ERC677/LinkToken.sol";
// Import the necessary contracts
import "@uniswap/v3-periphery/contracts/interfaces/INonfungiblePositionManager.sol";
import "@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol";
// Declare the contract
contract LiquidityExamples {
// Declare immutable variables
INonfungiblePositionManager public immutable nonfungiblePositionManager;
ISwapRouter public immutable swapRouter;
@Signor1
Signor1 / sample.sol
Last active March 4, 2025 12:12
Just for insight into what it will look like
pragma solidity ^0.8.0;
import "@uniswap/v4-core/contracts/interfaces/pool/IHook.sol";
import "@uniswap/v4-core/contracts/types/FullMath.sol";
interface IUniswapV4Pool {
function swap(address recipient, int256 amount0, int256 amount1, bytes calldata data) external;
function getReserves() external view returns (uint256 reserve0, uint256 reserve1);
}
@Signor1
Signor1 / mintNFTScript.ts
Last active February 15, 2025 12:35
Onchain Interaction on mintNFT
import hre from "hardhat"
// Configuration
const CONTRACT_ADDRESS = "0x05034393f6b1481e3f7e5B93b8d9392016BC2B12";
const QUANTITY = 1;
const REFERRAL_CODE = "";
async function main() {
try {