Skip to content

Potential Bug in ManualApprovalTransferManager  #456

Closed

Description

Hi,

I was looking through the ManualApprovalTransferManager code and was just wondering if

if ((manualApprovals[_from][_to].expiryTime >= now) && (manualApprovals[_from][_to].allowance >= _amount)) {
if (_isTransfer) {
manualApprovals[_from][_to].allowance = manualApprovals[_from][_to].allowance.sub(_amount);
}
return Result.VALID;
}

should return Result.ForceValid instead of Result.Valid.

/** @notice Used to verify the transfer transaction and allow a manually approved transqaction to bypass other restrictions

The above implies that MATM should bypass other restrictions, and this applies for the approval case as well.

At the current state, since in

return unarchived ? (isForceValid ? true : (isInvalid ? false : isValid)) : true;

If another module returns Result.INVALID, then isInvalid will be true, causing verifyTransfer to return false and hence cause the transaction to fail.

This defeats the purpose of MATM which suppose to bypass all other restrictions and transfer modules for both the block and approvals of transactions.

Thanks!

Activity

  1. ghost changed the title [-]ManualApprovalTransferManager[/-] [+]Potential Bug in ManualApprovalTransferManager [/+] on Dec 6, 2018
  2. adamdossa commented on Dec 18, 2018

    @adamdossa
    Contributor

    Hey @xAffinity - thanks for looking at this.

    This is by design - the MATM is allowed to override TransferManagers that return NA (e.g. the GeneralTransferManager if addresses are not on it's list), but not override a TM that returns INVALID (e.g. if an address has traded over its volume restriction in the VolumeRestrictionTM).

    For transfers that really need to be forced through, regardless of any restrictions, the issuer can use the forceTransfer method directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions