Skip to content

Instantly share code, notes, and snippets.

View ImHukam's full-sized avatar
💭
Always Enjoy my work

Hukam Singh ImHukam

💭
Always Enjoy my work
View GitHub Profile
@ImHukam
ImHukam / background.ts
Created February 28, 2024 14:15
om protocol extension
// Function to handle messages from the popup
chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) {
if (message && message.data) {
let name: string = message.data['thirdparty_user_info']['user_info']['name'];
console.log('Name:', name);
let email: string = message.data['thirdparty_user_info']['user_info']['email'];
console.log('Email:', email);
let evmAddress: string = message.data['wallets'][1]['public_address'];
console.log('EVM Address:', evmAddress);
const { ethers, Wallet } = require('ethers');
const fetch = require("node-fetch");
const sleep = ms => new Promise(res => setTimeout(res, ms));
const privatekey = 'PRIVATE_KEY_HERE';
const provider = new ethers.providers.JsonRpcProvider('https://rpc-mumbai.maticvigil.com');
const wallet = new ethers.Wallet(privatekey, provider);
const signer = wallet.connect(provider);
@ImHukam
ImHukam / deploy.js
Created October 3, 2023 15:35
Polygonscan contract verifications files
const hre = require("hardhat");
async function main() {
const Contract = await hre.ethers.getContractFactory("TokenTransfersLibrary");
const contract = await Contract.deploy();
await contract.deployed();
console.log("deployed to:", contract.address);
const { ethers } = require('ethers');
async function transferUSDT() {
// Provider and Signer
const provider = new ethers.providers.JsonRpcProvider('https://polygon-rpc.com');
const privateKey = 'YOUR_PRIVATE_KEY_HERE'; // Replace with your private key
const signer = new ethers.Wallet(privateKey, provider);
// USDT Contract
const usdtContractAddress = 'USDT_CONTRACT_ADDRESS'; // Replace with the actual USDT contract address
@ImHukam
ImHukam / zkEVM_log.js
Created March 28, 2023 11:10
zkEVM logs
const ethers = require('ethers');
const provider = new ethers.providers.JsonRpcProvider('https://zkevm-rpc.com');
// Define the range of blocks to retrieve logs for
const fromBlock = 100;
const toBlock = 9000;
// Define the filter to use for the logs
const filter = {
const { ethers, Wallet } = require('ethers');
const fetch = require("node-fetch");
const sleep = ms => new Promise(res => setTimeout(res, ms));
const privatekey = '<private key here>';
// const provider = new ethers.providers.JsonRpcProvider('https://public.zkevm-test.net:2083');
const wallet = new ethers.Wallet(privatekey, provider);
const signer = wallet.connect(provider);
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/utils/Context.sol";
interface Token {
@ImHukam
ImHukam / zkevm_deploy_erc165.js
Created October 11, 2022 03:03
zkevm_utils_test
const hre = require("hardhat");
async function main() {
const Contract = await hre.ethers.getContractFactory("TestERC165");
const contract = await Contract.deploy();
await contract.deployed();
console.log("deployed to:", contract.address);
@ImHukam
ImHukam / zkevm_proxy_contract_call.js
Last active October 11, 2022 02:59
zkevm_proxy_upgradable_contract
const hre = require("hardhat");
const { ethers } = require("ethers");
const matic_provider = new ethers.providers.JsonRpcProvider("https://internal.zkevm-test.net:2083")
const abi = [
"function value() public view returns(uint256)",
"function set_value(uint256 _val) public",
"function value_inc() public"
]; // abi of implementation contract

Keybase proof

I hereby claim:

  • I am imhukam on github.
  • I am imhukam (https://keybase.io/imhukam) on keybase.
  • I have a public key ASBrm3XuwGXVZSNCQ7aUqxQDu-vNwMYYMed4DH9H6Kjy8Qo

To claim this, I am signing this object: