Skip to content

Instantly share code, notes, and snippets.

View dabit3's full-sized avatar
🎡
probably nothing

Nader Dabit dabit3

🎡
probably nothing
View GitHub Profile
@dabit3
dabit3 / eigen-mcp.ts
Created March 19, 2025 22:20
EigenLayer MCP Server Example
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { z } from "zod";
import 'dotenv/config'
const server = new McpServer({
name: "EigenLayer AVS service",
version: "1.0.0",
});
@dabit3
dabit3 / testing-graphql.sh
Created September 17, 2020 15:28
GraphQL requests using CURL
# query
curl \
-X POST \
-H "x-api-key: xxx-xxxx" \
-H "Content-Type: application/json" \
-d '{ "query": "query { listUsers { name } }" }' \
https://app-id.appsync-api.us-east-1.amazonaws.com/graphql
# mutation with variables
curl \
@dabit3
dabit3 / wavs-prompting.md
Last active May 27, 2025 12:37
Prompting a WAVS price oracle AVS for a sports score oracle AVS - https://docs.wavs.xyz/overview

I want to create a similar oracle to the ETH Price Oracle at components/eth-price-oracle, but I want it to use the SportRadar API.

I want to set and reference the SportRadar API key from the Makefile, I do not want to use an .env file..

The request parameters for calling the SportRadar API look like this:

curl --request GET \
     --url 'https://api.sportradar.com/ncaamb/trial/v8/en/games/fa15684d-0966-46e7-a3f8-f1d378692109/boxscore.json?api_key={insert-api-key} \
     --header 'accept: application/json'
@dabit3
dabit3 / marketplace.sol
Last active April 29, 2025 06:06
NFT Marketplace Smart Contract (V2)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
contract NFTMarketplace is ERC721URIStorage {
@dabit3
dabit3 / ai-prompt.md
Last active April 13, 2025 23:17
Verifiable AI Inference AVS prompt using OpenAI Using WAVS - https://docs.wavs.xyz/overview

Create an OpenAI inference component based on the ETH Price Oracle (components/eth-price-oracle). The component should:

  1. Accept input in the format 'PROMPT|OPENAI_API_KEY|SEED' from a Makefile parameter
  2. Use fetch_json and http_request_post_json for API communication
  3. Return and log only choices[0].message.content and choices[0].finish_reason
  4. Include proper input validation and SEED should be an integer
  5. Use the main makefile, do not create a separate one.

Important Implementation Details:

@dabit3
dabit3 / demoday.md
Last active March 21, 2025 17:33
How to Give a Killer Pitch or Hackathon Demo
@dabit3
dabit3 / page.tsx
Created April 4, 2024 14:08
Next.js + Capsule example
'use client'
import Capsule, {
Environment,
CapsuleModal,
} from '@usecapsule/react-sdk';
import { useState, useEffect } from 'react'
const capsule = new Capsule(
Environment.BETA,
@dabit3
dabit3 / subgraph.yml
Created April 23, 2021 16:54
Example subgraph with two contract data sources
specVersion: 0.0.2
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: Token
network: mainnet
source:
address: "0xabEFBc9fD2F806065b4f3C237d4b59D9A97Bcac7"
abi: Token
@dabit3
dabit3 / blogpost.rs
Last active December 30, 2024 09:13
Example blog program - Anchor, Solana, and Rust
use anchor_lang::prelude::*;
declare_id!("Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS");
#[program]
pub mod blog {
use super::*;
pub fn create_blog(ctx: Context<CreateBlog>, name: String, bump: u8) -> Result<()> {
ctx.accounts.blog.name = name;
@dabit3
dabit3 / generateTemplate.ts
Last active December 27, 2024 13:45
Generate a random template
const baseInstructions = `
You do not like NFTs, so don't talk about them. Never use the word Buidl.
You are a hyper-optimist while also being a skeptic.
Everything always lowercase unless it absolutely has to be for the sake of emphasis or similar.
Never use emojis.