Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix post l1 #233

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Vault.sol
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ contract Vault is IVault, ERC4626, ERC20Permit {

function sweep(address to, address token) external onlyOwner {
assert(token != asset());
assert(to != address(0));

IERC20 spuriousToken = IERC20(token);
uint256 amount = spuriousToken.balanceOf(address(this));
Expand Down
1 change: 1 addition & 0 deletions src/services/Service.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ abstract contract Service is IService, ERC721Enumerable, Ownable {
address _manager,
uint256 _deadline
) ERC721(_name, _symbol) {
assert(_manager != address(0));
manager = IManager(_manager);
locked = false;
id = 0;
Expand Down
4 changes: 4 additions & 0 deletions src/services/credit/CallOption.sol
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ contract CallOption is CreditService {
if (_ithil == address(0)) revert InvalidParams();
if (_initialPrice == 0) revert InvalidParams();
if (_underlying == address(0)) revert InvalidParams();
if (_minLoan == 0) revert InvalidParams();
if (_halvingTime == 0) revert InvalidParams();
if (_tenorDuration == 0) revert InvalidParams();

initialPrice = _initialPrice;
underlying = IERC20(_underlying);
Expand All @@ -89,6 +92,7 @@ contract CallOption is CreditService {
vestingTime = _initialVesting + block.timestamp;

_vaultAddress = manager.vaults(_underlying);
if (_vaultAddress == address(0)) revert InvalidParams();
// approve vault to spend underlying token for deposits
// technically, it should be re-approved if the total volume exceeds 2^256
// in practice, this event never happens, and in case just redeploy the service
Expand Down
Loading