AlchemicTokenV2
This is the contract for version two alchemic tokens.
Functions
constructor
setFlashFee
Sets the flash minting fee.
This function reverts if msg.sender
is not an admin.
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The new flash mint fee. |
mint
Mints tokens to a recipient.
This function reverts if msg.sender
is not whitelisted. This function reverts if msg.sender
is paused.
Parameters:
Name | Type | Description |
---|---|---|
| address | The address to mint the tokens to. |
| uint256 | The amount of tokens to mint. |
setWhitelist
Sets minter
as whitelisted to mint.
This function reverts if msg.sender
is not an admin.
Parameters:
Name | Type | Description |
---|---|---|
| address | The account to permit to mint. |
| bool | A flag indicating if the minter should be able to mint. |
setSentinel
Sets sentinel
as a sentinel.
This function reverts if msg.sender
is not an admin.
Parameters:
Name | Type | Description |
---|---|---|
| address | The address to set as a sentinel. |
pauseMinter
Pauses minter
from minting tokens.
This function reverts if msg.sender
is not a sentinel.
Parameters:
Name | Type | Description |
---|---|---|
| address | The address to set as paused or unpaused. |
| bool | A flag indicating if the minter should be paused or unpaused. |
burn
Burns amount
tokens from msg.sender
.
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The amount of tokens to be burned. |
burnFrom
Destroys amount
tokens from account
, deducting from the caller's allowance.
Parameters:
Name | Type | Description |
---|---|---|
| address | The address the burn tokens from. |
| uint256 | The amount of tokens to burn. |
setMaxFlashLoan
Adjusts the maximum flashloan amount.
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The maximum flashloan amount. |
maxFlashLoan
Gets the maximum amount to be flash loaned of a token.
Parameters:
Name | Type | Description |
---|---|---|
| address | The address of the token. |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | maximum amount of |
flashFee
Gets the flash loan fee of amount
of token
.
Parameters:
Name | Type | Description |
---|---|---|
| address | The address of the token.` |
| uint256 | The amount of |
Return Values:
Name | Type | Description |
---|---|---|
| uint256 | flash loan fee. |
flashLoan
Performs a flash mint (called flash loan to confirm with ERC3156 standard).
Parameters:
Name | Type | Description |
---|---|---|
| contract IERC3156FlashBorrower | The address which will receive the flash minted tokens. |
| address | The address of the token to flash mint. |
| uint256 | How much to flash mint. |
| bytes | ABI encoded data to pass to the receiver. |
Return Values:
Name | Type | Description |
---|---|---|
| bool | the flash loan was successful. |
Events
Paused
An event which is emitted when a minter is paused from minting.
Parameters:
Name | Type | Description |
---|---|---|
| address | The address of the minter which was paused. |
## SetFlashMintFee | ||
```solidity | ||
event SetFlashMintFee( |
)
An event which is emitted when the max flash loan is updated.
Parameters:
Name | Type | Description |
---|---|---|
| uint256 | The new max flash loan. |
Last updated