-
Notifications
You must be signed in to change notification settings - Fork 32
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
Proposal for simple exit contract #362
Conversation
ec05f9d
to
9fa1abb
Compare
9b8991d
to
ee0c757
Compare
ee0c757
to
b205aa9
Compare
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.
More comments in conversation below PR
} | ||
// calculate the amount of eligible proceeds based on the total equity token supply and the | ||
// acquisition price | ||
return Math.mul(_exitAquisitionPriceEurUlps, amountTokens) / _exitEquityTokenSupply; |
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.
Sadly I don't know about high precision math but there is also Math.divRound
maybe it would be better her than simple /
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.
The div round does a round up from .5 upwards, and I thought it would be safer to always round down the way / does. Or what do you think?
|
||
(uint256 _tokens, uint256 _proceeds) = eligibleProceedsForInvestor(lostWallet); | ||
require(_proceeds > 0, "NF_NO_PROCEEDS"); | ||
|
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.
Maybe it makes sense to check claims of newWallet
and add requirement for KYC and bank account? It will help mitigate manual mistakes from nominee that will send those transactions.
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.
I would say this is already done in the euro token controller contract in function isTransferAllowedPrivate(address from, address to, bool allowPeerTransfers). So wallets that are not verified can't receive our-t. Could you double check if you think this is the case too?
Some loose ideas (more like brainstorming):
|
Co-authored-by: Arjun Umesha <arjunu@users.noreply.github.com>
3f3032c
to
6c644f5
Compare
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.
Just small comment typos
contracts/KnownInterfaces.sol
Outdated
@@ -100,5 +100,8 @@ contract KnownInterfaces { | |||
// Voting Center keccak256("IVotingCenter") | |||
bytes4 internal constant KNOWN_INTERFACE_VOTING_CENTER = 0xff5dbb18; | |||
|
|||
// Voting Center keccak256("ExitController") |
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.
// Voting Center keccak256("ExitController") | |
// Exit Controller keccak256("ExitController") |
//////////////////////// | ||
|
||
// | ||
// Implements IControllerGovernance |
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.
is that comment in place here? I'm wondering where state
function implements IControllerGovernance
startPayout(); | ||
} | ||
// when we already are in the closing state, investors can send | ||
// their tokens to be burned and converted to euro token |
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.
// their tokens to be burned and converted to euro token | |
// their tokens to be burned and converted to euro token |
|
||
// exit values get set when exit proceedings start | ||
uint256 private _exitEquityTokenSupply = 0; | ||
uint256 private _exitAquisitionPriceEurUlps = 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.
Maybe a typo: Acquisition
{ | ||
// payout euro tokens to investor | ||
uint256 _eligibleProceeds = eligibleProceedsForTokens(equityTokenAmount); | ||
EURO_TOKEN.transfer(investor, _eligibleProceeds, ""); |
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.
In case transfer failed (for .e.g someone reclaimed EURO_TOKEN
) we would still log event. Maybe we should wrap transfer
in require
?
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.
I think the same applies to manual payout too
|
||
contract ExitController is | ||
KnownInterfaces, | ||
Reclaimable, |
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.
Let's disallow reclaiming EQUITY_TOKEN
completely and EURO_TOKEN
up until we reach either ManualPayoutResolution
or a new Closed
state
equityTokens = EQUITY_TOKEN.balanceOf(investor); | ||
} | ||
else if (_state == State.ManualPayoutResolution) { | ||
equityTokens = EQUITY_TOKEN.balanceOfAt(investor, _manualPayoutResolutionStart); |
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 can add support for users without claimed tokens here by interacting with the ETOCommitment
smart-contract.
Pseudo-code
if (equityTokens == 0) {
(claimedOrRefunded, equityTOkenAmount) = ETO_COMMITMENT.investorTicket(investor)
if (claimedOrRefund == false) {
equityTokens = equityTOkenAmount;
}
}
ed560c5
to
6291188
Compare
6291188
to
e5f5004
Compare
d8595cc
to
2817b08
Compare
No description provided.