Skip to main content

MidnightAllowlistGate

Git Source - Generated with forge doc

Inherits: IEnterGate, ILiquidatorGate, Ownable2Step

Title: MidnightAllowlistGate

Allowlist-based gate for Midnight markets.

Set as the market's enterGate and/or liquidatorGate.

The owner can setAllowlist then renounceOwnership to make the stored allowlist immutable.

Allowlisting a public router or executor extends its permission to anyone able to call through it.

State Variables​

allowlist​

mapping(address => Role) public allowlist

Functions​

constructor​

constructor(address _owner) Ownable(_owner);

setAllowlist​

Sets the allowlist roles of one or more accounts.

function setAllowlist(Role[] calldata roles) external onlyOwner;

Parameters

NameTypeDescription
rolesRole[]The roles to set. Each role specifies a user and their gate permissions.

canIncreaseCredit​

function canIncreaseCredit(address account) external view override returns (bool);

canIncreaseDebt​

function canIncreaseDebt(address account) external view override returns (bool);

canLiquidate​

function canLiquidate(address account) external view override returns (bool);

Events​

MidnightAllowlistUpdated​

event MidnightAllowlistUpdated(
address indexed user, bool canIncreaseCredit, bool canIncreaseDebt, bool canLiquidate
);

Structs​

Role​

struct Role {
address user;
bool canIncreaseCredit;
bool canIncreaseDebt;
bool canLiquidate;
}