Commit 13a0aee6 authored by Uciel's avatar Uciel

BAT and OMG tokens live

parent f7c493a7
......@@ -226,12 +226,12 @@ class App extends Component {
// console.log('Input Invariant: ' + result);
});
exchange.methods.ethInMarket().call().then((result, error) => {
exchange.methods.ethPool().call().then((result, error) => {
this.props.setMarketEth1(result);
// console.log('Input Market ETH: ' + result);
});
exchange.methods.tokensInMarket().call().then((result, error) => {
exchange.methods.tokenPool().call().then((result, error) => {
this.props.setMarketTokens1(result);
// console.log('Input Market Tokens: ' + result);
});
......@@ -243,12 +243,12 @@ class App extends Component {
// console.log('Output Invariant: ' + result);
});
exchange.methods.ethInMarket().call().then((result, error) => {
exchange.methods.ethPool().call().then((result, error) => {
this.props.setMarketEth2(result);
// console.log('Output Market ETH: ' + result);
});
exchange.methods.tokensInMarket().call().then((result, error) => {
exchange.methods.tokenPool().call().then((result, error) => {
this.props.setMarketTokens2(result);
// console.log('Output Market Tokens: ' + result);
});
......
......@@ -8,6 +8,7 @@ import { setExchangeInputValue, setExchangeOutputValue, setExchangeRate, setExch
class Exchange extends Component {
onInputChange = async (event) => {
var inputValue = event.target.value;
console.log(inputValue, 'onInputChange value')
await this.props.setExchangeInputValue(inputValue);
this.setExchangeOutput();
}
......@@ -36,6 +37,8 @@ class Exchange extends Component {
setExchangeOutput = () => {
var inputValue = this.props.exchange.inputValue;
console.log(inputValue, 'from setExchangeOutput')
console.log('outputToken', this.props.exchange.outputToken);
if (this.props.web3Store.exchangeType === 'Invalid'){
this.props.setExchangeOutputValue(0);
this.props.setInteractionState('error1');
......
......@@ -33,8 +33,8 @@ class Purchase extends Component {
// transactions is cookie stuff, we'll keep that in state
// this.setState({ transactions: transactions })
// any particular reason why there are initialized as 0, but get turned to empty strings after the transaction is over?
this.props.setExchangeInputValue('');
this.props.setExchangeOutputValue('');
// this.props.setExchangeInputValue(0);
// this.props.setExchangeOutputValue(0);
this.props.setInteractionState('submitted');
// cookie.save('transactions', transactions, { path: '/' })
})
......@@ -64,8 +64,8 @@ class Purchase extends Component {
// let transactions = this.state.transactions
// transactions.push(result)
// this.setState({ transactions: transactions });
this.props.setExchangeInputValue('');
this.props.setExchangeOutputValue('');
// this.props.setExchangeInputValue(0);
// this.props.setExchangeOutputValue(0);
this.props.setInteractionState('submitted');
// cookie.save('transactions', transactions, { path: '/' })
})
......@@ -93,8 +93,8 @@ class Purchase extends Component {
// let transactions = this.state.transactions
// transactions.push(result)
// this.setState({ transactions: transactions });
this.props.setExchangeInputValue('');
this.props.setExchangeOutputValue('');
// this.props.setExchangeInputValue(0);
// this.props.setExchangeOutputValue(0);
this.props.setInteractionState('submitted');
// cookie.save('transactions', transactions, { path: '/' })
})
......
module.exports.exchangeABI =
[
{
"constant": true,
"inputs": [],
"name": "FEE_RATE",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_buyTokenAddress",
"type": "address"
},
{
"name": "_tokensSold",
"type": "uint256"
},
{
"name": "_minTokensReceived",
"type": "uint256"
},
{
"name": "_timeout",
"type": "uint256"
}
],
"name": "tokenToTokenSwap",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "addFeesToMarketPublic",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalShares",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "sharesBurned",
"type": "uint256"
}
],
"name": "divestLiquidity",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "investLiquidity",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "buyer",
"type": "address"
},
{
"name": "_minTokens",
"type": "uint256"
}
],
"name": "tokenToTokenIn",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ethFees",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_minTokens",
"type": "uint256"
},
{
"name": "_timeout",
"type": "uint256"
}
],
"name": "ethToTokenSwap",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "factoryAddress",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "tokenAddress",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "_tokenAmount",
"type": "uint256"
},
{
"name": "_minEth",
"type": "uint256"
},
{
"name": "_timeout",
"type": "uint256"
}
],
"name": "tokenToEthSwap",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "tokenFees",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "invariant",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "tokensInMarket",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "ethInMarket",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "provider",
"type": "address"
}
],
"name": "getShares",
"outputs": [
{
"name": "_shares",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "tokenAmount",
"type": "uint256"
}
],
"name": "initializeExchange",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"name": "_tokenAddress",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "buyer",
"type": "address"
},
{
"indexed": false,
"name": "tokensPurchased",
"type": "uint256"
},
{
"indexed": false,
"name": "ethSpent",
"type": "uint256"
}
],
"name": "TokenPurchase",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "buyer",
"type": "address"
},
{
"indexed": false,
"name": "ethPurchased",
"type": "uint256"
},
{
"indexed": false,
"name": "tokensSpent",
"type": "uint256"
}
],
"name": "EthPurchase",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "liquidityProvider",
"type": "address"
},
{
"indexed": true,
"name": "sharesPurchased",
"type": "uint256"
}
],
"name": "Investment",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "liquidityProvider",
"type": "address"
},
{
"indexed": true,
"name": "sharesBurned",
"type": "uint256"
}
],
"name": "Divestment",
"type": "event"
}
]
module.exports.exchangeABI =
[{"anonymous":false,"inputs":[{"indexed":true,"name":"liquidityProvider","type":"address"},{"indexed":true,"name":"sharesBurned","type":"uint256"}],"name":"Divestment","type":"event"},{"constant":false,"inputs":[],"name":"addFeesToMarketPublic","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_sharesBurned","type":"uint256"},{"name":"_minEth","type":"uint256"},{"name":"_minTokens","type":"uint256"}],"name":"divestLiquidity","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_minTokens","type":"uint256"},{"name":"_timeout","type":"uint256"},{"name":"_recipient","type":"address"}],"name":"ethToTokenPayment","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_minTokens","type":"uint256"},{"name":"_timeout","type":"uint256"}],"name":"ethToTokenSwap","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenAmount","type":"uint256"}],"name":"initializeExchange","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_minShares","type":"uint256"}],"name":"investLiquidity","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyer","type":"address"},{"indexed":true,"name":"ethIn","type":"uint256"},{"indexed":true,"name":"tokensOut","type":"uint256"}],"name":"EthToTokenPurchase","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"liquidityProvider","type":"address"},{"indexed":true,"name":"sharesPurchased","type":"uint256"}],"name":"Investment","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"buyer","type":"address"},{"indexed":true,"name":"tokensIn","type":"uint256"},{"indexed":true,"name":"ethOut","type":"uint256"}],"name":"TokenToEthPurchase","type":"event"},{"constant":false,"inputs":[{"name":"_tokenAmount","type":"uint256"},{"name":"_minEth","type":"uint256"},{"name":"_timeout","type":"uint256"},{"name":"_recipient","type":"address"}],"name":"tokenToEthPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenAmount","type":"uint256"},{"name":"_minEth","type":"uint256"},{"name":"_timeout","type":"uint256"}],"name":"tokenToEthSwap","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_recipient","type":"address"},{"name":"_minTokens","type":"uint256"}],"name":"tokenToTokenIn","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenPurchased","type":"address"},{"name":"_recipient","type":"address"},{"name":"_tokensSold","type":"uint256"},{"name":"_minTokensReceived","type":"uint256"},{"name":"_timeout","type":"uint256"}],"name":"tokenToTokenPayment","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_tokenPurchased","type":"address"},{"name":"_tokensSold","type":"uint256"},{"name":"_minTokensReceived","type":"uint256"},{"name":"_timeout","type":"uint256"}],"name":"tokenToTokenSwap","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_tokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"constant":true,"inputs":[],"name":"ethFees","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ethPool","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"factoryAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"FEE_RATE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_provider","type":"address"}],"name":"getShares","outputs":[{"name":"_shares","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"invariant","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenFees","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenPool","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"totalShares","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"}]
\ No newline at end of file
module.exports.factoryABI =
[
{
"constant": false,
"inputs": [
{
"name": "token",
"type": "address"
}
],
"name": "createExchange",
"outputs": [
{
"name": "exchange",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getExchangeCount",
"outputs": [
{
"name": "exchangeCount",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "tokenList",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "token",
"type": "address"
}
],
"name": "tokenToExchangeLookup",
"outputs": [
{
"name": "exchange",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "exchange",
"type": "address"
}
],
"name": "exchangeToTokenLookup",
"outputs": [
{
"name": "token",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]
module.exports.factoryABI =
[{"constant":true,"inputs":[],"name":"getExchangeCount","outputs":[{"name":"exchangeCount","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_token","type":"address"}],"name":"launchExchange","outputs":[{"name":"exchange","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"tokenList","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_token","type":"address"}],"name":"tokenToExchangeLookup","outputs":[{"name":"exchange","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_exchange","type":"address"}],"name":"exchangeToTokenLookup","outputs":[{"name":"token","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"exchange","type":"address"},{"indexed":true,"name":"token","type":"address"}],"name":"ExchangeLaunch","type":"event"}]
......@@ -13,14 +13,14 @@ export default {
exchangeType: 'ETH to Token',
exchangeAddresses: {
addresses: [
['UNI','0xcDc30C3b02c5776495298198377D2Fc0fd6B1F1C'],
['SWAP','0x4632a7Cd732c625dcc48d75E289c209422e1D2B7']
['BAT','0x80f5C1beA2Ea4a9C21E4c6D7831ae2Dbce45674d'],
['OMG','0x1033f09e293200de63AF16041e83000aFBBfF5c0']
]
},
tokenAddresses: {
addresses: [
['UNI','0x350E5DD084ecF271e8d3531D4324443952F47756'],
['SWAP','0x8B2A87F8243f23C33fb97E23a21Ae8EDB3b71AcA']
['BAT','0xDA5B056Cfb861282B4b59d29c9B395bcC238D29B'],
['OMG','0x879884c3C46A24f56089f3bBbe4d5e38dB5788C0']
]
}
},
......@@ -30,7 +30,7 @@ export default {
inputBalance: 0,
outputBalance: 0,
inputToken: { value: 'ETH', label: 'ETH', clearableValue: false },
outputToken: { value: 'UNI', label: 'UNI', clearableValue: false },
outputToken: { value: 'OMG', label: 'OMG', clearableValue: false },
invariant1: 0,
invariant2: 0,
marketEth1: 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment