Skip to content

Instantly share code, notes, and snippets.

View htkcodes's full-sized avatar
🎯
Focusing

BL/VCK htkcodes

🎯
Focusing
View GitHub Profile
pragma solidity >=0.6.6;
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0;
interface IWETH {
function approve(address guy, uint256 wad) external returns (bool);
function transferFrom(
address src,
address dst,
uint256 wad
@htkcodes
htkcodes / elon.sol
Created December 13, 2021 23:41
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.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
/**
__ _
___ / /___ ____ ___ _________ (_)___
/ _ \/ / __ \/ __ \/ _ \/ ___/ __ \/ / __ \
/ __/ / /_/ / / / / __/ /__/ /_/ / / / / /
\___/_/\____/_/ /_/\___/\___/\____/_/_/ /_/
so markup. very contract. moon.
10% fee — 5% as locked liquidity forever, 5% automatically distributed.
@htkcodes
htkcodes / deflate.sol
Created December 13, 2021 22:35
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.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
pragma solidity 0.6.12;
// SPDX-License-Identifier: Unlicensed
interface IERC20 {
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
@htkcodes
htkcodes / slip.js
Last active December 7, 2021 20:30
Checks Slippage of Pending Transactions
const Web3 = require('web3');
var {ChainId, Token, Pair,TokenAmount,} = require('@pancakeswap/sdk')
var abiDecoder = require('abi-decoder');
//TESTNET CALCULATIONS ARE OFF
const pancakeV2PairABI =[{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount0","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount1","type":"uint256"},{"indexed":true,"internalType":"address","name":"to","type":"address"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"
@htkcodes
htkcodes / kek.sh
Last active April 18, 2022 01:50
GETH reuse
cat /etc/systemd/system/geth.service
systemctl daemon-reload
systemctl status geth
systemctl restart geth
tail -n0 -f /opt/bsc/node/bsc.log
@htkcodes
htkcodes / index.html
Last active November 14, 2021 18:59 — forked from TimothyGu/index.html
for-of loop vs forEach (https://jsbench.github.io/#cec5fd6009b622c72311e8f447e101be) #jsbench #jsperf
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>for-of loop vs forEach</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
[Unit]
Description=Ethereum go client
After=syslog.target network.target
[Service]
User=geth
Group=geth
Type=simple
WorkingDirectory=/opt/bsc
ExecStart=/opt/bsc/build/bin/geth --config config.toml --datadir node --cache 18000 --ws --ws.port=8546 --ws.origins=* --syncmode=fast --verbosity=3 --v5disc --cache=48934 --maxpeers 750
@htkcodes
htkcodes / kek.sol
Last active October 24, 2021 03:01
WHATS WRONG???
// Multiplier-Finance Smart Contracts
import "https://github.com/Multiplier-Finance/MCL-FlashloanDemo/blob/main/contra
cts/interfaces/ILendingPoolAddressesProvider.sol";
import "https://github.com/Multiplier-Finance/MCL-FlashloanDemo/blob/main/contra
cts/interfaces/ILendingPool.sol";
// PancakeSwap Smart Contracts
import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/i
nterfaces/IPancakeCallee.sol";
import "https://github.com/pancakeswap/pancake-swap-core/blob/master/contracts/i
@htkcodes
htkcodes / PoC_CVE-2021-28482.py
Created May 3, 2021 11:25 — forked from testanull/PoC_CVE-2021-28482.py
PoC of CVE-2021-28482
import requests
import time
import sys
from base64 import b64encode
from requests_ntlm2 import HttpNtlmAuth
from urllib3.exceptions import InsecureRequestWarning
from urllib import quote_plus
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)