Skip to content
Merged
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
14 changes: 12 additions & 2 deletions lib/ethpy/ethpy/hyperdrive/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,12 @@ def get_out_for_in(
pool_config_str = self._serialized_pool_config()
pool_info_str = self._serialized_pool_info()
# pylint: disable=no-member
out_for_in = pyperdrive.get_out_for_in(pool_config_str, pool_info_str, str(amount_in.scaled_value), shares_in)
out_for_in = pyperdrive.get_out_for_in( # type: ignore
pool_config_str,
pool_info_str,
str(amount_in.scaled_value),
shares_in,
)
return FixedPoint(scaled_value=int(out_for_in))

def get_in_for_out(
Expand All @@ -246,7 +251,12 @@ def get_in_for_out(
pool_config_str = self._serialized_pool_config()
pool_info_str = self._serialized_pool_info()
# pylint: disable=no-member
in_for_out = pyperdrive.get_in_for_out(pool_config_str, pool_info_str, str(amount_out.scaled_value), shares_out)
in_for_out = pyperdrive.get_in_for_out( # type: ignore
pool_config_str,
pool_info_str,
str(amount_out.scaled_value),
shares_out,
)
return FixedPoint(scaled_value=int(in_for_out))

def _serialized_pool_config(self) -> PoolConfig:
Expand Down
15 changes: 14 additions & 1 deletion lib/ethpy/ethpy/hyperdrive/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from fixedpointmath import FixedPoint
from hypertypes.IHyperdriveTypes import Fees, PoolConfig
from web3 import Web3
from web3.constants import ADDRESS_ZERO
from web3.contract.contract import Contract
from web3.types import TxReceipt

Expand Down Expand Up @@ -222,18 +223,30 @@ def _deploy_hyperdrive_factory(
(base_token_contract, factory_token_contract) : tuple[Contract, Contract]
Containing he deployed base token and factory contracts.
"""
# args = [name, symbol, decimals, admin_addr, isCompetitionMode]
args = ["Base", "BASE", 18, ADDRESS_ZERO, False]
base_token_contract_addr, base_token_contract = deploy_contract(
web3,
abi=abis["ERC20Mintable"],
bytecode=bytecodes["ERC20Mintable"],
deploy_account_addr=deploy_account_addr,
args=args,
)
# args = [erc20_contract_addr, name, symbol, initial_apr, admin_addr, isCompetitionMode]
args = [
base_token_contract_addr,
"Delvnet Yield Source",
"DELV",
initial_variable_rate.scaled_value,
ADDRESS_ZERO,
False,
]
pool_contract_addr, _ = deploy_contract(
web3,
abi=abis["MockERC4626"],
bytecode=bytecodes["MockERC4626"],
deploy_account_addr=deploy_account_addr,
args=[base_token_contract_addr, "Delvnet Yield Source", "DELV", initial_variable_rate.scaled_value],
args=args,
)
forwarder_factory_contract_addr, forwarder_factory_contract = deploy_contract(
web3,
Expand Down
Loading