6

Why throw is deprecated in solidity?

Is there any drawbacks?

I also found below on Github

Even if we remove throw as a feature, the keyword should be kept. We might be able to introduce something in the future.

So what type of implementation will be done by throw in future? Is there any proposal set for this yet? Is there any documentation where I can find details related to this?

4

The solidity documents simply describes difference between throw and revert.

There are two other ways to trigger exceptions: The revert function can be used to flag an error and revert the current call. In the future it might be possible to also include details about the error in a call to revert. The throw keyword can also be used as an alternative to revert()

For a call of changing status failed, revert will refund unused gas, but throw not. and the same is all status would get rolled back.

0

Just simply use revert() or any of the shown error and replace the throw()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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