Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: lp_shared to use snekmate. #103

Open
wants to merge 1 commit into
base: aped
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
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)
Loading