Skip to content

Instantly share code, notes, and snippets.

View omgbbqhaxx's full-sized avatar
🪐
Universal

Yasin Aktimur omgbbqhaxx

🪐
Universal
View GitHub Profile
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
/**
/////////////////////////////////
// //
// //
// //
// ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓ //
@omgbbqhaxx
omgbbqhaxx / SwordNFT.sol
Created August 8, 2023 17:58 — forked from Chmarusso/SwordNFT.sol
Learn how to create truly immutable smart contracts (Ethereum / EVM) that can hold all metadata and SVG images on-chain
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
library Base64 {
string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000"
@omgbbqhaxx
omgbbqhaxx / quantum.rs
Last active April 1, 2023 17:31
simple quantum hademard gates
extern crate q1tsim;
use q1tsim::{circuit, gates};
fn main() {
// The number of times this circuit is evaluated
let nr_runs = 8192;
// Create a quantum circuit with 3 quantum bits and 3 classical (measurement)
// bits. The circuit starts by default with all quantum bits in the |0⟩ state,
@omgbbqhaxx
omgbbqhaxx / x.sol
Last active February 1, 2023 13:20
import * as anchor from "@project-serum/anchor";
import { Program } from "@project-serum/anchor";
import { Airdrop } from "../target/types/airdrop";
const assert = require("assert");
const anchor = require("@project-serum/anchor");
const { SystemProgram } = anchor.web3;
import {Connection, PublicKey, LAMPORTS_PER_SOL} from "@solana/web3.js";
use anchor_lang::prelude::*;
use anchor_lang::solana_program::entrypoint::ProgramResult;
declare_id!("DoV2hRXUUYzyZ7yM9Ttmdv32JLQYJS168sDuugWpU3sQ");
impl DepositeAccount {
pub const MAX_SIZE: usize = 2 + (1 + 32) + (4 + 10 * 32);
}
//import logo from './logo.svg';
import './App.css';
import { useEffect, useState } from 'react';
import { Connection, PublicKey } from '@solana/web3.js';
import { Program, BN, AnchorProvider, web3 } from '@project-serum/anchor';
import idl from './idl.json';
import { PhantomWalletAdapter } from '@solana/wallet-adapter-wallets';
import { useWallet, WalletProvider, ConnectionProvider } from '@solana/wallet-adapter-react';
import { WalletModalProvider, WalletMultiButton } from '@solana/wallet-adapter-react-ui';
//! An IDO pool program implementing the Mango Markets token sale design here:
//! https://docs.mango.markets/litepaper#token-sale.
use anchor_lang::prelude::*;
use anchor_lang::solana_program::program_option::COption;
use anchor_spl::token::{self, Burn, Mint, MintTo, TokenAccount, Transfer};
declare_id!("2xYSvW9TbU7wnefXnBrnAqpwTnMckMG53XeENv1kdrdw");
#[program]
@omgbbqhaxx
omgbbqhaxx / gist:426e57cbc90041cb7b951ac5a4d14cbb
Created June 11, 2021 10:36
how to generate ssl certificate on macbook instantly for node.js
openssl req -newkey rsa:2048 -new -nodes -keyout key.pem -out csr.pem
openssl x509 -req -days 365 -in csr.pem -signkey key.pem -out server.crt
var options = {
key: fs.readFileSync('./key.pem', 'utf8'),
cert: fs.readFileSync('./server.crt', 'utf8')
};
pragma solidity ^0.6.9;
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
contract ERC20 {
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
event Burn(address indexed from, uint256 value);
pragma solidity >=0.5.16 <0.6.9;
//INCONTRACTWETRUST4.0
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
contract EthereumeRush {
string public name;
string public symbol;
uint8 public decimals = 18;