Skip to content
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

The foreclosureTime and foreclosureTimePatron functions don't work when the token is new (ie no patron yet) #25

Open
JasoonS opened this issue Oct 19, 2019 · 0 comments

Comments

@JasoonS
Copy link
Member

JasoonS commented Oct 19, 2019

It tried to divide by zero when a token is new when calling this function:

    function foreclosureTimePatron(address tokenPatron) public view returns (uint256) {
        // patronage per second
        uint256 pps = totalPatronOwnedTokenCost[tokenPatron].div(patronageDenominator).div(365 days);
        return now.add(depositAbleToWithdraw(tokenPatron).div(pps)); // zero division if price is zero.
    }

since totalPatronOwnedTokenCost[tokenPatron] can be zero, and you get a divide by zero issue

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

No branches or pull requests

1 participant