put a trailing _ on private variable

This commit is contained in:
Noah Zinsmeister
2020-01-06 14:50:49 -05:00
parent 4cdfb7e384
commit a54b85f373

View File

@ -8,7 +8,7 @@ contract UniswapV2Factory is IUniswapV2Factory {
address public feeToSetter;
address public feeTo;
mapping (address => mapping(address => address)) private _getExchange;
mapping (address => mapping(address => address)) private getExchange_;
address[] public exchanges;
event ExchangeCreated(address indexed token0, address indexed token1, address exchange, uint);
@ -25,7 +25,7 @@ contract UniswapV2Factory is IUniswapV2Factory {
function getExchange(address tokenA, address tokenB) external view returns (address exchange) {
(address token0, address token1) = sortTokens(tokenA, tokenB);
return _getExchange[token0][token1];
return getExchange_[token0][token1];
}
function exchangesCount() external view returns (uint) {
@ -36,14 +36,14 @@ contract UniswapV2Factory is IUniswapV2Factory {
require(tokenA != tokenB, "UniswapV2Factory: SAME_ADDRESS");
require(tokenA != address(0) && tokenB != address(0), "UniswapV2Factory: ZERO_ADDRESS");
(address token0, address token1) = sortTokens(tokenA, tokenB);
require(_getExchange[token0][token1] == address(0), "UniswapV2Factory: EXCHANGE_EXISTS");
require(getExchange_[token0][token1] == address(0), "UniswapV2Factory: EXCHANGE_EXISTS");
bytes memory exchangeBytecodeMemory = exchangeBytecode; // load bytecode into memory because create2 requires it
bytes32 salt = keccak256(abi.encodePacked(token0, token1));
assembly { // solium-disable-line security/no-inline-assembly
exchange := create2(0, add(exchangeBytecodeMemory, 32), mload(exchangeBytecodeMemory), salt)
}
IUniswapV2(exchange).initialize(token0, token1);
_getExchange[token0][token1] = exchange;
getExchange_[token0][token1] = exchange;
exchanges.push(exchange);
emit ExchangeCreated(token0, token1, exchange, exchanges.length);
}