LaunchpadConfiguration

Overview

The LaunchpadConfiguration contract is designed to manage the configuration settings for a launchpad. This contract allows the owner to set and update various parameters, such as stablecoin statuses, addresses of other related contracts, slippage rates, fees, and intervals. It ensures that the launchpad operates with the correct configurations and can be adjusted as needed.

Key Components

  1. Dependencies and Imports:

    • Initializable: A base contract to aid in writing upgradeable contracts.

    • OwnableUpgradeable: An upgradeable version of the Ownable contract, providing ownership management.

    • ILaunchpadConfiguration: The interface defining the configuration functionalities.

  2. Storage Variables:

    • mapping(address => bool) private isStableCoin: A mapping to store allowed stablecoin addresses.

    • Addresses for related contracts:

      • CROSS_CHAIN_SALE_MANAGER

      • EXCHANGE_CONTRACT

      • WHITELIST_CONTRACT

    • Fee and rate parameters:

      • MAX_SLIPPAGE_RATE

      • SETUP_FEE

      • COMPLETION_FEE

      • SLIPPAGE_RATE

      • KEEPER_INTERVAL

    • address public TREASURY_ADDRESS: The treasury address.

  3. Initialization:

    • initialize(address _owner, address _treasury): Initializes the contract with the owner and treasury addresses, and sets default values for fees, slippage rates, and keeper intervals.

  4. Configuration Management Functions:

    • setCrossChainSaleManager(address _CROSS_CHAIN_SALE_MANAGER): Sets the address for the cross-chain sale manager.

    • setExchangeAddress(address _EXCHANGE_CONTRACT): Sets the address for the exchange contract.

    • setWhitelistAddress(address _WHITELIST_CONTRACT): Sets the address for the whitelist contract.

    • setTreasuryAddress(address _TREASURY_ADDRESS): Sets the address for the treasury.

    • updateStableCoinStatus(address _stableCoin, bool _status): Updates the status of a stablecoin.

    • setSlippageRate(uint256 _SLIPPAGE_RATE): Sets the slippage rate.

    • setSetupFee(uint256 _SETUP_FEE): Sets the setup fee.

    • setCompletionFee(uint256 _COMPLETION_FEE): Sets the completion fee.

    • setKeeperInterval(uint256 _KEEPER_INTERVAL): Sets the keeper interval.

    • isStableCoinAllowed(address _STABLE_COIN): Checks if a stablecoin is allowed.

Detailed Functionality

  1. Initialization (initialize):

    • Transfers ownership to the specified owner address.

    • Sets the initial treasury address.

    • Initializes setup and completion fees.

    • Sets the initial slippage rate and maximum slippage rate.

    • Initializes the keeper interval.

  2. Configuration Management:

    • Cross-Chain Sale Manager (setCrossChainSaleManager):

      • Updates the address for the cross-chain sale manager and emits an event.

    • Exchange Contract (setExchangeAddress):

      • Updates the address for the exchange contract and emits an event.

    • Whitelist Contract (setWhitelistAddress):

      • Updates the address for the whitelist contract and emits an event.

    • Treasury Address (setTreasuryAddress):

      • Updates the treasury address and emits an event.

    • Stablecoin Status (updateStableCoinStatus):

      • Updates the status of a stablecoin in the isStableCoin mapping and emits an event.

    • Slippage Rate (setSlippageRate):

      • Updates the slippage rate, ensuring it does not exceed the maximum slippage rate, and emits an event.

    • Setup Fee (setSetupFee):

      • Updates the setup fee and emits an event.

    • Completion Fee (setCompletionFee):

      • Updates the completion fee and emits an event.

    • Keeper Interval (setKeeperInterval):

      • Updates the keeper interval and emits an event.

    • Stablecoin Check (isStableCoinAllowed):

      • Returns the status of a given stablecoin address.

Events

  • CrossChainSaleManagerUpdated: Emitted when the cross-chain sale manager address is updated.

  • ExchangeAddressUpdated: Emitted when the exchange contract address is updated.

  • WhitelistAddressUpdated: Emitted when the whitelist contract address is updated.

  • TreasuryAddressUpdated: Emitted when the treasury address is updated.

  • StableCoinStatusUpdated: Emitted when the status of a stablecoin is updated.

  • SlippageRateUpdated: Emitted when the slippage rate is updated.

  • SetupFeeUpdated: Emitted when the setup fee is updated.

  • CompletionFeeUpdated: Emitted when the completion fee is updated.

  • KeeperIntervalUpdated: Emitted when the keeper interval is updated.

Usage

The AstraDAO Launchpad can use this contract to manage and configure key parameters essential for its operations. The owner of the contract has the authority to make adjustments as needed to ensure the smooth running of the launchpad. The ability to update fees, addresses, slippage rates, and stablecoin statuses provides flexibility and control over the launchpad's settings.

Last updated