-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BIP-38: Migrate urBEAN3CRV to urBEANETH (#655)
- Loading branch information
Showing
54 changed files
with
1,633 additions
and
747 deletions.
There are no files selected for viewing
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
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
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
34 changes: 34 additions & 0 deletions
34
protocol/contracts/beanstalk/init/InitMigrateUnripeBean3CrvToBeanEth.sol
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,34 @@ | ||
/* | ||
SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
pragma solidity =0.7.6; | ||
pragma experimental ABIEncoderV2; | ||
|
||
import {AppStorage} from "contracts/beanstalk/AppStorage.sol"; | ||
import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; | ||
import {C} from "contracts/C.sol"; | ||
import {LibDiamond} from "contracts/libraries/LibDiamond.sol"; | ||
import {LibUnripe} from "contracts/libraries/LibUnripe.sol"; | ||
|
||
/** | ||
* Initializes the Migration of the Unripe LP underlying tokens from Bean:3Crv to Bean:Eth. | ||
*/ | ||
contract InitMigrateUnripeBean3CrvToBeanEth { | ||
using SafeERC20 for IERC20; | ||
|
||
AppStorage internal s; | ||
|
||
function init() external { | ||
uint256 balanceOfUnderlying = s.u[C.UNRIPE_LP].balanceOfUnderlying; | ||
IERC20(s.u[C.UNRIPE_LP].underlyingToken).safeTransfer( | ||
LibDiamond.diamondStorage().contractOwner, | ||
balanceOfUnderlying | ||
); | ||
LibUnripe.decrementUnderlying(C.UNRIPE_LP, balanceOfUnderlying); | ||
LibUnripe.switchUnderlyingToken(C.UNRIPE_LP, C.BEAN_ETH_WELL); | ||
|
||
// Reset variable to 0 because it wasn't in BIP-36. | ||
delete s.season.withdrawSeasons; | ||
} | ||
} |
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
Oops, something went wrong.