Skip to content

Commit

Permalink
Resolve merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kryptoklob committed Jul 12, 2022
2 parents 23aaf65 + 97d1896 commit 4571613
Show file tree
Hide file tree
Showing 32 changed files with 218 additions and 170 deletions.
4 changes: 2 additions & 2 deletions contracts/mock/MockChainlinkOracle.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ contract MockChainlinkOracle is AggregatorV3Interface {
uint256 _updatedAt;
uint80 _answeredInRound;

constructor(int256 value, uint8 decimals) {
constructor(int256 value, uint8 oracleDecimals) {
_value = value;
_decimals = decimals;
_decimals = oracleDecimals;
_roundId = 42;
_startedAt = 1620651856;
_updatedAt = 1620651856;
Expand Down
6 changes: 5 additions & 1 deletion contracts/mock/MockConvexBaseRewardPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ contract MockConvexBaseRewardPool is MockERC20 {
getReward(msg.sender, claim);
}

function getReward(address who, bool claim) public returns (bool) {
function getReward(
address who,
bool /* claim*/
) public returns (bool) {
if (rewardAmountPerClaim > 0) {
rewardToken.mint(who, rewardAmountPerClaim);
}
Expand All @@ -40,6 +43,7 @@ contract MockConvexBaseRewardPool is MockERC20 {

function stakeFor(address who, uint256 amount) public returns (bool) {
_balances[who] = amount;
return true;
}

function balanceOf(address who) public view override returns (uint256) {
Expand Down
2 changes: 1 addition & 1 deletion contracts/mock/MockConvexBooster.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ contract MockConvexBooster is MockERC20 {
}

function deposit(
uint256 poolId,
uint256, /* poolId*/
uint256 lpTokens,
bool stake
) public returns (bool) {
Expand Down
17 changes: 13 additions & 4 deletions contracts/mock/MockCurve3pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ contract MockCurve3pool is MockERC20 {
slippage = _slippage;
}

function add_liquidity(uint256[3] memory amounts, uint256 min_mint_amount) public {
function add_liquidity(
uint256[3] memory amounts,
uint256 /* min_mint_amount*/
) public {
IERC20(coins[0]).transferFrom(msg.sender, address(this), amounts[0]);
IERC20(coins[1]).transferFrom(msg.sender, address(this), amounts[1]);
IERC20(coins[2]).transferFrom(msg.sender, address(this), amounts[2]);
Expand All @@ -33,7 +36,10 @@ contract MockCurve3pool is MockERC20 {
return IERC20(coins[i]).balanceOf(address(this));
}

function remove_liquidity(uint256 _amount, uint256[3] memory min_amounts) public {
function remove_liquidity(
uint256 _amount,
uint256[3] memory /* min_amounts*/
) public {
uint256[3] memory amounts;
amounts[0] = _amount / 3;
amounts[1] = _amount / 3;
Expand All @@ -47,7 +53,7 @@ contract MockCurve3pool is MockERC20 {
function remove_liquidity_one_coin(
uint256 _amount,
int128 i,
uint256 min_amount
uint256 /* min_amount*/
) public {
uint256 _amountOut = (_amount * (10000 - slippage)) / 10000;
_amountOut = (_amountOut * 100000) / 100015; // 0.015% fee
Expand All @@ -59,7 +65,10 @@ contract MockCurve3pool is MockERC20 {
return 1000000000000000000;
}

function calc_withdraw_one_coin(uint256 _token_amount, int128 i) public view returns (uint256) {
function calc_withdraw_one_coin(
uint256 _token_amount,
int128 /* i*/
) public view returns (uint256) {
uint256 _amountOut = (_token_amount * (10000 - slippage)) / 10000;
_amountOut = (_amountOut * 100000) / 100015; // 0.015% fee
return _amountOut;
Expand Down
17 changes: 13 additions & 4 deletions contracts/mock/MockCurveMetapool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ contract MockCurveMetapool is MockERC20 {
slippage = _slippage;
}

function add_liquidity(uint256[2] memory amounts, uint256 min_mint_amount) public {
function add_liquidity(
uint256[2] memory amounts,
uint256 /* min_mint_amount*/
) public {
IERC20(coins[0]).transferFrom(msg.sender, address(this), amounts[0]);
IERC20(coins[1]).transferFrom(msg.sender, address(this), amounts[1]);
uint256 totalTokens = ((amounts[0] + amounts[1]) * (10000 - slippage)) / 10000;
Expand All @@ -27,7 +30,10 @@ contract MockCurveMetapool is MockERC20 {
return IERC20(coins[i]).balanceOf(address(this));
}

function remove_liquidity(uint256 _amount, uint256[2] memory min_amounts) public {
function remove_liquidity(
uint256 _amount,
uint256[2] memory /* min_amounts*/
) public {
uint256[2] memory amounts;
amounts[0] = _amount / 2;
amounts[1] = _amount / 2;
Expand All @@ -39,7 +45,7 @@ contract MockCurveMetapool is MockERC20 {
function remove_liquidity_one_coin(
uint256 _amount,
int128 i,
uint256 min_amount
uint256 /* min_amount*/
) public {
uint256 _amountOut = (_amount * (10000 - slippage)) / 10000;
_amountOut = (_amountOut * 10000) / 10002; // 0.02% fee
Expand All @@ -51,7 +57,10 @@ contract MockCurveMetapool is MockERC20 {
return 1000000000000000000;
}

function calc_withdraw_one_coin(uint256 _token_amount, int128 i) public view returns (uint256) {
function calc_withdraw_one_coin(
uint256 _token_amount,
int128 /* i*/
) public view returns (uint256) {
uint256 _amountOut = (_token_amount * (10000 - slippage)) / 10000;
_amountOut = (_amountOut * 10000) / 10002; // 0.02% fee
return _amountOut;
Expand Down
6 changes: 3 additions & 3 deletions contracts/mock/MockERC20PCVDeposit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ contract MockERC20PCVDeposit is IPCVDeposit {
}

function withdrawERC20(
address token,
address _token,
address to,
uint256 amount
) public override {
SafeERC20.safeTransfer(IERC20(token), to, amount);
emit WithdrawERC20(msg.sender, to, token, amount);
SafeERC20.safeTransfer(IERC20(_token), to, amount);
emit WithdrawERC20(msg.sender, to, _token, amount);
}

function withdrawETH(address payable to, uint256 amountOut) external virtual override {
Expand Down
6 changes: 3 additions & 3 deletions contracts/mock/MockERC20UniswapPCVDeposit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ contract MockERC20UniswapPCVDeposit is IPCVDeposit {
}

function withdrawERC20(
address token,
address _token,
address to,
uint256 amount
) public override {
SafeERC20.safeTransfer(IERC20(token), to, amount);
emit WithdrawERC20(msg.sender, to, token, amount);
SafeERC20.safeTransfer(IERC20(_token), to, amount);
emit WithdrawERC20(msg.sender, to, _token, amount);
}

function withdrawETH(address payable to, uint256 amountOut) external virtual override {
Expand Down
2 changes: 1 addition & 1 deletion contracts/mock/MockEthPCVDeposit.sol
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract MockEthPCVDeposit is IPCVDeposit {
}

/// @notice display the related token of the balance reported
function balanceReportedIn() public view override returns (address) {
function balanceReportedIn() public pure override returns (address) {
return address(0);
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/mock/MockLendingPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ contract MockLendingPool {
address asset,
uint256 amount,
address onBehalfOf,
uint16 referralCode
uint16 /* referralCode*/
) external {
IERC20(asset).transferFrom(msg.sender, address(this), amount);
aToken.mint(onBehalfOf, amount);
Expand Down
2 changes: 1 addition & 1 deletion contracts/mock/MockMerkleOrchard.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ contract MockMerkleOrchard is IMerkleOrchard {
function claimDistributions(
address claimer,
Claim[] memory claims,
IERC20[] memory tokens
IERC20[] memory /* tokens*/
) external override {
balToken.mint(claimer, claims[0].balance);
}
Expand Down
22 changes: 14 additions & 8 deletions contracts/mock/MockRewardsDistributor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,22 @@ contract MockRewardsDistributor is IRewardsDistributorAdmin, Ownable {

/**
* @notice Set COMP speed for a single market
* @param cToken The market whose COMP speed to update
*/
function _setCompSupplySpeed(address cToken, uint256 compSpeed) external override onlyOwner {
function _setCompSupplySpeed(
address, /* cToken*/
uint256 compSpeed
) external override onlyOwner {
compSupplySpeed = compSpeed;
emit successSetCompSupplySpeed();
}

/**
* @notice Set COMP speed for a single market
* @param cToken The market whose COMP speed to update
*/
function _setCompBorrowSpeed(address cToken, uint256 compSpeed) external override onlyOwner {
function _setCompBorrowSpeed(
address, /* cToken*/
uint256 compSpeed
) external override onlyOwner {
compBorrowSpeed = compSpeed;
emit successSetCompBorrowSpeed();
}
Expand All @@ -108,17 +112,19 @@ contract MockRewardsDistributor is IRewardsDistributorAdmin, Ownable {

/**
* @notice view function to get the comp supply speeds from the rewards distributor contract
* @param cToken The market to view
*/
function compSupplySpeeds(address cToken) external view override returns (uint256) {
function compSupplySpeeds(
address /* cToken*/
) external view override returns (uint256) {
return compSupplySpeed;
}

/**
* @notice view function to get the comp borrow speeds from the rewards distributor contract
* @param cToken The market to view
*/
function compBorrowSpeeds(address cToken) external view override returns (uint256) {
function compBorrowSpeeds(
address /* cToken*/
) external view override returns (uint256) {
return compBorrowSpeed;
}

Expand Down
8 changes: 4 additions & 4 deletions contracts/mock/MockStEthStableSwap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract MockStEthStableSwap {

IERC20 public token;

constructor(address _token1) public {
constructor(address _token1) {
token = IERC20(_token1);
}

Expand All @@ -27,7 +27,7 @@ contract MockStEthStableSwap {

function exchange(
int128 i,
int128 j,
int128, /* j*/
uint256 input,
uint256 min_out
) public payable returns (uint256 output) {
Expand All @@ -42,8 +42,8 @@ contract MockStEthStableSwap {
}

function get_dy(
int128 i,
int128 j,
int128, /* i*/
int128, /* j*/
uint256 input
) public view returns (uint256 output) {
output = anti ? (input * (10000 + slippage)) / 10000 : (input * (10000 - slippage)) / 10000;
Expand Down
8 changes: 5 additions & 3 deletions contracts/mock/MockStEthToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ contract MockStEthToken is MockERC20 {
uint256 public totalShares;
mapping(address => uint256) public shares;

constructor() public {
constructor() {
pooledEth = 1_000_000e18;
totalShares = 999_999e18;
shares[address(msg.sender)] = totalShares;
}

function submit(address _referral) external payable returns (uint256 amount_) {
function submit(
address /* _referral*/
) external payable returns (uint256 amount_) {
amount_ = msg.value;

uint256 _shares = getSharesByPooledEth(amount_);
Expand Down Expand Up @@ -82,7 +84,7 @@ contract MockStEthToken is MockERC20 {
totalEther_ = pooledEth;
}

function getTotalShares() public returns (uint256 totalShares_) {
function getTotalShares() public view returns (uint256 totalShares_) {
totalShares_ = totalShares;
}

Expand Down
5 changes: 4 additions & 1 deletion contracts/mock/MockTokemakEthPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ contract MockTokemakEthPool is MockERC20 {
weth.deposit{value: msg.value}();
}

function withdraw(uint256 requestedAmount, bool asEth) external {
function withdraw(
uint256 requestedAmount,
bool /* asEth*/
) external {
require(requestedWithdrawal[msg.sender] >= requestedAmount, "WITHDRAW_INSUFFICIENT_BALANCE");
require(weth.balanceOf(address(this)) >= requestedAmount, "INSUFFICIENT_POOL_BALANCE");
requestedWithdrawal[msg.sender] -= requestedAmount;
Expand Down
6 changes: 3 additions & 3 deletions contracts/mock/MockTokemakRewards.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ contract MockTokemakRewards is MockERC20 {

function claim(
Recipient calldata recipient,
uint8 v,
bytes32 r,
bytes32 s // bytes calldata signature
uint8, /* v*/
bytes32, /* r*/
bytes32 /* s*/ // bytes calldata signature
) external {
rewardsToken.mint(recipient.wallet, recipient.amount);
}
Expand Down
4 changes: 3 additions & 1 deletion contracts/mock/MockTribalChief.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ contract MockTribalChief {
totalAllocPoint = _totalAllocPoint;
}

function poolInfo(uint256 _index)
function poolInfo(
uint256 /* _index*/
)
external
view
returns (
Expand Down
14 changes: 9 additions & 5 deletions contracts/mock/MockVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ contract MockVault {
TWO_TOKEN
}

function getPool(bytes32 poolId) external view returns (address poolAddress, PoolSpecialization poolSpec) {
function getPool(
bytes32 /* poolId*/
) external view returns (address poolAddress, PoolSpecialization poolSpec) {
poolAddress = address(_pool);
poolSpec = PoolSpecialization.TWO_TOKEN;
}

function getPoolTokens(bytes32 poolId)
function getPoolTokens(
bytes32 /* poolId*/
)
external
view
returns (
Expand All @@ -68,8 +72,8 @@ contract MockVault {
}

function joinPool(
bytes32 poolId,
address sender,
bytes32, /* poolId*/
address, /* sender*/
address recipient,
JoinPoolRequest memory request
) external payable {
Expand All @@ -89,7 +93,7 @@ contract MockVault {
}

function exitPool(
bytes32 poolId,
bytes32, /* poolId*/
address sender,
address payable recipient,
ExitPoolRequest memory request
Expand Down
1 change: 1 addition & 0 deletions contracts/test/integration/fixtures/MainnetAddresses.sol
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ library MainnetAddresses {
address public constant AGEUR = 0x1a7e4e63778B4f12a199C062f3eFdD288afCBce8;
address public constant USDC = 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
address public constant DAI_FIXED_PRICE_PSM = 0x2A188F9EB761F70ECEa083bA6c2A40145078dfc2;
address public constant LUSD_HOLDING_PCV_DEPOSIT = 0x4378De2F2991Fbed6616b34AC7727E7653713712;
}
2 changes: 1 addition & 1 deletion contracts/test/integration/fixtures/Orca.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function createPod(
function setupTimelock(
address proposer,
address executor,
address core
address /* core*/
) returns (TimelockController) {
address[] memory proposers = new address[](1);
proposers[0] = proposer;
Expand Down
Loading

0 comments on commit 4571613

Please sign in to comment.