Whitelist
Inherits: Ownable2Step
An external Whitelist module that Ion's system-wide contracts can use to verify that a user is permitted to borrow or lend. A merkle whitelist is used to allow for a large number of addresses to be whitelisted without consuming infordinate amounts of gas for the updates. There is also a protocol whitelist that can be used to allow for a protocol controlled address to bypass the merkle proof check. These protocol-controlled contract are expected to perform whitelist checks themsleves on their own entrypoints.
The full merkle tree is stored off-chain and only the root is stored on-chain.
State Variables
protocolWhitelist
borrowersRoot
lendersRoot
Functions
constructor
Creates a new Whitelist
instance.
Parameters
Name | Type | Description |
---|---|---|
|
| List borrower merkle roots for each ilk. |
|
| The lender merkle root. |
updateBorrowersRoot
Updates the borrower merkle root for a specific ilk.
Parameters
Name | Type | Description |
---|---|---|
|
| of the ilk. |
|
| The new borrower merkle root. |
updateLendersRoot
Updates the lender merkle root.
Parameters
Name | Type | Description |
---|---|---|
|
| The new lender merkle root. |
approveProtocolWhitelist
Approves a protocol controlled address to bypass the merkle proof check.
Parameters
Name | Type | Description |
---|---|---|
|
| The address to approve. |
revokeProtocolWhitelist
Revokes a protocol controlled address to bypass the merkle proof check.
Parameters
Name | Type | Description |
---|---|---|
|
| The address to revoke approval for. |
isWhitelistedBorrower
Called by external modifiers to prove inclusion as a borrower.
If the root is just zero, then the whitelist is effectively turned off as every address will be allowed.
Returns
Name | Type | Description |
---|---|---|
|
| True if the addr is part of the borrower whitelist or the protocol whitelist. False otherwise. |
isWhitelistedLender
Called by external modifiers to prove inclusion as a lender.
If the root is just zero, then the whitelist is effectively turned off as every address will be allowed.
Returns
Name | Type | Description |
---|---|---|
|
| True if the addr is part of the lender whitelist or the protocol whitelist. False otherwise. |