Skip to content

Error:Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? #756

Answered by 0xSanyam
AwaisTahseencode asked this question in Q&A
Discussion options

You must be logged in to vote

@AwaisTahseencode make the minAmount public so that other functions can use it and you have to multiply the 1e18 part with 50. When returning price multiply it with 1e10 as 8 decimals are already there (making it a total of 18 decimals)

uint256 public minAmount=50 * 1e18;
// rest of the code

return uint256(price * 1e10);

Also, you may/should refer this

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@0xSanyam
Comment options

@AwaisTahseencode
Comment options

@0xSanyam
Comment options

Answer selected by alymurtazamemon
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants