Fundamental features

Register with Referral: identical to register but adds the functionality to send 10% of the value to a specified address within the function.

Renew with referral: identical to renew but adds the functionality to send 10% of the value to a specified address within the function.

<aside> ⚠️ This spec allows a user to make a custom frontend that gives themselves a 10% discount. That is not an bug but a feature as we want alternative frontends to be built.

</aside>

Important features

Set Referral Fees: a function that can be only called by the DAO which sets the referral fee (in 1/1000 increments)

Might be important to consider

Withdraw: we should consider the gas impact vs code complexity of a push vs pull method. Should the referral be sent immediately when buying a name, or kept on the contract and the referrer can withdraw all in bulk? It might save gas on the renew/register functions, but will make the contract considerably more complex and require changes to the withdrawal contract

New Improvements:

Make Commitment with Payment:

Currently the app requires two transactions, the first being a plain commitment and the second a reveal where the user sends funds. The main purpose of the two transactions is to avoid being front run: a miner could see that user wants to register X, post a transaction with a higher gas and register before them and then attempt to sell them the name. Currently a commitment has a minimal waiting period of 1 minute and a maximum expiry date of 1 week, meaning that the user could commit to one name and only send the transaction a few days later, but this is not recommended as the name is only registered on the last step. The current process means the user needs to take these steps:

  1. Make a commit transaction

  2. Wait for it to be mined

  3. Wait another minute

  4. Make second transaction with funds

  5. Wait for it to be mined.

Currently the payment only happens on step 4, so only the user can reveal their own commitments, but if we could somehow change it so that step #4 is done automatically by the registration app, then the whole process would become:

  1. Make a commitment with funds