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.
Interface defining the frictionless conversion and atomic swapping of ERC-20 tokens for FrictionlessFundDepositToken
on the Frictionless protocol. The conversion of tokens is considered frictionless as the protocol does not impose any fee structures on the conversion itself.
See {PausableUpgradeable-_pause}
See {PausableUpgradeable-_unpause}
Set the conversion fees for the 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 conversion fees for the token pair using the tokenFeeKey_. 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
Removes the conversion fees for the token pair using the tokenFeeKey_. Fees can only be set by the Owner (PROTOCOL_ADMIN).
Parameters
Sets the mapping for the convertible tokens in the contract, calling this will add a new conversion pair to the contract.
Parameters
Converts from an ERC20 token to a FrictionlessFundDepositToken
, using the safe precision conversion. The ERC20 token is transferred to configured treasuryAddress in the conversion and the minted FrictionlessFundDepositToken
is sent to the msg.sender
Parameters
Converts from an ERC20 token to a FrictionlessFundDepositToken
, using the safe precision conversion. The ERC20 token is transferred to configured treasuryAddress in the conversion and the minted FrictionlessFundDepositToken
is sent to the convertedTokensRecipient_
Parameters
Returns
Converts to an ERC20 token from a FrictionlessFundDepositToken, using the safe precision conversion. The FrictionlessFundDepositToken is burned in the conversion and the ERC20 is sent to the msg.sender
from the treasuryAddress.
Parameters
Returns
Converts to an ERC20 token from a FrictionlessFundDepositToken
, using the safe precision conversion. The FrictionlessFundDepositToken is burned in the conversion and the ERC20 is sent to the convertedTokensRecipient_ from the treasuryAddress.
Parameters
Returns
Returns the FrictionlessTokensConvertInfo
for the given conversion key
Parameters
Returns
Returns the conversion keys for the given tokenAddr_
Parameters
Returns
Returns the count of conversion keys for the given tokenAddr_
Parameters
Returns
Returns the FrictionlessTokensConvertInfo
for the given tokenAddr_
Parameters
Returns
Returns true if the token specified by the tokenAddr_
has been registered as a valid convertible pair.
Parameters
Returns
Returns true if the token pair specified have been registered as a valid convertible pair.
Parameters
Returns
Returns true if the conversion key is supported.
Parameters
Returns
Returns the conversion key for the given token pair.
Parameters
Returns
Event emitted when a successful conversion occurs between an ERC20 and a FrictionlessFuncDepositToken.
thrown during addFrictionlessTokensConvertInfo
if the tokensConvertInfoArr_ contains zero addresses
thrown during addFrictionlessTokensConvertInfo
if the tokensConvertInfoArr_ cannot be updated
thrown during a convert to/from an ERC20 if the conversion resolves to zero
thrown during a convert to/from an ERC20 if the conversion is attempted for the same token
thrown if the IFrictionlessERC20ConverterManager
is configured as a zero address
Struct to represent the conversion between an ERC20 token and a FrictionlessFundDepositToken
on the Frictionless protocol
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 |
---|---|---|
erc20Token_
address
the address of the ERC20 token.
fundDepositToken_
address
the address of the FundDeposit token.
feeInfo_
FeeInfo
The fees associated with the conversion of the token pair. throws FrictionlessERC20ConverterManagerUnsupportedPair
if the token pair is not valid 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 tokenFeeKey as determined getConvertTokensKey
feeInfo_
FeeInfo
The fees associated with the conversion of the token pair. throws FrictionlessERC20ConverterManagerUnsupportedPair
if the token pair is not valid 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
erc20Token_
address
the address of the ERC20 token.
fundDepositToken_
address
the address of the FundDeposit token.
tokensConvertInfoArr_
FrictionlessTokensConvertInfo[]
the array of token conversions to set. throws FrictionlessERC20ConverterManagerInvalidTokenConvertInfo
if the tokensConvertInfoArr_ contains zero addresses throws FrictionlessERC20ConverterManagerUnableToUpdateConvertInfo
if the tokensConvertInfoArr_ cannot be updated
erc20Token_
address
the address of the ERC20 token to convert from, which must exist in a FrictionlessTokensConvertInfo
in order to succeed.
fundDepositToken_
address
the address of the FundDeposit token to convert to, which must exist in a FrictionlessTokensConvertInfo
in order to succeed.
erc20TokensAmount_
uint256
the amount of tokens to convert throws FrictionlessERC20ConverterManagerInvalidTokenType
if the tokenAddr_ is not a configured convertible erc20Token throw FrictionlessERC20ConverterManagerInvalidTokensAmountAfterConversion
if the conversion resolves to zero Emits the event FrictionlessTokensConverted
detailing the full convertibility
erc20Token_
address
the address of the ERC20 token to convert from, which must exist in a FrictionlessTokensConvertInfo
in order to succeed.
fundDepositToken_
address
the address of the FundDeposit token to convert to, which must exist in a FrictionlessTokensConvertInfo
in order to succeed.
convertedTokensRecipient_
address
the destination of the converted FrictionlessFundDepositToken
erc20TokensAmount_
uint256
the amount of tokens to convert
<none>
uint256
the amount of FrictionlessFundDepositToken
converted throws FrictionlessERC20ConverterManagerInvalidTokenType
if the tokenAddr_ is not a configured convertible erc20Token throw FrictionlessERC20ConverterManagerInvalidTokensAmountAfterConversion
if the conversion resolves to zero Emits the event FrictionlessTokensConverted
detailing the full convertibility
erc20Token_
address
fundDepositToken_
address
the address of the FrictionlessFundDepositToken token to convert from, which must exist in a FrictionlessTokensConvertInfo
in order to succeed.
fundDepositTokensAmount_
uint256
the amount of tokens to convert
<none>
uint256
the amount of ERC20 converted throws FrictionlessERC20ConverterManagerInvalidTokenType
if the tokenAddr_ is not a configured convertible fundDepositToken throw FrictionlessERC20ConverterManagerInvalidTokensAmountAfterConversion
if the conversion resolves to zero Emits the event FrictionlessTokensConverted
detailing the full convertibility
erc20Token_
address
fundDepositToken_
address
the address of the FrictionlessFundDepositToken
token to convert from, which must exist in a FrictionlessTokensConvertInfo
in order to succeed.
convertedTokensRecipient_
address
the destination of the converted ERC20 token
fundDepositTokensAmount_
uint256
the amount of tokens to convert
<none>
uint256
the amount of ERC20 converted throws FrictionlessERC20ConverterManagerInvalidTokenType
if the tokenAddr_ is not a configured convertible fundDepositToken throw FrictionlessERC20ConverterManagerInvalidTokensAmountAfterConversion
if the conversion resolves to zero Emits the event FrictionlessTokensConverted
detailing the full convertibility
convertInfoKey_
bytes32
the address of the token to validate.
<none>
FrictionlessTokensConvertInfo
the FrictionlessTokensConvertInfo
for the given conversion key
tokenAddr_
address
the address of the token to validate.
<none>
bytes32[]
the conversion keys arr for the given tokenAddr_
tokenAddr_
address
the address of the token to validate.
<none>
uint256
the count of conversion keys arr for the given tokenAddr_
tokenAddr_
address
the address of the token to validate.
<none>
FrictionlessTokensConvertInfo[]
the FrictionlessTokensConvertInfo
for the given tokenAddr_
tokenAddr_
address
the address of the token to validate.
<none>
bool
true if the token specified by the tokenAddr_
has been registered as a valid convertible pair, otherwise false
erc20Token_
address
the address of the ERC20 token.
fundDepositToken_
address
the address of the FundDeposit token.
<none>
bool
true if the token pair specified have been registered as a valid convertible pair, otherwise false
convertTokenKey_
bytes32
the conversion key as defined by getConvertTokensKey
<none>
bool
true if Returns true if the conversion key is supported, otherwise false
token0_
address
the first token in the convertible pair
token1_
address
the second token in the convertible pair
<none>
bytes32
the conversion key for the given token pair throws FrictionlessERC20ConverterManagerIdenticalAddresses
if both tokens are identical throws FrictionlessERC20ConverterManagerZeroAddress
if the tokens are a zero address