Skip to content

Instantly share code, notes, and snippets.

View sunnyRK's full-sized avatar
🎯
Focusing

Sunny Radadiya sunnyRK

🎯
Focusing
View GitHub Profile
import java.math.BigInteger;
import java.util.*;
class Forloop {
public static void main(String []args){
int[] allInputs = new int[]{10000, 50000, 100000, 500000, 1000000};
for(int i=0;i<allInputs.length;i++){
BigInteger number = BigInteger.valueOf(allInputs[i]);
BigInteger result = BigInteger.valueOf(1);
package main
import (
"fmt"
"time"
"math/big"
)
func main(){
package main
import (
"encoding/json"
"log"
"math/rand"
"net/http"
"strconv"
"github.com/gorilla/mux"
)
pragma solidity ^0.5.9;
// Adding only the ERC-20 function we need
interface DaiToken {
function transfer(address dst, uint wad) external returns (bool);
function transferFrom(address src, address dst, uint wad) external returns (bool);
function balanceOf(address guy) external view returns (uint);
function approve(address guy, uint wad) external returns (bool);
function allowance(address src, address guy) external view returns (uint);
}
import schedule
import time
import json
from web3 import Web3
import gspread
from oauth2client.service_account import ServiceAccountCredentials
from datetime import datetime
import math
millnames = ['',' K',' M',' B',' T']
@sunnyRK
sunnyRK / BiconomySwapper.sol
Last active February 3, 2021 18:28
Biconomy Forwarder contracts
pragma solidity ^0.6.12;
import './interfaces/IUniswapV2Router02.sol';
import '/interfaces/IERC20.sol';
import '/interfaces/IUniswapV2Pair.sol';
import '/interfaces/IUniswapV2Router02.sol';
import '/helper/SafeERC20.sol';
import '/helper/SafeMath.sol';
import "./IRelayRecipient.sol";
pragma solidity ^0.6.8;
import "../helper/SafeERC20.sol";
import "../interface/IUniswapV2Router02.sol";
import "../interface/IERC721.sol";
import "hardhat/console.sol";
import "../NFTX/ERC721Holder.sol";
interface INFTX {
function mint(uint256 vaultId, uint256[] calldata nftIds, uint256 d2Amount) external payable;
/**
* @title: Cream SLP wrapper
* @summary: Used for interacting with Cream Sushiswap LP Statergy. Has
* a common interface with all other protocol wrappers.
* This contract holds assets only during a tx, after tx it should be empty
* @author: Idle Labs Inc., idle.finance
*/
pragma solidity 0.5.16;
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @title: Idle BarnBridge wrapper
* @summary: Used for interacting with BarnBridge. Has
* a common interface with all other protocol wrappers.
* This contract holds assets only during a tx, after tx it should be empty
* @author: Idle Labs Inc., idle.finance
*/
pragma solidity 0.5.16;
pragma experimental ABIEncoderV2;
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.7.0;
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./IYieldSource.sol";
import "./IIdleToken.sol";
import "./IIdleTokenHelper.sol";