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
-- Seed data for indexer_metrics_api local development.
-- Usage: make db-reset && make migrate && then paste this into psql
-- ============================================================================
-- Blocks (one per day, spanning 2026-01-20 to 2026-02-08)
-- ============================================================================
INSERT INTO blocks (block_hash, prev_block_hash, height, block_time) VALUES
(decode('0000000000000000000000000000000000000000000000000000000000000001','hex'),
decode('00000000000
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IVRFCoordinator {
function requestRandomNumbers(uint32 numNumbers, uint256 seed) external returns (uint256);
}
contract VRFBenchmark {
IVRFCoordinator public constant coordinator = IVRFCoordinator(0x9d57aB4517ba97349551C876a01a7580B1338909);
// 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