Skip to content

Commit

Permalink
Merge branch 'main' into feat/cache-config
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshultz committed Feb 22, 2024
2 parents f587be8 + 31fab19 commit 112781f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,18 @@ You can enable `solc`'s `--via-IR` flag by adding the following values to your `
solidity:
via_ir: True
```

### Contract Flattening

`ape-solidity` has contract-flattening capabilities.
If you are publishing contracts using Ape, Ape automatically detects and uses the flattened-contract approach if needed.

To manually flatten a contract for your own benefit, use the following code:

```python
from ape import compilers, project
source_path = project.source_paths[0] # Replace with your path.
flattened_src = compilers.flatten_contract(source_path)
print(str(flattened_src))
```

0 comments on commit 112781f

Please sign in to comment.