Skip to content

Commit

Permalink
Merge branch 'release/0.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Elsasser committed Oct 16, 2018
2 parents ba4bf60 + 084811e commit 6628708
Show file tree
Hide file tree
Showing 13 changed files with 44,881 additions and 10,194 deletions.
20,579 changes: 20,579 additions & 0 deletions build/contracts/MarketCollateralPool.json

Large diffs are not rendered by default.

1,995 changes: 0 additions & 1,995 deletions build/contracts/MarketCollateralPoolFactory.json

This file was deleted.

1,842 changes: 1,035 additions & 807 deletions build/contracts/MarketContractFactoryOraclize.json

Large diffs are not rendered by default.

2,655 changes: 1,090 additions & 1,565 deletions build/contracts/MarketContractOraclize.json

Large diffs are not rendered by default.

2,155 changes: 1,150 additions & 1,005 deletions build/contracts/MarketContractRegistry.json

Large diffs are not rendered by default.

2,674 changes: 1,337 additions & 1,337 deletions build/contracts/MarketToken.json

Large diffs are not rendered by default.

15,560 changes: 15,560 additions & 0 deletions build/contracts/MarketTradingHub.json

Large diffs are not rendered by default.

3,588 changes: 1,794 additions & 1,794 deletions build/contracts/MathLib.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions build/contracts/Migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -1378,10 +1378,10 @@
"4": {
"events": {},
"links": {},
"address": "0x1e1485f7327183fccfc3138afd965c23c78f9050",
"transactionHash": "0xd3f5fa596159a60bbc043c7a3e02c22bfbd28067def6c92818585e9e905e099d"
"address": "0x70c7d18816575bb0a85d53dffec3f30749e0b65f",
"transactionHash": "0xa99f956eba07dbe95ec6661f56c18d52f43dff399ec71bad43f4b57190117360"
}
},
"schemaVersion": "2.0.1",
"updatedAt": "2018-10-05T14:03:26.626Z"
"updatedAt": "2018-10-16T03:15:00.647Z"
}
3,370 changes: 1,766 additions & 1,604 deletions build/contracts/OrderLib.json

Large diffs are not rendered by default.

110 changes: 50 additions & 60 deletions migrations/2_deploy_contracts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,92 +4,82 @@ const MathLib = artifacts.require(
const OrderLib = artifacts.require(
'@marketprotocol/marketprotocol/OrderLib.sol'
);
const QueryTest = artifacts.require(
'@marketprotocol/marketprotocol/OraclizeQueryTest.sol'
);
const MarketContractOraclize = artifacts.require(
'@marketprotocol/marketprotocol/MarketContractOraclize.sol'
);
const MarketContractFactory = artifacts.require(
'@marketprotocol/marketprotocol/MarketContractFactoryOraclize.sol'
);
const MarketCollateralPoolFactory = artifacts.require(
'@marketprotocol/marketprotocol/MarketCollateralPoolFactory.sol'
const MarketCollateralPool = artifacts.require(
'@marketprotocol/marketprotocol/MarketCollateralPool.sol'
);
const MarketContractRegistry = artifacts.require(
'@marketprotocol/marketprotocol/MarketContractRegistry.sol'
);
const MarketToken = artifacts.require(
'@marketprotocol/marketprotocol/MarketToken.sol'
);
const MarketTradingHub = artifacts.require(
'@marketprotocol/marketprotocol/MarketTradingHub.sol'
);

module.exports = function(deployer, network) {
module.exports = function (deployer, network) {
if (network !== 'live') {
deployer.deploy(MathLib);
deployer.deploy(OrderLib);
deployer.deploy(MarketContractRegistry).then(function() {

deployer.link(
MathLib,
QueryTest,
MarketContractOraclize,
MarketContractFactory
);
return deployer.deploy([MathLib, OrderLib, MarketContractRegistry]).then(function () {

deployer.link(
MathLib,
MarketCollateralPoolFactory
[
MarketContractOraclize,
MarketCollateralPool,
MarketContractFactory
]
);

deployer.link(OrderLib, MarketContractFactory, MarketContractOraclize);
// deploy our quest test contract
deployer.deploy(QueryTest).then(function(queryTestInstance) {
// by forcing the first query when we deploy we can make sure all the prices are accurate since
// the first query is free with oraclize.
return queryTestInstance.testOracleQuery(
'URL',
'json(https://api.kraken.com/0/public/Ticker?pair=BCHUSD).result.BCHUSD.c.0',
);
});
deployer.link(OrderLib, [MarketContractFactory, MarketContractOraclize, MarketTradingHub]);

// deploy MKT token
const marketTokenToLockForTrading = 0; // for testing purposes, require no lock
const marketTokenAmountForContractCreation = 0; //for testing purposes require no balance
return deployer
.deploy(
MarketToken,
marketTokenToLockForTrading,
marketTokenAmountForContractCreation
)
.then(function() {
// deploy and set up main factory to create MARKET Protocol smart contracts.
return MarketContractRegistry.deployed().then(function(
marketContractRegistry
) {
// deploy the global collateral pool
return deployer.deploy(MarketCollateralPool).then(function (marketCollateralPool) {

// deploy MKT token
const marketTokenToLockForTrading = 0; // for testing purposes, require no lock
const marketTokenAmountForContractCreation = 0; //for testing purposes require no balance
return deployer
.deploy(
MarketToken,
marketTokenToLockForTrading,
marketTokenAmountForContractCreation
)
.then(function () {
// deploy our trading hub!
return deployer.deploy(
MarketCollateralPoolFactory,
marketContractRegistry.address
).then(function(collateralPoolFactory)
{
return deployer
.deploy(
MarketContractFactory,
marketContractRegistry.address,
MarketToken.address,
collateralPoolFactory.address,
{
gas: 7000000
}
)
.then(function(factory) {
// white list the factory
return marketContractRegistry
.addFactoryAddress(factory.address)
MarketTradingHub,
MarketToken.address,
MarketCollateralPool.address
).then(function (marketTradingHub) {
return marketCollateralPool.setMarketTradingHubAddress(
marketTradingHub.address
).then(function () {
// deploy and set up main factory to create MARKET Protocol smart contracts.
return MarketContractRegistry.deployed().then(function (
marketContractRegistry
) {
return deployer.deploy(
MarketContractFactory,
marketContractRegistry.address,
MarketToken.address,
{
gas: 7000000
}
).then(function (factory) {
// white list the factory
return marketContractRegistry.addFactoryAddress(factory.address)
});
});
});
});
});
});
});
});
}
};
Loading

0 comments on commit 6628708

Please sign in to comment.