Skip to content

INestorERC20ConverterManager

Git Source

Inherits: IAbstractFeeModule

Author: Originally developed by DEFYCA Labs S.a.r.l., maintained by Nestor Exchange OÜ

MIT Licence. Originally Copyright © 2023 DEFYCA Labs S.a.r.l.

Interface defining the conversion and atomic swapping of ERC-20 tokens for NestorFundDepositToken on the Nestor Protocol.

Functions

pause / unpause

function pause() external;
function unpause() external;

setConvertTokensFees

function setConvertTokensFees(address erc20Token_, address fundDepositToken_, FeeInfo calldata feeInfo_) external;

setConvertTokensFee

function setConvertTokensFee(bytes32 tokenFeeKey_, FeeInfo calldata feeInfo_) external;

removeNestorTokensConvertInfo

function removeNestorTokensConvertInfo(address erc20Token_, address fundDepositToken_) external;

addNestorTokensConvertInfo

function addNestorTokensConvertInfo(NestorTokensConvertInfo[] calldata tokensConvertInfoArr_) external;

convertFromERC20

Converts from an ERC20 token to a NestorFundDepositToken. The ERC20 token is transferred to the treasuryAddress and the minted NestorFundDepositToken is sent to the msg.sender.

function convertFromERC20(address erc20Token_, address fundDepositToken_, uint256 erc20TokensAmount_) external returns (uint256);

convertFromERC20 (explicit recipient)

function convertFromERC20(address erc20Token_, address fundDepositToken_, address convertedTokensRecipient_, uint256 erc20TokensAmount_) external returns (uint256);

convertToERC20

Converts to an ERC20 token from a NestorFundDepositToken. The NestorFundDepositToken is burned and the ERC20 is sent to the msg.sender.

function convertToERC20(address erc20Token_, address fundDepositToken_, uint256 fundDepositTokensAmount_) external returns (uint256);

convertToERC20 (explicit recipient)

function convertToERC20(address erc20Token_, address fundDepositToken_, address convertedTokensRecipient_, uint256 fundDepositTokensAmount_) external returns (uint256);

getConvertTokenInfo

function getConvertTokenInfo(bytes32 convertInfoKey_) external view returns (NestorTokensConvertInfo memory);

getConvertTokenKeysByToken

function getConvertTokenKeysByToken(address tokenAddr_) external view returns (bytes32[] memory);

getConvertTokenKeysCountByToken

function getConvertTokenKeysCountByToken(address tokenAddr_) external view returns (uint256);

getConvertTokenInfosByToken

function getConvertTokenInfosByToken(address tokenAddr_) external view returns (NestorTokensConvertInfo[] memory);

isTokenSupported

function isTokenSupported(address tokenAddr_) external view returns (bool);

isTokenPairSupported

function isTokenPairSupported(address erc20Token_, address fundDepositToken_) external view returns (bool);

isConvertTokenKeySupported

function isConvertTokenKeySupported(bytes32 convertTokenKey_) external view returns (bool);

getConvertTokensKey

function getConvertTokensKey(address token0_, address token1_) external pure returns (bytes32);

Events

NestorTokensConverted

event NestorTokensConverted(address fromToken, address toToken, address toTokensRecipient, uint256 fromAmount, uint256 toAmount);

Errors

NestorERC20ConverterManagerInvalidTokenConvertInfo

error NestorERC20ConverterManagerInvalidTokenConvertInfo(NestorTokensConvertInfo);

NestorERC20ConverterManagerUnableToUpdateConvertInfo

error NestorERC20ConverterManagerUnableToUpdateConvertInfo(NestorTokensConvertInfo);

NestorERC20ConverterManagerUnsupportedPair

error NestorERC20ConverterManagerUnsupportedPair(address, address);

NestorERC20ConverterManagerInvalidTokensAmountAfterConversion

error NestorERC20ConverterManagerInvalidTokensAmountAfterConversion();

NestorERC20ConverterManagerIdenticalAddresses

error NestorERC20ConverterManagerIdenticalAddresses();

NestorERC20ConverterManagerZeroAddress

error NestorERC20ConverterManagerZeroAddress();

Structs

NestorTokensConvertInfo

struct NestorTokensConvertInfo {
    address erc20Token;
    address fundDepositToken;
    address treasuryAddress;
}