Hey all, I have a question about deploying a contract from a contract and contract size issues. Sorry it’s long.

Was trying to deploy contract B from contract A using B = new B (some params); but was breaking the size limit. My understanding is that when using “new” contract A will inline all of contract B’s code, so I modified this.

I moved contract B creation into a factory contract and passed the factory address into contract A, so I have BFactory bFactory = _bFactory; in the constructor and B = bFactory.createB (some params) in the code. Contract A was now under the limit (yay) but BFactory was over it. All BFactory does is declare create which receives the params and then does: return new B (some params);

I’ve gone through contract B and reduced it from >20KB to c. 15KB but still BFactory is around 45KB even with runs at 1. Why is BFactory so large? Am I using the pattern wrong? Is there anything else I can do?? Please help! Thanks 🙏

Nov 1, 2021, 1:36 PM

© 2024 Draquery.com All rights reserved.