0

For example, if a user is attempting to send below the minimum investment amount to a crowdsale contract, or if a user is sending above the maximum investment amount.

Ethereum wallet just says "This transaction will fail..." no matter what. It may be very confusing for some buyers.

How does one get around this and make it more user friendly?

1 Answer 1

1

No this is not possible as of writing.This has to be implemented from the client side currently. We are only allowed to pass in conditionals into require and assert, or revert once a condition is met.

In the near future however we'll be able to pass along error messages to those exceptions. These opcodes are already in if i'm not mistaken but not active.

NOW: require(a == b); 
FUTURE: require(a==b, "A does not equal B");

or

NOW: revert();
FUTURE: revert("Transaction failed, not enough balance");
1
  • Note that this is completely possible if you're willing to use Solidity Assembly, which already has revert with data.
    – natewelch_
    Feb 28, 2018 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.