arrow-left
All pages
gitbookPowered by GitBook
1 of 1

Loading...

IFrictionlessComplianceFactory

Git Sourcearrow-up-right

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.

Interface defining the upgradeable compliance factory for all tokens in the Frictionless protocol.

hashtag
Functions

hashtag
setTreasuryManager

Sets the Treasury Manager to be the specified address.

Parameters

Name
Type
Description

hashtag
updateModularComplianceImpl

Updates and upgrades the modular compliance implementation

Parameters

Name
Type
Description

hashtag
updateSupportedComplianceData

Updates the set of supported modular compliance modules.

Parameters

Name
Type
Description

hashtag
updateModularComplianceData

Updates the modular compliance data.

Parameters

Name
Type
Description

hashtag
deployCompliance

Deploys the compliance contract using the ProxyBeacon with the associated FrictionlessPermissionsManager contract

Parameters

Name
Type
Description

Returns

Name
Type
Description

hashtag
treasuryManager

returns the address of the treasuryManager

Returns

Name
Type
Description

hashtag
modularComplianceBeacon

returns the ProxyBeacon of the ModularCompliance

Returns

Name
Type
Description

hashtag
getModularComplianceImpl

returns the address of the ModularCompliance

Returns

Name
Type
Description

hashtag
getModularComplianceTokenType

returns the FrictionlessTokenTypes which is bound by the ModularCompliance

Parameters

Name
Type
Description

Returns

Name
Type
Description

hashtag
getSupportedComplianceModulesCount

returns the amount of supported compliances ModularCompliance for the specified tokenType_

Parameters

Name
Type
Description

Returns

Name
Type
Description

hashtag
getSupportedComplianceModules

returns the array of supported compliances ModularCompliance for the specified tokenType_

Parameters

Name
Type
Description

Returns

Name
Type
Description

hashtag
getSupportedComplianceInfo

hashtag
isSupportedComplianceModule

returns true if the compliance module supports the Frictionless token type, otherwise false

Parameters

Name
Type
Description

Returns

Name
Type
Description

hashtag
isModularCompliance

Returns true if the address provided is a ModularCompliance contract

Parameters

Name
Type
Description

Returns

Name
Type
Description

hashtag
Events

hashtag
FrictionlessComplianceDeployed

Event emitted upon successful deployment of a compliance contract.

hashtag
Errors

hashtag
FrictionlessComplianceFactoryZeroAddr

error thrown if the specified contract address is a zero address, during init, setTreasuryManager, and updateModularComplianceImpl

hashtag
FrictionlessComplianceFactoryNotATreasuryManager

error thrown if the msg.sender is not the treasury manager during the function deployCompliance

hashtag
FrictionlessComplianceFactoryNotAModularCompliance

error thrown if the modular compliance is invlaid for hte token type during the function updateModularCompliancesModules

hashtag
FrictionlessComplianceFactoryInvalidTokenType

error thrown if an invalid tokenType is specified during deployCompliance

hashtag
FrictionlessComplianceFactoryInvalidModularComplianceData

error thrown if an invalid module is specified during updateModularCompliancesModules

hashtag
Structs

hashtag
SupportedComplianceData

hashtag
ModularComplianceInfo

hashtag
UpdateModularComplianceData

Structure to represent the update of modular compliance data.

hashtag
UpdateSupportedComplianceData

Structure to represent the update of modular compliance data for a given token type

newTreasuryManager_

address

the address of the treasury manager to set throws FrictionlessComplianceFactoryZeroAddress if the newTreasuryManager_ is a zero address

newModularComplianceImpl_

address

the address of the modular compliance implementation

updateSupportedComplianceDataArr_

UpdateSupportedComplianceData[]

the set of supported modular compliance modules.

updateModularComplianceDataArr_

UpdateModularComplianceData[]

the modular compliance data.

tokenType_

IBasicFrictionlessToken.FrictionlessTokenTypes

The Frictionless token type as defined by IBasicFrictionlessToken.FrictionlessTokenTypes

<none>

address

the address of the deployed compliance contract for the specified Frictionless token type throws FrictionlessComplianceFactoryNotATreasuryManager if the msg.sender is not the treasury manager emits FrictionlessComplianceDeployed event upon successful deployment of the compliance contract.

<none>

address

the address of the treasuryManager

<none>

ProxyBeacon

the ProxyBeacon of the ModularCompliance

<none>

address

the address of the ModularCompliance

modularComplianceAddr_

address

the address of the ModularComplianceImpl

<none>

IBasicFrictionlessToken.FrictionlessTokenTypes

the address of the ModularCompliance

tokenType_

IBasicFrictionlessToken.FrictionlessTokenTypes

the type of token as defined by the IBasicFrictionlessToken.FrictionlessTokenTypes enumerated type

<none>

uint256

the amount of supported compliances

tokenType_

IBasicFrictionlessToken.FrictionlessTokenTypes

the type of token as defined by the IBasicFrictionlessToken.FrictionlessTokenTypes enumerated type

<none>

address[]

the array of supported compliances

tokenType_

IBasicFrictionlessToken.FrictionlessTokenTypes

the type of token as defined by the IBasicFrictionlessToken.FrictionlessTokenTypes enumerated type

moduleToCheck_

address

the address of the modular compliance contract to verify

<none>

bool

true if the compliance module supports the Frictionless token type, otherwise false

modularComplianceAddr_

address

the address of the ModularCompliance contract

<none>

bool

true if the address provided is a ModularCompliance contract, otherwise false

function setTreasuryManager(address newTreasuryManager_) external;
function updateModularComplianceImpl(address newModularComplianceImpl_) external;
function updateSupportedComplianceData(UpdateSupportedComplianceData[] calldata updateSupportedComplianceDataArr_)
    external;
function updateModularComplianceData(UpdateModularComplianceData[] calldata updateModularComplianceDataArr_) external;
function deployCompliance(IBasicFrictionlessToken.FrictionlessTokenTypes tokenType_) external returns (address);
function treasuryManager() external view returns (address);
function modularComplianceBeacon() external view returns (ProxyBeacon);
function getModularComplianceImpl() external view returns (address);
function getModularComplianceTokenType(address modularComplianceAddr_)
    external
    view
    returns (IBasicFrictionlessToken.FrictionlessTokenTypes);
function getSupportedComplianceModulesCount(IBasicFrictionlessToken.FrictionlessTokenTypes tokenType_)
    external
    view
    returns (uint256);
function getSupportedComplianceModules(IBasicFrictionlessToken.FrictionlessTokenTypes tokenType_)
    external
    view
    returns (address[] memory);
function getSupportedComplianceInfo(IBasicFrictionlessToken.FrictionlessTokenTypes tokenType_)
    external
    view
    returns (ModularComplianceInfo memory);
function isSupportedComplianceModule(IBasicFrictionlessToken.FrictionlessTokenTypes tokenType_, address moduleToCheck_)
    external
    view
    returns (bool);
function isModularCompliance(address modularComplianceAddr_) external view returns (bool);
event FrictionlessComplianceDeployed(
    IBasicFrictionlessToken.FrictionlessTokenTypes indexed tokenType, address newComplianceContract
);
error FrictionlessComplianceFactoryZeroAddr(string);
error FrictionlessComplianceFactoryNotATreasuryManager(address);
error FrictionlessComplianceFactoryNotAModularCompliance(address);
error FrictionlessComplianceFactoryInvalidTokenType();
error FrictionlessComplianceFactoryInvalidModularComplianceData(UpdateModularComplianceData modularComplianceData);
struct SupportedComplianceData {
    uint256 maxModulesCount;
    EnumerableSet.AddressSet modules;
    bytes32[48] _gap;
}
struct ModularComplianceInfo {
    uint256 maxModulesCount;
    address[] modules;
}
struct UpdateModularComplianceData {
    address modularCompliance;
    ModularComplianceInfo complianceInfo;
    bool isAdding;
}
struct UpdateSupportedComplianceData {
    IBasicFrictionlessToken.FrictionlessTokenTypes tokenType;
    ModularComplianceInfo complianceInfo;
    bool isAdding;
}