Skip to content

Instantly share code, notes, and snippets.

View sunnyRK's full-sized avatar
🎯
Focusing

Sunny Radadiya sunnyRK

🎯
Focusing
View GitHub Profile
{
callData: "0x000046800000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001e00000000000000000000000000000000000000000000000000000000000000005000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad000000000000000000000000da10009cbd5d07dd0cecc66161fc93d7c9000da100000000000000000000000068b3465833fb72a70ecdf485e0e4c7bd8665fc450000000000000000000000007f5c764cbc14f9669b88837ca1490cca17c31607000000000000000000000000794a61358d6845594f94dc1db02a252b5b4814ad000000000000000000000000000000000000000000000000000000000000000500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
import { useState, useRef, useEffect } from "react";
import { ethers } from "ethers";
import { toast } from "react-hot-toast";
import { FiCopy } from "react-icons/fi";
import { ImSpinner } from "react-icons/im";
import SocialLogin from "@biconomy/web3-auth";
import { ChainId } from "@biconomy/core-types";
import SmartAccount from "@biconomy/smart-account";
function depositBySocket(
uint16 _dstChainId,
bytes memory _toAddress,
uint _amount,
address payable _refundAddress,
address _zroPaymentAddress,
bytes memory _adapterParams
) external checkWhiteList payable {
_send(
_msgSender(), _dstChainId, _toAddress, _amount, _refundAddress,
txData
apiReturnData: {
success: true,
result: {
userTxType: 'fund-movr',
txType: 'eth_sendTransaction',
txData: '0xa44bbb150000000000000000000000000000000000000000000000000000000000000020000000000000000000000000f8a4f2b76d85287c6d71ee1da15b3f9314848515000000000000000000000000000000000000000000000000000000000000a86a0000000000000000000000000000000000000000000000000000000005f5e10000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000002e000000000000000000000000000000000000000000000000000000000000000150000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000001a0000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec7000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000
@sunnyRK
sunnyRK / BST.sol
Last active December 27, 2022 16:36
BST
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.15;
contract BinaryTree2 {
struct Node {
uint256 value;
int256 height;
bytes32 left;
bytes32 right;
}
@sunnyRK
sunnyRK / contracts...ARbitrumWithdraw.sol
Created November 8, 2022 06:27
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.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.0;
/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
/*//////////////////////////////////////////////////////////////
EVENTS
const { ethers } = require("hardhat");
const { expect, use } = require("chai");
const {solidity} = require('ethereum-waffle');
const { utils } = require('ethers');
const { parseEther, parseUnits } = require("ethers/lib/utils")
const { BigNumber } = require("@ethersproject/bignumber")
const { loadPerpLushanInfo, snapshot, revertToSnapshot, fromBigNumber } = require("./utils");
const bn = require("bignumber.js");
bn.config({ EXPONENTIAL_AT: 999999, DECIMAL_PLACES: 40 })
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity =0.7.6;
pragma abicoder v2;
import '@uniswap/v3-core/contracts/libraries/SafeCast.sol';
import '@uniswap/v3-core/contracts/libraries/TickMath.sol';
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Pool.sol';
import '@uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol';
import '@uniswap/v3-core/contracts/interfaces/IUniswapV3Factory.sol';
// import { MockContract, smockit } from "@eth-optimism/smock"
import { ethers, waffle } from "hardhat"
import { MockProvider } from 'ethereum-waffle';
import hre from "hardhat";
import { parseEther, parseUnits } from "ethers/lib/utils"
import {
AccountBalance,
BaseToken,
// ChainlinkPriceFeed,
ClearingHouse,
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity 0.7.6;
pragma abicoder v2;
import { AggregatorV3Interface } from "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";
contract MockTestAggregatorV3 is AggregatorV3Interface {
uint8 public _newdecimals;
uint80 public _roundId;