Maple Finance 백서

Maple Finance

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 63쪽

returns ( address poolDelegate_, address asset_, uint256 initialSupply_, string name_, string symbol_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------------: | :-----: | :-----------: | ----------- | | 0 | `encodedArguments_` | `bytes` | `bytes` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--------------: | :-------: | :-----------: | ----------- | | 0 | `poolDelegate_` | `address` | `address` | | | 1 | `asset_` | `address` | `address` | | | 2 | `initialSupply_` | `uint256` | `uint256` | | | 3 | `name_` | `string` | `string` | | | 4 | `symbol_` | `string` | `string` | | ### `delegateManagementFeeRate` Gets the delegate management fee rate. ```solidity function delegateManagementFeeRate() view returns ( uint256 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `uint256` | `uint256` | | ### `encodeArguments` ```solidity function encodeArguments( address poolDelegate_, address asset_, uint256 initialSupply_, string name_, string symbol_ ) pure returns ( bytes encodedArguments_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--------------: | :-------: | :-----------: | ----------- | | 0 | `poolDelegate_` | `address` | `address` | | | 1 | `asset_` | `address` | `address` | | | 2 | `initialSupply_` | `uint256` | `uint256` | | | 3 | `name_` | `string` | `string` | | | 4 | `symbol_` | `string` | `string` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :-----------------: | :-----: | :-----------: | ----------- | | 0 | `encodedArguments_` | `bytes` | `bytes` | | ### `liquidityCap` Gets the liquidity cap for the pool. ```solidity function liquidityCap() view returns ( uint256 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `uint256` | `uint256` | | ### `strategyList` Gets the address of the strategy in the list. ```solidity function strategyList( uint256 ) view returns ( address ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | \`\` | `uint256` | `uint256` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `pendingPoolDelegate` Gets the address of the pending pool delegate. ```solidity function pendingPoolDelegate() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `pool` Gets the address of the pool. ```solidity function pool() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `poolDelegate` Gets the address of the pool delegate. ```solidity function poolDelegate() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `poolDelegateCover` Gets the address of the pool delegate cover. ```solidity function poolDelegateCover() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `withdrawalManager` Gets the address of the withdrawal manager. ```solidity function withdrawalManager() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ## Events ### `Initialized` ```solidity event Initialized( address owner_, address asset_, address pool_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------: | :-------: | :-----------: | ----------- | | 0 | `owner_` | `address` | `address` | | | 1 | `asset_` | `address` | `address` | | | 2 | `pool_` | `address` | `address` | | # PoolPermissionManager ## Functions ### `admin` Returns the proxy's admin address. ```solidity function admin() view returns ( address admin_ ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :------: | :-------: | :-----------: | ------------------------- | | 0 | `admin_` | `address` | `address` | The address of the admin. | ### `configurePool` Configures the permissions of a pool. ```solidity function configurePool( address poolManager_, uint256 permissionLevel_, bytes32[] functionIds_, uint256[] poolBitmaps_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------------: | :---------: | :-----------: | ----------- | | 0 | `poolManager_` | `address` | `address` | | | 1 | `permissionLevel_` | `uint256` | `uint256` | | | 2 | `functionIds_` | `bytes32[]` | `bytes32[]` | | | 3 | `poolBitmaps_` | `uint256[]` | `uint256[]` | | ### `globals` Returns the address of the \`MapleGlobals\` contract. ```solidity function globals() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `hasPermission` Checks if the lender has permission to interact with a pool. The function identifier defines the function to check the permission for. ```solidity function hasPermission( address poolManager_, address[] lenders_, bytes32 functionId_ ) view returns ( bool hasPermission_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------: | :---------: | :-----------: | ----------- | | 0 | `poolManager_` | `address` | `address` | | | 1 | `lenders_` | `address[]` | `address[]` | | | 2 | `functionId_` | `bytes32` | `bytes32` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--------------: | :----: | :-----------: | ----------- | | 0 | `hasPermission_` | `bool` | `bool` | | ### `hasPermission` Checks if the lender has permission to interact with a pool. The function identifier defines the function to check the permission for. ```solidity function hasPermission( address poolManager_, address lender_, bytes32 functionId_ ) view returns ( bool hasPermission_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------: | :-------: | :-----------: | ----------- | | 0 | `poolManager_` | `address` | `address` | | | 1 | `lender_` | `address` | `address` | | | 2 | `functionId_` | `bytes32` | `bytes32` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--------------: | :----: | :-----------: | ----------- | | 0 | `hasPermission_` | `bool` | `bool` | | ### `implementation` Returns the proxy's implementation address. ```solidity function implementation() view returns ( address implementation_ ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :---------------: | :-------: | :-----------: | ---------------------------------- | | 0 | `implementation_` | `address` | `address` | The address of the implementation. | ### `lenderAllowlist` Checks if a pool has allowlisted a lender. ```solidity function lenderAllowlist( address, address ) view returns ( bool ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | \`\` | `address` | `address` | | | 1 | \`\` | `address` | `address` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :----: | :-----------: | ----------- | | 0 | | `bool` | `bool` | | ### `lenderBitmaps` Returns the permission bitmap of a lender. ```solidity function lenderBitmaps( address ) view returns ( uint256 ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | \`\` | `address` | `address` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `uint256` | `uint256` | | ### `permissionAdmins` Checks if the account is a permission admin. ```solidity function permissionAdmins( address ) view returns ( bool ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | \`\` | `address` | `address` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :----: | :-----------: | ----------- | | 0 | | `bool` | `bool` | | ### `permissionLevels` Returns the permission level of a pool. Permission levels: private (0), function-level (1), pool-level (2), public (3) ```solidity function permissionLevels( address ) view returns ( uint256 ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | \`\` | `address` | `address` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `uint256` | `uint256` | | ### `poolBitmaps` Returns a function-specific pool permission bitmap. Return the pool-level permission bitmap if the function identifier is zero. ```solidity function poolBitmaps( address, bytes32 ) view returns ( uint256 ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | \`\` | `address` | `address` | | | 1 | \`\` | `bytes32` | `bytes32` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `uint256` | `uint256` | | ### `setLenderAllowlist` Sets the allowlist status of one or more lenders. ```solidity function setLenderAllowlist( address poolManager_, address[] lenders_, bool[] booleans_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------: | :---------: | :-----------: | ----------- | | 0 | `poolManager_` | `address` | `address` | | | 1 | `lenders_` | `address[]` | `address[]` | | | 2 | `booleans_` | `bool[]` | `bool[]` | | ### `setLenderBitmaps` Sets the permission bitmaps of one or more lenders. ```solidity function setLenderBitmaps( address[] lenders_, uint256[] bitmaps_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--------: | :---------: | :-----------: | ----------- | | 0 | `lenders_` | `address[]` | `address[]` | | | 1 | `bitmaps_` | `uint256[]` | `uint256[]` | | ### `setPermissionAdmin` Sets the permission admin status of an account. ```solidity function setPermissionAdmin( address permissionAdmin_, bool isPermissionAdmin_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------------: | :-------: | :-----------: | ----------- | | 0 | `permissionAdmin_` | `address` | `address` | | | 1 | `isPermissionAdmin_` | `bool` | `bool` | | ### `setPoolBitmaps` Sets the permission bitmaps of a pool. ```solidity function setPoolBitmaps( address poolManager_, bytes32[] functionIds_, uint256[] bitmaps_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------: | :---------: | :-----------: | ----------- | | 0 | `poolManager_` | `address` | `address` | | | 1 | `functionIds_` | `bytes32[]` | `bytes32[]` | | | 2 | `bitmaps_` | `uint256[]` | `uint256[]` | | ### `setPoolPermissionLevel` Sets the permission level of a pool. Permission levels: private (0), function-level (1), pool-level (2), public (3) NOTE: Bitmaps must be set before setting the permission level to function-level (1) or pool-level (2). Otherwise, the pool will be permissionless by default to un-set lenders. ```solidity function setPoolPermissionLevel( address poolManager_, uint256 permissionLevel_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------------: | :-------: | :-----------: | ----------- | | 0 | `poolManager_` | `address` | `address` | | | 1 | `permissionLevel_` | `uint256` | `uint256` | | ## Events ### `LenderAllowlistSet` Emitted when the lender allowlist is updated. ```solidity event LenderAllowlistSet( address poolManager, address[] lenders, bool[] booleans ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :---------: | :-----------: | -------------------------------------------------- | | 0 | `poolManager` | `address` | `address` | Address of the pool manager. | | 1 | `lenders` | `address[]` | `address[]` | List of lender addresses to set the allowlist for. | | 2 | `booleans` | `bool[]` | `bool[]` | List of boolean values. | ### `LenderBitmapsSet` Emitted when lender bitmaps are updated. ```solidity event LenderBitmapsSet( address[] lenders, uint256[] bitmaps ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-------: | :---------: | :-----------: | ------------------------------------------------ | | 0 | `lenders` | `address[]` | `address[]` | List of lender addresses to set the bitmaps for. | | 1 | `bitmaps` | `uint256[]` | `uint256[]` | List of permission bitmaps. | ### `PermissionAdminSet` Emitted when a permission admin has been updated. ```solidity event PermissionAdminSet( address account, bool isAdmin ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-------: | :-------: | :-----------: | ---------------------------------------------------------------- | | 0 | `account` | `address` | `address` | Address of the updated account. | | 1 | `isAdmin` | `bool` | `bool` | \`true\` if the account is a permission admin, \`false\` if not. | ### `PoolBitmapsSet` Emitted when pool bitmaps are updated. ```solidity event PoolBitmapsSet( address poolManager, bytes32[] functionIds, uint256[] bitmaps ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :---------: | :-----------: | ---------------------------------------------------- | | 0 | `poolManager` | `address` | `address` | Address of the pool manager. | | 1 | `functionIds` | `bytes32[]` | `bytes32[]` | List of function identifiers to set the bitmaps for. | | 2 | `bitmaps` | `uint256[]` | `uint256[]` | List of permission bitmaps. | ### `PoolPermissionLevelSet` Emitted when the permission level of a pool is updated. ```solidity event PoolPermissionLevelSet( address poolManager, uint256 permissionLevel ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :---------------: | :-------: | :-----------: | ---------------------------- | | 0 | `poolManager` | `address` | `address` | Address of the pool manager. | | 1 | `permissionLevel` | `uint256` | `uint256` | Pool permission level. | # Core Strategy Maple Specific strategy that allocates pool funds into an another Maple ERC‑4626 vault. Supports funding, withdrawal requests and cancellations, pushing residual assets back to the pool, and strategy reactivation after impairment. ## Functions ### `fundStrategy` Deploys assets from the Maple pool into the strategy (only when active). ```solidity function fundStrategy( uint256 assetsIn ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--------: | :-------: | :-----------: | -------------------------- | | 0 | `assetsIn` | `uint256` | `uint256` | Amount of assets to deploy | ### `requestWithdrawFromStrategy` Requests withdrawal of assets back to the Maple pool. ```solidity function requestWithdrawFromStrategy( uint256 assetsOut ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :---------: | :-------: | :-----------: | ------------------------------------ | | 0 | `assetsOut` | `uint256` | `uint256` | Amount of assets requested to redeem | ### `removeShares` Cancels or reduces a pending withdrawal by removing shares. ```solidity function removeShares( uint256 shares ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------: | :-------: | :-----------: | ----------------------------------------- | | 0 | `shares` | `uint256` | `uint256` | Amount of shares to remove from the queue | ### `removeSharesById` Cancels or reduces a pending withdrawal by id. ```solidity function removeSharesById( uint256 requestId, uint256 shares ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :---------: | :-------: | :-----------: | -------------------------------------------- | | 0 | `requestId` | `uint256` | `uint256` | Identifier of the withdrawal request | | 1 | `shares` | `uint256` | `uint256` | Amount of shares to remove from that request | ### `pushAssetsToPool` Pushes any held funds asset back to the pool. ```solidity function pushAssetsToPool() external; ``` ### `reactivateStrategy` Reactivates a previously impaired or deactivated strategy. ```solidity function reactivateStrategy() external; ``` ### `mapleWithdrawalManager` Returns the strategy’s configured withdrawal manager. ```solidity function mapleWithdrawalManager() view returns ( address withdrawalManagerAddress ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :------------------------: | :-------: | :-----------: | --------------------------------- | | 0 | `withdrawalManagerAddress` | `address` | `address` | Address of the withdrawal manager | ## Events ### `AssetsTransferredToPool` ```solidity event AssetsTransferredToPool( address indexed fundAsset, address indexed pool, uint256 amount ); ``` ### `StrategyWithdrawalRequested` ```solidity event StrategyWithdrawalRequested( uint256 assetsOut, uint256 escrowedShares ); ``` ### `StrategyWithdrawalDecreased` ```solidity event StrategyWithdrawalDecreased( uint256 sharesReturned ); ``` ### `StrategyWithdrawalDecreased` ```solidity event StrategyWithdrawalDecreased( uint256 indexed requestId, uint256 sharesReturned ); ``` ### `StrategyWithdrawalUpdated` ```solidity event StrategyWithdrawalUpdated( uint256 oldRequestId, uint256 newRequestId, uint256 oldSharesTotal, uint256 newSharesTotal ); ``` ### `StrategyReactivated` ```solidity event StrategyReactivated(); ``` # Core Strategy Initializer Initializer for the Core Strategy proxy. Validates the pool manager and strategy vault against Globals and factory instances, ensures asset consistency, sets approvals, and emits the initialization event. ## Functions ### `decodeArguments` Decodes initializer arguments (factory fallback calldata) into parameters. ```solidity function decodeArguments( bytes encodedArguments_ ) pure returns ( address poolManager_, address strategyVault_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------------: | :-----: | :-----------: | ------------------------------------------ | | 0 | `encodedArguments_` | `bytes` | `bytes` | ABI-encoded `(poolManager, strategyVault)` |
프로젝트로 돌아가기