Skip to content

Instantly share code, notes, and snippets.

View Signor1's full-sized avatar
🎯
Focusing

Signor Dev Signor1

🎯
Focusing
View GitHub Profile
@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 {
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
/**
* @title Ballot
* @dev Implements voting process along with vote delegation
*/
contract Ballot {
struct Voter {
@Signor1
Signor1 / DegenToken.sol
Created October 24, 2024 21:38
DegenToken
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
contract DegenToken {
//the state variables
string public name = "Degen Gaming Token";
string public symbol = "DEGEN";
uint256 public totalSupply;
uint8 public decimals = 18;
@Signor1
Signor1 / MultiSig.sol
Created October 24, 2024 19:45
Solidity MultiSig smart contract
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
contract MultiSig {
address[] public signers;
uint256 quorum;
uint256 txCount;
address owner;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import "./VestLib.sol";
import {IERC20} from "./IERC20.sol";
contract TokenVesting {
using VestingLib for VestingLib.VestingSchedule;
mapping(address => VestingLib.VestingSchedule) private beneficiaries;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import "./IERC20.sol";
contract StakeXFI{
IERC20 public XFIContract;
IERC20 public MPXContract;
address internal owner;