@marketprotocol/abis
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -1378,11 +1378,11 @@ { | ||
"networks": { | ||
"4": { | ||
"42": { | ||
"events": {}, | ||
"links": {}, | ||
"address": "0x70c7d18816575bb0a85d53dffec3f30749e0b65f", | ||
"transactionHash": "0xa99f956eba07dbe95ec6661f56c18d52f43dff399ec71bad43f4b57190117360" | ||
"address": "0xd71bf1a726e0b1b7ee8fc79caae3f3fa455d6596", | ||
"transactionHash": "0x381fb823822b2ad00539eda26cfb74e512c5e0f5b8c7453d26ee0e61bda5cca4" | ||
} | ||
}, | ||
"schemaVersion": "2.0.1", | ||
"updatedAt": "2018-10-16T03:15:00.647Z" | ||
"updatedAt": "2018-12-12T17:43:12.924Z" | ||
} |
const MathLib = artifacts.require( | ||
'@marketprotocol/marketprotocol/MathLib.sol' | ||
); | ||
const OrderLib = artifacts.require( | ||
'@marketprotocol/marketprotocol/OrderLib.sol' | ||
); | ||
const MarketContractOraclize = artifacts.require( | ||
'@marketprotocol/marketprotocol/MarketContractOraclize.sol' | ||
); | ||
const MarketContract = artifacts.require( | ||
'@marketprotocol/marketprotocol/MarketContract.sol' | ||
); | ||
const MarketContractFactory = artifacts.require( | ||
@@ -22,9 +22,12 @@ '@marketprotocol/marketprotocol/MarketContractFactoryOraclize.sol' | ||
); | ||
const MarketTradingHub = artifacts.require( | ||
'@marketprotocol/marketprotocol/MarketTradingHub.sol' | ||
const CollateralToken = artifacts.require( | ||
'@marketprotocol/marketprotocol/InitialAllocationCollateralToken.sol' | ||
); | ||
const OracleHub = artifacts.require( | ||
'@marketprotocol/marketprotocol/OracleHubOraclize.sol' | ||
); | ||
module.exports = function (deployer, network) { | ||
if (network !== 'live') { | ||
return deployer.deploy([MathLib, OrderLib, MarketContractRegistry]).then(function () { | ||
return deployer.deploy([MathLib, MarketContractRegistry]).then(function () { | ||
@@ -36,44 +39,54 @@ deployer.link( | ||
MarketCollateralPool, | ||
MarketContractFactory | ||
MarketContractFactory, | ||
MarketContract | ||
] | ||
); | ||
deployer.link(OrderLib, [MarketContractFactory, MarketContractOraclize, MarketTradingHub]); | ||
// deploy the global collateral pool | ||
return deployer.deploy(MarketCollateralPool).then(function (marketCollateralPool) { | ||
return deployer.deploy( | ||
MarketCollateralPool, | ||
MarketContractRegistry.address | ||
).then(function () { | ||
// 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( | ||
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) | ||
// deploy our collateral token "USD" - a fake stable coin for testing | ||
return deployer.deploy(CollateralToken, "USD Stable", "USD", 1000000, 18).then(function () { | ||
// 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 deployer.deploy( | ||
MarketContractFactory, | ||
MarketContractRegistry.address, | ||
MarketCollateralPool.address, | ||
{gas: 7000000} | ||
).then(function (factory) { | ||
return MarketContractRegistry.deployed().then(function (marketContractRegistry) { | ||
// white list the factory | ||
return marketContractRegistry.addFactoryAddress(factory.address).then(function () { | ||
// deploy our oracle hub | ||
return deployer.deploy( | ||
OracleHub, | ||
factory.address, | ||
{gas: 7000000, value: 1e18} // sends ETH to fund oracle requests in the future | ||
).then(function (oracleHub) { | ||
return factory.setOracleHubAddress(oracleHub.address).then(function () { | ||
// deploy the first market contract for testing purposes | ||
return factory | ||
.deployMarketContractOraclize( | ||
'BTC_USDT_BIN_1548979199_BETA', | ||
CollateralToken.address, | ||
[150000000000, 600000000000, 8, 10000000000, 1548979199], | ||
'URL', | ||
'json(https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT).price', | ||
{gas: 7000000} | ||
); | ||
}); | ||
}); | ||
}); | ||
@@ -83,3 +96,3 @@ }); | ||
}); | ||
}); | ||
}); | ||
}); | ||
@@ -86,0 +99,0 @@ }); |
{ | ||
"name": "@marketprotocol/abis", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "MARKET Protocol truffle artifacts and ABIs", | ||
@@ -29,4 +29,4 @@ "main": "truffle-config.js", | ||
"devDependencies": { | ||
"@marketprotocol/marketprotocol": "^1.4.0" | ||
"@marketprotocol/marketprotocol": "^2.0.0-alpha" | ||
} | ||
} |
@@ -10,10 +10,10 @@ module.exports = { | ||
}, | ||
rinkeby: { | ||
kovan: { | ||
host: '127.0.0.1', | ||
port: 8545, | ||
from: '0x8a6C7Ea2C27827093825e5FdD57BD564312c6a2c', | ||
network_id: 4, | ||
gasPrice: 3000000000 // Specified in Wei | ||
from: '0x0088BD180722C48602770d355E692D2EBFbA86Ac', | ||
network_id: 42, | ||
gasPrice: 1000000000 // Specified in Wei | ||
} | ||
} | ||
}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
2757219
18
60738