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

[DRAFT] Ragequit POC #614

Draft
wants to merge 1 commit into
base: verbs-objection-period-spike
Choose a base branch
from

Conversation

eladmallel
Copy link
Collaborator

initial implementation for ragequit POC where nouns are sent to treasury

created this PR to make it easier to discuss

ragequitPenaltyBPs = ragequitPenaltyBPs_;
}

function _addRedeemableAsset(address erc20) external {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we discussed, we want to explore the approach of letting all treasury-owned ERC20s be redeemable by default
to make ragequit fair by default without having to get DAO permission and attention to whitelist tokens via proposals

timelock.redeem(msg.sender, amountOfEthToRedeem);

////// ERC20s redeem
for (uint256 i = 0; i < redeemableAssets.length; ++i) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as we discussed, we want to give users the ability to specify the list of ERC20s they want to redeem

function redeem(address account, uint256 amount) external {
require(msg.sender == admin, 'Only admin');

(bool success, ) = account.call{ value: amount, gas: 30_000 }(new bytes(0));
Copy link
Collaborator Author

@eladmallel eladmallel Nov 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you probably thought about this, just capturing for later: we probably want to do a "safe send" that uses WETH if sending ETH fails

wdyt @davidbrai ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either that, or we could use an escrow contract that the ragequitter can "pull" ETH from


proRataShare = (nounIds.length * IERC20(asset).balanceOf(address(timelock))) / supply;
uint256 amountOfTokensToRedeem = ((10_000 - ragequitPenaltyBPs) * proRataShare) / 10_000;
IERC20(asset).transferFrom(address(timelock), msg.sender, amountOfTokensToRedeem);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want to move this call into a new timelock function to remove the need for token approvals (in line with the other comment, letting minorities quit with ERC20 shares without needing majority permission)

@eladmallel
Copy link
Collaborator Author

@davidbrai I think it's looking good, captured comments that mirror our discussion
once those details are ironed out I think it could be cool to outline the upgrade process from current state to new state, specifically to see how we're handling the timelock change, and keeping control over the old timelock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants