Track all deployments
See original GitHub issueElevator pitch:
Right now, we have https://github.com/ApeWorX/ape/issues/530 which is a design to track deployments as such:
from ape import project
my_contract = account.deploy(project.MyContract)
project.track_deployment(my_contract)
my_contract = project.deployments(project.MyContract)[-1]
The line project.track_deployment(my_contract)
would add information about this contract deployment to .build/deployments/<ecosystem>/<network>/track_deployments.json
This file would look as such:
{
"MyContract": [
"0x40Ee4CfF4d103509cEe0720362b8055Ad65f259b",
.
.
.
],
"NextContract:[
.
.
],
...
}
This is how the project would keep track of deployments.
Value:
This is for all developers who don’t want to have to write custom scripts to keep track of their deployments.
Dependencies:
I don’t think this has any dependencies.
Design approach:
The main design is in the elevator pitch. But to continue, we may have to adjust the api for local networks. We’d wouldn’t always want the saved deployment to be saved forever on local networks that get destroyed so often:
def track_deployment(contract, persist: bool=true):
Or, we could pull from the ape-config.yaml
name: apeworx-project
contracts_folder: contracts
networks:
hardhat:
persist: false
Task list:
- Deployments can be tracked
- Tests for deployments written
- Documentation updates
Estimated completion date:
2 weeks
Design review:
Do not signoff unless:
-
- agreed the tasks and design approach will achieve acceptance, and
-
- the work can be completed by one person within the SLA. Design reviewers should consider simpler approaches to achieve goals.
(Please leave a comment to sign off)
Let me know if this is something I can take a crack at and if the design looks good.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Yes, we don’t need
track_deployment
to use this feature (the use case there is for keeping track of final copies of contracts to be deployed e.g. official releases), maybe let’s do this instead:Renamed the issue because there is a separate ticket for tracking deployments for publishing reasons that goes in the .build folder.
This ticket ended up by closed by #856 and was just for all deployments.
I know the history in confusing but otherwise this is duplicate of https://github.com/ApeWorX/ape/issues/530