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

Add recoverability for Dai mistakenly sent into the contract #49

Open
0age opened this issue Mar 19, 2020 · 2 comments
Open

Add recoverability for Dai mistakenly sent into the contract #49

0age opened this issue Mar 19, 2020 · 2 comments

Comments

@0age
Copy link

0age commented Mar 19, 2020

Dai (ERC20) that is sent into the contract becomes orphaned. Since all enlisted Dai is immediately locked in the vat, an owner should be able to safely retrieve the Dai and return it to the sender.

@naszam
Copy link

naszam commented Mar 24, 2020

I would recommend for the future to implement a fall back function as follow:

function deposit() payable external { balances[msg.sender] += msg.value; }

as recommended by ConsenSys.

Or using the selfdestruct() function at the end of the debt auctions, to collect the balance and send back the Dai to their owners or better, extend the withdraw function to address this issue (anyway, checking the code, I saw that something is already implemented and I'm wondering why people can't get back their DAI? should be possible I guess)

@naszam
Copy link

naszam commented Mar 30, 2020

Check here for new ways to mitigate funds accidentally sent to smart contracts, using Solidity 0.6.x receive(): link

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

No branches or pull requests

2 participants