Skip to content

Instantly share code, notes, and snippets.

View 10dimensions's full-sized avatar
🎯
Focusing

10dimensions

🎯
Focusing
  • Bangalore, India
View GitHub Profile
@10dimensions
10dimensions / contracts...Bundles.sol
Created February 25, 2022 13:17
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
pragma solidity >=0.7.0 <0.9.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/utils/Counters.sol";
import "contracts/utils.sol";
contract Bundle is ERC721Full {
using Counters for Counters.Counter;
@10dimensions
10dimensions / INRC_compiled.sol
Created July 21, 2022 18:28
INRC Stable Coin, Pegged to USDC at constant exchange rate
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
@10dimensions
10dimensions / INRC.sol
Created July 26, 2022 04:46
INR Stable Coin, Pegged to USDC at a static exchange rate
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
@10dimensions
10dimensions / scripts...deploy_with_ethers.ts
Created December 5, 2022 16:01
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.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// This script can be used to deploy the "Storage" contract using ethers.js library.
// Please make sure to compile "./contracts/1_Storage.sol" file before running this script.
// And use Right click -> "Run" from context menu of the file to run the script. Shortcut: Ctrl+Shift+S
import { deploy } from './ethers-lib'
(async () => {
try {
const result = await deploy('Storage', [])
console.log(`address: ${result.address}`)
@10dimensions
10dimensions / UniV2SwapIndexer.js
Created July 7, 2023 16:44
Simple UniswapV2 Event Indexer
const ethers = require("ethers");
const provider = new ethers.providers.WebSocketProvider(
"wss://mainnet.infura.io/ws/v3/<RPC-KEY-HERE>"
)
const swapHistory = {}
filter = {
address: ["0xE1De07566cEb19D2e45B60B491776aB74C9b8d7A"], //token address