Skip to content

Commit

Permalink
docs: update documentation about deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
SHAKOTN committed Jul 12, 2023
1 parent 5c5a4bb commit b8d43ec
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,23 @@ There is also search and lookup commands
```
Most of the other functions are used by a github action which regenerates files read in by those 2 functions on a weekly basis. You can explore them if you would like.

## Using deployments:
`.deployments` attribute is an object that is lazy loaded on first access.
It has first class support in IDEs, so you can use it as a normal object.

To use deployments information you can do the following:
```python
from bal_addresses.addresses import AddrBook

a = AddrBook("mainnet")
# At the stage when you try to access the deployments, the data will be loaded:
a.deployments
```

Now you can extract information:
```
>>> a.deployments.vault.contracts.Vault.address
'0xBA12222222228d8Ba445958a75a0704d566BF2C8'
>>> a.deployments.vault.contracts.Vault.name
'Vault'
```

0 comments on commit b8d43ec

Please sign in to comment.