Inherits: IAbstractFeeModule
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 IFrictionlessTransferManager is responsible for the management of the various transfer methodologies, fees processing, and defined control paradigm for DvP for all tokens in the Frictionless protocol. The tokens and their lifecycles are defined in the public README for the Frictionless protocol at https://gitlab.com/dfyclabs/protocol/dfyclabs-tokens/-/blob/main/README.md?ref_type=heads#funds-flows
Set a minimum redemption amount, to ensure there is meaningful settlement amounts, generally this is used to ensure FIAT transfers are above a minimum banking threshold, such as 1 USD.
Parameters
Set the transfer fees for the exchange/settlement of a token pair. The fees can be any combination of zero (0%) or upto 10000 bps (100%) on any directional transfer. Fees can only be set by the Owner (PROTOCOL_ADMIN).
Parameters
Set the fee associated with the transfer of a Token and manages the mapping of the key to this set of Fees. Can only be set by the Owner (PROTOCOL_ADMIN).
Parameters
Executes a token pair exchange. This function can only be invoked by the PROTOCOL_TREASURY
Parameters
Initiates/Creates a transferOffer between a token pair exchange. Setting the transfer status to PENDING for state management of the overall transfer. This function generates a transferOfferId_ which is returned so invokers of the function can perform further functions such as confirmTransferOffer
or cancelOffer
.
Parameters
Returns
Redeem/Burn an amount for tokens for the specified tokenAddr_ and msg.sender
Parameters
Redeem/Burn an amount for tokens for the specified ERC20 tokenAddr_ and msg.sender, this will convert the ERC20 token to a FrictionlessFundDepositToken first, then redeem See {IFrictionlessERC20ConverterManager-isTokenSupported} {IFrictionlessERC20ConverterManager-convertFromERC20}
Parameters
Redeem/Burn an amount for tokens for the specified tokenAddr_ and userAddr_. This function can only be invoked by the PROTOCOL_TREASURY
Parameters
Redeem/Burn an amount for tokens for the specified ERC20 tokenAddr_ and userAddr_. This will convert the ERC20 token to a FrictionlessFundDepositToken first, then reedem. This function can only be invoked by the PROTOCOL_TREASURY See {IFrictionlessERC20ConverterManager-isTokenSupported} {IFrictionlessERC20ConverterManager-convertFromERC20}
Parameters
Confirms and processes the transfer for the respective transferOfferId_, which results int he compliant token transfers under ERC-3643 specification to occur.
Parameters
Cancels a transfer for the given transferOfferId_, which results in the transfer status being set to TransferStatuses.CANCELED
and the relevant FrictionlessTransferOfferCanceled
being emitted.
Parameters
Generates the next transferOfferId in the smart contract, used to store state of a transfer.
Returns
Get the minimum redemption amount configured
Returns
Returns the transfer data stored for the given transferOfferId_
Parameters
Returns
get the tokenFeeInfo set for the fees associated per token in an exchange.
Parameters
Returns
Generates keys based on the packed encoding of the addresses of sets of tokens using the keccak256 hashing function. Used to store tokenFees in mappings.
Parameters
Returns
Generates a key based on the packed encoding of the addresses of both tokens using the keccak256 hashing function. Used to store tokenFees in mappings.
Parameters
Returns
Event emitted during createTransferOffer
Event emitted during confirmTransferOffer
Event emitted during cancelOffer
Event emitted during exchangeTokens
Event emitted during redeemTokens
and redeemTokensFrom
error thrown during setTransferFees
, setTransferFees
, exchangeTokens
or createTransferOffer
if any of the token addresses are zero.
error thrown during exchangeTokens
or createTransferOffer
if any of the tokenSender address in an exchange is a zero address
error thrown during createTransferOffer
if the token transfer is prohibited under Compliance contract rules
error thrown during redeemTokens
or redeemTokensFrom
if the token address or the msg.sender is a zero address
error thrown during exchangeTokens
, createTransferOffer
, redeemTokens
or redeemTokensFrom
if any of the token amounts are zero
error thrown when the redemption amount is below the configured minimum, during redeemTokens
or redeemERC20Tokens
error thrown during exchangeTokens
, createTransferOffer
, redeemTokens
or redeemTokensFrom
if the balance of any of the tokens held by any users in the transfer is below the transfer amount
error thrown during confirmTransferOffer
or cancelOffer
if the transfer status expectedStatus does not match the actualStatus
error thrown during createTransferOffer
or confirmTransferOffer
if any of the msg.sender is not an Agent of the tokens in the transfer.
TokenFeeInfo represents the fee (zero or otherwise) that is associated with the transfer of a token in the Transfer Manager exchange.
TokenTransferData represents the data set in a transfer of a token
TransferData represents a maker/taker model of transfer, where 1 token is exchanged for another
Enumeration to track transfer statuses
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
newMinRedeemAmount_
uint256
the minimum redemption amount, if not reached , typically throws FrictionlessTransferManagerRedeemAmountIsLessThanMinimum
token0FeeInfo_
TokenFeeInfo
The fees associated with the transfer of token0 (first token) in the exchange/settlement of the token pair.
token1FeeInfo_
TokenFeeInfo
The fees associated with the transfer of token1 (second token) in the exchange/settlement of the token pair. throws FrictionlessTransferManagerInvalidTokenAddresses
if the token addresses are invalid. throws AbstractFeeModuleInvalidFeeRecipient
if the feeRecipientAddr is a zero address throws AbstractFeeModuleInvalidFee
if the feeInBps is not in the valid range (ZERO_FEES_IN_BPS to MAX_FEES_IN_BPS) emits FrictionlessTokenFeeSet
upon completion of the setting of the fee info for the token in either set of fees
tokenFeeKey_
bytes32
the key, generated by the function getTokenFeeKey
, which is used to map a specific transfer polarity for tokens.
tokenFeeInfo_
TokenFeeInfo
The fees associated with the transfer of token, used in the calculation and disbursement of fees during exchange/settlement of a token pair. throws FrictionlessTransferManagerInvalidTokenAddresses
if the token addresses are invalid. throws AbstractFeeModuleInvalidFeeRecipient
if the feeRecipientAddr is a zero address throws AbstractFeeModuleInvalidFee
if the feeInBps is not in the valid range (ZERO_FEES_IN_BPS to MAX_FEES_IN_BPS) emits FrictionlessTokenFeeSet
upon completion of the setting of the fee info for the token
token0TransferData_
TokenTransferData
the transfer data for the first token in the exchange
token1TransferData_
TokenTransferData
the transfer data for the second token in the exchange throws FrictionlessTransferManagerNotEnoughTokens
if the balance of any of the tokens held by any users in the transfer is below the transfer amount throws FrictionlessTransferManagerInvalidTokenAddresses
if any of the token addresses are zero. throws FrictionlessTransferManagerZeroAmount
if any of the token amounts are zero throws FrictionlessTransferManagerInvalidTokenSenderAddresses
if the expectedToken0Sender_ is not the same as the token0TransferData_.tokenSender throws FrictionlessTransferManagerInvalidTokenSenderAddresses
if the token1TransferData_.tokenSender is a zero address emits FrictionlessTokensExchanged
upon successful exchange.
token0TransferData_
TokenTransferData
the transfer data for the first token in the exchange
token1TransferData_
TokenTransferData
the transfer data for the second token in the exchange
<none>
uint256
transferOfferId_ representing the stored transfer in this contract for future operations such as confirmTransferOffer
or cancelOffer
. throws FrictionlessTransferManagerNotEnoughTokens
if the balance of any of the tokens held by any users in the transfer is below the transfer amount throws FrictionlessTransferManagerInvalidTokenAddresses
if any of the token addresses are zero. throws FrictionlessTransferManagerZeroAmount
if any of the token amounts are zero throws FrictionlessTransferManagerInvalidTokenSenderAddresses
if the expectedToken0Sender_ is not the same as the token0TransferData_.tokenSender throws FrictionlessTransferManagerInvalidTokenSenderAddresses
if the token1TransferData_.tokenSender is a zero address emits FrictionlessTransferOfferCreated
upon successful offer created.
tokenAddr_
address
the address of the token
redeemAmount_
uint256
the amount of the token to burn (redeem) throws FrictionlessTransferManagerZeroAddress
if the token address or the msg.sender is a zero address throws FrictionlessTransferManagerZeroAmount
if the redeemAmount_ is zero throws FrictionlessTransferManagerNotEnoughTokens
if the balance of a user for a given token is below the redeemAmount_ emits FrictionlessTokensRedeemed
when the burn has occurred
erc20Token_
address
the address of the ERC20 token
fundDepositToken_
address
the address of the FundDeposit token
tokenRedeemAmount_
uint256
the amount of the token to convert & burn (redeem) throws FrictionlessTransferManagerZeroAddress if the token address or the msg.sender is a zero address throws FrictionlessTransferManagerZeroAmount if the tokenRedeemAmount_ is zero throws FrictionlessTransferManagerNotEnoughTokens
if the balance of a user for a given token is below the tokenRedeemAmount_ throws FrictionlessTransferManagerInvalidERC20TokenForRedeem
if the tokenAddr_ is noy a valid convertible ERC20 token emits FrictionlessTokensRedeemed when the burn has occurred
tokenAddr_
address
the address of the token
userAddr_
address
the address of the holder of the token
redeemAmount_
uint256
the amount of the token to burn (redeem) throws FrictionlessTransferManagerZeroAddress if the token address or the userAddr_ is a zero address throws FrictionlessTransferManagerZeroAmount if the redeemAmount_ is zero throws FrictionlessTransferManagerNotEnoughTokens
if the balance of a user for a given token is below the redeemAmount_ emits FrictionlessTokensRedeemed when the burn has occurred
erc20Token_
address
the address of the ERC20 token
fundDepositToken_
address
the address of the FundDeposit token
userAddr_
address
the address of the holder of the token
tokenRedeemAmount_
uint256
the amount of the token to convert and burn (redeem) throws FrictionlessTransferManagerZeroAddress if the token address or the userAddr_ is a zero address throws FrictionlessTransferManagerZeroAmount if the tokenRedeemAmount_ is zero throws FrictionlessTransferManagerNotEnoughTokens
if the balance of a user for a given token is below the tokenRedeemAmount_ throws FrictionlessTransferManagerInvalidERC20TokenForRedeem
if the tokenAddr_ is noy a valid convertible ERC20 token emits FrictionlessTokensRedeemed when the burn has occurred
transferOfferId_
uint256
the id of the transfer returned/emitted in the function createTransferOffer
Requires the transfer status is TransferStatuses.PENDING
throws FrictionlessTransferManagerInvalidTransferStatus
if the transfer status is NOT TransferStatuses.PENDING
throws FrictionlessTransferManagerNotEnoughPermissions
If the msg.sender is not the tokenSender of the second token in the exchange or if the msg.sender is not a valid TREX Agent of either toekns in the exchange. emits FrictionlessTransferOfferConfirmed
upon successful completion of the transfers.
transferOfferId_
uint256
the generated transferOfferId_ used to store the state of transfers in the contract. requires the Transfer to be in a PENDING state. throws FrictionlessTransferManagerInvalidTransferStatus
if the transfer status is NOT TransferStatuses.PENDING
throws FrictionlessTransferManagerNotEnoughPermissions
If the msg.sender is not the tokenSender of the second token in the exchange or if the msg.sender is not a valid TREX Agent of either tokens in the exchange.
<none>
uint256
the next transferOfferId in the smart contract, used to store state of a transfer.
<none>
uint256
minimum redemption amount, to ensure there is meaningful settlement amounts, generally this is used to ensure FIAT transfers are above a minimum banking threshold, such as 1 USD.
transferOfferId_
uint256
the generated transferOfferId_ used to store the state of transfers in the contract
<none>
TransferData
TransferData, the transfer data for the given transferOfferId_
token0_
address
the address of the first token in an exchange
token1_
address
the address of the second token in an exchange
<none>
FeeInfo
FeeInfo set for the fees associated per token in an exchange.
<none>
FeeInfo
token0_
address
the address of the token 0 in a transfer fee calculation
token1_
address
the address of the token 1 in a transfer fee calculation
<none>
bytes32
keys based on the packed encoding of the addresses of sets of tokens using the keccak256 hashing function.
<none>
bytes32
token0_
address
the address of the token 0 in a transfer fee calculation
token1_
address
the address of the token 1 in a transfer fee calculation
<none>
bytes32
generates a key based on the packed encoding of the addresses of both tokens using the keccak256 hashing function.
The Manager Contracts are the main entry points to the Frictionless protocol, they perform market functions such as permission management, treasury operations, issuance, transfer and settlement of securities, and attestations of deposits (proof-of-reserve) for the underlying of FrictionlessFundDepositTokens.
There are four main manager contracts in the Frictionless protocol, as described below.
The FrictionlessPermissionsManager defines a set of functions and events related to managing participants' permissions in the Frictionless protocol.
The interface includes an enumeration FrictionlessPermissionedUser
that enumerates different participants in the Frictionless protocol, such as PROTOCOL_TREASURY, PERMISSIONED_CUSTODIAN, etc.
Only valid agents can register, add or remove users and their associated claims.
The FrictionlessTransferManager manages the transfer of tokens within the Frictionless protocol. It is also responsible for the collection of fees associated with the exchange of tokens. These fees are mapped to specific fee schedules set by managers on their respective issuances.
The FrictionlessTransferManager overview is provided in the source README.
The Frictionless protocol enables GPs and Managers to collect fees on the primary issuance and secondary trades of digital securities.
The Frictionless protocol enables Investors to bilaterally trade digital securities via the FrictionlessTransferManager smart contract whilst enabling Managers to optionally collect fees on the transaction.
SeeonlyCounterpart
mode
The Frictionless protocol enables Managers and GPs to control cash distributions, waterfalls, and capital calls without the direct action of Investors, enabling sophisticated automation via the Frictionless Markets APIs and Manager automation interface.
See onlyTreasury
mode
exchangeTokens
, this function will execute the exchange of tokens between two counterparties, but it is executed by the PROTOCOL_TREASURY as the transfer agent optionally collecting fees. For example, payment in FrictionlessFundDepositToken by an Investor for FricitonlessDigitalSecurityToken held by a custodian (Primary trade) or FricitonlessDigitalSecurityToken held by another Investor (secondary trade).
The exchange flow is as follows:
The PROTOCOL_ADMIN optionally sets the transfer fees for the token inbound and outbound.
The PROTOCOL_TREASURY invokes the exchangeTokens
function, indicating the polarity of the transaction, such as cash for cash, cash for security, security for cash, or security for security. There are many options, but they all result in the same outcome, the compliant transfer of a Frictionless token for another Frictionless token in a single atomic transaction on-chain.
The transfer is enacted using the ERC-3643-compliant token transfer IToken.forcedTransfer
.
More scenarios for DvP are described in the source README.
createTransferOffer confirmTransferOffer
, cancelTransferOffer
these functions will execute the exchange tokens in a bilateral P2P mode between two counterparties in a maker-taker mode. This mode also optionally enables the protocol to collect fees.
The exchange flow is as follows:
The PROTOCOL_ADMIN optionally sets the transfer fees for the token inbound and outbound.
Investor X invokes the createTransferOffer
function, indicating the offer, such as cash for cash, cash for security, security for cash, or security for security. There are many options, but they all result in the same outcome, the compliant transfer of a Frictionless token for another Frictionless token in a single atomic transaction on-chain.
Investor Y can accept the offer by invoking the confirmTransferOffer
function, ensuring the ERC-3643-compliant token transfer using IToken.transferFrom
.
The FrictionlessTreasuryManager manages the minting, transfer, and burning of various tokens within the Frictionless protocol
Token Minting and Management:
The contract provides functions to mint different types of tokens within the Frictionless protocol, including Fund Deposit Tokens (mintFundDepositForTreasury
), Digital Security Tokens (mintDigitalSecurity
), and On-Chain Asset Tokens (mintOnChainAsset
).
Tokens are associated with compliance contracts, and their minting is subject to specific conditions, roles, and permissions.
Token Transfer and Burning:
The contract allows for the transfer and burning of tokens through functions like transferToken
and burnToken
. These actions are performed by an agent with the necessary permissions.
Fund Deposit Token Management:
The contract keeps track of existing Fund Deposit Tokens using a mapping _existingFundDepositTokens
. It prevents the creation of duplicate Fund Deposit Tokens for the same currency and fund IBAN.
The PROTOCOL_ADMIN is the only role permissioned to initially mint any Frictionless tokens, thereafter valid agents such as the PROTOCOL_TREASURY are permitted to increase supply (mint to address), transfer and burn Frictionless tokens.
The FrictionlessAttestationManager responsible for providing attestations of the balances held in the underlying funding account for each FrictionlessFundDepositToken
. The attestation is provided and signed by an independent 3rd party, known as PERMISSIONED_FUND_ACCOUNTANT in the Frictionless protocol.
Attestations are proof of balances in each currency on a regular basis for example, daily or hourly, the attestation data is based on the following snapshot of the currency account underpinning the FrictionlessFundDepositToken.
The attestation workflows are described in the source README.
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 IFrictionlessAttestationManager See the flow and description of the attestation workflow in the diagram at https://gitlab.com/dfyclabs/protocol/dfyclabs-tokens/-/raw/main/docs/img/frictionless-fund-deposit-flow-attestation.png
Update the token address of the FrictionlessFundDepositToken
for the currency_
and iban_
pair.
Parameters
Confirm the attestation by signing the signature, this is the proof of the attestation by the PERMISSIONED_FUND_ACCOUNTANT
Parameters
Get the minimum balance amount configured, for which an attestation can be run. If the balance of the attestation is below the value configured, the error will be thrown. The minimum allowed is 10_000 or 0.01
Returns
Get minimum time (reportEnd - reportStart) in blocktime for which an attestation can be run. Typically this is 1 hour, and dependent on the availability of transaction data in the underlying fund account as specified by the IBAN. The minimum allowed is 300 seconds.
Returns
Get maximum time (reportEnd - reportStart) in blocktime for which an attestation can be run. Typically this is 30 days, aligned with the reporting as per regulation for the underlying fund and issuer of the deposit token. The maximum allowed is 365 days.
Returns
Retrieves the keys of attestation data associated with a specific account identified by IBAN and currency.
Parameters
Returns
Retrieves the last attestation data associated with a specific account identified by IBAN and currency.
Parameters
Returns
Retrieves the key of the last attestation data associated with a specific account identified by IBAN and currency.
Parameters
Returns
Retrieves attestation data by the attestation data key.
Parameters
Returns
Get the valid FrictionlessFundDepositToken
for the currency_
and iban_
pair.
Parameters
Returns
Mint a new attestation, it returns hash of attestation data to sign by the PERMISSIONED_FUND_ACCOUNTANT
Parameters
Returns
Retrieves the attestation data key associated with a specific account identified by currency and IBAN.
Parameters
Returns
Emitted when the FrictionlessFundDepositToken
is updated in the IFrictionlessAttestationManager
.
Event emitted upon the confirmation of a FrictionlessFundDepositToken
in the IFrictionlessAttestationManager
thrown if msg.sender address is not a PROTOCOL_TREASURY, during updateAttestationToken
thrown if tokenAddress_ address is a zero address, during updateAttestationToken
thrown if permissionManagerAddr_ address is a zero address, during init
thrown if the FrictionlessFundDepositToken
has not been registered for the IBAN, currency pair.
thrown if the passed AttestationData
report is invalid.
thrown if the attestation balance is too small, below the configurable amount.
thrown if the last transaction hash for the attestation has already been used, this avoids duplicate attestations.
thrown if the attestation cannot be confirmed, meaning the signed attestation cannot be verified.
struct to hold attestation data, which is designed to provide the most recent attestation of balance and verified last transaction in an attestation window.
struct to hold account attestation data
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 IFrictionlessPermissionsManager is responsible for the management of permission of the various participants in the Frictionless protocol. The roles and responsibilities are defined in the public README for the Frictionless protocol at https://gitlab.com/dfyclabs/protocol/dfyclabs-tokens/-/blob/main/README.md?ref_type=heads#roles-responsibilities
Validates if a wallet address is permissioned in the Frictionless protocol
Parameters
Returns
Registers a users wallet address as an OnChainId (Identity) to the Frictionless protocol. This Identity is used when permissioning a user to the protocol by invoking the addUser function later.
Parameters
Returns
Gets a users OnChainId (Identity) in the Frictionless protocol.
Parameters
Returns
Get the signed claimData message to be used in the addUser function. The message must be signed using the PK of the ClaimIssuer (PROTOCOL_ADMIN)
Parameters
Returns
verify if the userAddress is permissioned in the Frictionless protocol and has a valid claim
Parameters
Returns
Adds a user's OnChainId (Identity) to the Frictionless protocol along with its associated claim data. The Identity is created by invoking the registerIdentity function first.
Parameters
Returns
Removes a user from the Frictionless protocol along with its associated claim data.
Parameters
Returns
Emitted when a user is added to the Frictionless protocol. This event is emitted by the addUser
function.
Emitted when a user is registered in the Frictionless protocol. This event is emitted by the registerIdentity
function.
Emitted when a user is removed in the Frictionless protocol. This event is emitted by the removeUser
function.
throws if specific address is zero.
throws if treasury tries to add or remove treasury.
throws if user is not a permissioned investor
the internal struct defining a Claim for a PERMISSIONED_USER in the protocol. Used to submit claims for the OnChainId by the ClaimIssuer.
Enum of the Frictionless protocol participants.
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 IFrictionlessTreasuryManager is responsible for all token operations, minting, transferring and burning in the Frictionless protocol. The tokens and their lifecycles are defined in the public README for the Frictionless protocol at https://gitlab.com/dfyclabs/protocol/dfyclabs-tokens/-/tree/main?ref_type=heads#tokens-overview
Sets and associates the implementation authority with the associated token type
Parameters
Mints a Fund Deposit Token in the specified currency/IBAN pair. This function is invoked to create the genesis mint of the deposit token in the PROTOCOL_TREASURY.
Parameters
Returns
Mints a FrictionlessDigitalSecurityToken as the future dated cash distribution from the underlying FrictionlessOnChainAssetToken. This function is invoked to create the genesis mint of the deposit token in the PROTOCOL_TREASURY.
Parameters
Returns
Mints a FrictionlessOnChainAssetToken as the representation of the asset to be securitized, fractionalized & sold. This function is invoked to create the genesis mint of the deposit token to the PERMISSIONED_CUSTODIAN.
Parameters
Returns
Used to increase the mint of a Frictionless token which already exists.
Parameters
Used to increase the mint of a Frictionless token which already exists.
Parameters
Used to burn an amount of Frictionless token which already exists.
Parameters
returns the address of the fund deposit token by currency and fundIBAN
Parameters
Returns
returns fund deposit token key by currency and fundIBAN
Parameters
Returns
Event emitted when a FrictionlessFundDeposit
, FrictionlessDigitalSecurity
or FrictionlessOnChainAsset
is minted.
Event emitted when a FrictionlessFundDeposit
, FrictionlessDigitalSecurity
or FrictionlessOnChainAsset
is transferred.
Event emitted when a FrictionlessFundDeposit
, FrictionlessDigitalSecurity
or FrictionlessOnChainAsset
is burned.
throws if specific address is zero.
error throw if the function caller is not a PROTOCOL_TREASURY address. Thrown during the mintFundDepositForTreasury
error throw if the FundDepositToken for specified currency and fundIBAN already exists
error throw if the data for the token init data FrictionlessTokenInitData
is invalid. Thrown during the _setTokensInitData
error throw if the data for the token init data FrictionlessTokenInitData
is already set. Thrown during the _setTokensInitData
error throw if the data for the IFrictionlessFundDepositToken is invalid. Thrown during the mintFundDepositForTreasury
error throw if the data for the IFrictionlessDigitalSecurityToken is invalid. Thrown during the mintDigitalSecurity
error throw if the data for the IFrictionlessDigitalSecurityToken is invalid. Thrown during the mintOnChainAsset
error throw if the data for the IFrictionlessDigitalSecurityToken is invalid. Thrown during the mintOnChainAsset
Structure that encapsulates both the implAuthority and the compliance for the specific token.
ATTESTATION FIELD | ATTESTATION COMMENT |
---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
CASH_IBAN
The IBAN of the cash account
CURRENCY
The 3-letter currency code of the cash account
REPORT_START_DATE
The start of this report, for example, yesterday at 6AM
REPORT_END_DATE
The end of this report, for example, today at 6AM
CASH_BALANCE
The actual balance on the account as of REPORT_END_DATE
for example, today 6AM
LAST_TX_COUNTERPARTY_ID
The ID of the counterparty in the last transaction on the account
LAST_TX_TIMESTAMP
The timestamp (same format as REPORT_END_DATE) in the last transaction on the account
LAST_TX_AMOUNT
The amount of the the last transaction on the account, A credit transaction is positive and a debit transaction is negative
tokenAddress_
address
the address of deposit FrictionlessFundDepositToken
iban_
string
the IBAN associated with the FrictionlessFundDepositToken
currency_
string
the currency associated with the FrictionlessFundDepositToken
throws FrictionlessAttestationManagerTokenZeroAddress
if tokenAddress_ address is a zero address emits FrictionlessFundDepositAttestationTokenUpdated
upon successful updating
attestationData_
AttestationData
attestation data to sign
sig_
bytes
the signature to sign by the PERMISSIONED_FUND_ACCOUNTANT throws FrictionlessAttestationManagerNotEnoughPermissions
if the msg.sender does not have the role PERMISSIONED_FUND_ACCOUNTANT throws FrictionlessAttestationManagerInvalidAttestation
if the attestation cannot be confirmed, meaning the signed attestation cannot be verified. emits FrictionlessFundDepositAttestationConfirmed
upon successful signing
<none>
uint256
minimum attestation balance.
<none>
uint256
minimum attestation window.
<none>
uint256
maximum attestation window.
iban_
string
the IBAN associated with the FrictionlessFundDepositToken
currency_
string
the currency associated with the FrictionlessFundDepositToken
<none>
bytes32[]
the array of bytes32 attestation data keys associated with the account.
iban_
string
the IBAN associated with the FrictionlessFundDepositToken
currency_
string
the currency associated with the FrictionlessFundDepositToken
<none>
AttestationData
the AttestationData
struct representing the last attestation data associated with the account.
iban_
string
the IBAN associated with the FrictionlessFundDepositToken
currency_
string
the currency associated with the FrictionlessFundDepositToken
<none>
bytes32
the last attestation data key associated with the account.
attestationDataKey_
bytes32
the key identifying the attestation data
<none>
AttestationData
the AttestationData struct representing the attestation data associated with the given key.
iban_
string
the IBAN associated with the FrictionlessFundDepositToken
currency_
string
the currency associated with the FrictionlessFundDepositToken
<none>
address
the address of the valid FrictionlessFundDepositToken
for the currency_
and iban_
pair
attestationData_
AttestationData
the complete set of attestation data to for the PERMISSIONED_FUND_ACCOUNTANT to certify/sign.
<none>
bytes32
a hash of the attestationData which will be signed to confirm the attestation
currency_
string
the currency associated with the FrictionlessFundDepositToken
iban_
string
the IBAN associated with the FrictionlessFundDepositToken
<none>
bytes32
the accound attestation key.
userAddress
address
the wallet address to verify
<none>
bool
true if the address is permissioned in the Frictionless Protocol.
userAddress
address
the address of the user's wallet to register
userISOCountry
uint16
the ISO 3166-1 numeric code of the user, can be the place of residence or the location KYC/AML onboarding was undertaken. requires The msg.sender to have the TREX Agent permissions (PROTOCOL_TREASURY or PROTOCOL_ADMIN)
<none>
address
address the address of the user's OnChainId (Identity) with the associated claims.
userAddress
address
the address of the user's wallet to register requires The msg.sender to have the TREX Agent permissions (PROTOCOL_TREASURY or PROTOCOL_ADMIN)
<none>
address
address the address of the user's OnChainId (Identity) with the associated claims.
userIdentity
address
the address of the user's OnChainId (Identity)
userType
IFrictionlessPermissionsManager.FrictionlessPermissionedUser
the type of the user as per the enum
<none>
bytes32
signed claimData message to be used in the addUser unction once signed by the ClaimIssuer PK.
userAddress
address
the address of the user's wallet to verify
userType
FrictionlessPermissionedUser
the type of the user as per the enum
<none>
bool
true if a valid permissioned user and has a valid claim, otherwise false.
userIdentity
address
the address of the user's OnChainId (Identity)
userType
FrictionlessPermissionedUser
the type of the user as per the enum
claimSignature
bytes
the signed claimData by the ClaimIssuer
claimURI
string
the URI of the off-chain claim for the user. i.e. The Frictionless Markets graphQL endpoint requires The msg.sender to be the Owner if the userType is the PROTOCOL_TREASURY requires The msg.sender to have the TREX Agent permissions (PROTOCOL_TREASURY or PROTOCOL_ADMIN) to add any user
<none>
address
address the address of the user's OnChainId (Identity) with the associated claims.
userAddress
address
the address of the user's wallet requires The msg.sender to have the TREX Agent permissions (PROTOCOL_TREASURY or PROTOCOL_ADMIN) to remove any user
<none>
bool
true if the user is removed from the Frictionless protocol along with its associated claim data, otherwise false.
initDataArr_
FrictionlessTokenInitData[]
the FrictionlessTokenInitData
configuration associating the implementation authority with the associated token type.
depositData
IFrictionlessFundDepositToken.FFDImmutableData
the immutable deposit data for the token
treasuryAddress
address
the address of the treasury, which receives the deposit tokens
amount
uint256
the amount of tokens
<none>
address
address of the token minted emits FrictionlessTokenMinted
event throws error FrictionlessTreasuryManagerInvalidDepositData
if the deposit data is invalid. requires the depositData.currency to be a 3 letter currency code requires the depositData.description to be not empty requires the depositData.IBAN to be not empty
initData
IFrictionlessDigitalSecurityToken.FDSImmutableData
the immutable data for the token
updateData
IFrictionlessDigitalSecurityToken.FDSMutableData
the mutable data for the token
amount
uint256
the amount of tokens
userAddress
address
the address of the protocol user, which receives the digital security tokens
<none>
address
address of the token minted emits FrictionlessTokenMinted
event throws error FrictionlessTreasuryManagerInvalidFDSImmutableData
if the initData is invalid. requires the initData.currency to be a 3 letter currency code requires the initData.onChainAssetAddress to be non 0 address
specData
IFrictionlessOnChainAssetToken.FOCASpecData
the immutable data for the token
issuanceData
IFrictionlessOnChainAssetToken.FOCAIssuanceData
the issuance data for the token
updateData
IFrictionlessOnChainAssetToken.FOCAUpdateData
the update data for the token
custodianAddress
address
the address of the protocol custodian, which receives the FrictionlessOnChainAssetToken
<none>
address
address of the token minted emits FrictionlessTokenMinted
event throws error FrictionlessTreasuryManagerInvalidFOCASpecData
or FrictionlessTreasuryManagerInvalidFOCAIssuanceData
if the specData or issuanceData is invalid.
token
address
the address of the token
userAddress
address
the address to min the token to
amount
uint256
the amount of tokens to mint emits FrictionlessTokenMinted
event
token
address
the address of the token
userAddressFrom
address
the address to transfer the tokens from
userAddressTo
address
the address to transfer the tokens to
amount
uint256
the amount of tokens to mint emits FrictionlessTokenTransferred
event
token
address
the address of the token
userAddress
address
the address to burn the tokens from
amount
uint256
the amount of tokens to burn emits FrictionlessTokenBurned
event
currency_
string
the currency of the fund deposit token
fundIBAN_
string
the fundIBAN of the fund deposit token
<none>
address
the address of the fund deposit token for specified currency and fundIBAN
currency_
string
the currency of the fund deposit token you need
fundIBAN_
string
the fundIBAN of the fund deposit token you need
<none>
bytes32
the fund deposit token key