Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatten contracts instantiation #67

Open
Tracked by #84
maurolacy opened this issue Dec 9, 2024 · 0 comments
Open
Tracked by #84

Flatten contracts instantiation #67

maurolacy opened this issue Dec 9, 2024 · 0 comments

Comments

@maurolacy
Copy link
Contributor

maurolacy commented Dec 9, 2024

#66 follow-up, and part of #45.

Let's simplify the instantiation logic further, by making the SDK instantiation logic explicit, instead of the babylon contract instantiating the other contracts.

After closer analysis this isn't as simple as it looks like, as there are cyclic dependencies between contracts

  1. babylon-contract depends on both btc-staking and btc-finality.
  2. btc-staking depends on babylon-contract.
  3. btc-finality depends on both babylon-contract and btc-staking.

So, we would need either a custom query to provide these addresses to contracts, as proposed in babylonlabs-io/babylon-contract#94, or a (privileged) way to set these addresses in the contracts (a gated set_contracts_addresses() helper in babylon-contract). Or perhaps, to stick to the current instantiation logic. On second thought, it's clearly not so bad compared to all these requirements for handling deps across contracts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant