CrossChainSaleManager
CrossChainSaleManager Documentation
Overview
The CrossChainSaleManager
contract is designed to manage cross-chain staking information and interactions between different chains using the Axelar Network. It ensures secure and seamless communication between multiple blockchain networks for staking and sale management purposes.
Table of Contents
Contract Inheritance
State Variables
Constructor
Modifiers
Functions
Public Functions
Internal Functions
View Functions
Contract Inheritance
The CrossChainSaleManager
contract inherits from the following contracts:
Ownable
: Provides basic authorization control functions.AxelarExecutable
: Allows the contract to be executed through the Axelar Network.ICrossChainSaleManager
: Interface for the cross-chain sale manager.
State Variables
IAxelarGasService public immutable AxelarGasService
: Axelar Gas Service contract.address public chef
: Address of the chef contract.string public chain
: The chain identifier.string[] public allChains
: List of all chains added to the contract.mapping(string => bool) private isChainAdded
: Mapping to check if a chain is added.mapping(string => address) private crossChainSaleManagers
: Mapping of chain identifiers to their respective cross-chain sale manager addresses.uint256 expirationTime
: Time duration after which the cross-chain staking info expires (default is 30 days).mapping(address => CrossChainStakingInfo) private crossChainStakingInfos
: Mapping of user addresses to their cross-chain staking information.
Constructor
The constructor initializes the contract with the following parameters:
address admin_
: Address of the contract admin.address gateway_
: Address of the Axelar gateway.address gasReceiver_
: Address of the Axelar gas receiver.string memory chain_
: Identifier of the chain.address chefAddress_
: Address of the chef contract.
Modifiers
verifyChainAndAddress
: Verifies if the chain and address are valid.validChain
: Ensures the chain is valid.
Functions
Public Functions
setExpirationTime Sets the expiration time for cross-chain staking info.
setCrossChainSaleManager Sets the address of the cross-chain sale manager for a specific chain.
removeCrossChainSaleManager Removes the cross-chain sale manager for a specific chain.
verifyMultiplierCrossChain Verifies the multiplier for cross-chain staking.
Internal Functions
_execute Internal function to execute the contract call from the Axelar Network.
setCrossChainStakingInfo Sets the cross-chain staking information.
View Functions
getCrossChainSaleManager Returns the address of the cross-chain sale manager for a specific chain.
getCrossChainStakingDetails Returns the cross-chain staking details for a user on a specific chain.
getNativeAmountAndMultiplier Returns the native staking amount and multiplier for a user.
getWeightedAverageMultiplier Returns the weighted average multiplier for a user across all chains.
Last updated