When hummingbot connects to 2 DEFI projects, the current gateway will receive 2 requests. If the 2 projects are both in the same network and the same wallet address, the nonce will be the same. As a result, one of the transactions will be overwritten.
In this PR, we wrap the Signer with a ethersproject/NonceManager, the nonce will be automatically increased across the 2 projects. We also add a factory in utils.js to reuse the NonceManager only when the network and wallet address are both the same.
When
hummingbot
connects to 2 DEFI projects, the current gateway will receive 2 requests. If the 2 projects are both in the same network and the same wallet address, the nonce will be the same. As a result, one of the transactions will be overwritten.In this PR, we wrap the
Signer
with aethersproject
/NonceManager
, the nonce will be automatically increased across the 2 projects. We also add a factory inutils.js
to reuse theNonceManager
only when the network and wallet address are both the same.References: