We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
TODO: replace all below with https://github.com/pcaversaccio/snekmate/blob/main/src/snekmate/utils/create2_address.vy#L49-L76
Consider:
from snekmate.utils import create2_address @internal @view def _root_lp_address( _factory: address, _token0: address, _token1: address, _type: int24 ) -> address: ... create2_address._compute_address(salt, init_hash, _factory)
Originally posted by @stas in #90 (comment)
The text was updated successfully, but these errors were encountered:
You could rewrite the if-else block like this:
if-else
common: Bytes[72] = concat(convert(chain.id, bytes32), convert(_token0, bytes20), convert(_token1, bytes20)) salt = keccak256(concat(common, 0x00)) if (_type == 0) else keccak256(concat(common, convert(_type, bytes3)))
Probably the recommended approach consumes slightly more gas, but is definitely more readable imo.
Originally posted by @pcaversaccio in #90 (comment)
Sorry, something went wrong.
stas
No branches or pull requests
TODO: replace all below with
https://github.com/pcaversaccio/snekmate/blob/main/src/snekmate/utils/create2_address.vy#L49-L76
Consider:
Originally posted by @stas in #90 (comment)
The text was updated successfully, but these errors were encountered: