Skip to content

Update ST20Generator.js #531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

cdlgz
Copy link

@cdlgz cdlgz commented Jan 18, 2019

The parameters of the allowance function is incorrect

Please check if the PR fulfills these requirements

  • The commit message follows our Submission guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?

(Bug fix, feature, docs update, ...)

What is the current behavior?

(You can also link to an open issue here)

What is the new behavior?

(Define and describe any new functionality. Clarify if this is a feature change)

Does this PR introduce a breaking change?

(What changes might users need to make in their application due to this PR?)

Any Other information:

The parameters of the allowance function is incorrect
@@ -187,7 +187,7 @@ async function approvePoly(spender, fee) {
polyBalance = await polyToken.methods.balanceOf(Issuer.address).call();
let requiredAmount = web3.utils.toWei(fee.toString(), "ether");
if (parseInt(polyBalance) >= parseInt(requiredAmount)) {
let allowance = await polyToken.methods.allowance(spender, Issuer.address).call();
let allowance = await polyToken.methods.allowance(Issuer.address, spender).call();
if (allowance == web3.utils.toWei(fee.toString(), "ether")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (allowance == web3.utils.toWei(fee.toString(), "ether")) {
if (allowance >= web3.utils.toWei(fee.toString(), "ether")) {

@F-OBrien
Copy link
Contributor

This issue is also present in investor_portal.js

@VictorVicente
Copy link
Contributor

VictorVicente commented Feb 6, 2019

Thanks @cdlgz and @F-OBrien, those are actually bugs on the CLI. As I haven't started working on 3.0.0 CLI, I included these fixes on 2.1.0 branch, where it is the most updated CLI.
Please, review these changes included on this PR: #515
And this is the commit: a742e67

I'll close this PR to avoid confusion, but thanks a lot again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants