ess` | `address` | The address of the pool manager. |
| 1 | `maxCoverLiquidationPercent_` | `uint256` | `uint256` | The new value for the cover liquidation percent. |
### `MigrationAdminSet`
The migration admin has been set.
```solidity
event MigrationAdminSet(
address previousMigrationAdmin_,
address nextMigrationAdmin_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------------: | :-------: | :-----------: | ----------------------------- |
| 0 | `previousMigrationAdmin_` | `address` | `address` | The previous migration admin. |
| 1 | `nextMigrationAdmin_` | `address` | `address` | The new migration admin. |
### `MinCoverAmountSet`
The minimum cover amount for the given pool manager has been set.
```solidity
event MinCoverAmountSet(
address poolManager_,
uint256 minCoverAmount_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :-------: | :-----------: | ------------------------------------------- |
| 0 | `poolManager_` | `address` | `address` | The address of the pool manager. |
| 1 | `minCoverAmount_` | `uint256` | `uint256` | The new value for the minimum cover amount. |
### `OperationalAdminSet`
The operational admin was set.
```solidity
event OperationalAdminSet(
address previousOperationalAdmin_,
address currentOperationalAdmin_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------------------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `previousOperationalAdmin_` | `address` | `address` | The address of the previous operational admin. |
| 1 | `currentOperationalAdmin_` | `address` | `address` | The address of the new operational admin. |
### `PendingGovernorSet`
The pending governor has been set.
```solidity
event PendingGovernorSet(
address pendingGovernor_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ------------------------- |
| 0 | `pendingGovernor_` | `address` | `address` | The new pending governor. |
### `PlatformManagementFeeRateSet`
The platform management fee rate for the given pool manager has been set.
```solidity
event PlatformManagementFeeRateSet(
address poolManager_,
uint256 platformManagementFeeRate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------------------------: | :-------: | :-----------: | --------------------------------------------------- |
| 0 | `poolManager_` | `address` | `address` | The address of the pool manager. |
| 1 | `platformManagementFeeRate_` | `uint256` | `uint256` | The new value for the platform management fee rate. |
### `PlatformOriginationFeeRateSet`
The platform origination fee rate for the given pool manager has been set.
```solidity
event PlatformOriginationFeeRateSet(
address poolManager_,
uint256 platformOriginationFeeRate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------------------: | :-------: | :-----------: | ------------------------------------------- |
| 0 | `poolManager_` | `address` | `address` | The address of the pool manager. |
| 1 | `platformOriginationFeeRate_` | `uint256` | `uint256` | The new value for the origination fee rate. |
### `PlatformServiceFeeRateSet`
The platform service fee rate for the given pool manager has been set.
```solidity
event PlatformServiceFeeRateSet(
address poolManager_,
uint256 platformServiceFeeRate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------------: | :-------: | :-----------: | ------------------------------------------------ |
| 0 | `poolManager_` | `address` | `address` | The address of the pool manager. |
| 1 | `platformServiceFeeRate_` | `uint256` | `uint256` | The new value for the platform service fee rate. |
### `PoolManagerActivated`
The pool manager was activated.
```solidity
event PoolManagerActivated(
address poolManager_,
address poolDelegate_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------: | :-------: | :-----------: | --------------------------------- |
| 0 | `poolManager_` | `address` | `address` | The address of the pool manager. |
| 1 | `poolDelegate_` | `address` | `address` | The address of the pool delegate. |
### `PoolManagerOwnershipTransferred`
The ownership of the pool manager was transferred.
```solidity
event PoolManagerOwnershipTransferred(
address fromPoolDelegate_,
address toPoolDelegate_,
address poolManager_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-------: | :-----------: | ------------------------------------------ |
| 0 | `fromPoolDelegate_` | `address` | `address` | The address of the previous pool delegate. |
| 1 | `toPoolDelegate_` | `address` | `address` | The address of the new pool delegate. |
| 2 | `poolManager_` | `address` | `address` | The address of the pool manager. |
### `PriceOracleSet`
The oracle for an asset has been set.
```solidity
event PriceOracleSet(
address asset_,
address oracle_,
uint96 maxDelay_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------: | :-------: | :-----------: | -------------------------------- |
| 0 | `asset_` | `address` | `address` | The address of the asset. |
| 1 | `oracle_` | `address` | `address` | The address of the oracle. |
| 2 | `maxDelay_` | `uint96` | `uint96` | The maximum delay of the oracle. |
### `ProtocolPauseSet`
The protocol pause was set to a new state.
```solidity
event ProtocolPauseSet(
address caller_,
bool protocolPaused_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :-------: | :-----------: | ------------------------------------------------------------------------ |
| 0 | `caller_` | `address` | `address` | The address of the security admin or governor that performed the action. |
| 1 | `protocolPaused_` | `bool` | `bool` | The protocol paused state. |
### `SecurityAdminSet`
The security admin was set.
```solidity
event SecurityAdminSet(
address previousSecurityAdmin_,
address currentSecurityAdmin_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------------: | :-------: | :-----------: | ------------------------------------------- |
| 0 | `previousSecurityAdmin_` | `address` | `address` | The address of the previous security admin. |
| 1 | `currentSecurityAdmin_` | `address` | `address` | The address of the new security admin. |
### `TimelockWindowSet`
A new timelock window was set.
```solidity
event TimelockWindowSet(
address contract_,
bytes32 functionId_,
uint128 delay_,
uint128 duration_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------: | :-------: | :-----------: | ------------------------------------ |
| 0 | `contract_` | `address` | `address` | The contract to execute the call on. |
| 1 | `functionId_` | `bytes32` | `bytes32` | The id of the function to execute. |
| 2 | `delay_` | `uint128` | `uint128` | The delay of the timelock window. |
| 3 | `duration_` | `uint128` | `uint128` | The duration of the timelock window. |
### `ValidBorrowerSet`
A valid borrower was set.
```solidity
event ValidBorrowerSet(
address borrower_,
bool isValid_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------: | :-------: | :-----------: | ----------------------------- |
| 0 | `borrower_` | `address` | `address` | The address of the borrower. |
| 1 | `isValid_` | `bool` | `bool` | The validity of the borrower. |
### `ValidCollateralAssetSet`
A valid asset was set.
```solidity
event ValidCollateralAssetSet(
address collateralAsset_,
bool isValid_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------------: | :-------: | :-----------: | ------------------------------------- |
| 0 | `collateralAsset_` | `address` | `address` | The address of the collateral asset. |
| 1 | `isValid_` | `bool` | `bool` | The validity of the collateral asset. |
### `ValidInstanceSet`
A valid instance was set.
```solidity
event ValidInstanceSet(
bytes32 instanceKey_,
address instance_,
bool isValid_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ----------------------------- |
| 0 | `instanceKey_` | `bytes32` | `bytes32` | The key of the instance. |
| 1 | `instance_` | `address` | `address` | The address of the instance. |
| 2 | `isValid_` | `bool` | `bool` | The validity of the instance. |
### `ValidPoolAssetSet`
A valid asset was set.
```solidity
event ValidPoolAssetSet(
address poolAsset_,
bool isValid_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | -------------------------- |
| 0 | `poolAsset_` | `address` | `address` | The address of the asset. |
| 1 | `isValid_` | `bool` | `bool` | The validity of the asset. |
### `ValidPoolDelegateSet`
A valid pool delegate was set.
```solidity
event ValidPoolDelegateSet(
address account_,
bool isValid_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------: | :-------: | :-----------: | -------------------------- |
| 0 | `account_` | `address` | `address` | The address the account. |
| 1 | `isValid_` | `bool` | `bool` | The validity of the asset. |
### `ValidPoolDeployerSet`
A valid pool deployer was set.
```solidity
event ValidPoolDeployerSet(
address poolDeployer_,
bool isValid_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------: | :-------: | :-----------: | -------------------------- |
| 0 | `poolDeployer_` | `address` | `address` | The address the account. |
| 1 | `isValid_` | `bool` | `bool` | The validity of the asset. |
# Liquidator
## Functions
### `collateralAsset`
Returns the address of the collateral asset.
```solidity
function collateralAsset()
view
returns (
address
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `address` | `address` | |
### `collateralRemaining`
Returns the amount of collateral yet to be liquidated.
```solidity
function collateralRemaining()
view
returns (
uint256
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `uint256` | `uint256` | |
### `factory`
The address of the proxy factory.
```solidity
function factory()
view
returns (
address factory_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------: | :-------: | :-----------: | ----------- |
| 0 | `factory_` | `address` | `address` | |
### `fundsAsset`
Returns the address of the funding asset.
```solidity
function fundsAsset()
view
returns (
address
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `address` | `address` | |
### `getExpectedAmount`
Returns the expected amount to be returned from a flash loan given a certain amount of \`collateralAsset\`.
```solidity
function getExpectedAmount(
uint256 swapAmount_
)
view
returns (
uint256 expectedAmount_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------: | :-------: | :-----------: | --------------------------------------------------- |
| 0 | `swapAmount_` | `uint256` | `uint256` | Amount of \`collateralAsset\` to be flash-borrowed. |
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :-------: | :-----------: | ----------------------------------------------------------------------- |
| 0 | `expectedAmount_` | `uint256` | `uint256` | Amount of \`fundsAsset\` that must be returned in the same transaction. |
### `globals`
```solidity
function globals()
view
returns (
address globals_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--------: | :-------: | :-----------: | ----------- |
| 0 | `globals_` | `address` | `address` | |
### `governor`
```solidity
function governor()
view
returns (
address governor_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------: | :-------: | :-----------: | ----------- |
| 0 | `governor_` | `address` | `address` | |
### `implementation`
The address of the implementation contract being proxied.
```solidity
function implementation()
view
returns (
address implementation_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :-------: | :-----------: | ----------- |
| 0 | `implementation_` | `address` | `address` | |
### `liquidatePortion`
Flash loan function that: 1. Transfers a specified amount of \`collateralAsset\` to \`msg.sender\`. 2. Performs an arbitrary call to \`msg.sender\`, to trigger logic necessary to get \`fundsAsset\` (e.g., AMM swap). 3. Performs a \`transferFrom\`, taking the corresponding amount of \`fundsAsset\` from the user. If the required amount of \`fundsAsset\` is not returned in step 3, the entire transaction reverts.
```solidity
function liquidatePortion(
uint256 collateralAmount_,
uint256 maxReturnAmount_,
bytes data_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-------: | :-----------: | ----------------------------------------------------------------------------- |
| 0 | `collateralAmount_` | `uint256` | `uint256` | |
| 1 | `maxReturnAmount_` | `uint256` | `uint256` | Max amount of \`fundsAsset\` that can be returned to the liquidator contract. |
| 2 | `data_` | `bytes` | `bytes` | ABI-encoded arguments to be used in the low-level call to perform step 2. |
### `loanManager`
Returns the address of the loan manager contract.
```solidity
function loanManager()
view
returns (
address
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :--: | :-------: | :-----------: | ----------- |
| 0 | | `address` | `address` | |
### `migrate`
Modifies the proxy's storage by delegate-calling a migrator contract with some arguments. Access control logic critical since caller can force a selfdestruct via a malicious \`migrator\_\` which is delegatecalled.
```solidity
function migrate(
address migrator_,
bytes arguments_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ------------------------------------------------ |
| 0 | `migrator_` | `address` | `address` | The address of a migrator contract. |
| 1 | `arguments_` | `bytes` | `bytes` | Some encoded arguments to use for the migration. |
### `poolDelegate`
```solidity
function poolDelegate()
view
returns (
address poolDelegate_
);
```
#### Return Values:
| Index | Name | Type | Internal Type | Description |
| :---: | :-------------: | :-------: | :-----------: | ----------- |
| 0 | `poolDelegate_` | `address` | `address` | |
### `pullFunds`
Pulls a specified amount of ERC-20 tokens from the contract. Can only be called by \`owner\`.
```solidity
function pullFunds(
address token_,
address destination_,
uint256 amount_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ---------------------------------- |
| 0 | `token_` | `address` | `address` | The ERC-20 token contract address. |
| 1 | `destination_` | `address` | `address` | The destination of the transfer. |
| 2 | `amount_` | `uint256` | `uint256` | The amount to transfer. |
### `setCollateralRemaining`
Sets the initial amount of collateral to be liquidated.
```solidity
function setCollateralRemaining(
uint256 collateralAmount_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :-----------------: | :-------: | :-----------: | ------------------------------------------ |
| 0 | `collateralAmount_` | `uint256` | `uint256` | The amount of collateral to be liquidated. |
### `setImplementation`
Modifies the proxy's implementation address.
```solidity
function setImplementation(
address implementation_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :-------: | :-----------: | ----------- |
| 0 | `implementation_` | `address` | `address` | |
### `upgrade`
Upgrades a contract implementation to a specific version. Access control logic critical since caller can force a selfdestruct via a malicious \`migrator\_\` which is delegatecalled.
```solidity
function upgrade(
uint256 version_,
bytes arguments_
)
nonpayable;
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `version_` | `uint256` | `uint256` | |
| 1 | `arguments_` | `bytes` | `bytes` | Some encoded arguments to use for the upgrade. |
## Events
### `FundsPulled`
Funds were withdrawn from the liquidator.
```solidity
event FundsPulled(
address token_,
address destination_,
uint256 amount_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :------------: | :-------: | :-----------: | ---------------------------------------- |
| 0 | `token_` | `address` | `address` | Address of the token that was withdrawn. |
| 1 | `destination_` | `address` | `address` | Address of where tokens were sent. |
| 2 | `amount_` | `uint256` | `uint256` | Amount of tokens that were sent. |
### `PortionLiquidated`
Portion of collateral was liquidated.
```solidity
event PortionLiquidated(
uint256 swapAmount_,
uint256 returnedAmount_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :---------------: | :-------: | :-----------: | ---------------------------------------------- |
| 0 | `swapAmount_` | `uint256` | `uint256` | Amount of collateralAsset that was liquidated. |
| 1 | `returnedAmount_` | `uint256` | `uint256` | Amount of fundsAsset that was returned. |
### `Upgraded`
The instance was upgraded.
```solidity
event Upgraded(
uint256 toVersion_,
bytes arguments_
);
```
#### Parameters:
| Index | Name | Type | Internal Type | Description |
| :---: | :----------: | :-------: | :-----------: | ------------------------------ |
| 0 | `toVersion_` | `uint256` | `uint256` | The new version of the loan. |
| 1 | `arguments_` | `bytes` | `bytes` | The upgrade arguments, if any. |
# GovernorTimelock
On‑chain administrative gateway for governor‑privileged actions. Enforces time‑delayed execution via scheduled proposals and per‑function timelock parameters. Manages proposer/executor/canceller roles and supports role updates through the timelock itself.
## Functions
### `CANCELLER_ROLE`
Returns the bytes32 representation of the canceller role.
```solidity
function CANCELLER_ROLE()
view
returns (
bytes32 cancelerRole
);
```
### `EXECUTOR_ROLE`
Returns the bytes32 representation of the executor role.
```solidity
function EXECUTOR_ROLE()
view
returns (
bytes32 executorRole
);
```
### `PROPOSER_ROLE`
Returns the bytes32 representation of the proposer role.
```solidity
function PROPOSER_ROLE()
view
returns (
b프로젝트로 돌아가기