diff --git a/packages/loopring_v3.js/src/exchange_v3.ts b/packages/loopring_v3.js/src/exchange_v3.ts index c277153a6..e0aee9851 100644 --- a/packages/loopring_v3.js/src/exchange_v3.ts +++ b/packages/loopring_v3.js/src/exchange_v3.ts @@ -79,15 +79,15 @@ export class ExchangeV3 { this.syncedToEthereumBlockIdx = 0; - const ABIPath = "ABI/version36/"; + const ABIPath = "ABI/version3x/"; this.exchangeV3Abi = fs.readFileSync(ABIPath + "IExchangeV3.abi", "ascii"); this.exchange = new web3.eth.Contract(JSON.parse(this.exchangeV3Abi)); this.exchange.options.address = this.exchangeAddress; - const exchangeCreationTimestamp = ( - await this.exchange.methods.getBlockInfo(0).call() - ).timestamp; + const exchangeCreationTimestamp = (await this.exchange.methods + .getBlockInfo(0) + .call()).timestamp; const genesisMerkleRoot = new BN( (await this.exchange.methods.getMerkleRoot().call()).slice(2), 16 diff --git a/packages/loopring_v3.js/src/protocol_v3.ts b/packages/loopring_v3.js/src/protocol_v3.ts index 0b9855ccd..7ceb420b1 100644 --- a/packages/loopring_v3.js/src/protocol_v3.ts +++ b/packages/loopring_v3.js/src/protocol_v3.ts @@ -48,7 +48,7 @@ export class ProtocolV3 { this.syncedToEthereumBlockIdx = 0; - const ABIPath = "ABI/version36/"; + const ABIPath = "ABI/version3x/"; this.loopringAbi = fs.readFileSync(ABIPath + "ILoopringV3.abi", "ascii"); this.loopring = new web3.eth.Contract(JSON.parse(this.loopringAbi)); diff --git a/packages/loopring_v3/genAbi.js b/packages/loopring_v3/genAbi.js index 253411b1c..a1a2aa3b0 100644 --- a/packages/loopring_v3/genAbi.js +++ b/packages/loopring_v3/genAbi.js @@ -1,6 +1,6 @@ const fs = require("fs"); const contractBuildPath = "./build/contracts"; -const abiDir = "./ABI/version36"; +const abiDir = "./ABI/version3x"; fs.readdir(contractBuildPath, function(err, files) { if (err) { diff --git a/packages/loopring_v3/genAbi.sh b/packages/loopring_v3/genAbi.sh index 8607e2150..deccbf883 100755 --- a/packages/loopring_v3/genAbi.sh +++ b/packages/loopring_v3/genAbi.sh @@ -3,11 +3,11 @@ rm -rf ABI/* node_modules/solc/solcjs \ - -o ABI/version36/ --overwrite \ + -o ABI/version3x/ --overwrite \ --abi contracts/core/iface/*.sol \ --allow-paths contracts/thirdparty/proxies/*.sol contracts/thirdparty/*.sol contracts/lib/*.sol -ABI_PATH="ABI/version36" +ABI_PATH="ABI/version3x" for file in $ABI_PATH/* do diff --git a/packages/loopring_v3/package.json b/packages/loopring_v3/package.json index 35d87b037..fa4e4f4cc 100644 --- a/packages/loopring_v3/package.json +++ b/packages/loopring_v3/package.json @@ -1,7 +1,7 @@ { "name": "loopring_v3", "version": "3.0.0", - "description": "Loopring DEX protocol version 3.0", + "description": "Loopring DEX protocol version 3.x", "main": "index.js", "directories": { "test": "test" @@ -33,7 +33,7 @@ "compile": "truffle compile", "make": "LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib/ make", "build": "./install && LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib/ make && npm run compile", - "genabi": "rm -rf ./ABI && mkdir -p ABI/version36 && node ./genAbi.js", + "genabi": "rm -rf ./ABI && mkdir -p ABI/version3x && node ./genAbi.js", "ganache": "./ganache.sh", "migrate": "npm run transpile && truffle migrate --network live | tee -a mainnet.deployed", "migrate-ropsten": "npm run transpile && truffle migrate --network ropsten | tee -a ropsten.deployed", diff --git a/packages/loopring_v3/scripts/feecollector_stats.ts b/packages/loopring_v3/scripts/feecollector_stats.ts index 3c4cae0c6..eecc1a1b2 100644 --- a/packages/loopring_v3/scripts/feecollector_stats.ts +++ b/packages/loopring_v3/scripts/feecollector_stats.ts @@ -89,7 +89,7 @@ async function getFeeCollectorStatsOfDate(date: string, blockNumber: number) { async function getTokenBalanceAtBlock(token: string, blockNumber: number) { const tokenContract = new web3.eth.Contract( - JSON.parse(fs.readFileSync("ABI/version36/ERC20.abi", "ascii")), + JSON.parse(fs.readFileSync("ABI/version3x/ERC20.abi", "ascii")), token ); diff --git a/packages/loopring_v3/scripts/list_unprocessed_deposits.ts b/packages/loopring_v3/scripts/list_unprocessed_deposits.ts index cba79c74a..8d0c9e688 100644 --- a/packages/loopring_v3/scripts/list_unprocessed_deposits.ts +++ b/packages/loopring_v3/scripts/list_unprocessed_deposits.ts @@ -14,7 +14,7 @@ const exchangeAddress = "0x0BABA1Ad5bE3a5C0a66E7ac838a129Bf948f1eA4"; async function listPendingDeposits(blocksAhead: number) { const depositEvents = await myEth.getEvents( - "ABI/version36/ExchangeV3.abi", + "ABI/version3x/ExchangeV3.abi", exchangeAddress, "DepositRequested", blocksAhead @@ -35,7 +35,7 @@ async function listPendingDeposits(blocksAhead: number) { const token = e.returnValues.token; const pendingAmount = await myEth.call( - "ABI/version36/ExchangeV3.abi", + "ABI/version3x/ExchangeV3.abi", exchangeAddress, "getPendingDepositAmount", to, diff --git a/packages/loopring_v3/scripts/redistribution_helper.ts b/packages/loopring_v3/scripts/redistribution_helper.ts index 3b1f94e94..0bc29f857 100644 --- a/packages/loopring_v3/scripts/redistribution_helper.ts +++ b/packages/loopring_v3/scripts/redistribution_helper.ts @@ -19,7 +19,7 @@ const defaultTxOpts = { const exchangeAddress = "0x0BABA1Ad5bE3a5C0a66E7ac838a129Bf948f1eA4"; async function getFailedDistributions(blocksAhead: number) { const failedEvents = await myEth.getEvents( - "ABI/version36/ExchangeV3.abi", + "ABI/version3x/ExchangeV3.abi", exchangeAddress, "WithdrawalFailed", blocksAhead @@ -37,7 +37,7 @@ async function getFailedDistributions(blocksAhead: number) { const token = e.returnValues.token; const withdrawableAmount = await myEth.call( - "ABI/version36/ExchangeV3.abi", + "ABI/version3x/ExchangeV3.abi", exchangeAddress, "getAmountWithdrawable", to, diff --git a/packages/loopring_v3/scripts/token_gas_stats.ts b/packages/loopring_v3/scripts/token_gas_stats.ts index a16504524..761cf6de1 100644 --- a/packages/loopring_v3/scripts/token_gas_stats.ts +++ b/packages/loopring_v3/scripts/token_gas_stats.ts @@ -17,7 +17,7 @@ async function getAllTokensInLoopring() { [...Array(tokenCount).keys()].map(async function(i) { if (i == 0) return; const tokenAddress = await myEth.call( - "ABI/version36/IExchangeV3.abi", + "ABI/version3x/IExchangeV3.abi", exchangeAddress, "getTokenAddress", i @@ -87,7 +87,7 @@ async function fetchTokenGasStats(token: string) { console.log("fetch stats for token:", token); const symbol = await myEth.call( - "ABI/version36/ERC20Token.abi", + "ABI/version3x/ERC20Token.abi", token, "symbol" ); @@ -95,7 +95,7 @@ async function fetchTokenGasStats(token: string) { if (symbol.startsWith("LP-")) return; const transferEvents = await myEth.getEvents( - "ABI/version36/ERC20Token.abi", + "ABI/version3x/ERC20Token.abi", token, "Transfer", 100000 diff --git a/packages/loopring_v3/test/context.ts b/packages/loopring_v3/test/context.ts index 3d916079a..c9f574246 100644 --- a/packages/loopring_v3/test/context.ts +++ b/packages/loopring_v3/test/context.ts @@ -13,7 +13,7 @@ export class Context { this.blockTimestamp = blockTimestamp; this.lrcAddress = lrcAddress; - const ABIPath = "ABI/version36/"; + const ABIPath = "ABI/version3x/"; const erc20Abi = fs.readFileSync(ABIPath + "ERC20.abi", "ascii"); /*if (!web3) { diff --git a/packages/loopring_v3/test/testExchangeNonReentrant.ts b/packages/loopring_v3/test/testExchangeNonReentrant.ts index 3996519ca..f8db1489a 100644 --- a/packages/loopring_v3/test/testExchangeNonReentrant.ts +++ b/packages/loopring_v3/test/testExchangeNonReentrant.ts @@ -31,7 +31,7 @@ contract("Exchange", (accounts: string[]) => { this.timeout(0); // Load IExchange ABI - const ABIPath = "ABI/version36/"; + const ABIPath = "ABI/version3x/"; const exchangeABI = JSON.parse( fs.readFileSync(ABIPath + "IExchangeV3.abi", "ascii") );