This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: GPL-3.0 | |
pragma solidity ^0.8.5; | |
contract School { | |
struct Instructor { | |
string name; | |
uint age; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
// Optimized version of the ballot contract on solidity docs | |
/// @title Voting with delegation. | |
contract Ballot { | |
// This declares a new complex type which will | |
// be used for variables later. | |
// It will represent a single voter. | |
struct Voter { | |
uint weight; // weight is accumulated by delegation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import json | |
from typing import Any, Dict, List, Tuple | |
import aiohttp | |
from bs4 import BeautifulSoup | |
async def main() -> None: | |
async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=False)) as session: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::{fs}; | |
use std::ops::Div; | |
use image::{ImageBuffer, RgbImage, imageops, DynamicImage}; | |
use std::path::PathBuf; | |
#[derive(Debug)] | |
enum FileType { | |
IMAGE, | |
VIDEO | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { clusterApiUrl, Connection, PartiallyDecodedInstruction, PublicKey } from "@solana/web3.js" | |
import { sha256 } from '@noble/hashes/sha256'; | |
import { bs58 } from '@coral-xyz/anchor/dist/cjs/utils/bytes'; | |
import * as borsh from "@coral-xyz/borsh"; | |
import { BorshCoder, EventParser, Idl } from "@coral-xyz/anchor"; | |
import { PumpFunIDL } from './idl'; | |
const parseInstruction = async () => { | |
const signature = "4XQZckrFKjaLHM68kJH7dpSPo2TCfMkwjYhLdcNRu5QdJTjAEehsS5UMaZKDXADD46d8v4XnuyuvLV36rNRTKhn7"; | |
const connection = new Connection(clusterApiUrl("mainnet-beta")); |