-
Notifications
You must be signed in to change notification settings - Fork 435
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
base: verbs-objection-period-spike
Are you sure you want to change the base?
[DRAFT] Ragequit POC #614
Conversation
ragequitPenaltyBPs = ragequitPenaltyBPs_; | ||
} | ||
|
||
function _addRedeemableAsset(address erc20) external { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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)
@davidbrai I think it's looking good, captured comments that mirror our discussion |
initial implementation for ragequit POC where nouns are sent to treasury
created this PR to make it easier to discuss