AlchemicTokenV2

This is the contract for version two alchemic tokens.

Functions

constructor

    function constructor() public;

setFlashFee

    function setFlashFee(uint256 newFee) external;

Sets the flash minting fee.

This function reverts if msg.sender is not an admin.

Parameters:

NameTypeDescription

newFee

uint256

The new flash mint fee.

mint

    function mint(
        address recipient,
        uint256 amount
    ) external;

Mints tokens to a recipient.

This function reverts if msg.sender is not whitelisted. This function reverts if msg.sender is paused.

Parameters:

NameTypeDescription

recipient

address

The address to mint the tokens to.

amount

uint256

The amount of tokens to mint.

setWhitelist

    function setWhitelist(
        address minter,
        bool state
    ) external;

Sets minter as whitelisted to mint.

This function reverts if msg.sender is not an admin.

Parameters:

NameTypeDescription

minter

address

The account to permit to mint.

state

bool

A flag indicating if the minter should be able to mint.

setSentinel

    function setSentinel(address sentinel) external;

Sets sentinel as a sentinel.

This function reverts if msg.sender is not an admin.

Parameters:

NameTypeDescription

sentinel

address

The address to set as a sentinel.

pauseMinter

    function pauseMinter(
        address minter,
        bool state
    ) external;

Pauses minter from minting tokens.

This function reverts if msg.sender is not a sentinel.

Parameters:

NameTypeDescription

minter

address

The address to set as paused or unpaused.

state

bool

A flag indicating if the minter should be paused or unpaused.

burn

    function burn(uint256 amount) external;

Burns amount tokens from msg.sender.

Parameters:

NameTypeDescription

amount

uint256

The amount of tokens to be burned.

burnFrom

    function burnFrom(
        address account,
        uint256 amount
    ) external;

Destroys amount tokens from account, deducting from the caller's allowance.

Parameters:

NameTypeDescription

account

address

The address the burn tokens from.

amount

uint256

The amount of tokens to burn.

setMaxFlashLoan

    function setMaxFlashLoan(uint256 _maxFlashLoanAmount) external;

Adjusts the maximum flashloan amount.

Parameters:

NameTypeDescription

_maxFlashLoanAmount

uint256

The maximum flashloan amount.

maxFlashLoan

    function maxFlashLoan(address token) public returns (uint256);

Gets the maximum amount to be flash loaned of a token.

Parameters:

NameTypeDescription

token

address

The address of the token.

Return Values:

NameTypeDescription

The

uint256

maximum amount of token that can be flashed loaned.

flashFee

    function flashFee(
        address token,
        uint256 amount
    ) public returns (uint256);

Gets the flash loan fee of amount of token.

Parameters:

NameTypeDescription

token

address

The address of the token.`

amount

uint256

The amount of token to flash mint.

Return Values:

NameTypeDescription

The

uint256

flash loan fee.

flashLoan

    function flashLoan(
        contract IERC3156FlashBorrower receiver,
        address token,
        uint256 amount,
        bytes data
    ) external returns (bool);

Performs a flash mint (called flash loan to confirm with ERC3156 standard).

Parameters:

NameTypeDescription

receiver

contract IERC3156FlashBorrower

The address which will receive the flash minted tokens.

token

address

The address of the token to flash mint.

amount

uint256

How much to flash mint.

data

bytes

ABI encoded data to pass to the receiver.

Return Values:

NameTypeDescription

If

bool

the flash loan was successful.

Events

Paused

event Paused(
    address minter,
    bool state
)

An event which is emitted when a minter is paused from minting.

Parameters:

NameTypeDescription

minter

address

The address of the minter which was paused.

## SetFlashMintFee

```solidity

event SetFlashMintFee(

uint256 fee

)

An event which is emitted when the flash mint fee is updated.



### Parameters:
| Name                           | Type          | Description                                    |
| :----------------------------- | :------------ | :--------------------------------------------- |
|`fee`| uint256 | The new flash mint fee. |
## SetMaxFlashLoan
```solidity
event SetMaxFlashLoan(
    uint256 maxFlashLoan
)

An event which is emitted when the max flash loan is updated.

Parameters:

NameTypeDescription

maxFlashLoan

uint256

The new max flash loan.

Last updated