Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
docs: fille out imports more
Browse files Browse the repository at this point in the history
  • Loading branch information
antazoey committed Jun 22, 2022
1 parent f7cbecb commit be9814e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ print(declaration.class_hash)
Then, you can use the class hash in a deploy system call in a factory contract:

```cairo
from starkware.cairo.common.alloc import alloc
from starkware.starknet.common.syscalls import deploy
from starkware.cairo.common.cairo_builtins import HashBuiltin
@external
func deploy_my_contract{
syscall_ptr : felt*,
Expand All @@ -121,6 +125,7 @@ After deploying the factory contract, you can use it to create contract instance
```python
from ape import Contract, project

declaration = project.provider.declare(project.MyContract)
factory = project.ContractFactory.deploy(declaration.class_hash)
call_result = factory.deploy_my_contract()
contract_address = project.starknet.decode_address(call_result)
Expand All @@ -130,8 +135,9 @@ contract = Contract(contract_address, contract_address)
You can also `deploy()` from the declaration receipt (which uses the legacy deploy transaction):

```python
from ape import accounts
from ape import accounts, project

declaration = project.provider.declare(project.MyContract)
receipt = declaration.deploy(1, 2, sender=accounts.load("MyAccount"))
```

Expand Down

0 comments on commit be9814e

Please sign in to comment.