Skip to content

Commit

Permalink
Merge pull request #83 from pods-finance/openzeppelin/N-13
Browse files Browse the repository at this point in the history
[OZ: N-13] Removed unused named return variables
  • Loading branch information
ggviana committed Oct 17, 2022
2 parents c47a0aa + ba55937 commit 17136cc
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 45 deletions.
16 changes: 8 additions & 8 deletions abi/BaseVault.json
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "shares",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -653,7 +653,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "shares",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -805,7 +805,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -842,7 +842,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -886,7 +886,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -1018,7 +1018,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand All @@ -1037,7 +1037,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "shares",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -1144,7 +1144,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "roundId",
"name": "",
"type": "uint256"
}
],
Expand Down
4 changes: 2 additions & 2 deletions abi/ETHAdapter.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "ethAmount",
"name": "",
"type": "uint256"
}
],
Expand All @@ -77,7 +77,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "stETHAmount",
"name": "",
"type": "uint256"
}
],
Expand Down
4 changes: 2 additions & 2 deletions abi/Migration.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "newShares",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -84,7 +84,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "newShares",
"name": "",
"type": "uint256"
}
],
Expand Down
16 changes: 8 additions & 8 deletions abi/PrincipalProtectedMock.json
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "shares",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -760,7 +760,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "shares",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -969,7 +969,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -1006,7 +1006,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -1050,7 +1050,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -1182,7 +1182,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand All @@ -1201,7 +1201,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "shares",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -1321,7 +1321,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "roundId",
"name": "",
"type": "uint256"
}
],
Expand Down
16 changes: 8 additions & 8 deletions abi/STETHVault.json
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "shares",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -768,7 +768,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "shares",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -964,7 +964,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -1001,7 +1001,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -1045,7 +1045,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -1177,7 +1177,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "assets",
"name": "",
"type": "uint256"
}
],
Expand All @@ -1196,7 +1196,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "shares",
"name": "",
"type": "uint256"
}
],
Expand Down Expand Up @@ -1316,7 +1316,7 @@
"outputs": [
{
"internalType": "uint256",
"name": "roundId",
"name": "",
"type": "uint256"
}
],
Expand Down
4 changes: 2 additions & 2 deletions contracts/proxy/ETHAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ contract ETHAdapter {
pool = _pool;
}

function convertToSTETH(uint256 ethAmount) external view returns (uint256 stETHAmount) {
function convertToSTETH(uint256 ethAmount) external view returns (uint256) {
return pool.get_dy(0, 1, ethAmount);
}

function convertToETH(uint256 stETHAmount) external view returns (uint256 ethAmount) {
function convertToETH(uint256 stETHAmount) external view returns (uint256) {
return pool.get_dy(1, 0, stETHAmount);
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/proxy/Migration.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ contract Migration {
to = _to;
}

function migrate(uint256 shares) external returns (uint256 newShares) {
function migrate(uint256 shares) external returns (uint256) {
from.redeem(shares, address(this), msg.sender);

IERC20 asset = IERC20(from.asset());
Expand All @@ -35,7 +35,7 @@ contract Migration {
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 newShares) {
) external returns (uint256) {
IERC20Permit(address(from)).permit(msg.sender, address(this), shares, deadline, v, r, s);
from.redeem(shares, address(this), msg.sender);

Expand Down
23 changes: 11 additions & 12 deletions contracts/vaults/BaseVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ abstract contract BaseVault is IVault, ERC20Permit, ERC4626, Capped {
virtual
override(ERC4626, IERC4626)
whenNotProcessingDeposits
returns (uint256 shares)
returns (uint256)
{
return super.deposit(assets, receiver);
}
Expand All @@ -100,7 +100,7 @@ abstract contract BaseVault is IVault, ERC20Permit, ERC4626, Capped {
uint8 v,
bytes32 r,
bytes32 s
) external whenNotProcessingDeposits returns (uint256 shares) {
) external whenNotProcessingDeposits returns (uint256) {
IERC20Permit(asset()).permit(msg.sender, address(this), assets, deadline, v, r, s);
return super.deposit(assets, receiver);
}
Expand All @@ -113,7 +113,7 @@ abstract contract BaseVault is IVault, ERC20Permit, ERC4626, Capped {
virtual
override(ERC4626, IERC4626)
whenNotProcessingDeposits
returns (uint256 assets)
returns (uint256)
{
return super.mint(shares, receiver);
}
Expand All @@ -125,8 +125,8 @@ abstract contract BaseVault is IVault, ERC20Permit, ERC4626, Capped {
uint8 v,
bytes32 r,
bytes32 s
) external whenNotProcessingDeposits returns (uint256 assets) {
assets = previewMint(shares);
) external whenNotProcessingDeposits returns (uint256) {
uint256 assets = previewMint(shares);
IERC20Permit(asset()).permit(msg.sender, address(this), assets, deadline, v, r, s);
return super.mint(shares, receiver);
}
Expand Down Expand Up @@ -160,16 +160,15 @@ abstract contract BaseVault is IVault, ERC20Permit, ERC4626, Capped {
/**
* @inheritdoc IERC4626
*/
function previewWithdraw(uint256 assets) public view override(ERC4626, IERC4626) returns (uint256 shares) {
shares = _convertToShares(assets, Math.Rounding.Up);
return shares;
function previewWithdraw(uint256 assets) public view override(ERC4626, IERC4626) returns (uint256) {
return _convertToShares(assets, Math.Rounding.Up);
}

/**
* @inheritdoc IERC4626
*/
function previewRedeem(uint256 shares) public view override(ERC4626, IERC4626) returns (uint256 assets) {
assets = _convertToAssets(shares, Math.Rounding.Down);
function previewRedeem(uint256 shares) public view override(ERC4626, IERC4626) returns (uint256) {
uint256 assets = _convertToAssets(shares, Math.Rounding.Down);
return assets - _getFee(assets);
}

Expand All @@ -194,7 +193,7 @@ abstract contract BaseVault is IVault, ERC20Permit, ERC4626, Capped {
/**
* @inheritdoc IERC4626
*/
function maxWithdraw(address owner) public view override(ERC4626, IERC4626) returns (uint256 assets) {
function maxWithdraw(address owner) public view override(ERC4626, IERC4626) returns (uint256) {
return previewRedeem(balanceOf(owner));
}

Expand Down Expand Up @@ -263,7 +262,7 @@ abstract contract BaseVault is IVault, ERC20Permit, ERC4626, Capped {
/**
* @inheritdoc IVault
*/
function startRound() external virtual onlyRoundStarter returns (uint256 roundId) {
function startRound() external virtual onlyRoundStarter returns (uint256) {
if (!isProcessingDeposits) revert IVault__NotProcessingDeposits();

isProcessingDeposits = false;
Expand Down
2 changes: 1 addition & 1 deletion contracts/vaults/STETHVault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ contract STETHVault is BaseVault {
address from,
address to,
uint256 amount
) internal returns (uint256 effectiveAmount) {
) internal returns (uint256) {
uint256 balanceBefore = IERC20Metadata(asset()).balanceOf(to);
if (from == address(this)) {
IERC20Metadata(asset()).safeTransfer(to, amount);
Expand Down

0 comments on commit 17136cc

Please sign in to comment.