Skip to content

Commit

Permalink
[Protocol3] Update README.md and package.json (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
dong77 committed Aug 8, 2019
1 parent 0249e1d commit e23e179
Show file tree
Hide file tree
Showing 12 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions packages/loopring_v3/.gitignore
@@ -1,6 +1,7 @@
node_modules/
build/
transpiled/
ABI/
ethsnarks/
keys/
blocks/
Expand Down
3 changes: 2 additions & 1 deletion packages/loopring_v3/README.md
Expand Up @@ -60,7 +60,8 @@ make
```

## Run Unit Tests

- please clone the circuits repository `https://github.com/Loopring/protocol3-circuits.git` to the same directory as this project.
- please make sure you run `npm run build` for the first time.
- run `npm run ganache` from project's root directory in terminal.
- run `npm run test` from project's root directory in another terminal window.
- run single test: `npm run test -- transpiled/test/xxx.js`
Expand Down
Expand Up @@ -36,6 +36,6 @@ contract IDowntimeCostCalculator
uint durationToPurchaseMinutes
)
external
view
// view - This function may choose to change internal state.
returns (uint cost);
}
2 changes: 1 addition & 1 deletion packages/loopring_v3/contracts/iface/IExchange.sol
Expand Up @@ -1028,7 +1028,7 @@ contract IExchange
uint durationMinutes
)
external
view
// view - may modify internal state.
returns (uint costLRC);

/// @dev Gets the total amount of time in seconds the exchange has ever been in maintenance.
Expand Down
Expand Up @@ -18,13 +18,14 @@ pragma solidity 0.5.10;

import "../lib/Claimable.sol";
import "../lib/MathUint.sol";
import "../lib/ReentrancyGuard.sol";

import "../iface/IDowntimeCostCalculator.sol";


/// @title The default IDowntimeCostCalculator implementation.
/// @author Daniel Wang - <daniel@loopring.org>
contract DowntimeCostCalculator is IDowntimeCostCalculator, Claimable
contract DowntimeCostCalculator is Claimable, ReentrancyGuard, IDowntimeCostCalculator
{
using MathUint for uint;

Expand Down Expand Up @@ -69,7 +70,7 @@ contract DowntimeCostCalculator is IDowntimeCostCalculator, Claimable
uint durationToPurchaseMinutes
)
external
view
nonReentrant
returns (uint)
{
uint newCost = getTotalCost(
Expand Down
2 changes: 1 addition & 1 deletion packages/loopring_v3/contracts/impl/Exchange.sol
Expand Up @@ -799,7 +799,7 @@ contract Exchange is IExchange, Claimable, NoDefaultFunc, ReentrancyGuard
uint durationMinutes
)
external
view
nonReentrant
returns (uint costLRC)
{
costLRC = state.getDowntimeCostLRC(durationMinutes);
Expand Down
Expand Up @@ -203,7 +203,6 @@ library ExchangeAdmins
uint durationMinutes
)
public
view
returns (uint)
{
require(!S.isInWithdrawalMode(), "INVALID_MODE");
Expand Down
Expand Up @@ -23,7 +23,7 @@ import "../iface/IDowntimeCostCalculator.sol";

/// @title A fixed price IDowntimeCostCalculator implememntation.
/// @author Daniel Wang - <daniel@loopring.org>
contract DowntimeCostCalculator is IDowntimeCostCalculator
contract FixedPriceDowntimeCostCalculator is IDowntimeCostCalculator
{
using MathUint for uint;

Expand All @@ -37,7 +37,6 @@ contract DowntimeCostCalculator is IDowntimeCostCalculator
uint durationToPurchaseMinutes
)
external
view
returns (uint)
{
return durationToPurchaseMinutes.mul(PRICE_PER_MINUTE);
Expand Down
2 changes: 1 addition & 1 deletion packages/loopring_v3/install
@@ -1,6 +1,6 @@
#!/bin/bash

git submodule update --init --remote --merge --recursive
git submodule update --init --recursive

case "$OSTYPE" in
darwin*)
Expand Down
2 changes: 1 addition & 1 deletion packages/loopring_v3/migrations/4_deploy_protocol.js
Expand Up @@ -3,7 +3,7 @@ var WETHToken = artifacts.require("./test/tokens/WETH.sol");
var ExchangeDeployer = artifacts.require("./impl/ExchangeDeployer");
var BlockVerifier = artifacts.require("./impl/BlockVerifier.sol");
var DowntimeCostCalculator = artifacts.require(
"./test/DowntimeCostCalculator.sol"
"./test/FixedPriceDowntimeCostCalculator.sol"
);
var LoopringV3 = artifacts.require("./impl/LoopringV3.sol");
var ExchangeAccounts = artifacts.require("./impl/libexchange/ExchangeAccounts");
Expand Down
2 changes: 1 addition & 1 deletion packages/loopring_v3/package.json
Expand Up @@ -31,7 +31,7 @@
"docker": "docker-compose up --build --abort-on-container-exit; docker-compose logs -f test",
"testdocker": "npm run transpile && truffle test --network docker",
"compile": "truffle compile",
"build": "./install && yarn run compile",
"build": "rm -rf keys && ./install && make && npm run compile",
"genabi": "node_modules/solc/solcjs --abi contracts/iface/*.sol -o ABI/version30/ --overwrite && node_modules/solc/solcjs --abi contracts/lib/*.sol --allow-paths contracts/iface/*.sol -o ABI/version30/ --overwrite",
"migrate": "npm run transpile && truffle migrate",
"deploy": "npm run migrate --network kovan",
Expand Down
2 changes: 1 addition & 1 deletion packages/loopring_v3/util/Artifacts.ts
Expand Up @@ -26,7 +26,7 @@ export class Artifacts {
this.ExchangeDeployer = artifacts.require("impl/ExchangeDeployer");
this.BlockVerifier = artifacts.require("impl/BlockVerifier");
this.DowntimeCostCalculator = artifacts.require(
"test/DowntimeCostCalculator"
"test/FixedPriceDowntimeCostCalculator"
);
this.DummyToken = artifacts.require("test/DummyToken");
this.LRCToken = artifacts.require("test/tokens/LRC");
Expand Down

0 comments on commit e23e179

Please sign in to comment.