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 better redemption mechanics #291

Merged
merged 12 commits into from
Oct 2, 2018
Merged

Conversation

adamdossa
Copy link
Contributor

@adamdossa adamdossa commented Sep 28, 2018

Redemption Mechanics:

NB - redemption / burning is the same thing - currently we use burn rather than redeem as the verb.

Currently we have a burn function that references a ITokenBurner contract that can only be called by the user wishing to burn tokens.

Issues:

  • No ability to approve someone to burn tokens on your behalf
  • no way for issuer to burn tokens (forceTransfer doesn’t allow transfer to 0x0 or reducing the totalSupply)
  • no way for a module to burn tokens
  • not possible to have multiple burn mechanics

Requirements:

  • Token holders cannot directly burn tokens - must happen through a REDEMPTION type module
  • REDEMPTION type modules cannot arbitrarily burn tokens, users must approve the module first for the amount of tokens that they are ceding control over
  • Issuer can force burn tokens (reducing total supply) subject to the same controls as forceTransfer

Implementation:

  • Addition of burnFrom as an analogue of transferFrom - i.e. uses allowance to burn tokens on behalf of someone else
  • burn and burnFrom can only be called from a REDEMPTION type module
  • Addition of forceBurn to allow an issuer to burn someone elses tokens (subject to same controls as forceTransfer
  • Issuer cannot call burn or burnFrom (i.e. we use onlyModule, not onlyModuleOrOwner)
  • Remove tokenBurner as redemption logic will instead happen in REDEMPTION module
  • Renamed STO_KEY as MINT_KEY and added BURN_KEY as a module type

Notes:

  • One type of behaviour this doesn’t allow is forced burning via a REDEMPTION module. However the issuer can still force burn tokens.

@adamdossa adamdossa changed the title Add better redemption mechanics WIP: Add better redemption mechanics Sep 28, 2018
@adamdossa adamdossa changed the title WIP: Add better redemption mechanics Add better redemption mechanics Sep 30, 2018
contracts/tokens/SecurityToken.sol Show resolved Hide resolved
contracts/tokens/SecurityToken.sol Show resolved Hide resolved
contracts/tokens/SecurityToken.sol Show resolved Hide resolved
contracts/tokens/SecurityToken.sol Show resolved Hide resolved
Copy link
Contributor

@satyamakgec satyamakgec left a comment

Choose a reason for hiding this comment

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

Looks good to me @pabloruiz55 please take a second look

@adamdossa adamdossa merged commit 840fb8f into development-1.5.0 Oct 2, 2018
@satyamakgec satyamakgec deleted the multiple_types branch October 30, 2019 12:20
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.

None yet

3 participants