aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-02-05 22:33:09 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-03-02 04:21:09 +0800
commit425039e4d3e45b27e1bac7338fa70e59eb438df2 (patch)
tree095e2e75afe0c933056b5c146b618984e8fedc73 /packages
parent6c5333180d6207f273219de3fb0c269a81e2ae48 (diff)
downloaddexon-sol-tools-425039e4d3e45b27e1bac7338fa70e59eb438df2.tar
dexon-sol-tools-425039e4d3e45b27e1bac7338fa70e59eb438df2.tar.gz
dexon-sol-tools-425039e4d3e45b27e1bac7338fa70e59eb438df2.tar.bz2
dexon-sol-tools-425039e4d3e45b27e1bac7338fa70e59eb438df2.tar.lz
dexon-sol-tools-425039e4d3e45b27e1bac7338fa70e59eb438df2.tar.xz
dexon-sol-tools-425039e4d3e45b27e1bac7338fa70e59eb438df2.tar.zst
dexon-sol-tools-425039e4d3e45b27e1bac7338fa70e59eb438df2.zip
Don't pass tokenGet and tokenGive because we can get them from 0x order
Diffstat (limited to 'packages')
-rw-r--r--packages/contracts/src/current/tutorials/Arbitrage/Arbitrage.sol20
-rw-r--r--packages/contracts/test/tutorials/arbitrage.ts4
2 files changed, 10 insertions, 14 deletions
diff --git a/packages/contracts/src/current/tutorials/Arbitrage/Arbitrage.sol b/packages/contracts/src/current/tutorials/Arbitrage/Arbitrage.sol
index f355cfefc..8a744fd8e 100644
--- a/packages/contracts/src/current/tutorials/Arbitrage/Arbitrage.sol
+++ b/packages/contracts/src/current/tutorials/Arbitrage/Arbitrage.sol
@@ -31,9 +31,7 @@ contract Arbitrage is Ownable {
*
* addresses
* 0..4 orderAddresses
- * 5 tokenGet
- * 6 tokenGive
- * 7 user
+ * 5 user
*
* values
* 0..5 orderValues
@@ -48,7 +46,7 @@ contract Arbitrage is Ownable {
* exchange then etherDelta
*/
function makeAtomicTrade(
- address[8] addresses, uint[12] values,
+ address[6] addresses, uint[12] values,
uint8[2] v, bytes32[2] r, bytes32[2] s
) external onlyOwner {
makeExchangeTrade(addresses, values, v, r, s);
@@ -56,29 +54,29 @@ contract Arbitrage is Ownable {
}
function makeEtherDeltaTrade(
- address[8] addresses, uint[12] values,
+ address[6] addresses, uint[12] values,
uint8[2] v, bytes32[2] r, bytes32[2] s
) internal {
uint amount = values[11];
- etherDelta.depositToken(addresses[5], values[7]);
+ etherDelta.depositToken(addresses[2], values[7]);
etherDelta.trade(
- addresses[5],
+ addresses[2],
values[7],
- addresses[6],
+ addresses[3],
values[8],
values[9],
values[10],
- addresses[7],
+ addresses[5],
v[1],
r[1],
s[1],
amount
);
- etherDelta.withdrawToken(addresses[6], values[8]);
+ etherDelta.withdrawToken(addresses[3], values[8]);
}
function makeExchangeTrade(
- address[8] addresses, uint[12] values,
+ address[6] addresses, uint[12] values,
uint8[2] v, bytes32[2] r, bytes32[2] s
) internal {
address[5] memory orderAddresses = [
diff --git a/packages/contracts/test/tutorials/arbitrage.ts b/packages/contracts/test/tutorials/arbitrage.ts
index d32b4b344..d438c5f5f 100644
--- a/packages/contracts/test/tutorials/arbitrage.ts
+++ b/packages/contracts/test/tutorials/arbitrage.ts
@@ -22,7 +22,7 @@ const web3 = web3Factory.create();
const web3Wrapper = new Web3Wrapper(web3.currentProvider);
const blockchainLifecycle = new BlockchainLifecycle();
-describe('Arbitrage', () => {
+describe.only('Arbitrage', () => {
let coinbase: string;
let maker: string;
let edMaker: string;
@@ -153,8 +153,6 @@ describe('Arbitrage', () => {
order.params.makerToken,
order.params.takerToken,
order.params.feeRecipient,
- tokenGet,
- tokenGive,
edMaker,
];
const fillTakerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(1), 18);