# IGToken

*Interface for GToken contract*

## GnsPriceProvider

```solidity
struct GnsPriceProvider {
  address addr;
  bytes signature;
}
```

## LockedDeposit

```solidity
struct LockedDeposit {
  address owner;
  uint256 shares;
  uint256 assetsDeposited;
  uint256 assetsDiscount;
  uint256 atTimestamp;
  uint256 lockDuration;
}
```

## ContractAddresses

```solidity
struct ContractAddresses {
  address asset;
  address owner;
  address manager;
  address admin;
  address gnsToken;
  address lockedDepositNft;
  address pnlHandler;
  address openTradesPnlFeed;
  struct IGToken.GnsPriceProvider gnsPriceProvider;
}
```

## Meta

```solidity
struct Meta {
  string name;
  string symbol;
}
```

## manager

```solidity
function manager() external view returns (address)
```

## admin

```solidity
function admin() external view returns (address)
```

## currentEpoch

```solidity
function currentEpoch() external view returns (uint256)
```

## currentEpochStart

```solidity
function currentEpochStart() external view returns (uint256)
```

## currentEpochPositiveOpenPnl

```solidity
function currentEpochPositiveOpenPnl() external view returns (uint256)
```

## updateAccPnlPerTokenUsed

```solidity
function updateAccPnlPerTokenUsed(uint256 prevPositiveOpenPnl, uint256 newPositiveOpenPnl) external returns (uint256)
```

## getLockedDeposit

```solidity
function getLockedDeposit(uint256 depositId) external view returns (struct IGToken.LockedDeposit)
```

## sendAssets

```solidity
function sendAssets(uint256 assets, address receiver) external
```

## receiveAssets

```solidity
function receiveAssets(uint256 assets, address user) external
```

## distributeReward

```solidity
function distributeReward(uint256 assets) external
```

## tvl

```solidity
function tvl() external view returns (uint256)
```

## marketCap

```solidity
function marketCap() external view returns (uint256)
```

## shareToAssetsPrice

```solidity
function shareToAssetsPrice() external view returns (uint256)
```

## collateralConfig

```solidity
function collateralConfig() external view returns (uint128, uint128)
```

## ManagerUpdated

```solidity
event ManagerUpdated(address newValue)
```

## AdminUpdated

```solidity
event AdminUpdated(address newValue)
```

## PnlHandlerUpdated

```solidity
event PnlHandlerUpdated(address newValue)
```

## OpenTradesPnlFeedUpdated

```solidity
event OpenTradesPnlFeedUpdated(address newValue)
```

## GnsPriceProviderUpdated

```solidity
event GnsPriceProviderUpdated(struct IGToken.GnsPriceProvider newValue)
```

## WithdrawLockThresholdsPUpdated

```solidity
event WithdrawLockThresholdsPUpdated(uint256[2] newValue)
```

## MaxAccOpenPnlDeltaUpdated

```solidity
event MaxAccOpenPnlDeltaUpdated(uint256 newValue)
```

## MaxDailyAccPnlDeltaUpdated

```solidity
event MaxDailyAccPnlDeltaUpdated(uint256 newValue)
```

## MaxSupplyIncreaseDailyPUpdated

```solidity
event MaxSupplyIncreaseDailyPUpdated(uint256 newValue)
```

## LossesBurnPUpdated

```solidity
event LossesBurnPUpdated(uint256 newValue)
```

## MaxGnsSupplyMintDailyPUpdated

```solidity
event MaxGnsSupplyMintDailyPUpdated(uint256 newValue)
```

## MaxDiscountPUpdated

```solidity
event MaxDiscountPUpdated(uint256 newValue)
```

## MaxDiscountThresholdPUpdated

```solidity
event MaxDiscountThresholdPUpdated(uint256 newValue)
```

## CurrentMaxSupplyUpdated

```solidity
event CurrentMaxSupplyUpdated(uint256 newValue)
```

## DailyAccPnlDeltaReset

```solidity
event DailyAccPnlDeltaReset()
```

## ShareToAssetsPriceUpdated

```solidity
event ShareToAssetsPriceUpdated(uint256 newValue)
```

## OpenTradesPnlFeedCallFailed

```solidity
event OpenTradesPnlFeedCallFailed()
```

## WithdrawRequested

```solidity
event WithdrawRequested(address sender, address owner, uint256 shares, uint256 currEpoch, uint256 unlockEpoch)
```

## WithdrawCanceled

```solidity
event WithdrawCanceled(address sender, address owner, uint256 shares, uint256 currEpoch, uint256 unlockEpoch)
```

## DepositLocked

```solidity
event DepositLocked(address sender, address owner, uint256 depositId, struct IGToken.LockedDeposit d)
```

## DepositUnlocked

```solidity
event DepositUnlocked(address sender, address receiver, address owner, uint256 depositId, struct IGToken.LockedDeposit d)
```

## RewardDistributed

```solidity
event RewardDistributed(address sender, uint256 assets)
```

## AssetsSent

```solidity
event AssetsSent(address sender, address receiver, uint256 assets)
```

## AssetsReceived

```solidity
event AssetsReceived(address sender, address user, uint256 assets, uint256 assetsLessDeplete)
```

## Depleted

```solidity
event Depleted(address sender, uint256 assets, uint256 amountGns)
```

## Refilled

```solidity
event Refilled(address sender, uint256 assets, uint256 amountGns)
```

## AccPnlPerTokenUsedUpdated

```solidity
event AccPnlPerTokenUsedUpdated(address sender, uint256 newEpoch, uint256 prevPositiveOpenPnl, uint256 newPositiveOpenPnl, uint256 newEpochPositiveOpenPnl, int256 newAccPnlPerTokenUsed)
```

## OnlyManager

```solidity
error OnlyManager()
```

## OnlyTradingPnlHandler

```solidity
error OnlyTradingPnlHandler()
```

## OnlyPnlFeed

```solidity
error OnlyPnlFeed()
```

## AddressZero

```solidity
error AddressZero()
```

## PriceZero

```solidity
error PriceZero()
```

## ValueZero

```solidity
error ValueZero()
```

## BytesZero

```solidity
error BytesZero()
```

## NoActiveDiscount

```solidity
error NoActiveDiscount()
```

## BelowMin

```solidity
error BelowMin()
```

## AboveMax

```solidity
error AboveMax()
```

## WrongValue

```solidity
error WrongValue()
```

## WrongValues

```solidity
error WrongValues()
```

## GnsPriceCallFailed

```solidity
error GnsPriceCallFailed()
```

## GnsTokenPriceZero

```solidity
error GnsTokenPriceZero()
```

## PendingWithdrawal

```solidity
error PendingWithdrawal()
```

## EndOfEpoch

```solidity
error EndOfEpoch()
```

## NotAllowed

```solidity
error NotAllowed()
```

## NoDiscount

```solidity
error NoDiscount()
```

## NotUnlocked

```solidity
error NotUnlocked()
```

## NotEnoughAssets

```solidity
error NotEnoughAssets()
```

## MaxDailyPnl

```solidity
error MaxDailyPnl()
```

## NotUnderCollateralized

```solidity
error NotUnderCollateralized()
```

## AboveInflationLimit

```solidity
error AboveInflationLimit()
```

## OwnableInvalidOwner

```solidity
error OwnableInvalidOwner(address owner)
```

## ERC4626ExceededMaxDeposit

```solidity
error ERC4626ExceededMaxDeposit()
```

## ERC4626ExceededMaxMint

```solidity
error ERC4626ExceededMaxMint()
```

## ERC4626ExceededMaxWithdraw

```solidity
error ERC4626ExceededMaxWithdraw()
```

## ERC4626ExceededMaxRedeem

```solidity
error ERC4626ExceededMaxRedeem()
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.gains.trade/developer/technical-reference/contracts/interfaces/igtoken.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
