Skip to content

Commit

Permalink
refactor: lp_shared to use snekmate.
Browse files Browse the repository at this point in the history
  • Loading branch information
stas committed Dec 20, 2024
1 parent 5dcf377 commit b2addcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
7 changes: 4 additions & 3 deletions ape-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ vyper:
evm_version: cancun

dependencies:
- name: snekmate
github: pcaversaccio/snekmate
version: 0.1.0
- pypi: snekmate
config_override:
base_path: src
contracts_folder: snekmate

networks:
custom:
Expand Down
17 changes: 3 additions & 14 deletions contracts/modules/lp_shared.vy
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# @title Velodrome Finance LP Module
# @author Velodrome Finance

from snekmate.utils import create2_address

MAX_FACTORIES: constant(uint256) = 10
MAX_POOLS: constant(uint256) = 2000
MAX_ITERATIONS: constant(uint256) = 8000
Expand Down Expand Up @@ -202,17 +204,4 @@ def _root_lp_address(
)
)


data: bytes32 = keccak256(
concat(
0xFF,
convert(_factory, bytes20),
salt,
init_hash
)
)

return convert(
convert(data, uint256) & convert(max_value(uint160), uint256),
address
)
return create2_address._compute_address(salt, init_hash, _factory)

0 comments on commit b2addcd

Please sign in to comment.