Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Blueprint support

See original GitHub issue


There are several ways to support so-called “blueprints” or factory-style contracts in different ecosystems. For example, ape-starknet has encode_contract_blueprint which takes advantage of a native StarkNet feature that allows encoding a contract type into a special chain-specific contract cache that new copies can be deployed from. In EVM ecosystems, a standard EIP-5202 is being developed that generalizes blueprint-style deployments (e.g. a contract that only supports codecopy for CREATE/CREATE2 deployments). In the past, there have been several other proxy/non-proxy implementations of similar ideas, but this standard has real promise for the ecosystem.

For ape, we should add a method that supports encoding a transaction which initializes a blueprint type on-chain for further use when linking code for making on-chain deployments.


class EcosystemAPI(...):

    def encode_contract_blueprint(self, contract: ContractType, *args, **kwargs) -> TransactionAPI:
        # doc string here...
class AccountAPI(...):
    def declare(self, contract_container: ContractContainer) -> ReceiptAPI:
        # Implement this


no dependencies

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

fubuloubucommented, Nov 23, 2022

Starknet accounts do have the additional declare() method, which is part of their spec and so it makes sense.

I think this might get more into the higher level API of how users might interface with this method

AccountAPI.declare(ContractContainer) -> ReceiptAPI is the higher level API for how we create blueprints. For EVM, this would craft an EIP-5202 style deployment, and then using receipt.contract_address as an ABI argument for any method/deployment that might want to reference the blueprint (this is typical of how this is used, as a template address). For StarkNet, there is a different flow where you would craft a “Contract Class Declaration” transaction type, and then the receipt would have receipt.class_hash available for you to use

unparalleled-jscommented, Nov 15, 2022

Yes, I think this part for sure makes sense. This is the part that both ecosystems share in common anyway. The rest is normal Ape stuff anyway imo, (e.g. deploying factory contracts of some sort and using the result from sending the encoded-blueprint transaction), and that differs from ecosystem-to-ecosystem and even project-to-project. We can create some material in Ape academy show-casing all of this excited stirs.

Starknet accounts do have the additional declare() method, which is part of their spec and so it makes sense. Does anything like that in Ethereum make sense to have?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Toll Free (Canada): (888) 517-4622. International: +1 (416) 479-0839. Fax: (888) 261-0520. Email: ...
Read more >
Wireless Network Support Services
Hotel WiFi support requires 24/7/365 responsiveness. Blueprint RF's network support services helps to ensure that your wireless interent goes uninterrupted.
Read more >
Contact Us
CONTACT US ; Business Hours. Monday to Friday 6:00am to 6:30pm (PST). Saturday 6:00am to 3:00pm (PST). Sunday 9:00am to 3:00pm (PST) ;...
Read more >
Meta Blueprint Technical Support and Feedback
Meta Blueprint Technical Support and Feedback. What's your email? What's your name? I want to... Request Technical Support Leave Feedback Delete My Account....
Read more >
Contact Us | Blueprint
Have a question? Need technical support? We're here to help. ... Want to partner with Blueprint? Our team is excited to work with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found