This is a quick implementation of the OpenSea OperatorFilter with a way to activate / deactivate it over time
This file contains 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
// code highly inspired by https://github.com/kongnet/openrarity | |
// rewritten and removed all dep | |
// the function exported by this file expects data of type Record<string, any>[] | |
/* | |
import openRarity from './openRarity.js'; | |
const data = [ | |
{ trait1: value1_1, trait2: value1_2, trait_3: value1_3 }, |
This file contains 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
version: "3" | |
services: | |
postgres: | |
image: postgres:16 | |
container_name: myWebsite_postgres | |
restart: unless-stopped | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=E8FiIVyP5DPiHLwCRMXPHGZYa # change that password |
This file contains 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 {getUnnamedAccounts, ethers} from 'hardhat'; | |
async function main() { | |
await network.provider.send('evm_setAutomine', [false]); | |
let snapshot = null; | |
async function mine() { | |
let blockNumber = parseInt(await network.provider.send('eth_blockNumber'), 16); | |
let block = await network.provider.send('eth_getBlockByNumber', [`0x${blockNumber.toString(16)}`, false]); | |
console.log(`${blockNumber}: ${block?.hash}`); |
This file contains 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
contract ERC721 { | |
// take OpenZeppelin contract and add this at the end: | |
uint256 private _lastTokenId; | |
// uncomment next line if you need totalSupply | |
// uint256 public totalSupply; | |
/// @dev be careful this function expects recipients to all be unique and not be address(0) | |
function _airdrop(address[] calldata recipients) internal virtual { |
This file contains 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
function getERC20Contract(address) { | |
return new ethers.Contract(address, [{ | |
anonymous: false, | |
inputs: [ | |
{ indexed: true, internalType: 'address', name: 'from', type: 'address' }, | |
{ indexed: true, internalType: 'address', name: 'to', type: 'address' }, | |
{ indexed: false, internalType: 'uint256', name: 'amount', type: 'uint256' }, | |
], | |
name: 'Transfer', | |
type: 'event', |
This file contains 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/ethers.umd.min.js"></script> | |
</head> | |
<body> | |
<script> |
This file contains 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
FROM node:14 as builder | |
WORKDIR /home/node/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . | |
RUN npm run build | |
FROM node:14 as installer | |
WORKDIR /home/node/app |
This file contains 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
did:3:bafyreiavdrl6ptxuqdefz7qod35zqyuzrasoosemcvskvsjoost5je3lxq |
NewerOlder