MontRewardManager

MontRewardManager

Inherits: IMontRewardManager, Ownable

Manages the distribution of MONT rewards to players based on game outcomes

State Variables

mont

Address of the MONT token

IMONT public immutable mont;

usdc

Address of the USDC token

IERC20 public immutable usdc;

vault

Address of the Vault contract

address public immutable vault;

poolFee

Fee of the Uniswap V3 pool for MONT-USDC

uniswapPool

Address of the Uniswap V3 pool for MONT-USDC

gameFactory

Address of the GameFactory contract

twapInterval

TWAP interval in seconds for getting the price from Uniswap Oracle

balances

Claimable balances of players in MONT token

Functions

constructor

Constructor to initialize contract state variables

Parameters

Name
Type
Description

_vault

address

Address of the Vault contract

_mont

IMONT

Address of the MONT token contract

_usdc

IERC20

Address of the USDC token contract

_gameFactory

GameFactory

Address of the GameFactory contract

_uniswapFactory

address

Address of the UniswapV3Factory

_poolFee

uint24

Uniswap pool fee tier

_twapInterval

uint32

TWAP interval in seconds

setTwapInterval

Changes the TWAP interval in seconds

Emits TwapIntervalChanged event

Parameters

Name
Type
Description

_twapInterval

uint32

The new TWAP interval in seconds

claim

Claims MONT tokens of the caller (player)

Emits MontClaimed event

Returns

Name
Type
Description

amount

uint256

Amount of MONT tokens transferred to caller

transferPlayerRewards

Transfers MONT rewards to the player based on game outcome

Emits MontRewardAssigned event

Parameters

Name
Type
Description

_betAmount

uint256

Amount of the bet

_totalAmount

uint256

Total amount of the bet multiplied by the odds

_houseEdgeAmount

uint256

The house edge amount reducted from the total amount if the player wins

_player

address

Address of the player

_isPlayerWinner

bool

Flag indicating whether the player won the bet

Returns

Name
Type
Description

reward

uint256

Amount of MONT rewards transferred to the player

Last updated