Closed fengtality closed 3 years ago
The ExchangeProxy (or Balancer contract address) is now stored at 2 locations, HB global config and Gateway .env
.
I think we should keep it at just one location to avoid confusion.
Would it be better to create an approve
endpoint in balancer
which redirects to approve
in eth
and supplies it with spenderAddress
? And HB client doesn't need to store the spender address.
OK, that makes sense. I'll make the change tmrw.
@Nullably I added approve
and allowances
endpoints to the Balancer routes.
I spent a lot of time trying to figure out a more elegant way using redirects or proxy requests to avoid duplicating the code, but failed to make it work.
@vic-en has an alternate method of calling approve
and allowances
that prevents code duplication in the Balancer routes - he's adding to the Uniswap gateway, and will modify this PR too
Fixes https://github.com/CoinAlpha/hummingbot/issues/2557
To make these functions non Balancer specific, this PR adds a
spenderAddress
parameter to/eth/approve
and/eth/allowances
, so the Balancer connector in the client needs to be changed to pass in the Balancer exchangeProxy address (mainnet:0x3E66B66Fd1d0b02fDa6C811Da9E0547970DB2f21
).I think the Balancer exchangeProxy address should be a global parameter that we set to the current mainnet address. If users want to test on Kovan, they are responsible for changing it.