@pendle/core-v2 5.5.0 → 5.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/build/artifacts/contracts/core/Market/v3/PendleMarketFactoryV3.sol/PendleMarketFactoryV3.dbg.json +1 -1
  2. package/build/artifacts/contracts/core/Market/v3/PendleMarketFactoryV3.sol/PendleMarketFactoryV3.json +2 -2
  3. package/build/artifacts/contracts/core/Market/v3/PendleMarketV3.sol/PendleMarketV3.dbg.json +1 -1
  4. package/build/artifacts/contracts/core/Market/v3/PendleMarketV3.sol/PendleMarketV3.json +2 -2
  5. package/build/artifacts/contracts/interfaces/IPActionAddRemoveLiqV3.sol/IPActionAddRemoveLiqV3.dbg.json +1 -1
  6. package/build/artifacts/contracts/interfaces/IPActionCallbackV3.sol/IPActionCallbackV3.dbg.json +1 -1
  7. package/build/artifacts/contracts/interfaces/IPActionMarketAuxStatic.sol/IPActionMarketAuxStatic.dbg.json +1 -1
  8. package/build/artifacts/contracts/interfaces/IPActionMiscV3.sol/IPActionMiscV3.dbg.json +1 -1
  9. package/build/artifacts/contracts/interfaces/IPActionSimple.sol/IPActionSimple.dbg.json +1 -1
  10. package/build/artifacts/contracts/interfaces/IPActionStorageStatic.sol/IPActionStorageStatic.dbg.json +1 -1
  11. package/build/artifacts/contracts/interfaces/IPActionStorageV4.sol/IPActionStorageV4.dbg.json +1 -1
  12. package/build/artifacts/contracts/interfaces/IPActionSwapPTV3.sol/IPActionSwapPTV3.dbg.json +1 -1
  13. package/build/artifacts/contracts/interfaces/IPActionSwapYTV3.sol/IPActionSwapYTV3.dbg.json +1 -1
  14. package/build/artifacts/contracts/interfaces/IPAllActionV3.sol/IPAllActionV3.dbg.json +1 -1
  15. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionAddRemoveLiqV3Events.dbg.json +1 -1
  16. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionMiscV3Events.dbg.json +1 -1
  17. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionStorageEvents.dbg.json +1 -1
  18. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapPTV3Events.dbg.json +1 -1
  19. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPActionSwapYTV3Events.dbg.json +1 -1
  20. package/build/artifacts/contracts/interfaces/IPAllEventsV3.sol/IPAllEventsV3.dbg.json +1 -1
  21. package/build/artifacts/contracts/interfaces/IPGovernanceProxy.sol/IPGovernanceProxy.dbg.json +1 -1
  22. package/build/artifacts/contracts/interfaces/IPGovernanceProxy.sol/IPGovernanceProxy.json +77 -0
  23. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitOrderType.dbg.json +1 -1
  24. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.dbg.json +1 -1
  25. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouter.json +32 -0
  26. package/build/artifacts/contracts/interfaces/IPLimitRouter.sol/IPLimitRouterCallback.dbg.json +1 -1
  27. package/build/artifacts/contracts/interfaces/IPMarketFactoryV3.sol/IPMarketFactoryV3.dbg.json +1 -1
  28. package/build/artifacts/contracts/interfaces/IPMarketFactoryV3.sol/IPMarketFactoryV3.json +23 -0
  29. package/build/artifacts/contracts/interfaces/IPRouterStatic.sol/IPRouterStatic.dbg.json +1 -1
  30. package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.dbg.json +1 -1
  31. package/build/artifacts/contracts/limit/LimitMathCore.sol/LimitMathCore.json +2 -2
  32. package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.dbg.json +1 -1
  33. package/build/artifacts/contracts/limit/LimitRouterBase.sol/LimitRouterBase.json +32 -0
  34. package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.dbg.json +1 -1
  35. package/build/artifacts/contracts/limit/PendleLimitRouter.sol/PendleLimitRouter.json +34 -2
  36. package/build/artifacts/contracts/offchain-helpers/LimitBackendHelper.sol/LimitBackendHelper.dbg.json +1 -1
  37. package/build/artifacts/contracts/offchain-helpers/LimitBackendHelper.sol/LimitBackendHelper.json +2 -2
  38. package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.dbg.json +1 -1
  39. package/build/artifacts/contracts/offchain-helpers/PendleGovernanceProxy.sol/PendleGovernanceProxy.json +98 -3
  40. package/build/artifacts/contracts/offchain-helpers/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.dbg.json +1 -1
  41. package/build/artifacts/contracts/offchain-helpers/PendlePoolDeployHelper.sol/PendlePoolDeployHelper.json +2 -2
  42. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.dbg.json +1 -1
  43. package/build/artifacts/contracts/offchain-helpers/router-static/PendleRouterStatic.sol/PendleRouterStatic.json +2 -2
  44. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.dbg.json +1 -1
  45. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionInfoStatic.sol/ActionInfoStatic.json +2 -2
  46. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.dbg.json +1 -1
  47. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketAuxStatic.sol/ActionMarketAuxStatic.json +2 -2
  48. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.dbg.json +1 -1
  49. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMarketCoreStatic.sol/ActionMarketCoreStatic.json +2 -2
  50. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.dbg.json +1 -1
  51. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionMintRedeemStatic.sol/ActionMintRedeemStatic.json +2 -2
  52. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.dbg.json +1 -1
  53. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionStorageStatic.sol/ActionStorageStatic.json +2 -2
  54. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.dbg.json +1 -1
  55. package/build/artifacts/contracts/offchain-helpers/router-static/base/ActionVePendleStatic.sol/ActionVePendleStatic.json +2 -2
  56. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.dbg.json +1 -1
  57. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtInLibV1.json +2 -2
  58. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.dbg.json +1 -1
  59. package/build/artifacts/contracts/offchain-helpers/router-static/base/MarketApproxLibV1.sol/MarketApproxPtOutLibV1.json +2 -2
  60. package/build/artifacts/contracts/offchain-helpers/router-static/base/StorageLayout.sol/StorageLayout.dbg.json +1 -1
  61. package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.dbg.json +1 -1
  62. package/build/artifacts/contracts/router/ActionAddRemoveLiqV3.sol/ActionAddRemoveLiqV3.json +2 -2
  63. package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.dbg.json +1 -1
  64. package/build/artifacts/contracts/router/ActionCallbackV3.sol/ActionCallbackV3.json +2 -2
  65. package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.dbg.json +1 -1
  66. package/build/artifacts/contracts/router/ActionMiscV3.sol/ActionMiscV3.json +2 -2
  67. package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.dbg.json +1 -1
  68. package/build/artifacts/contracts/router/ActionSimple.sol/ActionSimple.json +2 -2
  69. package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.dbg.json +1 -1
  70. package/build/artifacts/contracts/router/ActionStorageV4.sol/ActionStorageV4.json +2 -2
  71. package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.dbg.json +1 -1
  72. package/build/artifacts/contracts/router/ActionSwapPTV3.sol/ActionSwapPTV3.json +2 -2
  73. package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.dbg.json +1 -1
  74. package/build/artifacts/contracts/router/ActionSwapYTV3.sol/ActionSwapYTV3.json +2 -2
  75. package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.dbg.json +1 -1
  76. package/build/artifacts/contracts/router/PendleRouterV4.sol/PendleRouterV4.json +2 -2
  77. package/build/artifacts/contracts/router/Reflector.sol/Reflector.dbg.json +1 -1
  78. package/build/artifacts/contracts/router/Reflector.sol/Reflector.json +2 -2
  79. package/build/artifacts/contracts/router/base/ActionBase.sol/ActionBase.dbg.json +1 -1
  80. package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.dbg.json +1 -1
  81. package/build/artifacts/contracts/router/base/ActionDelegateBase.sol/ActionDelegateBase.json +2 -2
  82. package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.dbg.json +1 -1
  83. package/build/artifacts/contracts/router/math/ApproxStateLib.sol/ApproxStateLib.json +2 -2
  84. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.dbg.json +1 -1
  85. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtInLibOnchain.json +2 -2
  86. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.dbg.json +1 -1
  87. package/build/artifacts/contracts/router/math/MarketApproxLibOnchain.sol/MarketApproxPtOutLibOnchain.json +2 -2
  88. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.dbg.json +1 -1
  89. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtInLibV2.json +2 -2
  90. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.dbg.json +1 -1
  91. package/build/artifacts/contracts/router/math/MarketApproxLibV2.sol/MarketApproxPtOutLibV2.json +2 -2
  92. package/contracts/interfaces/IPGovernanceProxy.sol +10 -0
  93. package/contracts/interfaces/IPLimitRouter.sol +5 -0
  94. package/contracts/interfaces/IPMarketFactoryV3.sol +2 -0
  95. package/contracts/limit/LimitRouterBase.sol +6 -10
  96. package/contracts/offchain-helpers/PendleGovernanceProxy.sol +41 -10
  97. package/deployments/1-core.json +2 -1
  98. package/deployments/10-core.json +2 -1
  99. package/deployments/42161-core.json +2 -1
  100. package/deployments/5000-core.json +2 -1
  101. package/deployments/56-core.json +2 -1
  102. package/deployments/8453-core.json +2 -1
  103. package/deployments/merkle-distribution/2024-12-31-snapshot.json +65767 -0
  104. package/deployments/merkle-distribution/2025-01-30.json +28060 -0
  105. package/package.json +1 -1
  106. package/typechain-types/ActionCallbackV3.ts +164 -0
  107. package/typechain-types/IPActionCallbackV3.ts +164 -0
  108. package/typechain-types/IPGovernanceProxy.ts +236 -0
  109. package/typechain-types/IPLimitRouter.ts +633 -0
  110. package/typechain-types/IPLimitRouterCallback.ts +120 -0
  111. package/typechain-types/IPMarketFactoryV3.ts +321 -0
  112. package/typechain-types/LimitBackendHelper.ts +287 -0
  113. package/typechain-types/LimitRouterBase.ts +1138 -0
  114. package/typechain-types/PendleGovernanceProxy.ts +128 -0
  115. package/typechain-types/PendleLimitRouter.ts +1138 -0
  116. package/typechain-types/PendleMarketFactoryV3.ts +719 -0
  117. package/typechain-types/PendleMarketV3.ts +1195 -0
  118. package/typechain-types/factories/ActionAddRemoveLiqV3__factory.ts +1 -1
  119. package/typechain-types/factories/ActionCallbackV3__factory.ts +121 -0
  120. package/typechain-types/factories/ActionInfoStatic__factory.ts +1 -1
  121. package/typechain-types/factories/ActionMarketAuxStatic__factory.ts +1 -1
  122. package/typechain-types/factories/ActionMarketCoreStatic__factory.ts +1 -1
  123. package/typechain-types/factories/ActionMintRedeemStatic__factory.ts +1 -1
  124. package/typechain-types/factories/ActionMiscV3__factory.ts +1 -1
  125. package/typechain-types/factories/ActionSimple__factory.ts +1 -1
  126. package/typechain-types/factories/ActionStorageStatic__factory.ts +1 -1
  127. package/typechain-types/factories/ActionStorageV4__factory.ts +1 -1
  128. package/typechain-types/factories/ActionSwapPTV3__factory.ts +1 -1
  129. package/typechain-types/factories/ActionSwapYTV3__factory.ts +1 -1
  130. package/typechain-types/factories/ActionVePendleStatic__factory.ts +1 -1
  131. package/typechain-types/factories/IPActionCallbackV3__factory.ts +83 -0
  132. package/typechain-types/factories/IPGovernanceProxy__factory.ts +152 -0
  133. package/typechain-types/factories/IPLimitRouterCallback__factory.ts +64 -0
  134. package/typechain-types/factories/IPLimitRouter__factory.ts +748 -0
  135. package/typechain-types/factories/IPMarketFactoryV3__factory.ts +217 -0
  136. package/typechain-types/factories/LimitBackendHelper__factory.ts +232 -0
  137. package/typechain-types/factories/LimitRouterBase__factory.ts +1069 -0
  138. package/typechain-types/factories/PendleGovernanceProxy__factory.ts +97 -2
  139. package/typechain-types/factories/PendleLimitRouter__factory.ts +1139 -0
  140. package/typechain-types/factories/PendleMarketFactoryV3__factory.ts +714 -0
  141. package/typechain-types/factories/PendleMarketV3__factory.ts +1211 -0
  142. package/typechain-types/factories/PendlePoolDeployHelper__factory.ts +1 -1
  143. package/typechain-types/factories/PendleRouterStatic__factory.ts +1 -1
  144. package/typechain-types/factories/PendleRouterV4__factory.ts +1 -1
  145. package/typechain-types/factories/Reflector__factory.ts +1 -1
@@ -3,8 +3,8 @@
3
3
  "contractName": "MarketApproxPtOutLibOnchain",
4
4
  "sourceName": "contracts/router/math/MarketApproxLibOnchain.sol",
5
5
  "abi": [],
6
- "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212207eecdd58f9c9504f0ee4fa0cdd4e8962c8952088847de274ffa8e2245e1d158264736f6c63430008170033",
7
- "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212207eecdd58f9c9504f0ee4fa0cdd4e8962c8952088847de274ffa8e2245e1d158264736f6c63430008170033",
6
+ "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122058fdc410b4b575841c734f083b66e09fe250dc56257b5cb5e9b82e0618f7865264736f6c63430008170033",
7
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122058fdc410b4b575841c734f083b66e09fe250dc56257b5cb5e9b82e0618f7865264736f6c63430008170033",
8
8
  "linkReferences": {},
9
9
  "deployedLinkReferences": {}
10
10
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/7fa579b181813c7af64ef3c7fee573ab.json"
3
+ "buildInfo": "../../../../build-info/72388dcca8fd03931a3656e184e016ec.json"
4
4
  }
@@ -3,8 +3,8 @@
3
3
  "contractName": "MarketApproxPtInLibV2",
4
4
  "sourceName": "contracts/router/math/MarketApproxLibV2.sol",
5
5
  "abi": [],
6
- "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212206266cb8a9d26cfdec0daacc289ff5027055e0459d4fd3e5e0c05455ab230621f64736f6c63430008170033",
7
- "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212206266cb8a9d26cfdec0daacc289ff5027055e0459d4fd3e5e0c05455ab230621f64736f6c63430008170033",
6
+ "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220eaa91b6e04a07d29a1951ac794985ee2a81a1d6380d2db556aef65197c71331364736f6c63430008170033",
7
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220eaa91b6e04a07d29a1951ac794985ee2a81a1d6380d2db556aef65197c71331364736f6c63430008170033",
8
8
  "linkReferences": {},
9
9
  "deployedLinkReferences": {}
10
10
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../../build-info/7fa579b181813c7af64ef3c7fee573ab.json"
3
+ "buildInfo": "../../../../build-info/72388dcca8fd03931a3656e184e016ec.json"
4
4
  }
@@ -3,8 +3,8 @@
3
3
  "contractName": "MarketApproxPtOutLibV2",
4
4
  "sourceName": "contracts/router/math/MarketApproxLibV2.sol",
5
5
  "abi": [],
6
- "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bd2aa2abb3abdf314b919e4c0916b8e25e2a0cb1591068840a9937ce807dbb2c64736f6c63430008170033",
7
- "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220bd2aa2abb3abdf314b919e4c0916b8e25e2a0cb1591068840a9937ce807dbb2c64736f6c63430008170033",
6
+ "bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212204d1223a9f4e93fb50232986ef86372b1e885c1f948787333716c75d5559641eb64736f6c63430008170033",
7
+ "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea26469706673582212204d1223a9f4e93fb50232986ef86372b1e885c1f948787333716c75d5559641eb64736f6c63430008170033",
8
8
  "linkReferences": {},
9
9
  "deployedLinkReferences": {}
10
10
  }
@@ -11,4 +11,14 @@ interface IPGovernanceProxy {
11
11
  function pause(address[] calldata addrs) external;
12
12
 
13
13
  function aggregate(Call[] calldata calls) external payable returns (bytes[] memory rtnData);
14
+
15
+ event SetAllowedSelectors(bytes4[] selectors, bytes32 indexed role);
16
+
17
+ function ALICE() external view returns (bytes32);
18
+
19
+ function BOB() external view returns (bytes32);
20
+
21
+ function CHARLIE() external view returns (bytes32);
22
+
23
+ function allowedSelectors(bytes4 selector) external view returns (bytes32);
14
24
  }
@@ -89,6 +89,9 @@ interface IPLimitRouter is IPLimitOrderType {
89
89
  address taker
90
90
  );
91
91
 
92
+ // event added on 2/1/2025
93
+ event LnFeeRateRootsSet(address[] YTs, uint256[] lnFeeRateRoots);
94
+
92
95
  // @dev actualMaking, actualTaking are in the SY form
93
96
  function fill(
94
97
  FillOrderParams[] memory params,
@@ -118,6 +121,8 @@ interface IPLimitRouter is IPLimitOrderType {
118
121
 
119
122
  function simulate(address target, bytes calldata data) external payable;
120
123
 
124
+ function WNATIVE() external view returns (address);
125
+
121
126
  function _checkSig(
122
127
  Order memory order,
123
128
  bytes memory signature
@@ -28,4 +28,6 @@ interface IPMarketFactoryV3 {
28
28
  int256 initialAnchor,
29
29
  uint80 lnFeeRateRoot
30
30
  ) external returns (address market);
31
+
32
+ function setOverriddenFee(address router, address market, uint80 newFee) external;
31
33
  }
@@ -30,6 +30,8 @@ abstract contract LimitRouterBase is
30
30
  uint128 internal constant _ORDER_DOES_NOT_EXIST = 0;
31
31
  uint128 internal constant _ORDER_FILLED = 1;
32
32
  uint256 internal constant NEW_PRIME = 12421;
33
+ uint256 internal constant MAX_LN_FEE_RATE_ROOT = 48790164169432003; // ln(1.05)
34
+
33
35
  bytes private constant EMPTY_BYTES = abi.encode();
34
36
 
35
37
  address public feeRecipient;
@@ -37,7 +39,7 @@ abstract contract LimitRouterBase is
37
39
  // YT => lnFeeRateRoot // not to be accessed directly
38
40
  mapping(address => uint256) internal __lnFeeRateRoot;
39
41
 
40
- address private immutable WNATIVE;
42
+ address public immutable WNATIVE;
41
43
 
42
44
  mapping(bytes32 => OrderStatus) internal _status;
43
45
 
@@ -486,19 +488,13 @@ abstract contract LimitRouterBase is
486
488
  uint256 len = YTs.length;
487
489
  require(len == lnFeeRateRoots.length, "LOP: length mismatch");
488
490
 
489
- if (msg.sender == ownerHelper) {
490
- _requireFeeNotSet(YTs);
491
- }
492
-
493
491
  for (uint256 i = 0; i < len; i++) {
494
492
  require(lnFeeRateRoots[i] > 0, "LOP: zero fee not allowed");
493
+ require(lnFeeRateRoots[i] <= MAX_LN_FEE_RATE_ROOT, "LOP: fee too high");
494
+
495
495
  __lnFeeRateRoot[YTs[i]] = lnFeeRateRoots[i];
496
496
  }
497
- }
498
497
 
499
- function _requireFeeNotSet(address[] memory YTs) internal view {
500
- for (uint256 i = 0; i < YTs.length; i++) {
501
- require(__lnFeeRateRoot[YTs[i]] == 0, "LOP: fee already set");
502
- }
498
+ emit LnFeeRateRootsSet(YTs, lnFeeRateRoots);
503
499
  }
504
500
  }
@@ -13,13 +13,30 @@ import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
13
13
  contract PendleGovernanceProxy is AccessControlUpgradeable, UUPSUpgradeable, IPGovernanceProxy {
14
14
  bytes32 public constant GUARDIAN = keccak256("GUARDIAN");
15
15
 
16
+ bytes32 public constant ALICE = keccak256("ALICE");
17
+ bytes32 public constant BOB = keccak256("BOB");
18
+ bytes32 public constant CHARLIE = keccak256("CHARLIE");
19
+
20
+ mapping(bytes4 => bytes32) public allowedSelectors;
21
+
16
22
  modifier onlyGuardian() {
17
- require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || hasRole(GUARDIAN, msg.sender), "not authorized");
23
+ require(hasRole(GUARDIAN, msg.sender) || hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "n/a");
18
24
  _;
19
25
  }
20
26
 
21
27
  modifier onlyAdmin() {
22
- require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "not authorized");
28
+ require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "n/a");
29
+ _;
30
+ }
31
+
32
+ modifier onlyHaveSomeRole() {
33
+ require(
34
+ hasRole(ALICE, msg.sender) ||
35
+ hasRole(BOB, msg.sender) ||
36
+ hasRole(CHARLIE, msg.sender) ||
37
+ hasRole(DEFAULT_ADMIN_ROLE, msg.sender),
38
+ "n/a"
39
+ );
23
40
  _;
24
41
  }
25
42
 
@@ -27,6 +44,19 @@ contract PendleGovernanceProxy is AccessControlUpgradeable, UUPSUpgradeable, IPG
27
44
  _disableInitializers();
28
45
  }
29
46
 
47
+ function aggregate(Call[] calldata calls) external payable onlyHaveSomeRole returns (bytes[] memory) {
48
+ bool isAdmin = hasRole(DEFAULT_ADMIN_ROLE, msg.sender);
49
+
50
+ if (!isAdmin) {
51
+ for (uint256 i = 0; i < calls.length; i++) {
52
+ bytes4 selector = bytes4(calls[i].callData[:4]);
53
+ require(hasRole(allowedSelectors[selector], msg.sender), "n/a");
54
+ }
55
+ }
56
+
57
+ return _aggregate(calls);
58
+ }
59
+
30
60
  /*///////////////////////////////////////////////////////////////
31
61
  PAUSING
32
62
  //////////////////////////////////////////////////////////////*/
@@ -45,14 +75,19 @@ contract PendleGovernanceProxy is AccessControlUpgradeable, UUPSUpgradeable, IPG
45
75
  ADMIN CALL
46
76
  //////////////////////////////////////////////////////////////*/
47
77
 
48
- function aggregate(
49
- IPGovernanceProxy.Call[] calldata calls
50
- ) external payable onlyAdmin returns (bytes[] memory rtnData) {
78
+ function setAllowedSelectors(bytes4[] calldata selectors, bytes32 role) external onlyAdmin {
79
+ for (uint256 i = 0; i < selectors.length; i++) {
80
+ allowedSelectors[selectors[i]] = role;
81
+ }
82
+ emit SetAllowedSelectors(selectors, role);
83
+ }
84
+
85
+ function _aggregate(Call[] calldata calls) internal returns (bytes[] memory rtnData) {
51
86
  uint256 length = calls.length;
52
87
  rtnData = new bytes[](length);
53
88
 
54
89
  Call calldata call;
55
- for (uint256 i = 0; i < length; ) {
90
+ for (uint256 i = 0; i < length; i++) {
56
91
  call = calls[i];
57
92
 
58
93
  (bool success, bytes memory resp) = call.target.call{value: call.value}(call.callData);
@@ -63,10 +98,6 @@ contract PendleGovernanceProxy is AccessControlUpgradeable, UUPSUpgradeable, IPG
63
98
  }
64
99
 
65
100
  rtnData[i] = resp;
66
-
67
- unchecked {
68
- ++i;
69
- }
70
101
  }
71
102
  }
72
103
 
@@ -49,7 +49,8 @@
49
49
  "gaugeController": "0x47D74516B33eD5D70ddE7119A40839f6Fcc24e57",
50
50
  "feeDistributor": "0xd7b34a6fDCb2A7ceD2115FF7f5fdD72aa6aA4dE2",
51
51
  "feeDistributorV2": "0x8C237520a8E14D658170A633D96F8e80764433b9",
52
- "multiTokenDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
52
+ "vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
53
+ "externalRewardsDistributor": "0xae898a7d07f8e27f25e13d0f351a7401f9a5bf9d",
53
54
  "sparkLinearDiscountOracleFactory": "0xA9A924A4BB95509F77868E086154C25e934F6171",
54
55
  "beta": {
55
56
  "PendleChainlinkOracleFactory": "0x2A73e899389cABa2a2f648BaBA35e67f5C00EFee"
@@ -46,7 +46,8 @@
46
46
  "vePendle": "0xd5C47D2383Fddc19596489280C0A33AC42b2bB18",
47
47
  "gaugeController": "0x6875e4A945E498FE1B90BbB13CFbAF0b68658C9C",
48
48
  "sparkLinearDiscountOracleFactory": "0xA9A924A4BB95509F77868E086154C25e934F6171",
49
- "multiTokenDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
49
+ "vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
50
+ "externalRewardsDistributor": "0xae898a7d07f8e27f25e13d0f351a7401f9a5bf9d",
50
51
  "beta": {
51
52
  "PendleChainlinkOracleFactory": "0x2A73e899389cABa2a2f648BaBA35e67f5C00EFee"
52
53
  }
@@ -48,7 +48,8 @@
48
48
  "arbMerkleDistribution": "0x23a102e78D1FF1645a3666691495174764a5FCAF",
49
49
  "linearDistributor": "0x83d85AEDD308261d847C3eb8d7146457bD8F38E8",
50
50
  "sparkLinearDiscountOracleFactory": "0xA9A924A4BB95509F77868E086154C25e934F6171",
51
- "multiTokenDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
51
+ "vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
52
+ "externalRewardsDistributor": "0xae898a7d07f8e27f25e13d0f351a7401f9a5bf9d",
52
53
  "beta": {
53
54
  "PendleChainlinkOracleFactory": "0x2A73e899389cABa2a2f648BaBA35e67f5C00EFee"
54
55
  }
@@ -44,7 +44,8 @@
44
44
  "vePendle": "0x30c6d4e892871220B5Ab66c10db577da96Fb974b",
45
45
  "gaugeController": "0x428f2f93afAc3F96B0DE59854038c585e06165C8",
46
46
  "sparkLinearDiscountOracleFactory": "0xA9A924A4BB95509F77868E086154C25e934F6171",
47
- "multiTokenDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
47
+ "vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
48
+ "externalRewardsDistributor": "0xae898a7d07f8e27f25e13d0f351a7401f9a5bf9d",
48
49
  "beta": {
49
50
  "PendleChainlinkOracleFactory": "0x2A73e899389cABa2a2f648BaBA35e67f5C00EFee"
50
51
  }
@@ -46,7 +46,8 @@
46
46
  "vePendle": "0x8A09574b0401A856d89d1b583eE22E8cb0C5530B",
47
47
  "gaugeController": "0x704478Dd72FD7F9B83d1F1e0fc18C14B54F034d0",
48
48
  "sparkLinearDiscountOracleFactory": "0xA9A924A4BB95509F77868E086154C25e934F6171",
49
- "multiTokenDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
49
+ "vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
50
+ "externalRewardsDistributor": "0xae898a7d07f8e27f25e13d0f351a7401f9a5bf9d",
50
51
  "beta": {
51
52
  "PendleChainlinkOracleFactory": "0x2A73e899389cABa2a2f648BaBA35e67f5C00EFee"
52
53
  }
@@ -39,7 +39,8 @@
39
39
  "vePendle": "0x051dcd6a80f11fE68F77Fb0EBdE03853FA96B1fD",
40
40
  "gaugeController": "0x17F100fB4bE2707675c6439468d38249DD993d58",
41
41
  "sparkLinearDiscountOracleFactory": "0xA9A924A4BB95509F77868E086154C25e934F6171",
42
- "multiTokenDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
42
+ "vePendleAirdropDistributor": "0x3942F7B55094250644cFfDa7160226Caa349A38E",
43
+ "externalRewardsDistributor": "0xae898a7d07f8e27f25e13d0f351a7401f9a5bf9d",
43
44
  "beta": {
44
45
  "PendleChainlinkOracleFactory": "0x2A73e899389cABa2a2f648BaBA35e67f5C00EFee"
45
46
  }