Skip to content

Commit

Permalink
PDB-01S] Unutilized Contract Member (#875)
Browse files Browse the repository at this point in the history
* Remove unused variable from contracts

* Update scripts
  • Loading branch information
zajck authored Jan 9, 2024
1 parent b29767e commit 634c838
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 22 deletions.
9 changes: 1 addition & 8 deletions contracts/protocol/bases/PriceDiscoveryBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,17 @@ contract PriceDiscoveryBase is ProtocolBase {
using SafeERC20 for IERC20;

IWrappedNative internal immutable wNative;
uint256 private immutable EXCHANGE_ID_2_2_0; // solhint-disable-line

/**
* @notice
* For offers with native exchange token, it is expected the the price discovery contracts will
* operate with wrapped native token. Set the address of the wrapped native token in the constructor.
*
* After v2.2.0, token ids are derived from offerId and exchangeId.
* EXCHANGE_ID_2_2_0 is the first exchange id to use for 2.2.0.
* Set EXCHANGE_ID_2_2_0 in the constructor.
*
* @param _wNative - the address of the wrapped native token
* @param _firstExchangeId2_2_0 - the first exchange id to use for 2.2.0
*/
//solhint-disable-next-line
constructor(address _wNative, uint256 _firstExchangeId2_2_0) {
constructor(address _wNative) {
wNative = IWrappedNative(_wNative);
EXCHANGE_ID_2_2_0 = _firstExchangeId2_2_0;
}

/**
Expand Down
7 changes: 1 addition & 6 deletions contracts/protocol/facets/PriceDiscoveryHandlerFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,10 @@ contract PriceDiscoveryHandlerFacet is IBosonPriceDiscoveryHandler, PriceDiscove
* For offers with native exchange token, it is expected the the price discovery contracts will
* operate with wrapped native token. Set the address of the wrapped native token in the constructor.
*
* After v2.2.0, token ids are derived from offerId and exchangeId.
* EXCHANGE_ID_2_2_0 is the first exchange id to use for 2.2.0.
* Set EXCHANGE_ID_2_2_0 in the constructor.
*
* @param _wNative - the address of the wrapped native token
* @param _firstExchangeId2_2_0 - the first exchange id to use for 2.2.0
*/
//solhint-disable-next-line
constructor(address _wNative, uint256 _firstExchangeId2_2_0) PriceDiscoveryBase(_wNative, _firstExchangeId2_2_0) {}
constructor(address _wNative) PriceDiscoveryBase(_wNative) {}

/**
* @notice Facet Initializer
Expand Down
7 changes: 1 addition & 6 deletions contracts/protocol/facets/SequentialCommitHandlerFacet.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,10 @@ contract SequentialCommitHandlerFacet is IBosonSequentialCommitHandler, PriceDis
* For offers with native exchange token, it is expected the the price discovery contracts will
* operate with wrapped native token. Set the address of the wrapped native token in the constructor.
*
* After v2.2.0, token ids are derived from offerId and exchangeId.
* EXCHANGE_ID_2_2_0 is the first exchange id to use for 2.2.0.
* Set EXCHANGE_ID_2_2_0 in the constructor.
*
* @param _wNative - the address of the wrapped native token
* @param _firstExchangeId2_2_0 - the first exchange id to use for 2.2.0
*/
//solhint-disable-next-line
constructor(address _wNative, uint256 _firstExchangeId2_2_0) PriceDiscoveryBase(_wNative, _firstExchangeId2_2_0) {}
constructor(address _wNative) PriceDiscoveryBase(_wNative) {}

/**
* @notice Initializes facet.
Expand Down
4 changes: 2 additions & 2 deletions scripts/config/facet-deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ async function getFacets(config) {
facetArgs["ExchangeHandlerFacet"] = { init: [], constructorArgs: [protocolConfig.EXCHANGE_ID_2_2_0[network]] };
facetArgs["SequentialCommitHandlerFacet"] = {
init: [],
constructorArgs: [protocolConfig.WrappedNative[network], protocolConfig.EXCHANGE_ID_2_2_0[network]],
constructorArgs: [protocolConfig.WrappedNative[network]],
};
facetArgs["PriceDiscoveryHandlerFacet"] = {
init: [],
constructorArgs: [protocolConfig.WrappedNative[network], protocolConfig.EXCHANGE_ID_2_2_0[network]],
constructorArgs: [protocolConfig.WrappedNative[network]],
};

// metaTransactionsHandlerFacet initializer arguments.
Expand Down

0 comments on commit 634c838

Please sign in to comment.