Skip to content

Instantly share code, notes, and snippets.

View korrio's full-sized avatar
👽

kOrriO korrio

👽
View GitHub Profile
@korrio
korrio / truffle-config.js
Created October 28, 2021 17:34
truffle-config.js
const HDWalletProvider = require('@truffle/hdwallet-provider');
const Web3 = require('web3');
const fs = require('fs');
const { infuraProjectId, privateKeys, etherApiKey, bscApiKey } = JSON.parse(fs.readFileSync('.secret').toString().trim());
// const infuraProjectId = `86f947e6d8ad4483a95d5a53864e7a8e`;
const binanceTestnetProvider = new HDWalletProvider({
privateKeys: privateKeys,
@korrio
korrio / menu.ts
Created October 27, 2021 08:50
menu.ts
import { MenuEntry } from 'the-vonder-uikit'
const config: MenuEntry[] = [{
label: 'Home',
icon: 'HomeIcon',
href: '/',
},
{
label: 'Stats',
icon: 'InfoIcon',
{
pair(id: "0xf70a40749006c7952186666c92f32b8f5c2129f9") {
id
totalSupply
token0 {
symbol
derivedETH: derivedBNB
volume: tradeVolume
volumeUSD: tradeVolumeUSD
}
@korrio
korrio / apr-fee.js
Created October 11, 2021 15:59
apr-fee.js
const aprToApy = (apr, frequency = BLOCKS_IN_A_YEAR) => ((1 + apr / 100 / frequency) ** frequency - 1) * 100
const feeApyPerYear = aprToApy((((((pairVolumeUSD - (pair1wVolumeUSD ?? 0)) * 0.0025) / 7) * 365) / pairReserveUSD) * 100, 3650) / 100
const feeApyPerMonth = feeApyPerYear / 12
const feeApyPerDay = feeApyPerMonth / 30
const feeApyPerHour = feeApyPerDay / blocksPerHour
const sushiPerBlock = pool?.owner?.sushiPerBlock / 1e18 ||
(pool?.owner?.sushiPerSecond / 1e18) * averageBlockTime ||
masterChefV1SushiPerBlock
@korrio
korrio / networks.ts
Last active May 16, 2022 07:57
EVM-compatible Networks
const NETWORKS = {
'1': 'https://eth-mainnet.alchemyapi.io/v2/q1gSNoSMEzJms47Qn93f9-9Xg5clkmEC',
'3': 'https://eth-ropsten.alchemyapi.io/v2/cidKix2Xr-snU3f6f6Zjq_rYdalKKHmW',
'4': 'https://eth-rinkeby.alchemyapi.io/v2/XVLwDlhGP6ApBXFz_lfv0aZ6VmurWhYD',
'5': 'https://eth-goerli.alchemyapi.io/v2/Dkk5d02QjttYEoGmhZnJG37rKt8Yl3Im',
'10': 'https://mainnet.optimism.io',
'42': 'https://eth-kovan.alchemyapi.io/v2/6OVAa_B_rypWWl9HqtiYK26IRxXiYqER',
'56': 'https://bsc-dataseed.binance.org/',
'65': 'https://exchaintestrpc.okex.org',
'66': 'https://exchainrpc.okex.org',
@korrio
korrio / HolderBonus.sol
Last active September 29, 2021 10:24
HolderBonus.sol
pragma solidity ^0.6.12;
pragma experimental ABIEncoderV2;
// import './VonderToken.sol';
// import './MasterChef.sol';
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
@korrio
korrio / VonderToken.sol
Created September 14, 2021 13:38
VonderToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
@korrio
korrio / MasterChef.sol
Created September 14, 2021 13:37
MasterChef.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
import "./VonderToken.sol";
library Address {
/**
* @dev Returns true if `account` is a contract.
*
@korrio
korrio / Arbitrage_Q4_2022.sol
Last active October 1, 2022 06:55
Arbitrage_Q4_2022.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
@korrio
korrio / Arbitrage_2.sol
Created September 14, 2021 12:12
Arbitrage_2.sol
pragma solidity ^0.6.12;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.