Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
13a0aee6
Commit
13a0aee6
authored
Mar 24, 2018
by
Uciel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BAT and OMG tokens live
parent
f7c493a7
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
485 deletions
+22
-485
App.js
src/App.js
+4
-4
Exchange.js
src/components/Exchange.js
+3
-0
Purchase.js
src/components/Purchase.js
+6
-6
exchangeABI.js
src/helpers/exchangeABI.js
+2
-377
factoryABI.js
src/helpers/factoryABI.js
+2
-93
initial-state.js
src/store/initial-state.js
+5
-5
No files found.
src/App.js
View file @
13a0aee6
...
@@ -226,12 +226,12 @@ class App extends Component {
...
@@ -226,12 +226,12 @@ class App extends Component {
// console.log('Input Invariant: ' + result);
// console.log('Input Invariant: ' + result);
});
});
exchange
.
methods
.
eth
InMarket
().
call
().
then
((
result
,
error
)
=>
{
exchange
.
methods
.
eth
Pool
().
call
().
then
((
result
,
error
)
=>
{
this
.
props
.
setMarketEth1
(
result
);
this
.
props
.
setMarketEth1
(
result
);
// console.log('Input Market ETH: ' + result);
// console.log('Input Market ETH: ' + result);
});
});
exchange
.
methods
.
token
sInMarket
().
call
().
then
((
result
,
error
)
=>
{
exchange
.
methods
.
token
Pool
().
call
().
then
((
result
,
error
)
=>
{
this
.
props
.
setMarketTokens1
(
result
);
this
.
props
.
setMarketTokens1
(
result
);
// console.log('Input Market Tokens: ' + result);
// console.log('Input Market Tokens: ' + result);
});
});
...
@@ -243,12 +243,12 @@ class App extends Component {
...
@@ -243,12 +243,12 @@ class App extends Component {
// console.log('Output Invariant: ' + result);
// console.log('Output Invariant: ' + result);
});
});
exchange
.
methods
.
eth
InMarket
().
call
().
then
((
result
,
error
)
=>
{
exchange
.
methods
.
eth
Pool
().
call
().
then
((
result
,
error
)
=>
{
this
.
props
.
setMarketEth2
(
result
);
this
.
props
.
setMarketEth2
(
result
);
// console.log('Output Market ETH: ' + result);
// console.log('Output Market ETH: ' + result);
});
});
exchange
.
methods
.
token
sInMarket
().
call
().
then
((
result
,
error
)
=>
{
exchange
.
methods
.
token
Pool
().
call
().
then
((
result
,
error
)
=>
{
this
.
props
.
setMarketTokens2
(
result
);
this
.
props
.
setMarketTokens2
(
result
);
// console.log('Output Market Tokens: ' + result);
// console.log('Output Market Tokens: ' + result);
});
});
...
...
src/components/Exchange.js
View file @
13a0aee6
...
@@ -8,6 +8,7 @@ import { setExchangeInputValue, setExchangeOutputValue, setExchangeRate, setExch
...
@@ -8,6 +8,7 @@ import { setExchangeInputValue, setExchangeOutputValue, setExchangeRate, setExch
class
Exchange
extends
Component
{
class
Exchange
extends
Component
{
onInputChange
=
async
(
event
)
=>
{
onInputChange
=
async
(
event
)
=>
{
var
inputValue
=
event
.
target
.
value
;
var
inputValue
=
event
.
target
.
value
;
console
.
log
(
inputValue
,
'
onInputChange value
'
)
await
this
.
props
.
setExchangeInputValue
(
inputValue
);
await
this
.
props
.
setExchangeInputValue
(
inputValue
);
this
.
setExchangeOutput
();
this
.
setExchangeOutput
();
}
}
...
@@ -36,6 +37,8 @@ class Exchange extends Component {
...
@@ -36,6 +37,8 @@ class Exchange extends Component {
setExchangeOutput
=
()
=>
{
setExchangeOutput
=
()
=>
{
var
inputValue
=
this
.
props
.
exchange
.
inputValue
;
var
inputValue
=
this
.
props
.
exchange
.
inputValue
;
console
.
log
(
inputValue
,
'
from setExchangeOutput
'
)
console
.
log
(
'
outputToken
'
,
this
.
props
.
exchange
.
outputToken
);
if
(
this
.
props
.
web3Store
.
exchangeType
===
'
Invalid
'
){
if
(
this
.
props
.
web3Store
.
exchangeType
===
'
Invalid
'
){
this
.
props
.
setExchangeOutputValue
(
0
);
this
.
props
.
setExchangeOutputValue
(
0
);
this
.
props
.
setInteractionState
(
'
error1
'
);
this
.
props
.
setInteractionState
(
'
error1
'
);
...
...
src/components/Purchase.js
View file @
13a0aee6
...
@@ -33,8 +33,8 @@ class Purchase extends Component {
...
@@ -33,8 +33,8 @@ class Purchase extends Component {
// transactions is cookie stuff, we'll keep that in state
// transactions is cookie stuff, we'll keep that in state
// this.setState({ transactions: transactions })
// this.setState({ transactions: transactions })
// any particular reason why there are initialized as 0, but get turned to empty strings after the transaction is over?
// 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.setExchangeInputValue(0
);
this
.
props
.
setExchangeOutputValue
(
''
);
// this.props.setExchangeOutputValue(0
);
this
.
props
.
setInteractionState
(
'
submitted
'
);
this
.
props
.
setInteractionState
(
'
submitted
'
);
// cookie.save('transactions', transactions, { path: '/' })
// cookie.save('transactions', transactions, { path: '/' })
})
})
...
@@ -64,8 +64,8 @@ class Purchase extends Component {
...
@@ -64,8 +64,8 @@ class Purchase extends Component {
// let transactions = this.state.transactions
// let transactions = this.state.transactions
// transactions.push(result)
// transactions.push(result)
// this.setState({ transactions: transactions });
// this.setState({ transactions: transactions });
this
.
props
.
setExchangeInputValue
(
''
);
// this.props.setExchangeInputValue(0
);
this
.
props
.
setExchangeOutputValue
(
''
);
// this.props.setExchangeOutputValue(0
);
this
.
props
.
setInteractionState
(
'
submitted
'
);
this
.
props
.
setInteractionState
(
'
submitted
'
);
// cookie.save('transactions', transactions, { path: '/' })
// cookie.save('transactions', transactions, { path: '/' })
})
})
...
@@ -93,8 +93,8 @@ class Purchase extends Component {
...
@@ -93,8 +93,8 @@ class Purchase extends Component {
// let transactions = this.state.transactions
// let transactions = this.state.transactions
// transactions.push(result)
// transactions.push(result)
// this.setState({ transactions: transactions });
// this.setState({ transactions: transactions });
this
.
props
.
setExchangeInputValue
(
''
);
// this.props.setExchangeInputValue(0
);
this
.
props
.
setExchangeOutputValue
(
''
);
// this.props.setExchangeOutputValue(0
);
this
.
props
.
setInteractionState
(
'
submitted
'
);
this
.
props
.
setInteractionState
(
'
submitted
'
);
// cookie.save('transactions', transactions, { path: '/' })
// cookie.save('transactions', transactions, { path: '/' })
})
})
...
...
src/helpers/exchangeABI.js
View file @
13a0aee6
This diff is collapsed.
Click to expand it.
src/helpers/factoryABI.js
View file @
13a0aee6
module
.
exports
.
factoryABI
=
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
"
}]
{
"
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
"
}
]
src/store/initial-state.js
View file @
13a0aee6
...
@@ -13,14 +13,14 @@ export default {
...
@@ -13,14 +13,14 @@ export default {
exchangeType
:
'
ETH to Token
'
,
exchangeType
:
'
ETH to Token
'
,
exchangeAddresses
:
{
exchangeAddresses
:
{
addresses
:
[
addresses
:
[
[
'
UNI
'
,
'
0xcDc30C3b02c5776495298198377D2Fc0fd6B1F1C
'
],
[
'
BAT
'
,
'
0x80f5C1beA2Ea4a9C21E4c6D7831ae2Dbce45674d
'
],
[
'
SWAP
'
,
'
0x4632a7Cd732c625dcc48d75E289c209422e1D2B7
'
]
[
'
OMG
'
,
'
0x1033f09e293200de63AF16041e83000aFBBfF5c0
'
]
]
]
},
},
tokenAddresses
:
{
tokenAddresses
:
{
addresses
:
[
addresses
:
[
[
'
UNI
'
,
'
0x350E5DD084ecF271e8d3531D4324443952F47756
'
],
[
'
BAT
'
,
'
0xDA5B056Cfb861282B4b59d29c9B395bcC238D29B
'
],
[
'
SWAP
'
,
'
0x8B2A87F8243f23C33fb97E23a21Ae8EDB3b71AcA
'
]
[
'
OMG
'
,
'
0x879884c3C46A24f56089f3bBbe4d5e38dB5788C0
'
]
]
]
}
}
},
},
...
@@ -30,7 +30,7 @@ export default {
...
@@ -30,7 +30,7 @@ export default {
inputBalance
:
0
,
inputBalance
:
0
,
outputBalance
:
0
,
outputBalance
:
0
,
inputToken
:
{
value
:
'
ETH
'
,
label
:
'
ETH
'
,
clearableValue
:
false
},
inputToken
:
{
value
:
'
ETH
'
,
label
:
'
ETH
'
,
clearableValue
:
false
},
outputToken
:
{
value
:
'
UNI
'
,
label
:
'
UNI
'
,
clearableValue
:
false
},
outputToken
:
{
value
:
'
OMG
'
,
label
:
'
OMG
'
,
clearableValue
:
false
},
invariant1
:
0
,
invariant1
:
0
,
invariant2
:
0
,
invariant2
:
0
,
marketEth1
:
0
,
marketEth1
:
0
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment