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
3 changes: 0 additions & 3 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@ export USER_KEY="0xUSER_PRIVATE_KEY"
export AGENT_KEYS='["0xAGENT_PRIVATE_KEY"]'
export AGENT_BASE_BUDGETS='[3396163194603698651136]'
export AGENT_ETH_BUDGETS='[1000000000000000000]'
export RPC_URL="http://localhost:8545"
Comment thread
dpaiton marked this conversation as resolved.
export ARTIFACTS_URL="http://localhost:80"
export BASE_ABI_FILE="./hyperdrive_solidity/out/ERC20Mintable.sol/ERC20Mintable.json"
8 changes: 1 addition & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,4 @@ RUN python -m pip install --no-cache-dir --upgrade pip && \
python -m pip install --no-cache-dir -e ."[with-dependencies,ape]" && \
apt-get remove -y gcc python3-dev libssl-dev && \
apt-get autoremove -y && \
pip uninstall pipenv -y

# copy hyperdrive contracts from migrations image
COPY --from=migrations /src/ ./hyperdrive_solidity/

# copy foundry over from migrations image
COPY --from=migrations /usr/local/bin/ /usr/local/bin
pip uninstall pipenv -y
6 changes: 3 additions & 3 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ An explanation of what the above steps do:

## Working with smart contracts (optional)

We run several tests and offer utilities that depend on executing Hyperdrive solidity contracts. This is not required to use elfpy.
We run tests and offer utilities that depend on executing bytecode compiled from Hyperdrive solidity contracts. This is not required to use elfpy.

NOTE: The Hyperdrive solidity implementation is currently under security review, and thus is not available publicly.
The following instructions will not work for anyone who is not a member of Delv.

### 5. Set up smart contracts
### 1. Set up smart contracts

Clone the hyperdrive repo, then create a [sym link](https://en.wikipedia.org/wiki/Symbolic_link#POSIX_and_Unix-like_operating_systems) at `hyperdrive_solidity/` pointing to the repo location.

Expand All @@ -63,7 +63,7 @@ git clone git@github.com:delvtech/hyperdrive.git ../hyperdrive
ln -s ../hyperdrive hyperdrive_solidity
```

### 6. Install Hyperdrive pre-requisites
### 2. Install Hyperdrive

Complete the steps in Hyperdrive's [Pre-requisites](https://github.com/delvtech/hyperdrive#pre-requisites) and [Build](https://github.com/delvtech/hyperdrive#build) sections.

Expand Down
2 changes: 1 addition & 1 deletion elfpy/bots/checkpoint_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def main() -> None:
logging.info("Successfully funded the sender=%s.", sender.account.address)

# Get the Hyperdrive contract.
hyperdrive_abis = eth.abi.load_all_abis(config.build_folder)
hyperdrive_abis = eth.abi.load_all_abis(config.abi_folder)
addresses = hyperdrive_interface.fetch_hyperdrive_address_from_url(
os.path.join(config.artifacts_url, "addresses.json")
)
Expand Down
4 changes: 2 additions & 2 deletions elfpy/bots/environment_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class EnvironmentConfig(types.FrozenClass):
# abi filenames
hyperdrive_abi: str = "IHyperdrive"
base_abi: str = "ERC20Mintable"
# build location
build_folder: str = "./hyperdrive_solidity/out"
# ABI location
abi_folder: str = "packages/hyperdrive/src/abis/"

def __getitem__(self, attrib) -> None:
return getattr(self, attrib)
Expand Down
2 changes: 1 addition & 1 deletion elfpy/data/acquire_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class EthConfig:
# pylint: disable=invalid-name
CONTRACTS_URL: str = "http://localhost:80/addresses.json"
ETHEREUM_NODE: str = "http://localhost:8545"
ABI_DIR: str = "./hyperdrive_solidity/out/"
ABI_DIR: str = "./packages/hyperdrive/src/"


def build_eth_config() -> EthConfig:
Expand Down
2 changes: 1 addition & 1 deletion examples/eth_bots/fund_bots.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
# setup web3 & contracts
web3 = eth.web3_setup.initialize_web3_with_http_provider(environment_config.rpc_url)
abi_file_loc = os.path.join(
os.path.join(environment_config.build_folder, environment_config.base_abi + ".sol"),
os.path.join(environment_config.abi_folder, environment_config.base_abi + ".sol"),
environment_config.base_abi + ".json",
)
base_contract_abi = eth.abi.load_abi_from_file(abi_file_loc)
Expand Down
2 changes: 1 addition & 1 deletion examples/eth_bots/setup_experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def setup_experiment() -> tuple[Web3, Contract, Contract, EnvironmentConfig, lis
# point to chain env
web3 = eth.web3_setup.initialize_web3_with_http_provider(environment_config.rpc_url, reset_provider=False)
# setup base contract interface
hyperdrive_abis = eth.abi.load_all_abis(environment_config.build_folder)
hyperdrive_abis = eth.abi.load_all_abis(environment_config.abi_folder)
addresses = hyperdrive_interface.fetch_hyperdrive_address_from_url(
os.path.join(environment_config.artifacts_url, "addresses.json")
)
Expand Down
Loading