text: // MY INFURA_ID, SWAP IN YOURS FROM https://infura.io/dashboard/ethereum
  export const INFURA_ID = "460f40a260564ac4a4f4b3fffb032dad";
  export const ALCHEMY_ID = "T2slBtipg2WexVWuWmuR-S28gz_pYph0";
  
  // MY ETHERSCAN_ID, SWAP IN YOURS FROM https://etherscan.io/myapikey
  export const ETHERSCAN_KEY = "PSW8C433Q667DVEX5BCRMGNAH9FSGFZ7Q8";
  
  // BLOCKNATIVE ID FOR Notify.js:
  export const BLOCKNATIVE_DAPPID = "0b58206a-f3c0-4701-a62f-73c7243e8c77";
  
  export const RARIBLE_BASE_URL = "https://ethereum-api-dev.rarible.org/v0.1/"
  
  // EXTERNAL CONTRACTS
  
  export const DAI_ADDRESS = "0x6B175474E89094C44Da98b954EedeAC495271d0F";
  
  export const DAI_ABI = [
    {
      inputs: [{ internalType: "uint256", name: "chainId_", type: "uint256" }],
      payable: false,
      stateMutability: "nonpayable",
      type: "constructor",
    },
    {
      anonymous: false,
      inputs: [
        { indexed: true, internalType: "address", name: "src", type: "address" },
        { indexed: true, internalType: "address", name: "guy", type: "address" },
        { indexed: false, internalType: "uint256", name: "wad", type: "uint256" },
      ],
      name: "Approval",
      type: "event",
    },
    {
      anonymous: true,
      inputs: [
        { indexed: true, internalType: "bytes4", name: "sig", type: "bytes4" },
        { indexed: true, internalType: "address", name: "usr", type: "address" },
        { indexed: true, internalType: "bytes32", name: "arg1", type: "bytes32" },
        { indexed: true, internalType: "bytes32", name: "arg2", type: "bytes32" },
        { indexed: false, internalType: "bytes", name: "data", type: "bytes" },
      ],
      name: "LogNote",
      type: "event",
    },
    {
      anonymous: false,
      inputs: [
        { indexed: true, internalType: "address", name: "src", type: "address" },
        { indexed: true, internalType: "address", name: "dst", type: "address" },
        { indexed: false, internalType: "uint256", name: "wad", type: "uint256" },
      ],
      name: "Transfer",
      type: "event",
    },
    {
      constant: true,
      inputs: [],
      name: "DOMAIN_SEPARATOR",
      outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
    {
      constant: true,
      inputs: [],
      name: "PERMIT_TYPEHASH",
      outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
    {
      constant: true,
      inputs: [
        { internalType: "address", name: "", type: "address" },
        { internalType: "address", name: "", type: "address" },
      ],
      name: "allowance",
      outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
    {
      constant: false,
      inputs: [
        { internalType: "address", name: "usr", type: "address" },
        { internalType: "uint256", name: "wad", type: "uint256" },
      ],
      name: "approve",
      outputs: [{ internalType: "bool", name: "", type: "bool" }],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: true,
      inputs: [{ internalType: "address", name: "", type: "address" }],
      name: "balanceOf",
      outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
    {
      constant: false,
      inputs: [
        { internalType: "address", name: "usr", type: "address" },
        { internalType: "uint256", name: "wad", type: "uint256" },
      ],
      name: "burn",
      outputs: [],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: true,
      inputs: [],
      name: "decimals",
      outputs: [{ internalType: "uint8", name: "", type: "uint8" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
    {
      constant: false,
      inputs: [{ internalType: "address", name: "guy", type: "address" }],
      name: "deny",
      outputs: [],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: false,
      inputs: [
        { internalType: "address", name: "usr", type: "address" },
        { internalType: "uint256", name: "wad", type: "uint256" },
      ],
      name: "mint",
      outputs: [],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: false,
      inputs: [
        { internalType: "address", name: "src", type: "address" },
        { internalType: "address", name: "dst", type: "address" },
        { internalType: "uint256", name: "wad", type: "uint256" },
      ],
      name: "move",
      outputs: [],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: true,
      inputs: [],
      name: "name",
      outputs: [{ internalType: "string", name: "", type: "string" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
    {
      constant: true,
      inputs: [{ internalType: "address", name: "", type: "address" }],
      name: "nonces",
      outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
    {
      constant: false,
      inputs: [
        { internalType: "address", name: "holder", type: "address" },
        { internalType: "address", name: "spender", type: "address" },
        { internalType: "uint256", name: "nonce", type: "uint256" },
        { internalType: "uint256", name: "expiry", type: "uint256" },
        { internalType: "bool", name: "allowed", type: "bool" },
        { internalType: "uint8", name: "v", type: "uint8" },
        { internalType: "bytes32", name: "r", type: "bytes32" },
        { internalType: "bytes32", name: "s", type: "bytes32" },
      ],
      name: "permit",
      outputs: [],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: false,
      inputs: [
        { internalType: "address", name: "usr", type: "address" },
        { internalType: "uint256", name: "wad", type: "uint256" },
      ],
      name: "pull",
      outputs: [],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: false,
      inputs: [
        { internalType: "address", name: "usr", type: "address" },
        { internalType: "uint256", name: "wad", type: "uint256" },
      ],
      name: "push",
      outputs: [],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: false,
      inputs: [{ internalType: "address", name: "guy", type: "address" }],
      name: "rely",
      outputs: [],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: true,
      inputs: [],
      name: "symbol",
      outputs: [{ internalType: "string", name: "", type: "string" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
    {
      constant: true,
      inputs: [],
      name: "totalSupply",
      outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
    {
      constant: false,
      inputs: [
        { internalType: "address", name: "dst", type: "address" },
        { internalType: "uint256", name: "wad", type: "uint256" },
      ],
      name: "transfer",
      outputs: [{ internalType: "bool", name: "", type: "bool" }],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: false,
      inputs: [
        { internalType: "address", name: "src", type: "address" },
        { internalType: "address", name: "dst", type: "address" },
        { internalType: "uint256", name: "wad", type: "uint256" },
      ],
      name: "transferFrom",
      outputs: [{ internalType: "bool", name: "", type: "bool" }],
      payable: false,
      stateMutability: "nonpayable",
      type: "function",
    },
    {
      constant: true,
      inputs: [],
      name: "version",
      outputs: [{ internalType: "string", name: "", type: "string" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
    {
      constant: true,
      inputs: [{ internalType: "address", name: "", type: "address" }],
      name: "wards",
      outputs: [{ internalType: "uint256", name: "", type: "uint256" }],
      payable: false,
      stateMutability: "view",
      type: "function",
    },
  ];
  
  export const NETWORK = chainId => {
    for (const n in NETWORKS) {
      if (NETWORKS[n].chainId === chainId) {
        return NETWORKS[n];
      }
    }
  };
  
  export const NETWORKS = {
    localhost: {
      name: "localhost",
      color: "#666666",
      chainId: 31337,
      blockExplorer: "",
      rpcUrl: "http://" + window.location.hostname + ":8545",
    },
    mainnet: {
      name: "mainnet",
      color: "#ff8b9e",
      chainId: 1,
      rpcUrl: `https://mainnet.infura.io/v3/${INFURA_ID}`,
      blockExplorer: "https://etherscan.io/",
    },
    kovan: {
      name: "kovan",
      color: "#7003DD",
      chainId: 42,
      rpcUrl: `https://kovan.infura.io/v3/${INFURA_ID}`,
      blockExplorer: "https://kovan.etherscan.io/",
      faucet: "https://gitter.im/kovan-testnet/faucet", // https://faucet.kovan.network/
    },
    rinkeby: {
      name: "rinkeby",
      color: "#e0d068",
      chainId: 4,
      rpcUrl: `https://rinkeby.infura.io/v3/${INFURA_ID}`,
      faucet: "https://faucet.rinkeby.io/",
      blockExplorer: "https://rinkeby.etherscan.io/",
    },
    ropsten: {
      name: "ropsten",
      color: "#F60D09",
      chainId: 3,
      faucet: "https://faucet.ropsten.be/",
      blockExplorer: "https://ropsten.etherscan.io/",
      rpcUrl: `https://ropsten.infura.io/v3/${INFURA_ID}`,
    },
    goerli: {
      name: "goerli",
      color: "#0975F6",
      chainId: 5,
      faucet: "https://goerli-faucet.slock.it/",
      blockExplorer: "https://goerli.etherscan.io/",
      rpcUrl: `https://goerli.infura.io/v3/${INFURA_ID}`,
    },
    xdai: {
      name: "xdai",
      color: "#48a9a6",
      chainId: 100,
      price: 1,
      gasPrice: 1000000000,
      rpcUrl: "https://dai.poa.network",
      faucet: "https://xdai-faucet.top/",
      blockExplorer: "https://blockscout.com/poa/xdai/",
    },
    matic: {
      name: "matic",
      color: "#2bbdf7",
      chainId: 137,
      price: 1,
      gasPrice: 1000000000,
      rpcUrl: "https://rpc-mainnet.maticvigil.com",
      faucet: "https://faucet.matic.network/",
      blockExplorer: "https://explorer-mainnet.maticvigil.com//",
    },
    mumbai: {
      name: "mumbai",
      color: "#92D9FA",
      chainId: 80001,
      price: 1,
      gasPrice: 1000000000,
      rpcUrl: "https://rpc-mumbai.maticvigil.com",
      faucet: "https://faucet.matic.network/",
      blockExplorer: "https://mumbai-explorer.matic.today/",
    },
  };
  