Skip to content

Instantly share code, notes, and snippets.

View 0xV4L3NT1N3's full-sized avatar

nic | nic.ethkl.eth 0xV4L3NT1N3

View GitHub Profile
@0xV4L3NT1N3
0xV4L3NT1N3 / uni.js
Created March 17, 2025 17:50
Get Uniswap V4 Swaps
const ethers = require("ethers")
async function getUniswapV4Swaps() {
// get abi
const requestAbi = await fetch("https://api.etherscan.io/v2/api?chainid=1&module=contract&action=getabi&address=0xc7bbec68d12a0d1830360f8ec58fa599ba1b0e9b&apikey=YourApiKeyToken")
const abi = await requestAbi.json()
// get logs from ETH/USDC pair
@0xV4L3NT1N3
0xV4L3NT1N3 / ofac.js
Last active February 10, 2025 13:13
AML Check if Address Has Interacted with OFAC Santions
async function checkAML(address) {
// sanctioned addresses dataset
const sanctionedAddresses = [
'0x308ed4b7b49797e1a98d3818bff6fe5385410370',
'0x01e2919679362dfbc9ee1644ba9c6da6d6245bb1'
]
// get list of transactions on Ethereum, use chainId for other chains like Base
@0xV4L3NT1N3
0xV4L3NT1N3 / flaunch.js
Created February 6, 2025 10:56
Newly Flaunched Tokens
async function flaunch() {
// fetch transactions from etherscan
const query = await fetch(`https://api.etherscan.io/v2/api?chainid=8453&module=account&action=txlistinternal&address=0x6A53F8b799bE11a2A3264eF0bfF183dCB12d9571&startblock=0&endblock=99999999&page=1&offset=10&sort=desc&apikey=YourApiKeyToken`)
const data = await query.json()
// filter for second CREATE2 transaction, which is the token address
const flaunchedTokens = data.result
@0xV4L3NT1N3
0xV4L3NT1N3 / vyper.json
Created November 7, 2024 17:05
Sample Vyper JSON Input
{
"language":"Vyper",
"sources":{
"multijson.vy":{
"content":"# @pragma version ^0.4.0\n\"\"\"\n@title Another smart contract\n@author Some person on the internet\n@license none\n\"\"\"\n\nimport math\n# Other ways to import\n# import math as m\n# from . import math\n# from . import math as m\n\nstored_number: public(uint256)\n\n@deploy\ndef __init__():\n self.stored_number = 1\n\n@external\ndef call_math_mul(x: uint256, y: uint256):\n self.stored_number = math.mul(x, y)\n\n@view\n@external\ndef get_number() -> uint256:\n return self.stored_number"
},
"math.vy":{
"content":"# @pragma version ^0.4.0\r\n\r\n@pure\r\ndef mul(x: uint256, y: uint256) -> uint256:\r\n return x * y\r\n"
}
},
@0xV4L3NT1N3
0xV4L3NT1N3 / main.js
Created November 6, 2024 10:06
Get Total USDC Transfers Last Hour Sample
async function sumUSDCTransfers(chain, address) {
// get the latest block
const lastBlockQuery = await fetch(`https://api.etherscan.io/v2/api?chainid=${chain}&module=proxy&action=eth_blockNumber&apikey=YourApiKeyToken`)
const lastBlockData = await lastBlockQuery.json()
const lastBlock = Number(lastBlockData.result)
// get the past hour block
@0xV4L3NT1N3
0xV4L3NT1N3 / main.js
Created October 28, 2024 07:06
Get L2 Balances
async function main() {
// query ETH balances on Arbitrum, Base and Optimism
const chains = [42161, 8453, 10]
for (const chain of chains) {
// add your key here
@0xV4L3NT1N3
0xV4L3NT1N3 / result.json
Created May 2, 2024 03:04
Bitcoin Info CoinGecko
{
"id": "bitcoin",
"symbol": "btc",
"name": "Bitcoin",
"web_slug": "bitcoin",
"asset_platform_id": null,
"platforms": {
"": ""
},
"detail_platforms": {
{
"name": "Sloth Jazz",
"website": "https://www.example.com",
"description": "The smoothest restaking experience",
"logo": "https://gist.github.com/assets/33112835/3b6a5513-0e79-4ee5-be75-d75517017708",
"twitter": "https://x.com/example"
}
@0xV4L3NT1N3
0xV4L3NT1N3 / results.md
Created March 13, 2024 06:10
Challenge 3 : Interaction ( Gemma )

Input Data:

  • Address: address recipient = "0x9558...ED"; (Replace with your actual address)
  • Amount: uint256 amount=10; (Specify desired number of tokens to transfer, in this case it's set at '7')

Function Call: solidity transfer("address recipient", uint_t amount);

@0xV4L3NT1N3
0xV4L3NT1N3 / results.md
Created March 13, 2024 06:07
Challenge 1 : Interpretation ( Gemma )

This smart contracts is a multi-signature wallet that allows for the creation of transactions by multiple owners with different approval requirements based on their roles within an organization or group setting

Use Case:

The MultiSigWallet Contract enables organizations to manage assets collectively through shared ownership, ensuring secure and efficient decision making process. It facilitates seamless collaboration among members while maintaining control over funds due its multi-signature requirement for transaction execution . This contract is designed specifically with the Ethereum blockchain in mind , leveraging smart contracts capabilities

Functions:

  • Deposit: Allows owners to contribute ether into a shared wallet, triggering an event detailing deposits and overall balance.