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

Feat/restituton2.0 #1

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
16 changes: 15 additions & 1 deletion contracts/RemBadger.sol
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ import "../interfaces/setth/IGac.sol";
* RemBadger Version
* Allows for one time dilution of ppfs by minting extra shares (briked after)
* DepositBricked to track when deposits can no longer be done (irreversible)

V1.Rem2.0
* Introduces function to enable deposits after they have been bricked
* Intended to allow for a single user re-entry via `depositFor` called by Governance (BIP 103 - Amendment 3)
* Reference: https://forum.badger.finance/t/bip-103-restitution-amendments/6184/5
*/

contract RemBadger is ERC20Upgradeable, SettAccessControlDefended, PausableUpgradeable {
Expand Down Expand Up @@ -71,6 +76,7 @@ contract RemBadger is ERC20Upgradeable, SettAccessControlDefended, PausableUpgra
event FullPricePerShareUpdated(uint256 value, uint256 indexed timestamp, uint256 indexed blockNumber);

event DepositBricked(uint256 indexed timestamp);
event DepositEnabled(uint256 indexed timestamp);

modifier whenNotPaused() override {
require(!paused(), "Pausable: paused");
Expand Down Expand Up @@ -117,6 +123,14 @@ contract RemBadger is ERC20Upgradeable, SettAccessControlDefended, PausableUpgra
emit DepositBricked(block.timestamp);
}

/// @dev Sets `depositsEnded` to false, enabling deposits
function enableDeposits() public {
_onlyGovernance();
depositsEnded = false;

emit DepositEnabled(block.timestamp);
}

/// @dev Mint more shares, diluting the ppfs
/// @notice This bricks deposit to avoid griefing, can only call once!!
function mintExtra(uint256 amount) external {
Expand Down Expand Up @@ -151,7 +165,7 @@ contract RemBadger is ERC20Upgradeable, SettAccessControlDefended, PausableUpgra
/// ===== View Functions =====

function version() public view returns (string memory) {
return "1.4r - remBadger";
return "1.4r - remBadger 2.0";
}

function getPricePerFullShare() public virtual view returns (uint256) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,4 @@ contract VipCappedGuestListWrapperUpgradeable is OwnableUpgradeable {
bytes32 node = keccak256(abi.encodePacked(account));
return MerkleProofUpgradeable.verify(merkleProof, guestRoot, node);
}
}
}
7 changes: 7 additions & 0 deletions interfaces/badger/IProxyAdmin.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.6.11;

interface IProxyAdmin {
function upgrade(address, address) external;
}
Loading