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
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.24;
/* Autogenerated file. Do not edit manually. */
// Import store internals
import { IStore } from "@latticexyz/store/src/IStore.sol";
import { StoreSwitch } from "@latticexyz/store/src/StoreSwitch.sol";
import { StoreCore } from "@latticexyz/store/src/StoreCore.sol";
import { Bytes } from "@latticexyz/store/src/Bytes.sol";
$ forge init hello
$ cd hello
$ forge build
$ forge script CounterScript --rpc-url https://testnet.riselabs.xyz --broadcast --private-key 0x123123 --via-ir
$ forge verify-contract --rpc-url https://testnet.riselabs.xyz --verifier blockscout --verifier-url https://explorer.testnet.riselabs.xyz/api/ --via-ir 0x2F47eFFda91FEF070Df725704F8546DF3F3356De src/Counter.sol:Counter
Start verifying contract `0x2F47eFFda91FEF070Df725704F8546DF3F3356De` deployed on 11155931
Submitting verification for [src/Counter.sol:Counter] 0x2F47eFFda91FEF070Df725704F8546DF3F3356De.
Submitted contract for verification:
Response: `OK`
@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,