Core
Last updated
Last updated
The Core smart contract is the central component of a decentralized application (DApp) ecosystem that manages tariffs, partners, games, stakings, and betting activities. It provides functionalities for creating and managing tariffs, partners, games, and stakings, as well as facilitating betting and staking operations within the ecosystem.
The contract is deployed at:
The contract is structured into different sections corresponding to the management of tariffs, partners, games, stakings, and betting operations.
addTariff
: Allows the addition of new tariffs with specified pricing, profit, and stake profit parameters.
removeTariff
: Allows the removal of existing tariffs.
getTariffs
: Retrieves a list of all tariffs.
addPartner
Enables partners to register with the system by linking to existing tariffs and making payments.
getPartners
Retrieves a list of all registered partners.
addGame
: Permits the addition of new games with version validation.
getGames
: Retrieves a list of all registered games.
isGame
: Checks if a given address corresponds to a registered game.
removeGame
: Allows the removal of existing games.
addStaking
: Allows the addition of new stakings with address validation.
getStakings
: Retrieves a list of all registered stakings.
isStaking
: Checks if a given address corresponds to a registered staking.
removeStaking
: Allows the removal of existing stakings.
placeBet
: Enables partners to place bets on behalf of players, with fee calculations and bet creation.
stake
: Enables partners to stake tokens on behalf of players, with profit distribution.
The contract defines various error codes to indicate specific error conditions encountered during contract execution. These error codes are documented within the contract code and serve as a reference for developers integrating with the contract.
The contract utilizes AccessControl from OpenZeppelin for role-based access control. The roles defined include PARTNER
and TIMELOCK
. These roles control access to critical functions within the contract.