Skip to content

Instantly share code, notes, and snippets.

// File: contracts/common/mixin/Initializable.sol
pragma solidity ^0.5.2;
contract Initializable {
bool inited = false;
modifier initializer() {
require(!inited, "already inited");
@rahuldamodar94
rahuldamodar94 / ethscan.js
Created October 26, 2020 11:31
Balance scanner
let Web3 = require("web3");
let ethScan =require('@mycrypto/eth-scan');
// Matic balance
ethScan.getEtherBalances("https://rpc-mumbai.matic.today",["0xFd71Dc9721d9ddCF0480A582927c3dCd42f3064C"],{contractAddress: "0xa878A805F78d22126188aBa9b6D0c5E907e29459"}).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})
// Matic tokens balances
ethScan.getTokensBalance("https://rpc-mumbai.matic.today","0xFd71Dc9721d9ddCF0480A582927c3dCd42f3064C",["0xd393b1E02dA9831Ff419e22eA105aAe4c47E1253"],{contractAddress: "0xa878A805F78d22126188aBa9b6D0c5E907e29459"}).then(res => {
let Biconomy = require("@biconomy/mexa");
let abi = require('./testabi.json')
let Web3 = require("web3")
const biconomy = new Biconomy(window.ethereum,{apiKey: "QmA4kP-Eu.8f858b94-9d32-4d73-9102-13f0e6e60659"});
web3 = new Web3(biconomy);
biconomy.onEvent(biconomy.READY, async () => {
try{
@rahuldamodar94
rahuldamodar94 / gist:47344086a915941d754fb617c66b9015
Created September 25, 2020 08:29
ERC20MintablePredicate.sol
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
After you install dependecies, go to node_modules/@0x/contract-addresses/lib/addresses.json
and add the following to the list of addresses
"80001":{
"erc20Proxy": "0x0b47076aaa5246411458fcf85494f41bbfdb8470",
"erc721Proxy": "0xff7ca10af37178bdd056628ef42fd7f799fac77c",
"erc1155Proxy": "0x53d791f18155c211ff8b58671d0f7e9b50e596ad",
"zrxToken": "0x5af2b282779c7d4ffc69ca4e6e16676747f5c56b",
"etherToken": "0x5b5e11e4818cceba3e82ca9b97cd0ab80be75ad3",
"exchange": "0x533dc89624dcc012c7323b41f286bd2df478800b",
let Web3 = require("web3");
let artifacts = require("./abi.json");
const provider = new Web3.providers.WebsocketProvider(
"wss://ws-mumbai.matic.today"
);
const web3 = new Web3(provider);
const rootContractInstance = new web3.eth.Contract(
artifacts,
DEPLOYMENT_NETWORK=testnet
DEPLOYMENT_VERSION=mumbai
MAIN_RPC=https://goerli.infura.io/v3/70645f042c3a409599c60f96f6dd9fbc
MATIC_RPC=https://rpc-mumbai.matic.today
MARKETPLACE_API_HOST=https://marketplace.api.matic.today/api/v1
FILE_HOST=https://marketplace.api.matic.today/
DISPLAY_SALE_TAG_TIME=2
pragma solidity ^0.6.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
var prompt = require("prompt");
var array = [
[0, 0, 0, 0, 0],
[0, 16, 0, 0, 0],
[0, 4, 0, 0, 0],
[16, 32, 0, 0, 0],
[8, 16, 0, 0, 0],
[4, 8, 4, 0, 0],
];
// File: @openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {