Closed antazoey closed 10 months ago
This is also something that is hinting might be a good ticket to do for titanboa enhancement.
My idea is something along the lines of allowing ape-vyper
to customize ContractContainer
objects for vyper contracts. I don't know exactly how that will work yet.
@fubuloubu
No longer needed - declare
is now part of official API.
Elevator pitch:
Deploying contracts and / or contract interaction can sometimes work differently, depending on the development environment (e.g. Starknet)
ape-starknet
needs more customization aroundContractContainer
s available on theProjectManager
(e.g.ape.project.MyContract
).We need to support contract declaration. Soon,
Deploy
transactions will no longer work on Starknet. A contract declaration in Starknet is a type of transaction (like aDeploy
) but for allowing other contracts to deploy your contract. You cannot invoke methods on a ContractDeclaration. It like a Class versus an instance of the class. In Starknet, you publish your contract types and other contracts (accounts) can deploy those types.Additionally, we would like to be able to customize the selector hash function of contract types, which is available in
ethpm-types
but there is not an easy way to force Ape to use a custom class ofContractType
.Value:
Dependencies:
n/a
Design approach:
ape.api.compilers.py:
CompilerManager in ape:
new file:
ape.api.contracts.py
:ape-cairo compilers.py:
ape-starknet register the container
Task list:
Estimated completion date:
For now, the plan to add
declare()
to theaccounts
, since we havedeploy()
there as well. However, it is more ideal to have both.Design review:
Do not signoff unless:
(Please leave a comment to sign off)
Related Tickets
Contract declaration support: https://github.com/ApeWorX/ape-starknet/issues/32 Custom selector insurance: https://github.com/ApeWorX/ethpm-types/issues/38 Custom contract types in ape-cairo: https://github.com/ApeWorX/ape-cairo/issues/20