Skip to content

[Loopring 3.x] change target dir #2467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/loopring_v3.js/src/exchange_v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/loopring_v3.js/src/protocol_v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion packages/loopring_v3/genAbi.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions packages/loopring_v3/genAbi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/loopring_v3/package.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/loopring_v3/scripts/feecollector_stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand Down
4 changes: 2 additions & 2 deletions packages/loopring_v3/scripts/list_unprocessed_deposits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions packages/loopring_v3/scripts/redistribution_helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions packages/loopring_v3/scripts/token_gas_stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -87,15 +87,15 @@ 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"
);
console.log("symbol:", symbol);
if (symbol.startsWith("LP-")) return;

const transferEvents = await myEth.getEvents(
"ABI/version36/ERC20Token.abi",
"ABI/version3x/ERC20Token.abi",
token,
"Transfer",
100000
Expand Down
2 changes: 1 addition & 1 deletion packages/loopring_v3/test/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion packages/loopring_v3/test/testExchangeNonReentrant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
);
Expand Down