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

Proposal for simple exit contract #362

Merged
merged 10 commits into from
Mar 29, 2021
Merged

Proposal for simple exit contract #362

merged 10 commits into from
Mar 29, 2021

Conversation

sh-rp
Copy link

@sh-rp sh-rp commented Mar 3, 2021

No description provided.

@sh-rp sh-rp force-pushed the d#/closing_token_controller branch from ec05f9d to 9fa1abb Compare March 3, 2021 13:41
@sh-rp sh-rp force-pushed the d#/closing_token_controller branch 8 times, most recently from 9b8991d to ee0c757 Compare March 9, 2021 17:00
@sh-rp sh-rp marked this pull request as ready for review March 9, 2021 17:49
@sh-rp sh-rp force-pushed the d#/closing_token_controller branch from ee0c757 to b205aa9 Compare March 14, 2021 10:30
Copy link
Contributor

@banciur banciur left a 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;
Copy link
Contributor

@banciur banciur Mar 24, 2021

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 /

Copy link
Author

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");

Copy link
Contributor

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.

Copy link
Author

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?

@banciur
Copy link
Contributor

banciur commented Mar 24, 2021

Some loose ideas (more like brainstorming):

  • I was thinking about manual phase. I think we should avoid manual contract operations as those are prone to copy paste errors and write script that would take data as csv file and do it automatically.
  • track addresses that would receive payout in manual process to not send eur twice to same address
    • this can be done offchain when preparing csv
    • this might be valid usecase so maybe we should not prevent it
  • Amount of EUR received from nominee will be known from start so it could be a constructor parameter and then validated when processing first transaction to make sure nominee would send correct amount
  • Idea for frontend app. Highlight minimum redeem amount and tx price to let people know that with current gas price it doesn't make sense. This depends of structure of owners.
  • I wonder could we and if we can does it makes sense to incorporate redeem into manual payout. Then tx cost will be lower.
  • Add minimum payout phase period. Just nice blockchainy phase to show we do it "right" and can't control everything.

Co-authored-by: Arjun Umesha <arjunu@users.noreply.github.com>
@sh-rp sh-rp force-pushed the d#/closing_token_controller branch from 3f3032c to 6c644f5 Compare March 25, 2021 15:07
Copy link

@desfero desfero left a 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

@@ -100,5 +100,8 @@ contract KnownInterfaces {
// Voting Center keccak256("IVotingCenter")
bytes4 internal constant KNOWN_INTERFACE_VOTING_CENTER = 0xff5dbb18;

// Voting Center keccak256("ExitController")
Copy link

Choose a reason for hiding this comment

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

Suggested change
// Voting Center keccak256("ExitController")
// Exit Controller keccak256("ExitController")

////////////////////////

//
// Implements IControllerGovernance
Copy link

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
Copy link

Choose a reason for hiding this comment

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

Suggested change
// 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;
Copy link

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, "");
Copy link

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?

Copy link

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,
Copy link

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);
Copy link

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;
                }
            }
           

@sh-rp sh-rp force-pushed the d#/closing_token_controller branch from ed560c5 to 6291188 Compare March 29, 2021 13:07
@sh-rp sh-rp force-pushed the d#/closing_token_controller branch from 6291188 to e5f5004 Compare March 29, 2021 13:16
@sh-rp sh-rp force-pushed the d#/closing_token_controller branch from d8595cc to 2817b08 Compare March 29, 2021 21:02
@sh-rp sh-rp merged commit b31c442 into master Mar 29, 2021
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.

4 participants