Skip to content

Instantly share code, notes, and snippets.

View AndreiD's full-sized avatar
🦄
🐦

Dan Ξ AndreiD

🦄
🐦
  • in front of a screen
View GitHub Profile
@AndreiD
AndreiD / erc20staking.sol
Created October 1, 2024 07:13
erc20staking.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/ReentrancyGuard.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/utils/Pausable.sol";
contract DogStaking is ReentrancyGuard, Ownable, Pausable {
IERC20 stakingToken;
@AndreiD
AndreiD / token_with_buy_sell_tax.sol
Created September 27, 2024 07:13
token_with_buy_sell_tax.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;
abstract contract Ownable {
address private _owner;
constructor() {
_owner = msg.sender;
}
@AndreiD
AndreiD / swap.ts
Created July 7, 2024 18:36
simple_uniswap_v3_swap
//1. make sure enough funds
//2. make sure the pair tokens have allowance to uniswap router v2
//3. find out the best pool and it's fee
import {
SWAP_ROUTER_02_ADDRESSES
} from "@uniswap/sdk-core";
import { swapRouter02ABI } from "../../data/swapRouter02ABI";
const swapRouter = new ethers.Contract(
@AndreiD
AndreiD / genesis.json
Created September 12, 2023 08:07
genesis pv
{
"config" : {
"chainId" : 4444,
"muirglacierblock" : 0,
"ibft2" : {
"blockperiodseconds" : 3,
"epochlength" : 30000,
"requesttimeoutseconds" : 4
}
},
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta
name="description"
content="The Future of Grenfell Tower - A vote by the community, for the community"
/>
<meta name="author" content="LWRA" />
<title>The Future of Grenfell Tower</title>
<!-- Open Graph tags for Facebook -->
<meta
@AndreiD
AndreiD / hardhat.config.js
Created April 30, 2021 20:29
hardhat.config.js
// hardhat.config.js
require("dotenv/config")
require("@nomiclabs/hardhat-etherscan")
require("@nomiclabs/hardhat-solhint")
// require("@nomiclabs/hardhat-solpp")
require("@tenderly/hardhat-tenderly")
require("@nomiclabs/hardhat-waffle")
require("hardhat-abi-exporter")
require("hardhat-deploy")
require("hardhat-deploy-ethers")
@AndreiD
AndreiD / stablecoin_abi
Created March 16, 2021 08:08
stablecoin_abi
[
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "owner",
"type": "address"
},
@AndreiD
AndreiD / bep20onefile.sol
Created February 28, 2021 15:12
BEP20onefile
pragma solidity 0.5.16;
interface IBEP20 {
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function symbol() external view returns (string memory);
function name() external view returns (string memory);
function getOwner() external view returns (address);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address _owner, address spender) external view returns (uint256);
@AndreiD
AndreiD / erc20_mintable_pausable.sol
Last active February 27, 2021 17:29
erc20_mintable_pausable.sol
//AND Token Binance Smart Chain: 0x19F4e6D283F91BD2C6209F6E54bDC22B0897b5fd
//USDA Token Binance Smart Chain: 0x0BCb308E5D5340aFf8f5A06436377159022244aA
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
@AndreiD
AndreiD / kafka_min.sh
Last active February 14, 2020 16:52
kafka_bootstrap_min_resources
sudo apt-get update; sudo apt-get -y upgrade
sudo apt install -y software-properties-common
sudo apt install -y curl net-tools nethogs htop unzip tree
sudo apt-get install -y default-jre
sudo apt-get install -y zookeeperd
sudo systemctl enable zookeeper
cd /tmp
wget https://www-eu.apache.org/dist/kafka/2.4.0/kafka_2.13-2.4.0.tgz