Skip to content

Instantly share code, notes, and snippets.

View staccDOTsol's full-sized avatar
🏠
Working from home

Jarett Dunn staccDOTsol

🏠
Working from home
View GitHub Profile
ffd2ae04-f849-4f59-860b-6215ec77bb4f
@staccDOTsol
staccDOTsol / erc721 custom
Created September 26, 2022 17:39
erc721 custom
//Contract based on [https://docs.openzeppelin.com/contracts/3.x/erc721](https://docs.openzeppelin.com/contracts/3.x/erc721)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
contract StaccStaccs is ERC721URIStorage, Ownable {
@staccDOTsol
staccDOTsol / coping fixed price
Last active October 9, 2022 16:05
coping fixed price
// put this in this dir https://github.com/metaplex-foundation/metaplex-program-library/blob/master/fixed-price-sale/js/test/buy.test.ts
import test from 'tape';
import { killStuckProcess, logDebug, sleep } from './utils';
import {
createStore,
createPrerequisites,
initSellingResource,
createMarket,
mintTokenToAccount,
@staccDOTsol
staccDOTsol / streamflosavings.ts
Last active November 30, 2022 18:33
streamflo savings
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import { NodeWallet } from "@project-serum/common";
import { getOrCreateAssociatedTokenAccount } from "@solana/spl-token";
import fs from "fs";
import {
StreamClient,
Stream,
CreateParams,
CreateMultiParams,
WithdrawParams,
@staccDOTsol
staccDOTsol / contracts...1_Storage.sol
Created December 12, 2022 00:54
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.17+commit.8df45f5f.js&optimize=true&runs=9999999&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import '@uniswap/v2-core/contracts/interfaces/IUniswapV2ERC20.sol';
import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol';
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
import '@uniswap/v2-core/contracts/interfaces/IUniswapV2Pair.sol';
import "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol";
@staccDOTsol
staccDOTsol / getluts.js
Created December 17, 2022 22:51
helius getluts.js
var express = require("express");
var bodyParser = require("body-parser");
var cors = require("cors");
var app = express();
app.use(bodyParser());
app.use(cors());
var reservePairs = {};
app.post("/", async function (req, res) {
if (req.body.fee > 5000) {
export SOLANA_KEY=yaddayadda
setx SOLANA_KEY yaddayadda
npm i @coral-xyz/anchor @solana/web3.js @project-serum/common @orca-so/whirlpools-sdk @orca-so/sdk
let connection = new Connection ("https://rpc.helius.xyz/?api-key=helius-is-cool")
// @ts-ignore
const fetcher = new AccountFetcher(connection);
// @ts-ignore
const provider = new AnchorProvider( connection, new NodeWallet(Keypair.fromSecretKey(bs58.decode(process.env.SOLANA_KEY!))), {})
// @ts-ignore
const ctx = WhirlpoolContext.from(connection, new NodeWallet(Keypair.fromSecretKey(bs58.decode(process.env.SOLANA_KEY!))),ORCA_WHIRLPOOL_PROGRAM_ID,fetcher)// (provider, ORCA_WHIRLPOOL_PROGRAM_ID);