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

DaiFaucet contract mistake #22

Closed
kadenzipfel opened this issue Oct 25, 2019 · 2 comments
Closed

DaiFaucet contract mistake #22

kadenzipfel opened this issue Oct 25, 2019 · 2 comments

Comments

@kadenzipfel
Copy link

kadenzipfel commented Oct 25, 2019

In the DaiFaucet contract, it checks to see if the withdraw_amount parameter is <= 0.1 ether, when it should just be 0.1.

So instead of:
require(withdraw_amount <= 0.1 ether);

It should be:

require(withdraw_amount <= 0.1);

Edit: It's not that simple to work with decimals in Solidity, so I'm not entirely sure what the solution would be. We can still limit it in Ether, but it would have to be much less than 0.1 eth. I will be using 0.0005 eth for mine.

@kadenzipfel
Copy link
Author

This can also be seen in the remix screenshot right below the contract, so that should probably be fixed as well.

@liberuum
Copy link
Collaborator

The example was written with this in mind: https://solidity.readthedocs.io/en/v0.4.24/units-and-global-variables.html#ether-units

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

2 participants