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

Potential Bug in ManualApprovalTransferManager #456

Closed
xAffinity opened this issue Dec 6, 2018 · 1 comment
Closed

Potential Bug in ManualApprovalTransferManager #456

xAffinity opened this issue Dec 6, 2018 · 1 comment

Comments

@xAffinity
Copy link

xAffinity commented Dec 6, 2018

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!

@xAffinity xAffinity changed the title ManualApprovalTransferManager Potential Bug in ManualApprovalTransferManager Dec 6, 2018
@adamdossa
Copy link
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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants