Maple Finance 백서

Maple Finance

원문

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

ytes32 proposerRole ); ``` ### `ROLE_ADMIN` Returns the bytes32 representation of the role admin. ```solidity function ROLE_ADMIN() view returns ( bytes32 roleAdmin ); ``` ### `MIN_DELAY` Returns the minimum allowed delay (seconds). ```solidity function MIN_DELAY() view returns ( uint32 ); ``` ### `MIN_EXECUTION_WINDOW` Returns the minimum allowed execution window (seconds). ```solidity function MIN_EXECUTION_WINDOW() view returns ( uint32 ); ``` ### `defaultTimelockParameters` Returns the default timelock parameters. ```solidity function defaultTimelockParameters() view returns ( uint32 delay, uint32 executionWindow ); ``` ### `setDefaultTimelockParameters` Sets the default timelock parameters (only via timelock itself). ```solidity function setDefaultTimelockParameters( uint32 delay, uint32 executionWindow ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :---------------: | :------: | :-----------: | ---------------------------- | | 0 | `delay` | `uint32` | `uint32` | New default delay (seconds) | | 1 | `executionWindow` | `uint32` | `uint32` | New default window (seconds) | ### `setFunctionTimelockParameters` Sets per‑function timelock parameters (only via timelock itself). ```solidity function setFunctionTimelockParameters( address target, bytes4 functionSelector, uint32 delay, uint32 executionWindow ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------------: | :-------: | :-----------: | ---------------------------------- | | 0 | `target` | `address` | `address` | Target contract address | | 1 | `functionSelector` | `bytes4` | `bytes4` | Function selector | | 2 | `delay` | `uint32` | `uint32` | Delay for this function (seconds) | | 3 | `executionWindow` | `uint32` | `uint32` | Execution window for this function | ### `scheduleProposals` Schedules proposals for execution after the delay. ```solidity function scheduleProposals( address[] targets, bytes[] data ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-------: | :---------: | :-----------: | --------------------------------- | | 0 | `targets` | `address[]` | `address[]` | Target contract addresses to call | | 1 | `data` | `bytes[]` | `bytes[]` | Encoded calldata for each target | ### `unscheduleProposals` Unschedules proposals by id (non‑role updates only). ```solidity function unscheduleProposals( uint256[] proposalIds ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :---------: | :-----------: | -------------------------- | | 0 | `proposalIds` | `uint256[]` | `uint256[]` | IDs of proposals to cancel | ### `executeProposals` Executes proposals within their execution window. ```solidity function executeProposals( uint256[] proposalIds, address[] targets, bytes[] data ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :---------: | :-----------: | -------------------------------- | | 0 | `proposalIds` | `uint256[]` | `uint256[]` | IDs of proposals to execute | | 1 | `targets` | `address[]` | `address[]` | Target contract addresses | | 2 | `data` | `bytes[]` | `bytes[]` | Encoded calldata for each target | ### `proposeRoleUpdates` Proposes role grants/revocations (must be executed via timelock). ```solidity function proposeRoleUpdates( bytes32[] roles, address[] accounts, bool[] shouldGrant ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :---------: | :-----------: | --------------------------------- | | 0 | `roles` | `bytes32[]` | `bytes32[]` | Roles to update | | 1 | `accounts` | `address[]` | `address[]` | Accounts to apply role changes to | | 2 | `shouldGrant` | `bool[]` | `bool[]` | true to grant, false to revoke | ### `updateRole` Updates a role (callable only by the timelock itself during execution). ```solidity function updateRole( bytes32 role, address account, bool grantRole ) external; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :---------: | :-------: | :-----------: | --------------------------- | | 0 | `role` | `bytes32` | `bytes32` | Role identifier | | 1 | `account` | `address` | `address` | Account to update | | 2 | `grantRole` | `bool` | `bool` | true to grant, false revoke | ### `isExecutable` Returns true if a proposalId is executable now. ```solidity function isExecutable( uint256 proposalId ) view returns ( bool isExecutable_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------: | :-------: | :-----------: | ------------------------ | | 0 | `proposalId` | `uint256` | `uint256` | Proposal to check timing | ## Events ### `DefaultTimelockSet` ```solidity event DefaultTimelockSet( uint32 delay, uint32 executionWindow ); ``` ### `ERC20TokenWithdrawn` ```solidity event ERC20TokenWithdrawn( address indexed token, address indexed receiver, uint256 amount ); ``` ### `FunctionTimelockSet` ```solidity event FunctionTimelockSet( address indexed target, bytes4 indexed functionSelector, uint32 delay, uint32 executionWindow ); ``` ### `PendingTokenWithdrawerSet` ```solidity event PendingTokenWithdrawerSet( address indexed newPendingTokenWithdrawer ); ``` ### `ProposalExecuted` ```solidity event ProposalExecuted( uint256 indexed proposalId ); ``` ### `ProposalScheduled` ```solidity event ProposalScheduled( uint256 indexed proposalId, Proposal proposal ); ``` ### `ProposalUnscheduled` ```solidity event ProposalUnscheduled( uint256 indexed proposalId ); ``` ### `RoleUpdated` ```solidity event RoleUpdated( bytes32 indexed role, address indexed account, bool grantRole ); ``` ### `TokenWithdrawerAccepted` ```solidity event TokenWithdrawerAccepted( address indexed tokenWithdrawer ); ``` # SyrupRouter Lightweight router for lender integrations with Syrup pools. Provides stable entry points for first‑time authorized deposits (with optional ERC‑2612 permits) and subsequent deposits, and exposes the underlying pool, manager, and permission manager addresses. ## Functions ### `asset` Returns the underlying asset of the ERC‑4626 vault (pool). ```solidity function asset() view returns ( address asset ); ``` ### `pool` Returns the Maple Pool (ERC‑4626 vault) address. ```solidity function pool() view returns ( address pool ); ``` ### `poolManager` Returns the Pool Manager address. ```solidity function poolManager() view returns ( address poolManager ); ``` ### `poolPermissionManager` Returns the Pool Permission Manager address. ```solidity function poolPermissionManager() view returns ( address poolPermissionManager ); ``` ### `nonces` Returns the current nonce for the owner (used in authorization signatures). ```solidity function nonces( address owner ) view returns ( uint256 ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----: | :-------: | :-----------: | ------------------------ | | 0 | `owner` | `address` | `address` | Address to get nonce for | ### `authorizeAndDeposit` Authorizes the lender and deposits assets. ```solidity function authorizeAndDeposit( uint256 bitmap, uint256 deadline, uint8 v, bytes32 r, bytes32 s, uint256 amount, bytes32 depositData ) external returns ( uint256 shares ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :-------: | :-----------: | ------------------------------ | | 0 | `bitmap` | `uint256` | `uint256` | Lender permission bitmap | | 1 | `deadline` | `uint256` | `uint256` | Authorization expiry timestamp | | 2 | `v` | `uint8` | `uint8` | ECDSA v component | | 3 | `r` | `bytes32` | `bytes32` | ECDSA r component | | 4 | `s` | `bytes32` | `bytes32` | ECDSA s component | | 5 | `amount` | `uint256` | `uint256` | Asset amount to deposit | | 6 | `depositData` | `bytes32` | `bytes32` | Optional deposit metadata | ### `authorizeAndDepositWithPermit` Authorizes the lender and deposits with an ERC‑2612 permit. ```solidity function authorizeAndDepositWithPermit( uint256 bitmap, uint256 authDeadline, uint8 authV, bytes32 authR, bytes32 authS, uint256 amount, bytes32 depositData, uint256 permitDeadline, uint8 permitV, bytes32 permitR, bytes32 permitS ) external returns ( uint256 shares ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--------------: | :-------: | :-----------: | ------------------------------ | | 0 | `bitmap` | `uint256` | `uint256` | Lender permission bitmap | | 1 | `authDeadline` | `uint256` | `uint256` | Authorization expiry timestamp | | 2 | `authV` | `uint8` | `uint8` | Auth ECDSA v component | | 3 | `authR` | `bytes32` | `bytes32` | Auth ECDSA r component | | 4 | `authS` | `bytes32` | `bytes32` | Auth ECDSA s component | | 5 | `amount` | `uint256` | `uint256` | Asset amount to deposit | | 6 | `depositData` | `bytes32` | `bytes32` | Optional deposit metadata | | 7 | `permitDeadline` | `uint256` | `uint256` | Permit expiry timestamp | | 8 | `permitV` | `uint8` | `uint8` | Permit ECDSA v component | | 9 | `permitR` | `bytes32` | `bytes32` | Permit ECDSA r component | | 10 | `permitS` | `bytes32` | `bytes32` | Permit ECDSA s component | ### `deposit` Deposits assets when already authorized. ```solidity function deposit( uint256 amount, bytes32 depositData ) external returns ( uint256 shares ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :-------: | :-----------: | ------------------------- | | 0 | `amount` | `uint256` | `uint256` | Asset amount to deposit | | 1 | `depositData` | `bytes32` | `bytes32` | Optional deposit metadata | ### `depositWithPermit` Deposits with an ERC‑2612 permit when already authorized. ```solidity function depositWithPermit( uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s, bytes32 depositData ) external returns ( uint256 shares ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :-------: | :-----------: | ------------------------- | | 0 | `amount` | `uint256` | `uint256` | Asset amount to deposit | | 1 | `deadline` | `uint256` | `uint256` | Permit expiry timestamp | | 2 | `v` | `uint8` | `uint8` | ECDSA v component | | 3 | `r` | `bytes32` | `bytes32` | ECDSA r component | | 4 | `s` | `bytes32` | `bytes32` | ECDSA s component | | 5 | `depositData` | `bytes32` | `bytes32` | Optional deposit metadata | ## Events ```solidity event DepositData( address indexed owner, uint256 amount, bytes32 depositData ); ``` # LiquidatorFactory ## Constructor ```solidity constructor( address globals_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--------: | :-------: | :-----------: | ----------- | | 0 | `globals_` | `address` | `address` | | ## Functions ### `createInstance` Deploys a new instance proxying the default implementation version, with some initialization arguments. Uses a nonce and \`msg.sender\` as a salt for the CREATE2 opcode during instantiation to produce deterministic addresses. ```solidity function createInstance( bytes arguments_, bytes32 salt_ ) nonpayable returns ( address instance_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------: | :-------: | :-----------: | ------------------------------------------------------------------------ | | 0 | `arguments_` | `bytes` | `bytes` | The initialization arguments to use for the instance deployment, if any. | | 1 | `salt_` | `bytes32` | `bytes32` | The salt to use in the contract creation process. | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :---------: | :-------: | :-----------: | ------------------------------------------- | | 0 | `instance_` | `address` | `address` | The address of the deployed proxy contract. | ### `defaultImplementation` The address of an implementation for proxies. ```solidity function defaultImplementation() view returns ( address defaultImplementation_ ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :----------------------: | :-------: | :-----------: | ----------- | | 0 | `defaultImplementation_` | `address` | `address` | | ### `defaultVersion` The default version. ```solidity function defaultVersion() view returns ( uint256 ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `uint256` | `uint256` | | ### `disableUpgradePath` Disables upgrading from a version to a version of a implementation. Only the Governor can call this function. ```solidity function disableUpgradePath( uint256 fromVersion_, uint256 toVersion_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------: | :-------: | :-----------: | -------------------------------------------- | | 0 | `fromVersion_` | `uint256` | `uint256` | The starting version of the upgrade path. | | 1 | `toVersion_` | `uint256` | `uint256` | The destination version of the upgrade path. | ### `enableUpgradePath` Enables upgrading from a version to a version of an implementation, with an optional migrator. Only the Governor can call this function. ```solidity function enableUpgradePath( uint256 fromVersion_, uint256 toVersion_, address migrator_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :------------: | :-------: | :-----------: | -------------------------------------------- | | 0 | `fromVersion_` | `uint256` | `uint256` | The starting version of the upgrade path. | | 1 | `toVersion_` | `uint256` | `uint256` | The destination version of the upgrade path. | | 2 | `migrator_` | `address` | `address` | The address of the migrator, if any. | ### `getInstanceAddress` Returns the deterministic address of a potential proxy, given some arguments and salt. ```solidity function getInstanceAddress( bytes arguments_, bytes32 salt_ ) view returns ( address instanceAddress_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------: | :-------: | :-----------: | ----------------------------------------------------------------- | | 0 | `arguments_` | `bytes` | `bytes` | The initialization arguments to be used when deploying the proxy. | | 1 | `salt_` | `bytes32` | `bytes32` | The salt to be used when deploying the proxy. | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :----------------: | :-------: | :-----------: | ----------------------------------------------- | | 0 | `instanceAddress_` | `address` | `address` | The deterministic address of a potential proxy. | ### `implementationOf` Returns the address of an implementation version. ```solidity function implementationOf( uint256 version_ ) view returns ( address implementation_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--------: | :-------: | :-----------: | --------------------------- | | 0 | `version_` | `uint256` | `uint256` | The implementation version. | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :---------------: | :-------: | :-----------: | ---------------------------------- | | 0 | `implementation_` | `address` | `address` | The address of the implementation. | ### `isInstance` Returns if a given address has been deployed by this factory/ ```solidity function isInstance( 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` | | ### `mapleGlobals` The address of the MapleGlobals contract. ```solidity function mapleGlobals() view returns ( address ); ``` #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | | `address` | `address` | | ### `migratorForPath` Returns the address of a migrator contract for a migration path (from version, to version). If oldVersion\_ == newVersion\_, the migrator is an initializer. ```solidity function migratorForPath( uint256 oldVersion_, uint256 newVersion_ ) view returns ( address migrator_ ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-----------: | :-------: | :-----------: | ---------------- | | 0 | `oldVersion_` | `uint256` | `uint256` | The old version. | | 1 | `newVersion_` | `uint256` | `uint256` | The new version. | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :---------: | :-------: | :-----------: | ----------------------------------- | | 0 | `migrator_` | `address` | `address` | The address of a migrator contract. | ### `registerImplementation` Registers the address of an implementation contract as a version, with an optional initializer. Only the Governor can call this function. ```solidity function registerImplementation( uint256 version_, address implementationAddress_, address initializer_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------------------: | :-------: | :-----------: | --------------------------------------- | | 0 | `version_` | `uint256` | `uint256` | The version to register. | | 1 | `implementationAddress_` | `address` | `address` | The address of the implementation. | | 2 | `initializer_` | `address` | `address` | The address of the initializer, if any. | ### `setDefaultVersion` Sets the default version. Only the Governor can call this function. ```solidity function setDefaultVersion( uint256 version_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--------: | :-------: | :-----------: | ------------------------------------------------- | | 0 | `version_` | `uint256` | `uint256` | The implementation version to set as the default. | ### `setGlobals` Sets the Maple Globals contract. Only the Governor can call this function. ```solidity function setGlobals( address mapleGlobals_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :-------------: | :-------: | :-----------: | ---------------------------------------- | | 0 | `mapleGlobals_` | `address` | `address` | The address of a Maple Globals contract. | ### `upgradeEnabledForPath` Whether the upgrade is enabled for a path from a version to another version. ```solidity function upgradeEnabledForPath( uint256, uint256 ) view returns ( bool ); ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :-------: | :-----------: | ----------- | | 0 | \`\` | `uint256` | `uint256` | | | 1 | \`\` | `uint256` | `uint256` | | #### Return Values: | Index | Name | Type | Internal Type | Description | | :---: | :--: | :----: | :-----------: | ----------- | | 0 | | `bool` | `bool` | | ### `upgradeInstance` Upgrades the calling proxy contract's implementation, with some migration arguments. ```solidity function upgradeInstance( uint256 toVersion_, bytes arguments_ ) nonpayable; ``` #### Parameters: | Index | Name | Type | Internal Type | Description | | :---: | :----------: | :-------: | :-----------: | ---------------
프로젝트로 돌아가기