Skip to content

Instantly share code, notes, and snippets.

View jeftarmascarenhas's full-sized avatar
🎯
Focusing

Jeftar Mascarenhas jeftarmascarenhas

🎯
Focusing
View GitHub Profile
import { ethers } from 'ethers';
import { SwapRouter, Pool } from '@uniswap/v3-sdk';
import { Token, TradeType, Route, Trade, CurrencyAmount } from '@uniswap/sdk-core';
// async function getQuote(
// tokenIn,
// tokenOut,
// amountIn,
// slippageTolerance
// ) {
> ts-node-dev --transpile-only src/app.ts --watch 'src/' -e ts,js,json | pino-pretty -c
[INFO] 17:56:45 ts-node-dev ver. 2.0.0 (using ts-node ver. 10.9.2, typescript ver. 5.3.2)
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/user/projects/blockchain/myproject/node_modules/@silencelaboratories/walletprovider-sdk/dist/index.js from /home/user/projects/blockchain/myproject/node_modules/@biconomy/account/dist/_cjs/modules/sessions/dan.js not supported.
Instead change the require of index.js in /home/user/projects/blockchain/myproject/node_modules/@biconomy/account/dist/_cjs/modules/sessions/dan.js to a dynamic import() which is available in all CommonJS modules.
at require.extensions..jsx.require.extensions..js (/tmp/ts-node-dev-hook-5900037615891709.js:114:20)
at Object.nodeDevHook [as .js] (/home/user/projects/blockchain/myproject/node_modules/ts-node-dev/lib/hook.js:63:13)
at Object.<anonymous> (/home/user/projects/blockchain/myproject/node_modules/@biconomy/account/dist/_cjs/modules/sessio
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NFT Timeline</title>
<style>
* {
margin: 0;
padding: 0;
const fs = require("fs");
const crypto = require("crypto");
function createHash(file) {
return new Promise((resolve, reject) => {
const hash = crypto.createHash("sha256");
const stream = fs.createReadStream(file);
stream.on("data", (chunk) => {
hash.update(chunk);
import { ZkEVM } from 'zkEVM';
// Cria uma instância do zkEVM
const zkEVM = new ZkEVM();
// Define os parâmetros da transação
const remetente = '0x123456789abcdef';
const destinatario = '0x987654321fedcba';
const valor = 100;

Flow from Mint a MUSIC unit Share List, Mint, Transfer and Burn

Mint Music NFT 0

shareIsApproveForAll: hash:

0x7209ddbeb69b70129824bcacca680e1b90b6d8b4b0eb6130f63d6347410ac72e

royaltyIsApprovedForAll hash:

@jeftarmascarenhas
jeftarmascarenhas / eventFilterWithPagination.js
Created November 21, 2023 02:08 — forked from wschwab/eventFilterWithPagination.js
an attempt at implementing some kind of pagination to an Ethereum event filter
const eventFilterv5WithPagination = (contractAddress, erc20abi, _provider, numberOfResponses) => {
// creating the interface of the ABI
const iface = new ethers.utils.Interface(erc20abi.abi);
// intialize array for the logs
let logs = [];
// get latest block number
const latest = await provider.getBlockNumber();
// intialize a counter for which block we're scraping starting at the most recent block
let blockNumberIndex = latest;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/[email protected]/token/ERC20/ERC20.sol";
import "@openzeppelin/[email protected]/token/ERC721/IERC721.sol";
import "@openzeppelin/[email protected]/access/Ownable.sol";
import "@openzeppelin/[email protected]/token/ERC20/extensions/draft-ERC20Permit.sol";
import "@openzeppelin/[email protected]/token/ERC721/utils/ERC721Holder.sol";
contract FractionalizedNFT is ERC20, Ownable, ERC20Permit, ERC721Holder {
@jeftarmascarenhas
jeftarmascarenhas / BinanceSmallWallet.ts
Last active March 30, 2023 04:41
Connector to Binance on Wagmi - Small Example
export class BinanceSmallConnector extends InjectedConnector {
constructor({ chains }: { chains: Chain[] | undefined }) {
const options = {
name: "Binance",
shimDisconnect: true,
shimChainChangedDisconnect: false,
};
super({
chains,
options,