yearn/yearn-sdk

token.mjs example fails with out of gas exception

bsamuels453 opened this issue · 3 comments

the token.mjs example is failing with an outofgas exception.

I've tracked the issue down to the following helper contract: https://etherscan.io/address/0x855ffe28019106d089bc018df18838f8d241c402#readContract

tokensAddresses() is called with about 70 tokens as tokensAddresses parameters, which is causing the out of gas exception.

After a bit of testing, the following is the minimal set of tokenAddresses I found that will cause an out of gas exception:

accountAddress: 0xFEB4acf3df3cDEA7399794D0869ef76A6EfAff52

tokenAddresses:
[0x3F1B0278A9ee595635B61817630cC19DE792f506,0x9c2C8910F113181783c249d8F6Aa41b51Cde0f0c,0x8818a9bb44Fbf33502bE7c15c500d0C783B73067]

Not sure if this counts as a yearn-lens issue

for anyone searching, this can be fixed by using alchemy for your web3 node

@bsamuels453 mind if I close this?

@bsamuels453 mind if I close this?

sure; if anyone runs into this issue in the future, either use alchemy, or run your node with --rpc.gascap 0 to disable the gas limit on eth calls