1

is possible to make a function to recall a certain amount from a token Holder?

What I meant is:

The Token Owner make a transaction with 10 tokens to a client, this client do not pay for the tokens. Is possible to make a function to get back the 10 tokens?

1 Answer 1

1

Yes, but the token must specifically support this action.

Here is an example code of such token feature. In this case, reclaim only works until the token has been set to unreclaimable state.

contract AMLToken is BurnableCrowdsaleToken {

  // An event when the owner has reclaimed non-released tokens
  event OwnerReclaim(address fromWhom, uint amount);

  function AMLToken(string _name, string _symbol, uint _initialSupply, uint _decimals, bool _mintable) BurnableCrowdsaleToken(_name, _symbol, _initialSupply, _decimals, _mintable) {

  }

  /// @dev Here the owner can reclaim the tokens from a participant if
  ///      the token is not released yet. Refund will be handled offband.
  /// @param fromWhom address of the participant whose tokens we want to claim
  function transferToOwner(address fromWhom) onlyOwner {
    if (released) revert();

    uint amount = balanceOf(fromWhom);
    balances[fromWhom] = balances[fromWhom].sub(amount);
    balances[owner] = balances[owner].add(amount);
    Transfer(fromWhom, owner, amount);
    OwnerReclaim(fromWhom, amount);
  }
}

Full code: https://github.com/TokenMarketNet/smart-contracts/blob/master/contracts/AMLToken.sol#L38

1
  • Thanks this is fine for what I need. Commented Apr 15, 2020 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.