generated from defi-wonderland/solidity-foundry-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
3,749 additions
and
2,668 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// SPDX-License-Identifier: Unlicense | ||
pragma solidity ^0.8.19; | ||
|
||
import {Auth,Authority} from 'isolmate/auth/Auth.sol'; | ||
import {IERC20} from 'isolmate/interfaces/tokens/IERC20.sol'; | ||
|
||
contract ZoomerMigrator is Auth { | ||
IERC20 public immutable OLD_ZOOMER; | ||
IERC20 public immutable NEW_ZOOMER; | ||
|
||
constructor(address _oldZoomer, address _newZoomer) Auth(msg.sender, Authority(address(0))) { | ||
OLD_ZOOMER = IERC20(_oldZoomer); | ||
NEW_ZOOMER = IERC20(_newZoomer); | ||
} | ||
|
||
function migrate() external { | ||
uint256 _amount = OLD_ZOOMER.balanceOf(msg.sender); | ||
OLD_ZOOMER.transferFrom(msg.sender, address(this), _amount); | ||
NEW_ZOOMER.transfer(msg.sender, _amount); | ||
} | ||
|
||
function migrate(uint256 _amount) external { | ||
require(_amount > 0, 'ZoomerMigrator: amount must be greater than 0'); | ||
|
||
OLD_ZOOMER.transferFrom(msg.sender, address(this), _amount); | ||
NEW_ZOOMER.transfer(msg.sender, _amount); | ||
} | ||
} |
Oops, something went wrong.