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

[Feature] Bond contract - Investigate Clone vs Naive #22

Open
CjHare opened this issue Oct 29, 2021 · 2 comments
Open

[Feature] Bond contract - Investigate Clone vs Naive #22

CjHare opened this issue Oct 29, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@CjHare
Copy link
Contributor

CjHare commented Oct 29, 2021

Feature Description

The BondFactory uses a naive approach, that deploys a new Bond contract every time. Another approach is to instead create a clone.

Clones reduce the initialisation cost, but slightly increase general call costs. This means with volume there's a turning point where the cost saving of the deploy pales in comparison to additional cost to each call.

Create a comparison table between the naive and clone versions of the Bond through different version of the BondFactory.

q) What is the turning point? How many guarantors are needed to warrant a naive approach?

q) Should both a naive and clone factory be provided? (as the costs are pushed onto different actors, deploy is the admin/treasury and usage the community)

Additional Information

OpenZepplin Clones
OpenZepplin Cones examples

@CjHare CjHare added the enhancement New feature or request label Oct 29, 2021
@afkbyte afkbyte self-assigned this Oct 29, 2021
@afkbyte
Copy link
Contributor

afkbyte commented Oct 29, 2021

happy to take this one on after the initial bond contract is merged :) I know berlin increased the costs of this but I remember when I was looking at the uniswap clone factory post-berlin the tipping point was ~1000 interactions. Ours should be less due to smaller bytecode size but will be fun to look into.

@CjHare
Copy link
Contributor Author

CjHare commented Oct 30, 2021

happy to take this one on

Excellent 😁

I'm not certain of the best/quickest method for measure the gas, although I have noticed that a HardHat node can be run with config that outputs the transaction details (includig gas cost logged config exmaple. )
There are also additional option for setting the hardfork, creating a script that deploys to a HardHat node could be an option, but it's entirely your call 🙂

@CjHare CjHare added this to the Bond v2 milestone Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants