Skip to content

Commit

Permalink
Bump dependencies. Tweak tests to respect dependency changes. Use pre…
Browse files Browse the repository at this point in the history
…tties instead of solhint to fix formatting issues.
  • Loading branch information
blitz-1306 committed Sep 26, 2023
1 parent e094095 commit f71f5e4
Show file tree
Hide file tree
Showing 6 changed files with 4,273 additions and 3,281 deletions.
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
"bracketSpacing": true
}
}
]
],
"plugins": ["prettier-plugin-solidity"]
}
15 changes: 8 additions & 7 deletions contracts/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
contract Vault {
using SafeERC20 for IERC20;

IERC20 public immutable token;
IERC20 public token;

uint public totalSupply;
uint256 public totalSupply;

mapping(address => uint) public balanceOf;
mapping(address => uint256) public balanceOf;

constructor(address token_) {
token = IERC20(token_);
}

function deposit(uint amount_) external {
uint shares;
function deposit(uint256 amount_) external {
uint256 shares;

if (totalSupply == 0) {
shares = amount_;
Expand All @@ -33,8 +33,9 @@ contract Vault {
token.safeTransferFrom(msg.sender, address(this), amount_);
}

function withdraw(uint shares_) external {
uint amount = (shares_ * token.balanceOf(address(this))) / totalSupply;
function withdraw(uint256 shares_) external {
uint256 amount = (shares_ * token.balanceOf(address(this))) /
totalSupply;

totalSupply -= shares_;

Expand Down
Loading

0 comments on commit f71f5e4

Please sign in to comment.