Skip to content

Commit

Permalink
feat: migratooor
Browse files Browse the repository at this point in the history
  • Loading branch information
rhlsthrm committed Dec 22, 2023
1 parent 5a884ce commit 4c29635
Show file tree
Hide file tree
Showing 4 changed files with 3,749 additions and 2,668 deletions.
Binary file added .yarn/install-state.gz
Binary file not shown.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
"isolmate": "github:defi-wonderland/isolmate#59e1804"
},
"devDependencies": {
"@commitlint/cli": "17.0.3",
"@commitlint/config-conventional": "17.0.3",
"@commitlint/cli": "18.4.3",
"@commitlint/config-conventional": "18.4.3",
"ds-test": "github:dapphub/ds-test#e282159",
"forge-std": "github:foundry-rs/forge-std#v1.7.3",
"forge-std": "github:foundry-rs/forge-std#v1.7.4",
"husky": ">=8",
"lint-staged": ">=10",
"solhint": "3.6.2",
"solhint-plugin-defi-wonderland": "1.1.0",
"sort-package-json": "1.53.1"
"lint-staged": ">=15",
"solhint": "4.0.0",
"solhint-plugin-defi-wonderland": "1.1.2",
"sort-package-json": "2.6.0"
}
}
28 changes: 28 additions & 0 deletions solidity/contracts/Migrator.sol
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);
}
}
Loading

0 comments on commit 4c29635

Please sign in to comment.