Skip to content
Misconfiguration Audit finding Beginner

Test addresses and incorrect interface in code prevent integration with UniswapV3 and Camelot

The smart contracts for Camelot and UniswapV3 relayers used testnet factory addresses and an incorrect interface for fetching the Camelot pair. If deployed as-is, the relayers would not function, preventing integration with those decentralised exchanges.

twicek Follow with kutugu, spark and 6 others

Originally disclosed on Code4rena

Submitted by twicek, also found by kutugu, spark, 0xMosh (1, 2), pep7siup, 0xhacksmithh, ni8mare, Arz, btk, bitsurfer, and xAriextz (1, 2)

Testing addresses for Camelot and UniswapV3 factories are still used in the code:

CamelotRelayer.sol#L20

  address internal constant _CAMELOT_FACTORY = GOERLI_CAMELOT_V3_FACTORY;

UniV3Relayer.sol#L18

  address internal constant _UNI_V3_FACTORY = GOERLI_UNISWAP_V3_FACTORY;

Additionally, the correct interface to get the camelotPair is commented out:

CamelotRelayer.sol#L41-L42

    // camelotPair = ICamelotFactory(_CAMELOT_FACTORY).getPair(_baseToken, _quoteToken);
    camelotPair = IAlgebraFactory(_CAMELOT_FACTORY).poolByPair(_baseToken, _quoteToken);

Impact

It will prevent integration with UniswapV3 and Camelot.

Recommended Mitigation Steps

Make the changes necessary to be compatible with Arbitrum One.

MiloTruck (Judge) commented:

While the protocol team is most likely aware of this and these addresses are probably set to testnet ones currently for testing purposes, it is an undeniable fact that if the current code was to be deployed without any modifications, the CamelotRelayer and UniV3Relayer contracts would not function as expected.

As such, I believe medium severity is appropriate.

pi0neerpat (OpenDollar) commented:

The problem stated is that the Camelot and Uniswap factory addresses set in the Registry are set to Goerli addresses, not Mainnet. In production, we will swap Goerli addresses for Mainnet. Perhaps there is a better way to manage this than manually changing the constant variable in the Registry, however the recommendation does provide a helpful suggestion.


The original report as published on Code4rena, by twicek. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

If deployed without modification, the CamelotRelayer and UniV3Relayer contracts would not function as expected, preventing integration with UniswapV3 and Camelot.

What the attacker needed

None

The fix

The code should be updated to use mainnet factory addresses and the correct interface for fetching the Camelot pair.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

These contracts are supposed to fetch price information from two exchanges, Camelot and UniswapV3. But they were pointing at test networks instead of the real network, and one used the wrong function to look up a trading pair. So if the code went live unchanged, those price feeds would break.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More from Open Dollar

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.