Skip to content

Instantly share code, notes, and snippets.

View samigabor's full-sized avatar
🏗️

Sami Gabor samigabor

🏗️
  • Streamr Network
  • Cluj-Napoca, Romania
View GitHub Profile

forge inspect contractName methods

pandoc 2024-09-05-tswap-audit.md -o report.pdf --from markdown --template=eisvogel --listings

@samigabor
samigabor / getTokenTransfers.ts
Created March 25, 2024 10:25
code snippet to to get a list of all ERC20 transfers where the `from` OR the `to` is part of a given list and have happened over the last X years
import { ethers } from 'ethers';
import { LogDescription } from 'ethers/lib/utils';
import { abi } from './abis/Token';
// Connect to a locally run ethereum node (e.g. run `anvil` for testing)
const RPC_URL = 'http://127.0.0.1:8545';
// Connect to 3rd party provider
// import 'dotenv/config'
// const RPC_URL = process.env.RPC_URL_SEPOLIA;
@samigabor
samigabor / Base64.sol
Last active February 27, 2022 14:06
Provides functions for encoding/decoding base64. Also available as a package `npm i base64-sol`
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
/// @title Base64
/// @author Brecht Devos - <brecht@loopring.org>
/// @notice Provides functions for encoding/decoding base64
library Base64 {
string internal constant TABLE_ENCODE = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
bytes internal constant TABLE_DECODE = hex"0000000000000000000000000000000000000000000000000000000000000000"
@samigabor
samigabor / StringsUtils.sol
Created February 27, 2022 13:58
String length in Solidity
// SPDX-License-Identifier: UNLICENSED
// Source: https://github.com/ensdomains/ens-contracts/blob/master/contracts/ethregistrar/StringUtils.sol
pragma solidity >=0.8.4;
library StringUtils {
/**
* @dev Returns the length of a given string
*

Install gh-pages

npm install gh-pages --save-dev

Add predeploy and deploy scripts to package.json

"predeploy": "npm run build",
"deploy": "gh-pages -d build",

Deploy to github pages

npm run deploy

@samigabor
samigabor / db.json
Created January 29, 2022 18:22
Localhost mock REST API
{
"tasks": [
{
"name": "Task Name",
"day": "Day & Date",
"reminder": false,
"id": 1
}
]
}