IFrictionlessAttestationManager
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
Functions
updateAttestationToken
Update the token address of the FrictionlessFundDepositToken
for the currency_
and iban_
pair.
Parameters
Name | Type | Description |
---|---|---|
|
| the address of deposit |
|
| the IBAN associated with the |
|
| the currency associated with the |
confirmAttestation
Confirm the attestation by signing the signature, this is the proof of the attestation by the PERMISSIONED_FUND_ACCOUNTANT
Parameters
Name | Type | Description |
---|---|---|
|
| attestation data to sign |
|
| the signature to sign by the PERMISSIONED_FUND_ACCOUNTANT throws |
minBalance
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
Name | Type | Description |
---|---|---|
|
| minimum attestation balance. |
minWindow
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
Name | Type | Description |
---|---|---|
|
| minimum attestation window. |
maxWindow
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
Name | Type | Description |
---|---|---|
|
| maximum attestation window. |
getAccountAttestationDataKeys
Retrieves the keys of attestation data associated with a specific account identified by IBAN and currency.
Parameters
Name | Type | Description |
---|---|---|
|
| the IBAN associated with the |
|
| the currency associated with the |
Returns
Name | Type | Description |
---|---|---|
|
| the array of bytes32 attestation data keys associated with the account. |
getAccountLastAttestationData
Retrieves the last attestation data associated with a specific account identified by IBAN and currency.
Parameters
Name | Type | Description |
---|---|---|
|
| the IBAN associated with the |
|
| the currency associated with the |
Returns
Name | Type | Description |
---|---|---|
|
| the |
getAccountLastAttestationDataKey
Retrieves the key of the last attestation data associated with a specific account identified by IBAN and currency.
Parameters
Name | Type | Description |
---|---|---|
|
| the IBAN associated with the |
|
| the currency associated with the |
Returns
Name | Type | Description |
---|---|---|
|
| the last attestation data key associated with the account. |
getAttestationData
Retrieves attestation data by the attestation data key.
Parameters
Name | Type | Description |
---|---|---|
|
| the key identifying the attestation data |
Returns
Name | Type | Description |
---|---|---|
|
| the AttestationData struct representing the attestation data associated with the given key. |
getTokenAddress
Get the valid FrictionlessFundDepositToken
for the currency_
and iban_
pair.
Parameters
Name | Type | Description |
---|---|---|
|
| the IBAN associated with the FrictionlessFundDepositToken |
|
| the currency associated with the FrictionlessFundDepositToken |
Returns
Name | Type | Description |
---|---|---|
|
| the address of the valid |
getAttestationDataHash
Mint a new attestation, it returns hash of attestation data to sign by the PERMISSIONED_FUND_ACCOUNTANT
Parameters
Name | Type | Description |
---|---|---|
|
| the complete set of attestation data to for the PERMISSIONED_FUND_ACCOUNTANT to certify/sign. |
Returns
Name | Type | Description |
---|---|---|
|
| a hash of the attestationData which will be signed to confirm the attestation |
getAccountAttestationKey
Retrieves the attestation data key associated with a specific account identified by currency and IBAN.
Parameters
Name | Type | Description |
---|---|---|
|
| the currency associated with the |
|
| the IBAN associated with the |
Returns
Name | Type | Description |
---|---|---|
|
| the accound attestation key. |
Events
FrictionlessFundDepositAttestationTokenUpdated
Emitted when the FrictionlessFundDepositToken
is updated in the IFrictionlessAttestationManager
.
FrictionlessFundDepositAttestationConfirmed
Event emitted upon the confirmation of a FrictionlessFundDepositToken
in the IFrictionlessAttestationManager
Errors
FrictionlessAttestationManagerCallerNotAProtocolTreasury
thrown if msg.sender address is not a PROTOCOL_TREASURY, during updateAttestationToken
FrictionlessAttestationManagerTokenZeroAddress
thrown if tokenAddress_ address is a zero address, during updateAttestationToken
FrictionlessAttestationManagerPermissionsZeroAddress
thrown if permissionManagerAddr_ address is a zero address, during init
FrictionlessAttestationManagerInvalidToken
thrown if the FrictionlessFundDepositToken
has not been registered for the IBAN, currency pair.
FrictionlessAttestationManagerInvalidReport
thrown if the passed AttestationData
report is invalid.
FrictionlessAttestationManagerBalanceTooLow
thrown if the attestation balance is too small, below the configurable amount.
FrictionlessAttestationManagerDuplicateLastTxHash
thrown if the last transaction hash for the attestation has already been used, this avoids duplicate attestations.
FrictionlessAttestationManagerInvalidAttestationSigner
thrown if the attestation cannot be confirmed, meaning the signed attestation cannot be verified.
Structs
AttestationData
struct to hold attestation data, which is designed to provide the most recent attestation of balance and verified last transaction in an attestation window.
AccountAttestationData
struct to hold account attestation data