Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

more stupidity fix#399

New issue

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
liquid-8 merged 1 commit intouniswap-python:dev/v4fromliquid-8:dev
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletionsuniswap/types.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,12 +37,12 @@ def __repr__(self) -> str:
@dataclass
class UniswapV4_path_key:
# The lower currency of the pool, sorted numerically
currency0 :Address
currency0 :str
# The higher currency of the pool, sorted numerically
currency1 :Address
currency1 :str
# The pool swap fee, capped at 1_000_000. If the first bit is 1, the pool has a dynamic fee and must be exactly equal to 0x800000
fee : int
# Ticks that involve positions must be a multiple of tick spacing
tickSpacing : int
# The hooks of the pool
hooks :List[Address]
hooks :str
4 changes: 2 additions & 2 deletionsuniswap/uniswap4.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -777,8 +777,8 @@ def get_token(self, address: AddressLike, abi_name: str = "erc20") -> ERC20Token
return ERC20Token(symbol, address, name, decimals)

def get_pool_id(self, currency0: Union[AddressLike, str, None], currency1: Union[AddressLike, str, None], fee : int, tickSpacing : int, hooks : Union[AddressLike, str, None] = NOHOOK_ADDRESS) -> bytes:
currency0 = str(currency0)
currency1 = str(currency1)
currency0 = str(self.w3.to_checksum_address(currency0))
currency1 = str(self.w3.to_checksum_address(currency1))
if int(currency0, 16) > int(currency1, 16):
currency0 , currency1 = currency1 , currency0
pool_id = bytes(self.w3.solidity_keccak(["address", "address", "int24", "int24", "address"], [(currency0, currency1, fee, tickSpacing, hooks)]))
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp