Skip to content

Instantly share code, notes, and snippets.

View Turupawn's full-sized avatar
🇭🇳
Karaoke veteran

Ahmed Castro Turupawn

🇭🇳
Karaoke veteran
View GitHub Profile
@Turupawn
Turupawn / 01_SimpleERC20.sol
Created October 17, 2025 21:05
Scroll DeFi Sepolia 2025 Workshop
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.27;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
contract MyToken is ERC20 {
constructor() ERC20("My Simple ERC20", "MS") {
_mint(msg.sender, 21_000_000);
}
@Turupawn
Turupawn / before the great disaster.sol
Created September 16, 2025 18:43
before the great disaster
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {GachaToken} from "./GachaToken.sol";
contract TwoPartyWarGame is Ownable, Pausable {
enum State { NotStarted, Committed, HashPosted, Revealed, Forfeited }
@Turupawn
Turupawn / before the great disaster.sol
Created September 16, 2025 18:23
before the great disaster
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {Pausable} from "@openzeppelin/contracts/utils/Pausable.sol";
import {GachaToken} from "./GachaToken.sol";
contract TwoPartyWarGame is Ownable, Pausable {
enum State { NotStarted, Committed, HashPosted, Revealed, Forfeited }
@Turupawn
Turupawn / solidity.jam
Created August 30, 2025 14:05
solidity jam
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract Test {
uint amountCount;
mapping (address org => uint amount) amountCountOrg;
function deposit(uint amount, address org) public payable {
require(msg.value >= 0.0001 ether, "");
amountCountOrg[org] += msg.value;
@Turupawn
Turupawn / pimlico.sol
Created August 7, 2025 16:38
pimlico erc4337 bundler on scroll
import 'dotenv/config'
import { createPublicClient, http } from 'viem'
import { scrollSepolia } from 'viem/chains'
import { toSimpleSmartAccount } from 'permissionless/accounts'
import { createSmartAccountClient } from 'permissionless'
import { createPimlicoClient } from 'permissionless/clients/pimlico'
import { privateKeyToAccount } from 'viem/accounts'
async function main() {
const apiKey = process.env.PIMLICO_API_KEY!
irenee@fedora:~/Projects/borrame/testi$ cat Cargo.toml
[package]
name = "testi"
version = "0.1.0"
edition = "2024"
[dependencies]
ghost-crab = "0.10.1"
irenee@fedora:~/Projects/borrame/testi$ cargo build
Compiling zstd-sys v2.0.15+zstd.1.5.7
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
// IERC20 interface needed to interact with USDC and WETH
interface IERC20 {
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
}
@Turupawn
Turupawn / failed.md
Created June 16, 2025 21:38
failed sushi test

Swap Tokens on Sushi (Uniswap V2 Fork)

SushiSwap is a popular Uniswap V2 fork that allows for simple token swaps using the ISushiRouter interface. Below is an example of swapping an ERC20 token for ETH on Scroll Mainnet.

Learn more at UniV2 Docs.

        _approve(address(this), address(router), amountToSwap);
        router.swapExactTokensForETHSupportingFeeOnTransferTokens(
            amountToSwap,
@Turupawn
Turupawn / failed.md
Created June 14, 2025 16:38
failed noir zk tutorial

import Aside from "../../../../../components/Aside.astro" import ClickToZoom from "../../../../../components/ClickToZoom.astro" import ToggleElement from "../../../../../components/ToggleElement.astro" import paymentDApp from "../../../../../assets/images/developers/stablecoin-payments-tutorial/payment-dapp.png" import nftRecipt from "../../../../../assets/images/developers/stablecoin-payments-tutorial/nft-recipt.png"

123

import { useAccount, useConnect, useDisconnect, useWriteContract, useConfig } from 'wagmi'
import { parseEther } from 'viem'
import { createPublicClient, http } from 'viem'
import { scrollSepolia } from 'viem/chains'
import { useEffect, useState } from 'react'
import { waitForTransactionReceipt } from '@wagmi/core'
export const publicClient = createPublicClient({
chain: scrollSepolia,
transport: http()