Skip to content

Instantly share code, notes, and snippets.

View Aniket965's full-sized avatar
❤️
Focusing

Aniket Sharma Aniket965

❤️
Focusing
View GitHub Profile
@Aniket965
Aniket965 / find_address.js
Created July 23, 2024 17:04
Find Deployment Addresss
const { ethers, getCreateAddress } = require('ethers');
// Connect to the Ethereum network
const provider = new ethers.JsonRpcProvider('https://eth.llamarpc.com');
const contractAddress = '0xdAC17F958D2ee523a2206206994597C13D831ec7';
async function findDeploymentBlock(startBlock, endBlock) {
while (startBlock <= endBlock) {
const midBlock = Math.floor((startBlock + endBlock) / 2);
@Aniket965
Aniket965 / polynomial_bridge.json
Last active October 15, 2024 12:08
Polynomial Mainnet
{
"1": {
"sDAI": {
"isAppChain": false,
"NonMintableToken": "0x83f20f44975d03b1b09e64809b757c47f942beea",
"Vault": "0x615172e47c0C5A6dA8ea959632Ac0166f7a59eDc",
"ExecutionHelper": "0x17C9D8Cef7Ef072844EEaEdE1F9f54C7E3fa8743",
"LimitExecutionHook": "0x2A06DEAc3E863c23DD6a89Eeacd80aBA9E08B77B",
"connectors": {
"8008": {
@Aniket965
Aniket965 / polynomial_testnet_bridge.json
Last active October 11, 2024 07:52
polynomial_testnet_bridge.json
{
"80008": {
"USDC": {
"isAppChain": true,
"MintableToken": "0x167488C5B51E15F0132A68208b4F2Ad3F1831c63",
"Controller": "0x4B7f716152E29A652c2A8681Fb03190a9B475E70",
"ExecutionHelper": "0xF5F23b2C1b8756E1175755D747ABF279FF2d4EBf",
"LimitExecutionHook": "0x287d69904Cc69e1578B72d136a54d12E9D442165",
"connectors": {
"421614": {
@Aniket965
Aniket965 / t.sol
Created October 9, 2023 18:48
order hash
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
import "forge-std/Test.sol";
import "../src/extractors/SocketExtractor.sol";
import "../src/common/SocketStructs.sol";
import "../src/lib/BasicInfoLib.sol";
import "../src/lib/SocketOrderLib.sol";
import "../src/lib/RFQOrderLib.sol";
// import "./SignerHelper.sol";
import {ISignatureTransfer} from "permit2/src/interfaces/ISignatureTransfer.sol";
@Aniket965
Aniket965 / orderhash.js
Last active October 9, 2023 18:43
orderhash
const ethers = require('ethers');
const { defaultAbiCoder } = require('ethers/lib/utils');
// bytes internal constant RFQ_ORDER_TYPE =
// abi.encodePacked(
// "RFQOrder(",
// "SocketOrder order,",
// "uint256 promisedAmount,",
// "bytes userSignature)"
// );
@Aniket965
Aniket965 / add.md
Created May 24, 2023 09:06
yoyoyo.md
source Destination Bridge Source Contract Destination contract
polygon arbitrum hop 0x2879ee08cf1e11109df85c09d194342a3c16cb12 0xdd74ee6c6568429537bf30cb63dab0061b83c41a
polygon optimism hop 0xab60c7e6f373cfe6c70fc5fbfcf8c2dc2db31899 0x115d5d58b21b5c2625a51e660dcefcc830edbd96
polygon optimism anyswap 0xca1604344e30189b490c7cad0a826e6fb1461f0d 0x88e7385eacf8e31c9cddce7632bfe654b58f4a09
polygon arbitrum anyswap 0xc83d63897c3f0c12555f1d07cce3b470343b9af7 0xc7c52aa35d499e0c18ff3854f24e65d43c97d5a4
optimism arbitrum hop 0x2cf22dd0077a0c4e604b95ebaa45cebb92ef11c6 0x695d803207579bb4f34c97ab3e3a449de8ad042e
optimism polygon hop 0xb70c4109f03b221930812116f548f9e5856b6313 0x1ae481af959d14c42338
@Aniket965
Aniket965 / hello.sh
Created May 16, 2023 12:12
example build -tx
curl -X 'POST' \
'https://api.socket.tech/v2/build-tx' \
-H 'accept: application/json' \
-H 'API-KEY: 72a5b4b0-e727-48be-8aa1-5da9d62fe635' \
-H 'Content-Type: application/json' \
-d '{
"route": {
"routeId": "f0b60df0-a7b9-42c6-b746-94e0207922e1",
"isOnlySwapRoute": false,
"fromAmount": "100000000",
@Aniket965
Aniket965 / polygonroute.json
Last active November 29, 2022 11:29
Polygon Route With Refuel
{
"fromAssetAddress": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
"fromChainId": 1,
"toAssetAddress": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
"toChainId": 137,
"route": {
"routeId": "97ae30c1-4d82-4779-9465-9adfd6126a7a",
"isOnlySwapRoute": false,
"fromAmount": "2000000",
"toAmount": "2000000",
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
// NOTE: Deploy this contract first
contract Bridge {
event TokenBridged(address token, uint256 amount);
function BridgeMe(address token, uint256 amount) public {
emit TokenBridged(token,amount);
}
import argparse
import time
import random
import apache_beam as beam
from apache_beam.options.pipeline_options import PipelineOptions, SetupOptions
class AddKeyInfoFn(beam.DoFn):
"""output tuple of window(key) + element(value)"""
def process(self, element, window=beam.DoFn.WindowParam):