# SupplySchedule¶

## Description¶

Defines the Synthetix inflationary supply schedule, according to which the synthetix inflationary supply is released.

Minting is performed in increments of a week whenever recordMintEvent is called from Synthetix.mint. Minting can be called weekly after the time elapses for more than 7 days. These accrue so that no tokens are lost even if minting is not performed for several periods; the accrued total is minted at the next invocation. These computations are covered in more detail in the mintableSupply description.

The supply decay follows an exponential decay formula calculated for each week.

supplyForWeek = Initial Weekly Supply * (1 - rate of decay) ^ number of weeks

Source: contracts/SupplySchedule.sol

## Variables¶

### CONTRACT_NAME¶

Source

Type: bytes32

### INFLATION_START_DATE¶

Source

The timestamp at which the inflationary SNX supply began to be minted.

Value: 1551830400 (2019-03-06T00:00:00+00:00)

Type: uint256

### MAX_MINTER_REWARD¶

Source

Type: uint256

### MINT_BUFFER¶

Source

A buffer added to the lastMintEvent to ensure that synthetix rewards are issued after a feePeriod closes.

Value: 1 days

Type: uint256

### MINT_PERIOD_DURATION¶

Source

The duration of each minting period. This is constant at one week.

Value: 1 weeks

Type: uint256

### inflationAmount¶

Source

Type: uint256

### lastMintEvent¶

Source

The timestamp when new supply was last minted - Is set to the number of weeks since inflation start date plus a minting buffer to allow feePeriod to close first.

Type: uint256

### maxInflationAmount¶

Source

Type: uint256

### minterReward¶

Source

Used as the quantity of SNX to reward the caller of Synthetix.mint, which incentivises users to continue minting the inflationary supply over time. Initialised to 200 SNX.

Type: uint256

### synthetixProxy¶

Source

The address of the main SynthetixProxy contract.

Type: address payable

### weekCounter¶

Source

Counter to record the number of weeks inflation has been issued and calculate the applicable supply to add based on the current weekCounter.

Type: uint256

## Constructor¶

### constructor¶

Source

Sets up the minting schedule and the inherited Owned instance.

Details

Signature

constructor(address _owner, uint256 _lastMintEvent, uint256 _currentWeek)

Visibility

public

State Mutability



## Views¶

### isMintable¶

Source

Returns true if minting from the inflationary supply is permitted at the present time.

This means that tokens are only mintable once a week.

Details

Signature

isMintable() view returns (bool)

Visibility

public

State Mutability

view

### mintableSupply¶

Source

Returns the number of tokens currently mintable from the inflationary supply.

If isMintable returns false, this is $0$. Otherwise, it is the number of tokens accruing per week in the current year, multiplied by the number of whole weeks since the last mint event.

Details

Signature

mintableSupply() view returns (uint256)

Visibility

external

State Mutability

view

### weeksSinceLastIssuance¶

Source

This just returns its argument floor divided by MINT_PERIOD_DURATION. Since this is only used in mintableSupply() it seems as if a variable would have done better than a public function.

Details

Signature

weeksSinceLastIssuance() view returns (uint256)

Visibility

public

State Mutability

view

## Restricted Functions¶

### recordMintEvent¶

Source

This is called within Synthetix.mint to declare that the outstanding inflationary supply of tokens has been minted before they are actually distributed.

When called, this function adds a quantity of mintableSupply() tokens to the current schedule.totalSupplyMinted entry, and updates the lastMintEvent timestamp.

Although this function has no check that any tokens actually are mintable when it is called, the Synthetix contract requires it to be the case, so double calls should not occur. Similarly, the function does not itself enforce that the actual token supply has been increased by Synthetix in a manner consistent with the defined schedule and must simply trust that this compact is observed.

The function always returns true if the transaction was not reverted.

Details

Signature

recordMintEvent(uint256 supplyMinted) returns (uint256)

Visibility

external

State Mutability



Modifiers

Emits

### setInflationAmount¶

Source

Details

Signature

setInflationAmount(uint256 amount)

Visibility

external

State Mutability



Requires

Modifiers

Emits

### setMaxInflationAmount¶

Source

Details

Signature

setMaxInflationAmount(uint256 amount)

Visibility

external

State Mutability



Modifiers

Emits

### setMinterReward¶

Source

Allows the owner to set the current minter reward.

Details

Signature

setMinterReward(uint256 amount)

Visibility

external

State Mutability



Requires

Modifiers

Emits

### setSynthetixProxy¶

Source

Allows the owner to set the synthetix address.

Details

Signature

setSynthetixProxy(contract ISynthetix _synthetixProxy)

Visibility

external

State Mutability



Requires

Modifiers

Emits

## Modifiers¶

### onlySynthetix¶

Source

Reverts the transaction if msg.sender is not the synthetix address. Synthetix address is found by lookup to the proxy.target().

## Events¶

### InflationAmountUpdated¶

Source

Signature: InflationAmountUpdated(uint256 newInflationAmount)

### MaxInflationAmountUpdated¶

Source

Signature: MaxInflationAmountUpdated(uint256 newInflationAmount)

### MinterRewardUpdated¶

Source

Records that the minter reward was updated.

Signature: MinterRewardUpdated(uint256 newRewardAmount)

### SupplyMinted¶

Source

Records that a quantity of new tokens was minted.

Signature: SupplyMinted(uint256 supplyMinted, uint256 numberOfWeeksIssued, uint256 lastMintEvent, uint256 timestamp)

### SynthetixProxyUpdated¶

Source

Signature: SynthetixProxyUpdated(address newAddress)