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
// TODO: how include from different files?
extern {
// TODO: is it possible to use the same name for different functions?
fn usize_as_u256(_ value: usize) -> u256
fn u8_as_u256(_ value: u8) -> u256
fn u256_as_usize(_ value: u256) -> usize
fn todo() -> !
}
use ingot::evm
// TODO: how include from different files?
extern {
// TODO: is it possible to use the same name for different functions?
fn usize_as_u256(_ value: usize) -> u256
fn u8_as_u256(_ value: u8) -> u256
fn u256_as_usize(_ value: u256) -> usize
fn todo() -> !
}
// We'll use the official node-telegram-bot-api library to interact with the Telegram API and ethers to verify the signature
const TelegramBot = require("node-telegram-bot-api");
const { ethers } = require("ethers");
require("dotenv").config();
const express = require("express");
const cors = require("cors");
const bot = new TelegramBot(process.env.BOT_TOKEN, { polling: true });
const CHAIN_ID = process.env.CHAIN_ID;
const WEB_DAPP_URL = process.env.WEB_DAPP_URL;
@Turupawn
Turupawn / fe_jam.fe
Created March 4, 2025 17:46
fe jam 4 marzo
mod std {
pub mod evm {
pub type Address = u256
pub struct Wei { value: usize }
pub struct Ptr { pub location: usize }
pub struct Buf { pub offset: Ptr, pub len: usize }
const HASH_SCRATCH_OFFSET: u256 = 0x0
extern {
pub fn __call(gas: Wei, address: Address, value: Wei, args: Buf, ret: Buf)
pub fn __mstore(_ loc: u256, _ data: u256)
@Turupawn
Turupawn / fe_jam.fe
Created March 4, 2025 17:45
fe_jam.fe marzo 4
mod std {
pub mod evm {
pub type Address = u256
pub struct Wei { value: usize }
pub struct Ptr { pub location: usize }
pub struct Buf { pub offset: Ptr, pub len: usize }
const HASH_SCRATCH_OFFSET: u256 = 0x0
extern {
pub fn __call(gas: Wei, address: Address, value: Wei, args: Buf, ret: Buf)
pub fn __mstore(_ loc: u256, _ data: u256)
@Turupawn
Turupawn / fe_jam.fe
Created February 26, 2025 14:35
Fe jam 25 feb 2025
// std/evm.fe
mod std {
pub mod evm {
pub type Address = u256
pub struct Wei { value: usize }
pub struct Ptr { pub location: usize }
pub struct Buf { pub offset: Ptr, pub len: usize }
const HASH_SCRATCH_OFFSET: u256 = 0x0
extern {
pub fn __call(gas: Wei, address: Address, value: Wei, args: Buf, ret: Buf)
@Turupawn
Turupawn / run.sh
Last active April 24, 2025 23:24
AI subtitles
## Install
sudo dnf install ffmpeg
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install ffmpeg
sudo dnf install python3 python3-pip
pip install openai-whisper
@Turupawn
Turupawn / eas.sol
Created November 6, 2024 09:02
Eas test
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;
import { IEAS, AttestationRequest, AttestationRequestData, RevocationRequest, RevocationRequestData } from "@ethereum-attestation-service/eas-contracts/contracts/IEAS.sol";
import { NO_EXPIRATION_TIME, EMPTY_UID } from "@ethereum-attestation-service/eas-contracts/contracts/Common.sol";
contract SwapAttestation
{
address easAddress = 0xaEF4103A04090071165F78D45D83A0C0782c2B2a;
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
[GIN-debug] GET /debug/pprof/ --> github.com/gin-contrib/pprof.RouteRegister.WrapF.func1 (2 handlers)
[GIN-debug] GET /debug/pprof/cmdline --> github.com/gin-contrib/pprof.RouteRegister.WrapF.func2 (2 handlers)
[GIN-debug] GET /debug/pprof/profile --> github.com/gin-contrib/pprof.RouteRegister.WrapF.func3 (2 handlers)
[GIN-debug] POST /debug/pprof/symbol --> github.com/gin-contrib/pprof.RouteRegister.WrapF.func4 (2 handlers)
[GIN-debug] GET /debug/pprof/symbol --> github.com/gin-contrib/pprof.RouteRegister.WrapF.func5 (2 handlers)
[GIN-debug] GET /debug/pprof/trace --> github.com/gin-contrib/pprof.RouteRegister.WrapF.func6 (2 handlers)
@Turupawn
Turupawn / 01_Array.sol
Last active October 9, 2024 16:45
L1Sload Advanced structures
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract L1ArrayDemo {
uint[5] myArray;
constructor() {
myArray[0] = 10;
myArray[1] = 20;
myArray[2] = 30;