Skip to content

Conversation

@ra-phael
Copy link
Collaborator

  • Add IERC1238Holdable & ERC1238Holdable extension to let ERC1238 tokens be held by another account
  • Add IERC1238Holder interface that should be inherited by smart contract holding tokens
  • Start adding tests (more will be added in another PR)

@ra-phael ra-phael mentioned this pull request Apr 14, 2022
@ra-phael ra-phael requested a review from 0xpApaSmURf April 14, 2022 15:57
* Requirements:
* - `holder` should hold at least the `amount` of tokens with the `id` passed
*/
function _burnHeldTokens(
Copy link

@0xpApaSmURf 0xpApaSmURf Apr 14, 2022

Choose a reason for hiding this comment

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

I would still just call this a burn function. A burn may affect a token that is currently being held but it also may not. It should just attempt burn flows, check if its being held, if it is, then do more, if not, continue with burn flow.

using Address for address;

// Mapping holder => id => balance
mapping(address => mapping(uint256 => uint256)) private _heldBalances;

Choose a reason for hiding this comment

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

Should we add another mapping for discoverability?

As a user/application I would want an easy way to check who might be a holder of a particular token. This mapping just gives us the balances of a specific holder we might be interested in.

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.

3 participants