This contract is used for depositing ASTRADAO tokens when creating a new index. The deposited amount will go directly to the treasury address.
This function is used to initialize the necessary things for the payment contract. At the time of setup, users need to send the Astra contract, configuration contract, swap contract, and treasury address.
- address _ASTRTokenAddress: Astra token address.
- address _poolConf: Configuration contract address.
- address _exchangeContract: Exchange contract address for token swapping.
- address _treasury: Treasury address.
Function to calculate the minimum return for implementing slippage.
- uint256 _amount: Input amount to calculate output amount after implementing slippage.
Internal function called by deposit function. Buy ASTRADAO and send it to the treasury address if the user deposits in any other supported coin.
- address _token: Token address to swap with ASTRADAO.
- uint256 _value: Amount of input token from swap.
Set the minimum number of Astra tokens required to deposit. Only the owner can call this function.
- uint256 _amount: Minimum ASTRADAO amount for the deposit.
Set the treasury address. The owner can only call this function.
- address _treasury: New treasury address.
Function users need to call to make a deposit. Here users need to send the deposit token’s address and amount. If the token is not supported, the transaction will be reverted; else, it will convert it to Astra and send it to the treasury. Users can use Astra directly.
- address _tokenAddress: Token address to make a deposit.
- uint256 _amount: Amount of token to deposit.