Skip to content

Commit

Permalink
clean-up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
davebryson committed Mar 21, 2024
1 parent cb05930 commit 597237a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ The primary motivation for this work is to be able to model smart-contract inter
- `Contract`: high-level, user-friendy Python API

## Build from source
- You need `Rust`, `Python/Poetry`, and optionally `Make`.
- Create a local Python virtual environment. With Poetry, run `poetry install`
- Run `make build` or run `poetry run maturin develop`
- You need `Rust` and `Python`, and optionally `Make`. We use `hatch` for Python project management, but it's not required
- Create a local Python virtual environment. Within that environment install Python dependencies
- Run `make build` or `hatch run maturin develop`
- See `simular/` for the main python api

## Getting Started
Expand Down
5 changes: 2 additions & 3 deletions docs/src/getstarted.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Getting Started

Simular can be installed via PyPi (LINK TO THE PYPI Page). It requires a Python version of `>=3.11`.
Simular can be installed via [PyPi](https://pypi.org/project/simular-evm/). It requires a Python version of `>=3.11`.

**Install:**
```bash
pip install simular-evm
```
## Examples

Here are a few quick examples that demonstrate the API. You can find more details on the API in the **Reference Guide** section.

### Transfer Ether between accounts
Expand Down Expand Up @@ -108,4 +107,4 @@ assert counter.increment.transact(1, caller=bob)
assert 1 == counter.number.call()
```

See **Reference Guide** for more API details.
See [Reference Guide](./reference/contract.md) for more API details.
10 changes: 8 additions & 2 deletions docs/src/reference/contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function hello(address caller) public returns (bool){}

function world(string name) view (string)
```
Those methods will be automatically available in the instance of the Contract like this:
they will be automatically available in the instance of the Contract like this:

```python
# write call to the hello method
Expand All @@ -32,7 +32,13 @@ Each method name is an attribute on the instance of Contract. To invoke them, y
.call(*args)
```

Under the covers, Contract knows how to properly encode the call to the EVM, and likewise decode any return values.
Under the covers, a Contract knows how to properly encode all interactions with the EVM, and likewise decode any return values.

- [Contract API](#contract-api)
- [Constructor](#constructor)
- [Methods](#methods)
- [at](#at)
- [deploy](#deploy)

## Constructor
Create an instance of a Contract from an ABI.
Expand Down
9 changes: 9 additions & 0 deletions docs/src/reference/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

Utilities defines several 'helper' functions to create contracts and accounts.

- [Utility Functions](#utility-functions)
- [Functions](#functions)
- [generate\_random address](#generate_random-address)
- [create\_account](#create_account)
- [create\_many\_accounts](#create_many_accounts)
- [contract\_from\_raw\_abi](#contract_from_raw_abi)
- [contract\_from\_abi\_bytecode](#contract_from_abi_bytecode)
- [contract\_from\_inline\_abi](#contract_from_inline_abi)

## Functions

### generate_random address
Expand Down

0 comments on commit 597237a

Please sign in to comment.