Skip to content

Best way to convert from BigNumber with ethers CLI ? #2117

Answered by ricmoo
lildata asked this question in Q&A
Discussion options

You must be logged in to vote

You need to await on a Promise, there isn’t much way around that. You could use a show script and use the CLI and use run instead of eval. I could add support for “here documents” if that is what you are asking for?

In your example above, you might be able to change the return type in the ABI to uint48 instead of uint256 (since output is not included in the selector), which will coerce it into a number, but will throw if it is outside the safe range. But that’s more specific to this example rather than something more general.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@lildata
Comment options

Comment options

You must be logged in to vote
1 reply
@lildata
Comment options

Answer selected by lildata
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