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
f44d0749
Unverified
Commit
f44d0749
authored
Oct 20, 2018
by
Chi Kei Chan
Committed by
GitHub
Oct 20, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Approval and Unlocks integration (#73)
parent
ade904d2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
index.js
src/components/CurrencyInputPanel/index.js
+0
-1
approval-utils.js
src/helpers/approval-utils.js
+11
-5
No files found.
src/components/CurrencyInputPanel/index.js
View file @
f44d0749
...
@@ -284,7 +284,6 @@ class CurrencyInputPanel extends Component {
...
@@ -284,7 +284,6 @@ class CurrencyInputPanel extends Component {
const
{
const
{
title
,
title
,
description
,
description
,
value
,
errors
,
errors
,
showSubButton
,
showSubButton
,
subButtonContent
,
subButtonContent
,
...
...
src/helpers/approval-utils.js
View file @
f44d0749
...
@@ -18,8 +18,14 @@ export const isExchangeUnapproved = opts => {
...
@@ -18,8 +18,14 @@ export const isExchangeUnapproved = opts => {
return
false
;
return
false
;
}
}
const
allowanceKey
=
drizzleCtx
.
contracts
[
inputExchange
].
methods
.
allowance
.
cacheCall
(
account
,
inputExchange
);
const
allowanceKey
=
drizzleCtx
.
contracts
[
currency
].
methods
.
allowance
.
cacheCall
(
account
,
inputExchange
);
const
allowance
=
contractStore
[
inputExchange
].
allowance
[
allowanceKey
];
if
(
!
contractStore
[
currency
])
{
return
false
;
}
const
allowance
=
contractStore
[
currency
].
allowance
[
allowanceKey
];
if
(
!
allowance
)
{
if
(
!
allowance
)
{
return
false
;
return
false
;
}
}
...
@@ -42,10 +48,10 @@ export const approveExchange = async opts => {
...
@@ -42,10 +48,10 @@ export const approveExchange = async opts => {
}
}
const
decimals
=
await
getDecimals
({
address
:
currency
,
drizzleCtx
,
contractStore
});
const
decimals
=
await
getDecimals
({
address
:
currency
,
drizzleCtx
,
contractStore
});
const
approvals
=
BN
(
10
**
decimals
).
multipliedBy
(
BN
(
10
**
8
)).
toFixed
(
0
);
return
drizzleCtx
.
contracts
[
inputExchange
].
methods
.
approve
.
cacheSend
(
return
drizzleCtx
.
contracts
[
currency
].
methods
.
approve
.
cacheSend
(
inputExchange
,
inputExchange
,
web3
.
utils
.
toHex
(
decimals
*
10
**
18
),
web3
.
utils
.
toHex
(
approvals
),
{
from
:
account
}
{
from
:
account
}
);
);
};
};
...
...
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