IFrictionlessComplianceModule

Git Source

Inherits: IModule

Author: DEFYCA Labs S.à.r.l

Copyright © 2023 DEFYCA Labs S.à.r.l Permission is hereby granted, free of charge, to any person obtaining a copy of the Frictionless protocol smart contracts (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL DEFYCA LABS S.à.r.l BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

The IFrictionlessCompliance is responsible for the compliant transfer of the various Tokens in the Frictionless protocol.

Functions

setPermissionsManager

Sets the instance of the IFrictionlessPermissionsManager to determine permissions for users.

function setPermissionsManager(address frictionlessPermissionsManager_) external;

Parameters

NameTypeDescription

frictionlessPermissionsManager_

address

the address of the IFrictionlessPermissionsManager contract

setComplianceFactory

Sets the instance of the IFrictionlessComplianceFactory to determine the compliance module for the protocol.

function setComplianceFactory(address newComplianceFactory_) external;

Parameters

NameTypeDescription

newComplianceFactory_

address

the address of the IFrictionlessComplianceFactory contract

permissionsManager

Gets the instance of the IFrictionlessPermissionsManager to determine permissions for users.

function permissionsManager() external view returns (IFrictionlessPermissionsManager);

Returns

NameTypeDescription

<none>

IFrictionlessPermissionsManager

the address of the IFrictionlessPermissionsManager contract

complianceFactory

Gets the instance of the IFrictionlessComplianceFactory to determine the compliance module for the protocol.

function complianceFactory() external view returns (IFrictionlessComplianceFactory);

Returns

NameTypeDescription

<none>

IFrictionlessComplianceFactory

the address of the IFrictionlessComplianceFactory contract

isTreasury

Verifies if the specified wallet address is a PROTOCOL_TREASURY user.

function isTreasury(address walletAddress_) external view returns (bool);

Parameters

NameTypeDescription

walletAddress_

address

the address of the users wallet.

Returns

NameTypeDescription

<none>

bool

true if the specified wallet address is a PROTOCOL_TREASURY user, otherwise false

isCustodian

Verifies if the specified wallet address is a PERMISSIONED_CUSTODIAN user.

function isCustodian(address walletAddress_) external view returns (bool);

Parameters

NameTypeDescription

walletAddress_

address

the address of the users wallet.

Returns

NameTypeDescription

<none>

bool

true if the specified wallet address is a PERMISSIONED_CUSTODIAN user, otherwise false

isInvestor

Verifies if the specified wallet address is a PERMISSIONED_INVESTOR user.

function isInvestor(address walletAddress_) external view returns (bool);

Parameters

NameTypeDescription

walletAddress_

address

the address of the users wallet.

Returns

NameTypeDescription

<none>

bool

true if the specified wallet address is a PERMISSIONED_INVESTOR user, otherwise false

isManager

Verifies if the specified wallet address is a PERMISSIONED_MANAGER user.

function isManager(address walletAddress_) external view returns (bool);

Parameters

NameTypeDescription

walletAddress_

address

the address of the users wallet.

Returns

NameTypeDescription

<none>

bool

true if the specified wallet address is a PERMISSIONED_MANAGER user, otherwise false

isCalculatingAgent

Verifies if the specified wallet address is a PERMISSIONED_CALCULATING_AGENT user.

function isCalculatingAgent(address walletAddress_) external view returns (bool);

Parameters

NameTypeDescription

walletAddress_

address

the address of the users wallet.

Returns

NameTypeDescription

<none>

bool

true if the specified wallet address is a PERMISSIONED_CALCULATING_AGENT user, otherwise false

isTransferAgent

Verifies if the specified wallet address is a PERMISSIONED_TRANSFER_AGENT user.

function isTransferAgent(address walletAddress_) external view returns (bool);

Parameters

NameTypeDescription

walletAddress_

address

the address of the users wallet.

Returns

NameTypeDescription

<none>

bool

true if the specified wallet address is a PERMISSIONED_TRANSFER_AGENT user, otherwise false

isFundAccountant

Verifies if the specified wallet address is a PERMISSIONED_FUND_ACCOUNTANT user.

function isFundAccountant(address walletAddress_) external view returns (bool);

Parameters

NameTypeDescription

walletAddress_

address

the address of the users wallet.

Returns

NameTypeDescription

<none>

bool

true if the specified wallet address is a PERMISSIONED_FUND_ACCOUNTANT user, otherwise false

isUser

Verifies if the specified wallet address is a permissioned user in the Frictionless protocol.

function isUser(address walletAddress_) external view returns (bool);

Parameters

NameTypeDescription

walletAddress_

address

the address of the users wallet.

Returns

NameTypeDescription

<none>

bool

true if the specified wallet address is a permissioned user in the Frictionless protocol, otherwise false

hasClaim

verify if the userAddress is permissioned in the Frictionless protocol and has a valid claim

function hasClaim(address userAddress_, IFrictionlessPermissionsManager.FrictionlessPermissionedUser userType_)
    external
    view
    returns (bool);

Parameters

NameTypeDescription

userAddress_

address

the address of the user's wallet to verify

userType_

IFrictionlessPermissionsManager.FrictionlessPermissionedUser

the type of the user as per the enum

Returns

NameTypeDescription

<none>

bool

true if a valid permissioned user and has a valid claim, otherwise false.

Events

FrictionlessTokenTransferred

Event emitted during compliance module transfers

event FrictionlessTokenTransferred(
    IBasicFrictionlessToken.FrictionlessTokenTypes tokenType,
    address tokenAddr,
    address from,
    address to,
    uint256 amount
);

Errors

FrictionlessIsZeroAddress

throws if specific address is zero.

error FrictionlessIsZeroAddress(string);

FrictionlessComplianceModuleInvalidCompliance

thrown if the compliance module address is invalid during bindCompliance and unBindCompliance

error FrictionlessComplianceModuleInvalidCompliance(address compliance);

FrictionlessComplianceModuleNotAnApprovedCompliance

thrown if the compliance module address is not approved during bindCompliance

error FrictionlessComplianceModuleNotAnApprovedCompliance(address compliance);

FrictionlessComplianceModuleComplianceIsAlreadyBound

thrown if the compliance module address is already bound, thrown by bindCompliance

error FrictionlessComplianceModuleComplianceIsAlreadyBound(address compliance);

FrictionlessComplianceModuleNotABoundCompliance

thrown if the compliance module address is not already bound during unBindCompliance

error FrictionlessComplianceModuleNotABoundCompliance(address compliance);
Logo

Copyright © 2024 Frictionless Markets S.à.r.l