Skip to content

Instantly share code, notes, and snippets.

@zengzengzenghuy
zengzengzenghuy / bridged_token.json
Last active July 14, 2025 12:44
Read token limits on Omnibridge Gnosis Chain
{"token":[{
"bridge_type": "omni",
"foreign_address": "0x6810e776880C02933D47DB1b9fc05908e5386b96",
"origin_chain_id": "1",
"address": "0x9C58BAcC331c9aa871AFD802DB6379a98e80CEdb",
"decimals": "18",
"symbol": "GNO"
},
{
"bridge_type": "omni",
import { createChainConfig, createChainForkConfig } from "@lodestar/config";
import { mainnetChainConfig } from "@lodestar/config/networks";
const _targetSlot = 11698097; // slot after Pectra
const rootPath = ["block_roots"];
const forkConfig = createChainForkConfig(createChainConfig(mainnetChainConfig));
const BLOCK_ROOTS_INDEX = forkConfig
.getForkTypes(_targetSlot)
@zengzengzenghuy
zengzengzenghuy / claimDAI.js
Last active April 16, 2025 11:00
Given a xDAI relayTokens or Transfer transaction hash from Gnosis Chain, call executeSignature on Ethereum to claim DAI
import {
createPublicClient,
createWalletClient,
http,
parseAbiItem,
decodeEventLog,
} from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { gnosis, mainnet } from "viem/chains";
@zengzengzenghuy
zengzengzenghuy / Rebalance.js
Last active February 13, 2025 13:47
Rebalance logic for intent solver
import {
createClient,
getClient,
convertViemChainToRelayChain,
MAINNET_RELAY_API,
adaptViemWallet,
} from "@reservoir0x/relay-sdk";
import { createWalletClient, http, parseUnits, publicActions } from "viem";
import { arbitrum, base } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
@zengzengzenghuy
zengzengzenghuy / mockAdapter.js
Last active November 26, 2024 15:24
Mock Adapter for Safe cross chain
import { http, createWalletClient, parseAbiItem, publicActions } from "viem";
import { gnosis, sepolia } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
const main = async () => {
console.log("Start event listener");
// Configuration
const sourceChain = sepolia;
const destinationChain = gnosis;
@zengzengzenghuy
zengzengzenghuy / index.js
Created October 22, 2024 13:39
Mock Oracle for Hashi
import { http, createWalletClient, parseAbiItem, publicActions } from "viem";
import { gnosisChiado, sepolia } from "viem/chains";
import { privateKeyToAccount } from "viem/accounts";
const main = async () => {
console.log("Start event listener");
// Configuration
const sourceChain = sepolia;
const destinationChain = gnosisChiado;
@zengzengzenghuy
zengzengzenghuy / index.ts
Last active February 22, 2025 06:33
Hyperbridge script
require("log-timestamp");
import { HyperClient, MessageStatusWithMeta } from "@polytope-labs/hyperclient";
import { config } from "dotenv";
import {
createPublicClient,
createWalletClient,
decodeFunctionData,
getContract,
http,
pragma solidity 0.5.10;
interface IValidatorSetAuRa {
function addPool(address, address) external returns(uint256);
function initialize(
address,
address,
address,
address[] calldata,
pragma solidity 0.5.10;
interface IValidatorSetAuRa {
function addPool(address, address) external returns(uint256);
function initialize(
address,
address,
address,
address[] calldata,
{
"@context": [
{
"@protected": true,
"@version": 1.1,
"id": "@id",
"type": "@type",
"EmploymentProof": {
"@context": {
"@propagate": true,