Skip to content

Commit

Permalink
use erc-token-js
Browse files Browse the repository at this point in the history
  • Loading branch information
clbrge committed Apr 18, 2023
1 parent 94782cb commit badb18f
Show file tree
Hide file tree
Showing 8 changed files with 6,094 additions and 32,824 deletions.
4 changes: 2 additions & 2 deletions deploy/00_deploy_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const deploy = async ({getNamedAccounts, deployments}) => {
const { deploy } = deployments
const { deployer } = await getNamedAccounts()

// const balance = await provider.getBalance(deployer.address)
// console.log('deployer is ', deployer.address, balance)
//const balance = await ethers.provider.getBalance(deployer.address)
//console.log('deployer is ', deployer.address, balance)

const singleton = await deploy('Rouge', {
from: deployer,
Expand Down
82 changes: 66 additions & 16 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ module.exports = {
namedAccounts: {
deployer: {
default: 0, // here this will by default take the first account as deployer
'arb-nova': deployer
'oeth': `privatekey://${deployer}`,
'gno': `privatekey://${deployer}`,
'matic': `privatekey://${deployer}`,
'arb-nova': `privatekey://${deployer}`,
},
// pool:{
// default: 1, // here this will by default take the second account
Expand All @@ -40,21 +43,6 @@ module.exports = {
//initialBaseFeePerGas: 0, // workaround from https://github.com/sc-forks/>
// forking: { url: `https://eth-mainnet.alchemyapi.io/v2/${process.env.ALCHEMY_KEY}`, }
},
// main nets
'arb-nova': {
url: 'https://nova.arbitrum.io/rpc',
tokens: {
'USDC': '0x750ba8b76187092b0d1e87e28daaf484d1b5273b',
'XDAI': '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
}
},
'optimism': {
url: '',
tokens: {
'USDC': '',
'XDAI': '',
}
},
// test nets
'geth': {
targets: [ 'test' ],
Expand All @@ -71,6 +59,32 @@ module.exports = {
url: `https://goerli.infura.io/v3/${process.env.INFURA_KEY}`,
accounts: { mnemonic },
},
// use to test deployments. do not use with app
sep: {
// 11155111
url: `https://sepolia.infura.io/v3/${process.env.INFURA_KEY}`,
accounts: { mnemonic },
},
'scr-alpha': {
// 534353
url: `https://alpha-rpc.scroll.io/l2`,
accounts: { mnemonic },
},
'testnet-zkEVM-mango': {
// 1442
url: `https://rpc.public.zkevm-test.net`,
accounts: { mnemonic },
},
"mantle-testnet": {
// 5001
url: "https://rpc.testnet.mantle.xyz/",
accounts: { mnemonic },
},
"taiko-a2": {
// 167004
url: "https://rpc.a2.taiko.xyz",
accounts: { mnemonic },
},
'arb-goerli': {
url: `https://goerli-rollup.arbitrum.io/rpc`,
accounts: { mnemonic },
Expand All @@ -87,6 +101,7 @@ module.exports = {
url: 'https://stardust.metis.io/?owner=588',
accounts: { mnemonic },
},
// main nets
mainnet: {
tokens: {
'USDC': 'TODO',
Expand All @@ -97,6 +112,41 @@ module.exports = {
maxFeePerGas: 65 * 1e9
//You sent both gasPrice, and maxFeePerGas or maxPriorityFeePerGas
},
'oeth': {
// 10
url: `${process.env.OPTIMISM_RPC}`,
xtokens: {
'USDC': '',
'XDAI': '',
}
},
'gno': {
// 100
url: 'https://rpc.ankr.com/gnosis',
xtokens: {
'USDC': '',
'WDAI': '',
}
},
'matic': {
// 137
// https://gasstation-mainnet.matic.network/v2
url: `${process.env.POLYGON_RPC}`,
maxFeePerGas: 100 * 1e9, // api is fast.maxfee
maxPriorityFeePerGas: 60 * 1e9, // api is fast.maxPriorityFee
xtokens: {
'USDC': '',
'XDAI': '',
}
},
'arb-nova': {
// 42170
url: 'https://nova.arbitrum.io/rpc',
tokens: {
'USDC': '0x750ba8b76187092b0d1e87e28daaf484d1b5273b',
'XDAI': '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
}
},
},
gasReporter: {
enabled: process.env.REPORT_GAS !== undefined,
Expand Down
245 changes: 0 additions & 245 deletions lib/Token.mjs

This file was deleted.

3 changes: 1 addition & 2 deletions lib/rouge.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { Buffer } from 'buffer'
import { utils, constants, BigNumber, ethers } from 'ethers'

import { Token, TokenAmount } from './Token.mjs'
import { TokenAmount } from 'erc-token-js'

const nullLogger = {
fatal: args => new Error(...args),
Expand All @@ -16,7 +16,6 @@ const nullLogger = {

let { fatal, error, warn, info, debug, trace } = nullLogger


export const setLogger = logger => {
void({ fatal, error, warn, info, debug, trace } = logger)
}
Expand Down
Loading

0 comments on commit badb18f

Please sign in to comment.