aave / aave-utilities

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use ethereum-abi-types-generator instead of typechain ones

joshstevens19 opened this issue · comments

TypeChain is awesome but at the end of the day, it adds bundle size to the output. Every TypeChain factory IS a class and you have to call it like this.contractFactory.connect < this ADDS bundle size to the output. If you look what is in some of these factories it has LONG abi strings etc which can eat up bundle size for sure! Just look at tx-builder > contract-types that's 428KB of stuff that could be added to the output of the bundle.

I promote we use https://github.com/joshstevens19/ethereum-abi-types-generator < was built for this exact reason you just use native ethers interface and everything in the generated types are interfaces meaning once compiled no bundle size is added to the output (as interfaces are not real). It also does other things typechain does not > https://github.com/joshstevens19/ethereum-abi-types-generator#ethereum-abi-types-generator-vs-typechain

On top of this I see in the project you have got the return types of the contracts tx-builder > types this will all be redundant with this package as it exposes them all for you without you having to recreate it.

not the end of the world but if our aim is bundle size aka smallest package going then this could be a good place to start.

commented

Had a look at the library & i'd be open to giving it a try, looks good imo & might be an improvement over the current situation.

I think its worth an more in-depth conversation with other people who use it I guess. The benefits it brings in term of less bundle size can be quite a lot. Obviously it has to make sense for aave to use it throughout but I do think it can bring a lot of benefit for the client 👍

commented

eventually decided against this to be in line with the ecosystem