@stargatefinance/stg-evm-sdk-v2 0.0.21 → 0.0.22
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.
- package/deployments/arbsep-testnet/CreditMessaging.json +1441 -0
- package/deployments/arbsep-testnet/RewardLib.json +41 -0
- package/deployments/arbsep-testnet/RewardRegistryLib.json +41 -0
- package/deployments/arbsep-testnet/StargateMultiRewarder.json +1161 -0
- package/deployments/arbsep-testnet/StargateStaking.json +726 -0
- package/deployments/arbsep-testnet/StargateZapperV1.json +898 -0
- package/deployments/arbsep-testnet/TokenMessaging.json +2315 -0
- package/deployments/arbsep-testnet/Treasurer.json +411 -0
- package/deployments/bsc-testnet/CreditMessaging.json +1441 -0
- package/deployments/bsc-testnet/FeeLibV1USDT.json +975 -0
- package/deployments/bsc-testnet/RewardLib.json +41 -0
- package/deployments/bsc-testnet/RewardRegistryLib.json +41 -0
- package/deployments/bsc-testnet/StargateMultiRewarder.json +1161 -0
- package/deployments/bsc-testnet/StargatePoolUSDT.json +2507 -0
- package/deployments/bsc-testnet/StargateStaking.json +726 -0
- package/deployments/bsc-testnet/StargateZapperV1.json +898 -0
- package/deployments/bsc-testnet/TokenMessaging.json +2315 -0
- package/deployments/bsc-testnet/Treasurer.json +411 -0
- package/deployments/klaytn-testnet/CreditMessaging.json +1441 -0
- package/deployments/klaytn-testnet/RewardLib.json +41 -0
- package/deployments/klaytn-testnet/RewardRegistryLib.json +41 -0
- package/deployments/klaytn-testnet/StargateMultiRewarder.json +1161 -0
- package/deployments/klaytn-testnet/StargateStaking.json +726 -0
- package/deployments/klaytn-testnet/TokenMessaging.json +2315 -0
- package/deployments/klaytn-testnet/Treasurer.json +411 -0
- package/deployments/optsep-testnet/CreditMessaging.json +1441 -0
- package/deployments/optsep-testnet/RewardLib.json +41 -0
- package/deployments/optsep-testnet/RewardRegistryLib.json +41 -0
- package/deployments/optsep-testnet/StargateMultiRewarder.json +1161 -0
- package/deployments/optsep-testnet/StargateStaking.json +726 -0
- package/deployments/optsep-testnet/StargateZapperV1.json +898 -0
- package/deployments/optsep-testnet/TokenMessaging.json +2315 -0
- package/deployments/optsep-testnet/Treasurer.json +411 -0
- package/deployments/sepolia-testnet/CreditMessaging.json +1441 -0
- package/deployments/sepolia-testnet/FeeLibV1USDT.json +975 -0
- package/deployments/sepolia-testnet/PoolTokenUSDT.json +597 -0
- package/deployments/sepolia-testnet/RewardLib.json +41 -0
- package/deployments/sepolia-testnet/RewardRegistryLib.json +41 -0
- package/deployments/sepolia-testnet/StargateMultiRewarder.json +1161 -0
- package/deployments/sepolia-testnet/StargatePoolUSDT.json +2507 -0
- package/deployments/sepolia-testnet/StargateStaking.json +726 -0
- package/deployments/sepolia-testnet/StargateZapperV1.json +898 -0
- package/deployments/sepolia-testnet/TokenMessaging.json +2315 -0
- package/deployments/sepolia-testnet/Treasurer.json +411 -0
- package/package.json +2 -2
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "0xa13A3849ea1Ce390890C51AbCDc05ec9b1cfFe14",
|
|
3
|
+
"abi": [],
|
|
4
|
+
"transactionHash": "0x3dd4939510c2ac0f96558df11fc3000c80c69314c9e7c60929c3977184d7d4ab",
|
|
5
|
+
"receipt": {
|
|
6
|
+
"to": null,
|
|
7
|
+
"from": "0x8563b504Bf705E870588002bf1e32931cD7Be5E6",
|
|
8
|
+
"contractAddress": "0xa13A3849ea1Ce390890C51AbCDc05ec9b1cfFe14",
|
|
9
|
+
"transactionIndex": 1,
|
|
10
|
+
"gasUsed": "72227",
|
|
11
|
+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
12
|
+
"blockHash": "0x792b053ce3e2365e42a43468dea56b8e2657bd4d3229aa6070bde34715e97bb4",
|
|
13
|
+
"transactionHash": "0x3dd4939510c2ac0f96558df11fc3000c80c69314c9e7c60929c3977184d7d4ab",
|
|
14
|
+
"logs": [],
|
|
15
|
+
"blockNumber": 35437984,
|
|
16
|
+
"cumulativeGasUsed": "72227",
|
|
17
|
+
"status": 1,
|
|
18
|
+
"byzantium": true
|
|
19
|
+
},
|
|
20
|
+
"args": [],
|
|
21
|
+
"numDeployments": 1,
|
|
22
|
+
"solcInputHash": "05099c960904a3822f80e7570ab1e13b",
|
|
23
|
+
"metadata": "{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Library which handles staking rewards.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/peripheral/rewarder/lib/RewardLib.sol\":\"RewardLib\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":5000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"src/peripheral/rewarder/interfaces/IMultiRewarder.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity ^0.8.22;\\n\\nimport { IRewarder, IERC20 } from \\\"./IRewarder.sol\\\";\\n\\n// @dev This is an internal struct, placed here as its shared between multiple libraries.\\nstruct RewardPool {\\n uint256 accRewardPerShare;\\n address rewardToken;\\n uint48 lastRewardTime;\\n uint48 allocPoints;\\n IERC20 stakingToken;\\n bool removed;\\n mapping(address => uint256) rewardDebt;\\n}\\n\\n/// @notice A rewarder that can distribute multiple reward tokens (ERC20 and native) to `StargateStaking` pools.\\n/// @dev The native token is encoded as 0x0.\\ninterface IMultiRewarder is IRewarder {\\n struct RewardDetails {\\n uint256 rewardPerSec;\\n uint160 totalAllocPoints;\\n uint48 start;\\n uint48 end;\\n bool exists;\\n }\\n\\n /// @notice MultiRewarder renounce ownership is disabled.\\n error MultiRewarderRenounceOwnershipDisabled();\\n\\n /// @notice This token is not registered via `setReward` yet, register it first.\\n error MultiRewarderUnregisteredToken(address token);\\n /**\\n * @notice Due to various functions looping over the staking tokens connected to a reward token,\\n * a maximum number of such links is instated.\\n */\\n error MultiRewarderMaxPoolsForRewardToken();\\n /**\\n * @notice Due to various functions looping over the reward tokens connected to a staking token,\\n * a maximum number of such links is instated.\\n */\\n error MultiRewarderMaxActiveRewardTokens();\\n /// @notice The function can only be called while the pool hasn't ended yet.\\n error MultiRewarderPoolFinished(address rewardToken);\\n /// @notice The pool emission duration cannot be set to zero, as this would cause the rewards to be voided.\\n error MultiRewarderZeroDuration();\\n /// @notice The pool start time cannot be set in the past, as this would cause the rewards to be voided.\\n error MultiRewarderStartInPast(uint256 start);\\n /**\\n * @notice The recipient failed to handle the receipt of the native tokens, do they have a receipt hook?\\n * If not, use `emergencyWithdraw`.\\n */\\n error MultiRewarderNativeTransferFailed(address to, uint256 amount);\\n /**\\n * @notice A wrong `msg.value` was provided while setting a native reward, make sure it matches the function\\n * `amount`.\\n */\\n error MultiRewarderIncorrectNative(uint256 expected, uint256 actual);\\n /**\\n * @notice Due to a zero input or rounding, the reward rate while setting this pool would be zero,\\n * which is not allowed.\\n */\\n error MultiRewarderZeroRewardRate();\\n\\n /// @notice Emitted when additional rewards were added to a pool, extending the reward duration.\\n event RewardExtended(address indexed rewardToken, uint256 amountAdded, uint48 newEnd);\\n /**\\n * @notice Emitted when a reward token has been registered. Can be emitted again for the same token after it has\\n * been explicitly stopped.\\n */\\n event RewardRegistrered(address indexed rewardToken);\\n /// @notice Emitted when the reward pool has been adjusted or intialized, with the new params.\\n event RewardSet(\\n address indexed rewardToken,\\n uint256 amountAdded,\\n uint256 amountPeriod,\\n uint48 start,\\n uint48 duration\\n );\\n /// @notice Emitted whenever rewards are claimed via the staking pool.\\n event RewardsClaimed(address indexed user, address[] rewardTokens, uint256[] amounts);\\n /**\\n * @notice Emitted whenever a new staking pool combination was registered via the allocation point adjustment\\n * function.\\n */\\n event PoolRegistered(address indexed rewardToken, IERC20 indexed stakeToken);\\n /// @notice Emitted when the owner adjusts the allocation points for pools.\\n event AllocPointsSet(address indexed rewardToken, IERC20[] indexed stakeToken, uint48[] allocPoint);\\n\\n /**\\n * @notice Sets the reward for `rewards` of `rewardToken` over `duration` seconds, starting at `start`. The actual\\n * reward over this period will be increased by any rewards on the pool that haven't been distributed yet.\\n */\\n function setReward(address rewardToken, uint256 rewards, uint48 start, uint48 duration) external payable;\\n /**\\n * @notice Extends the reward duration for `rewardToken` by `amount` tokens, extending the duration by the\\n * equivalent time according to the `rewardPerSec` rate of the pool.\\n */\\n function extendReward(address rewardToken, uint256 amount) external payable;\\n /**\\n * @notice Configures allocation points for a reward token over multiple staking tokens, setting the `allocPoints`\\n * for each `stakingTokens` and updating the `totalAllocPoint` for the `rewardToken`. The allocation\\n * points of any non-provided staking tokens will be left as-is, and won't be reset to zero.\\n */\\n function setAllocPoints(\\n address rewardToken,\\n IERC20[] calldata stakingTokens,\\n uint48[] calldata allocPoints\\n ) external;\\n /**\\n * @notice Unregisters a reward token fully, immediately preventing users from ever harvesting their pending\\n * accumulated rewards. Optionally `pullTokens` can be set to false which causes the token balance to\\n * not be sent to the owner, this should only be set to false in case the token is bugged and reverts.\\n */\\n function stopReward(address rewardToken, address receiver, bool pullTokens) external;\\n\\n /**\\n * @notice Returns the reward pools linked to the `stakingToken` alongside the pending rewards for `user`\\n * for these pools.\\n */\\n function getRewards(IERC20 stakingToken, address user) external view returns (address[] memory, uint256[] memory);\\n\\n /// @notice Returns the allocation points for the `rewardToken` over all staking tokens linked to it.\\n function allocPointsByReward(\\n address rewardToken\\n ) external view returns (IERC20[] memory stakingTokens, uint48[] memory allocPoints);\\n /// @notice Returns the allocation points for the `stakingToken` over all reward tokens linked to it.\\n function allocPointsByStake(\\n IERC20 stakingToken\\n ) external view returns (address[] memory rewardTokens, uint48[] memory allocPoints);\\n\\n /// @notice Returns all enabled reward tokens. Stopped reward tokens are not included, while ended rewards are.\\n function rewardTokens() external view returns (address[] memory);\\n /// @notice Returns the emission details of a `rewardToken`, configured via `setReward`.\\n function rewardDetails(address rewardToken) external view returns (RewardDetails memory);\\n}\\n\",\"keccak256\":\"0x19c4cd9d79d55fb01298b15d0c376397af89176ff338bb1f58c5d039c2a6d9cd\",\"license\":\"BUSL-1.1\"},\"src/peripheral/rewarder/interfaces/IRewarder.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity ^0.8.22;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @notice A rewarder is connected to the staking contract and distributes rewards whenever the staking contract\\n * updates the rewarder.\\n */\\ninterface IRewarder {\\n /**\\n * @notice This function is only callable by the staking contract.\\n */\\n error MultiRewarderUnauthorizedCaller(address caller);\\n /**\\n * @notice The rewarder cannot be reconnected to the same staking token as it would cause wrongful reward\\n * attribution through reconfiguration.\\n */\\n error RewarderAlreadyConnected(IERC20 stakingToken);\\n\\n /**\\n * @notice Emitted when the rewarder is connected to a staking token.\\n */\\n event RewarderConnected(IERC20 indexed stakingToken);\\n\\n /**\\n * @notice Informs the rewarder of an update in the staking contract, such as a deposit, withdraw or claim.\\n * @dev Emergency withdrawals draw the balance of a user to 0, and DO NOT call `onUpdate`.\\n * The rewarder logic must keep this in mind!\\n */\\n function onUpdate(IERC20 token, address user, uint256 oldStake, uint256 oldSupply, uint256 newStake) external;\\n\\n /**\\n * @notice Called by the staking contract whenever this rewarder is connected to a staking token in the staking\\n * contract. Should only be callable once per staking token to avoid wrongful reward attribution through\\n * reconfiguration.\\n */\\n function connect(IERC20 stakingToken) external;\\n}\\n\",\"keccak256\":\"0x8a190dc01c20581529de7fe951f33133e948d97de73295ac7fcfc294f5b48420\",\"license\":\"BUSL-1.1\"},\"src/peripheral/rewarder/lib/RewardLib.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity ^0.8.22;\\n\\nimport { IMultiRewarder, RewardPool } from \\\"../interfaces/IMultiRewarder.sol\\\";\\n\\n/// @dev Library which handles staking rewards.\\nlibrary RewardLib {\\n uint256 private constant PRECISION = 10 ** 24;\\n\\n function indexAndUpdate(\\n RewardPool storage pool,\\n IMultiRewarder.RewardDetails storage rewardDetails,\\n address user,\\n uint256 oldStake,\\n uint256 totalSupply\\n ) internal returns (uint256) {\\n uint256 accRewardPerShare = index(pool, rewardDetails, totalSupply);\\n return update(pool, user, oldStake, accRewardPerShare);\\n }\\n\\n function update(\\n RewardPool storage pool,\\n address user,\\n uint256 oldStake,\\n uint256 accRewardPerShare\\n ) internal returns (uint256) {\\n uint256 rewardsForUser = ((accRewardPerShare - pool.rewardDebt[user]) * oldStake) / PRECISION;\\n pool.rewardDebt[user] = accRewardPerShare;\\n return rewardsForUser;\\n }\\n\\n function index(\\n RewardPool storage pool,\\n IMultiRewarder.RewardDetails storage rewardDetails,\\n uint256 totalSupply\\n ) internal returns (uint256 accRewardPerShare) {\\n accRewardPerShare = _index(pool, rewardDetails, totalSupply);\\n pool.accRewardPerShare = accRewardPerShare;\\n pool.lastRewardTime = uint32(block.timestamp);\\n }\\n\\n function _index(\\n RewardPool storage pool,\\n IMultiRewarder.RewardDetails storage rewardDetails,\\n uint256 totalSupply\\n ) internal view returns (uint256) {\\n // max(start, lastRewardTime)\\n uint256 start = rewardDetails.start > pool.lastRewardTime ? rewardDetails.start : pool.lastRewardTime;\\n // min(end, now)\\n uint256 end = rewardDetails.end < block.timestamp ? rewardDetails.end : block.timestamp;\\n if (start >= end || totalSupply == 0 || rewardDetails.totalAllocPoints == 0) {\\n return pool.accRewardPerShare;\\n }\\n\\n return\\n (rewardDetails.rewardPerSec * (end - start) * pool.allocPoints * PRECISION) /\\n rewardDetails.totalAllocPoints /\\n totalSupply +\\n pool.accRewardPerShare;\\n }\\n\\n function getRewards(\\n RewardPool storage pool,\\n IMultiRewarder.RewardDetails storage rewardDetails,\\n address user,\\n uint256 oldStake,\\n uint256 oldSupply\\n ) internal view returns (uint256) {\\n uint256 accRewardPerShare = _index(pool, rewardDetails, oldSupply);\\n return ((accRewardPerShare - pool.rewardDebt[user]) * oldStake) / PRECISION;\\n }\\n}\\n\",\"keccak256\":\"0x132b2721199fbe9357800109b0dce10b752815782257bb21628cde79c36448fd\",\"license\":\"BUSL-1.1\"}},\"version\":1}",
|
|
24
|
+
"bytecode": "0x60566037600b82828239805160001a607314602a57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122077fa1627dc544ec4f150b6ef171a69d2a033c1df0dd2c43659b8ea223cb00df564736f6c63430008160033",
|
|
25
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122077fa1627dc544ec4f150b6ef171a69d2a033c1df0dd2c43659b8ea223cb00df564736f6c63430008160033",
|
|
26
|
+
"devdoc": {
|
|
27
|
+
"details": "Library which handles staking rewards.",
|
|
28
|
+
"kind": "dev",
|
|
29
|
+
"methods": {},
|
|
30
|
+
"version": 1
|
|
31
|
+
},
|
|
32
|
+
"userdoc": {
|
|
33
|
+
"kind": "user",
|
|
34
|
+
"methods": {},
|
|
35
|
+
"version": 1
|
|
36
|
+
},
|
|
37
|
+
"storageLayout": {
|
|
38
|
+
"storage": [],
|
|
39
|
+
"types": null
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"address": "0x141bEFDb521A83079042126c8775582C6E4C45d8",
|
|
3
|
+
"abi": [],
|
|
4
|
+
"transactionHash": "0xd5db867f790020e5301d13db9efc56e68f6c424d146533d04abe29ca21b5f7e8",
|
|
5
|
+
"receipt": {
|
|
6
|
+
"to": null,
|
|
7
|
+
"from": "0x8563b504Bf705E870588002bf1e32931cD7Be5E6",
|
|
8
|
+
"contractAddress": "0x141bEFDb521A83079042126c8775582C6E4C45d8",
|
|
9
|
+
"transactionIndex": 3,
|
|
10
|
+
"gasUsed": "404056",
|
|
11
|
+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
|
|
12
|
+
"blockHash": "0x4f205e75207226328ccdc97a7358c9a6d78bce400021b852a9dca789ec7a8077",
|
|
13
|
+
"transactionHash": "0xd5db867f790020e5301d13db9efc56e68f6c424d146533d04abe29ca21b5f7e8",
|
|
14
|
+
"logs": [],
|
|
15
|
+
"blockNumber": 35439647,
|
|
16
|
+
"cumulativeGasUsed": "664483",
|
|
17
|
+
"status": 1,
|
|
18
|
+
"byzantium": true
|
|
19
|
+
},
|
|
20
|
+
"args": [],
|
|
21
|
+
"numDeployments": 1,
|
|
22
|
+
"solcInputHash": "05099c960904a3822f80e7570ab1e13b",
|
|
23
|
+
"metadata": "{\"compiler\":{\"version\":\"0.8.22+commit.4fc1097e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"Library for staking pool logic.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/peripheral/rewarder/lib/RewardRegistryLib.sol\":\"RewardRegistryLib\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":5000},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\\n}\\n\",\"keccak256\":\"0x287b55befed2961a7eabd7d7b1b2839cbca8a5b80ef8dcbb25ed3d4c2002c305\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.9.0) (utils/structs/EnumerableSet.sol)\\n// This file was procedurally generated from scripts/generate/templates/EnumerableSet.js.\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for managing\\n * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive\\n * types.\\n *\\n * Sets have the following properties:\\n *\\n * - Elements are added, removed, and checked for existence in constant time\\n * (O(1)).\\n * - Elements are enumerated in O(n). No guarantees are made on the ordering.\\n *\\n * ```solidity\\n * contract Example {\\n * // Add the library methods\\n * using EnumerableSet for EnumerableSet.AddressSet;\\n *\\n * // Declare a set state variable\\n * EnumerableSet.AddressSet private mySet;\\n * }\\n * ```\\n *\\n * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)\\n * and `uint256` (`UintSet`) are supported.\\n *\\n * [WARNING]\\n * ====\\n * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure\\n * unusable.\\n * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info.\\n *\\n * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an\\n * array of EnumerableSet.\\n * ====\\n */\\nlibrary EnumerableSet {\\n // To implement this library for multiple types with as little code\\n // repetition as possible, we write it in terms of a generic Set type with\\n // bytes32 values.\\n // The Set implementation uses private functions, and user-facing\\n // implementations (such as AddressSet) are just wrappers around the\\n // underlying Set.\\n // This means that we can only create new EnumerableSets for types that fit\\n // in bytes32.\\n\\n struct Set {\\n // Storage of set values\\n bytes32[] _values;\\n // Position of the value in the `values` array, plus 1 because index 0\\n // means a value is not in the set.\\n mapping(bytes32 => uint256) _indexes;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function _add(Set storage set, bytes32 value) private returns (bool) {\\n if (!_contains(set, value)) {\\n set._values.push(value);\\n // The value is stored at length-1, but we add 1 to all indexes\\n // and use 0 as a sentinel value\\n set._indexes[value] = set._values.length;\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function _remove(Set storage set, bytes32 value) private returns (bool) {\\n // We read and store the value's index to prevent multiple reads from the same storage slot\\n uint256 valueIndex = set._indexes[value];\\n\\n if (valueIndex != 0) {\\n // Equivalent to contains(set, value)\\n // To delete an element from the _values array in O(1), we swap the element to delete with the last one in\\n // the array, and then remove the last element (sometimes called as 'swap and pop').\\n // This modifies the order of the array, as noted in {at}.\\n\\n uint256 toDeleteIndex = valueIndex - 1;\\n uint256 lastIndex = set._values.length - 1;\\n\\n if (lastIndex != toDeleteIndex) {\\n bytes32 lastValue = set._values[lastIndex];\\n\\n // Move the last value to the index where the value to delete is\\n set._values[toDeleteIndex] = lastValue;\\n // Update the index for the moved value\\n set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex\\n }\\n\\n // Delete the slot where the moved value was stored\\n set._values.pop();\\n\\n // Delete the index for the deleted slot\\n delete set._indexes[value];\\n\\n return true;\\n } else {\\n return false;\\n }\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function _contains(Set storage set, bytes32 value) private view returns (bool) {\\n return set._indexes[value] != 0;\\n }\\n\\n /**\\n * @dev Returns the number of values on the set. O(1).\\n */\\n function _length(Set storage set) private view returns (uint256) {\\n return set._values.length;\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function _at(Set storage set, uint256 index) private view returns (bytes32) {\\n return set._values[index];\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function _values(Set storage set) private view returns (bytes32[] memory) {\\n return set._values;\\n }\\n\\n // Bytes32Set\\n\\n struct Bytes32Set {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _add(set._inner, value);\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {\\n return _remove(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {\\n return _contains(set._inner, value);\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(Bytes32Set storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {\\n return _at(set._inner, index);\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n bytes32[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // AddressSet\\n\\n struct AddressSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(AddressSet storage set, address value) internal returns (bool) {\\n return _add(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(AddressSet storage set, address value) internal returns (bool) {\\n return _remove(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(AddressSet storage set, address value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(uint256(uint160(value))));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(AddressSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(AddressSet storage set, uint256 index) internal view returns (address) {\\n return address(uint160(uint256(_at(set._inner, index))));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(AddressSet storage set) internal view returns (address[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n address[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n\\n // UintSet\\n\\n struct UintSet {\\n Set _inner;\\n }\\n\\n /**\\n * @dev Add a value to a set. O(1).\\n *\\n * Returns true if the value was added to the set, that is if it was not\\n * already present.\\n */\\n function add(UintSet storage set, uint256 value) internal returns (bool) {\\n return _add(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Removes a value from a set. O(1).\\n *\\n * Returns true if the value was removed from the set, that is if it was\\n * present.\\n */\\n function remove(UintSet storage set, uint256 value) internal returns (bool) {\\n return _remove(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns true if the value is in the set. O(1).\\n */\\n function contains(UintSet storage set, uint256 value) internal view returns (bool) {\\n return _contains(set._inner, bytes32(value));\\n }\\n\\n /**\\n * @dev Returns the number of values in the set. O(1).\\n */\\n function length(UintSet storage set) internal view returns (uint256) {\\n return _length(set._inner);\\n }\\n\\n /**\\n * @dev Returns the value stored at position `index` in the set. O(1).\\n *\\n * Note that there are no guarantees on the ordering of values inside the\\n * array, and it may change when more values are added or removed.\\n *\\n * Requirements:\\n *\\n * - `index` must be strictly less than {length}.\\n */\\n function at(UintSet storage set, uint256 index) internal view returns (uint256) {\\n return uint256(_at(set._inner, index));\\n }\\n\\n /**\\n * @dev Return the entire set in an array\\n *\\n * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed\\n * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that\\n * this function has an unbounded cost, and using it as part of a state-changing function may render the function\\n * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.\\n */\\n function values(UintSet storage set) internal view returns (uint256[] memory) {\\n bytes32[] memory store = _values(set._inner);\\n uint256[] memory result;\\n\\n /// @solidity memory-safe-assembly\\n assembly {\\n result := store\\n }\\n\\n return result;\\n }\\n}\\n\",\"keccak256\":\"0x9f4357008a8f7d8c8bf5d48902e789637538d8c016be5766610901b4bba81514\",\"license\":\"MIT\"},\"src/peripheral/rewarder/interfaces/IMultiRewarder.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity ^0.8.22;\\n\\nimport { IRewarder, IERC20 } from \\\"./IRewarder.sol\\\";\\n\\n// @dev This is an internal struct, placed here as its shared between multiple libraries.\\nstruct RewardPool {\\n uint256 accRewardPerShare;\\n address rewardToken;\\n uint48 lastRewardTime;\\n uint48 allocPoints;\\n IERC20 stakingToken;\\n bool removed;\\n mapping(address => uint256) rewardDebt;\\n}\\n\\n/// @notice A rewarder that can distribute multiple reward tokens (ERC20 and native) to `StargateStaking` pools.\\n/// @dev The native token is encoded as 0x0.\\ninterface IMultiRewarder is IRewarder {\\n struct RewardDetails {\\n uint256 rewardPerSec;\\n uint160 totalAllocPoints;\\n uint48 start;\\n uint48 end;\\n bool exists;\\n }\\n\\n /// @notice MultiRewarder renounce ownership is disabled.\\n error MultiRewarderRenounceOwnershipDisabled();\\n\\n /// @notice This token is not registered via `setReward` yet, register it first.\\n error MultiRewarderUnregisteredToken(address token);\\n /**\\n * @notice Due to various functions looping over the staking tokens connected to a reward token,\\n * a maximum number of such links is instated.\\n */\\n error MultiRewarderMaxPoolsForRewardToken();\\n /**\\n * @notice Due to various functions looping over the reward tokens connected to a staking token,\\n * a maximum number of such links is instated.\\n */\\n error MultiRewarderMaxActiveRewardTokens();\\n /// @notice The function can only be called while the pool hasn't ended yet.\\n error MultiRewarderPoolFinished(address rewardToken);\\n /// @notice The pool emission duration cannot be set to zero, as this would cause the rewards to be voided.\\n error MultiRewarderZeroDuration();\\n /// @notice The pool start time cannot be set in the past, as this would cause the rewards to be voided.\\n error MultiRewarderStartInPast(uint256 start);\\n /**\\n * @notice The recipient failed to handle the receipt of the native tokens, do they have a receipt hook?\\n * If not, use `emergencyWithdraw`.\\n */\\n error MultiRewarderNativeTransferFailed(address to, uint256 amount);\\n /**\\n * @notice A wrong `msg.value` was provided while setting a native reward, make sure it matches the function\\n * `amount`.\\n */\\n error MultiRewarderIncorrectNative(uint256 expected, uint256 actual);\\n /**\\n * @notice Due to a zero input or rounding, the reward rate while setting this pool would be zero,\\n * which is not allowed.\\n */\\n error MultiRewarderZeroRewardRate();\\n\\n /// @notice Emitted when additional rewards were added to a pool, extending the reward duration.\\n event RewardExtended(address indexed rewardToken, uint256 amountAdded, uint48 newEnd);\\n /**\\n * @notice Emitted when a reward token has been registered. Can be emitted again for the same token after it has\\n * been explicitly stopped.\\n */\\n event RewardRegistrered(address indexed rewardToken);\\n /// @notice Emitted when the reward pool has been adjusted or intialized, with the new params.\\n event RewardSet(\\n address indexed rewardToken,\\n uint256 amountAdded,\\n uint256 amountPeriod,\\n uint48 start,\\n uint48 duration\\n );\\n /// @notice Emitted whenever rewards are claimed via the staking pool.\\n event RewardsClaimed(address indexed user, address[] rewardTokens, uint256[] amounts);\\n /**\\n * @notice Emitted whenever a new staking pool combination was registered via the allocation point adjustment\\n * function.\\n */\\n event PoolRegistered(address indexed rewardToken, IERC20 indexed stakeToken);\\n /// @notice Emitted when the owner adjusts the allocation points for pools.\\n event AllocPointsSet(address indexed rewardToken, IERC20[] indexed stakeToken, uint48[] allocPoint);\\n\\n /**\\n * @notice Sets the reward for `rewards` of `rewardToken` over `duration` seconds, starting at `start`. The actual\\n * reward over this period will be increased by any rewards on the pool that haven't been distributed yet.\\n */\\n function setReward(address rewardToken, uint256 rewards, uint48 start, uint48 duration) external payable;\\n /**\\n * @notice Extends the reward duration for `rewardToken` by `amount` tokens, extending the duration by the\\n * equivalent time according to the `rewardPerSec` rate of the pool.\\n */\\n function extendReward(address rewardToken, uint256 amount) external payable;\\n /**\\n * @notice Configures allocation points for a reward token over multiple staking tokens, setting the `allocPoints`\\n * for each `stakingTokens` and updating the `totalAllocPoint` for the `rewardToken`. The allocation\\n * points of any non-provided staking tokens will be left as-is, and won't be reset to zero.\\n */\\n function setAllocPoints(\\n address rewardToken,\\n IERC20[] calldata stakingTokens,\\n uint48[] calldata allocPoints\\n ) external;\\n /**\\n * @notice Unregisters a reward token fully, immediately preventing users from ever harvesting their pending\\n * accumulated rewards. Optionally `pullTokens` can be set to false which causes the token balance to\\n * not be sent to the owner, this should only be set to false in case the token is bugged and reverts.\\n */\\n function stopReward(address rewardToken, address receiver, bool pullTokens) external;\\n\\n /**\\n * @notice Returns the reward pools linked to the `stakingToken` alongside the pending rewards for `user`\\n * for these pools.\\n */\\n function getRewards(IERC20 stakingToken, address user) external view returns (address[] memory, uint256[] memory);\\n\\n /// @notice Returns the allocation points for the `rewardToken` over all staking tokens linked to it.\\n function allocPointsByReward(\\n address rewardToken\\n ) external view returns (IERC20[] memory stakingTokens, uint48[] memory allocPoints);\\n /// @notice Returns the allocation points for the `stakingToken` over all reward tokens linked to it.\\n function allocPointsByStake(\\n IERC20 stakingToken\\n ) external view returns (address[] memory rewardTokens, uint48[] memory allocPoints);\\n\\n /// @notice Returns all enabled reward tokens. Stopped reward tokens are not included, while ended rewards are.\\n function rewardTokens() external view returns (address[] memory);\\n /// @notice Returns the emission details of a `rewardToken`, configured via `setReward`.\\n function rewardDetails(address rewardToken) external view returns (RewardDetails memory);\\n}\\n\",\"keccak256\":\"0x19c4cd9d79d55fb01298b15d0c376397af89176ff338bb1f58c5d039c2a6d9cd\",\"license\":\"BUSL-1.1\"},\"src/peripheral/rewarder/interfaces/IRewarder.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity ^0.8.22;\\n\\nimport { IERC20 } from \\\"@openzeppelin/contracts/token/ERC20/IERC20.sol\\\";\\n\\n/**\\n * @notice A rewarder is connected to the staking contract and distributes rewards whenever the staking contract\\n * updates the rewarder.\\n */\\ninterface IRewarder {\\n /**\\n * @notice This function is only callable by the staking contract.\\n */\\n error MultiRewarderUnauthorizedCaller(address caller);\\n /**\\n * @notice The rewarder cannot be reconnected to the same staking token as it would cause wrongful reward\\n * attribution through reconfiguration.\\n */\\n error RewarderAlreadyConnected(IERC20 stakingToken);\\n\\n /**\\n * @notice Emitted when the rewarder is connected to a staking token.\\n */\\n event RewarderConnected(IERC20 indexed stakingToken);\\n\\n /**\\n * @notice Informs the rewarder of an update in the staking contract, such as a deposit, withdraw or claim.\\n * @dev Emergency withdrawals draw the balance of a user to 0, and DO NOT call `onUpdate`.\\n * The rewarder logic must keep this in mind!\\n */\\n function onUpdate(IERC20 token, address user, uint256 oldStake, uint256 oldSupply, uint256 newStake) external;\\n\\n /**\\n * @notice Called by the staking contract whenever this rewarder is connected to a staking token in the staking\\n * contract. Should only be callable once per staking token to avoid wrongful reward attribution through\\n * reconfiguration.\\n */\\n function connect(IERC20 stakingToken) external;\\n}\\n\",\"keccak256\":\"0x8a190dc01c20581529de7fe951f33133e948d97de73295ac7fcfc294f5b48420\",\"license\":\"BUSL-1.1\"},\"src/peripheral/rewarder/lib/RewardRegistryLib.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity ^0.8.22;\\n\\nimport { EnumerableSet } from \\\"@openzeppelin/contracts/utils/structs/EnumerableSet.sol\\\";\\n\\nimport { IMultiRewarder, RewardPool, IERC20 } from \\\"../interfaces/IMultiRewarder.sol\\\";\\n\\n/// @dev Internal representation for a staking pool.\\nstruct RewardRegistry {\\n uint256 rewardIdCount;\\n mapping(uint256 => RewardPool) pools;\\n mapping(address rewardToken => EnumerableSet.UintSet) byReward;\\n mapping(IERC20 stakingToken => EnumerableSet.UintSet) byStake;\\n mapping(address rewardToken => mapping(IERC20 stakingToken => uint256)) byRewardAndStake;\\n mapping(address rewardToken => IMultiRewarder.RewardDetails) rewardDetails;\\n EnumerableSet.AddressSet rewardTokens;\\n}\\n\\n/// @dev Library for staking pool logic.\\nlibrary RewardRegistryLib {\\n using EnumerableSet for EnumerableSet.UintSet;\\n using EnumerableSet for EnumerableSet.AddressSet;\\n\\n uint256 private constant MAX_ACTIVE_POOLS_PER_REWARD = 100;\\n uint256 private constant MAX_ACTIVE_REWARD_TOKENS = 100;\\n\\n //** REGISTRY ADJUSTMENTS **/\\n function getOrCreateRewardDetails(\\n RewardRegistry storage self,\\n address rewardToken\\n ) internal returns (IMultiRewarder.RewardDetails storage reward) {\\n reward = self.rewardDetails[rewardToken];\\n if (!reward.exists) {\\n if (self.rewardTokens.length() >= MAX_ACTIVE_REWARD_TOKENS) {\\n revert IMultiRewarder.MultiRewarderMaxActiveRewardTokens();\\n }\\n reward.exists = true;\\n self.rewardTokens.add(rewardToken);\\n emit IMultiRewarder.RewardRegistrered(rewardToken);\\n }\\n }\\n\\n function getOrCreatePoolId(\\n RewardRegistry storage self,\\n address reward,\\n IERC20 stake\\n ) internal returns (uint256 poolId) {\\n poolId = self.byRewardAndStake[reward][stake];\\n if (poolId == 0) {\\n if (self.byReward[reward].length() >= MAX_ACTIVE_POOLS_PER_REWARD) {\\n revert IMultiRewarder.MultiRewarderMaxPoolsForRewardToken();\\n }\\n poolId = ++self.rewardIdCount; // Start at 1\\n self.byRewardAndStake[reward][stake] = poolId;\\n self.byReward[reward].add(poolId);\\n self.byStake[stake].add(poolId);\\n self.pools[poolId].rewardToken = reward;\\n self.pools[poolId].stakingToken = stake;\\n self.pools[poolId].lastRewardTime = uint48(block.timestamp);\\n\\n emit IMultiRewarder.PoolRegistered(reward, stake);\\n }\\n }\\n\\n function removeReward(RewardRegistry storage self, address rewardToken) internal {\\n if (!self.rewardDetails[rewardToken].exists) revert IMultiRewarder.MultiRewarderUnregisteredToken(rewardToken);\\n uint256[] memory ids = self.byReward[rewardToken].values();\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n IERC20 stakingToken = self.pools[id].stakingToken;\\n\\n self.byStake[stakingToken].remove(id);\\n self.byReward[rewardToken].remove(id);\\n self.byRewardAndStake[rewardToken][stakingToken] = 0;\\n self.pools[id].removed = true;\\n }\\n self.rewardTokens.remove(rewardToken);\\n delete self.rewardDetails[rewardToken];\\n }\\n\\n function setAllocPoints(\\n RewardRegistry storage self,\\n address rewardToken,\\n IERC20[] calldata stakingTokens,\\n uint48[] calldata allocPoints\\n ) internal {\\n IMultiRewarder.RewardDetails storage reward = self.rewardDetails[rewardToken];\\n uint160 totalSubtract;\\n uint160 totalAdd;\\n uint256 length = stakingTokens.length;\\n for (uint256 i = 0; i < length; i++) {\\n uint256 id = getOrCreatePoolId(self, rewardToken, stakingTokens[i]);\\n totalSubtract += self.pools[id].allocPoints;\\n totalAdd += allocPoints[i];\\n self.pools[id].allocPoints = allocPoints[i];\\n }\\n\\n reward.totalAllocPoints = reward.totalAllocPoints + totalAdd - totalSubtract;\\n }\\n\\n //** VIEW FUNCTIONS **/\\n\\n function allocPointsByReward(\\n RewardRegistry storage self,\\n address rewardToken\\n ) external view returns (IERC20[] memory stakingTokens, uint48[] memory allocPoints) {\\n uint256[] memory ids = self.byReward[rewardToken].values();\\n stakingTokens = new IERC20[](ids.length);\\n allocPoints = new uint48[](ids.length);\\n for (uint256 i = 0; i < ids.length; i++) {\\n stakingTokens[i] = self.pools[ids[i]].stakingToken;\\n allocPoints[i] = self.pools[ids[i]].allocPoints;\\n }\\n }\\n\\n function allocPointsByStake(\\n RewardRegistry storage self,\\n IERC20 stakingToken\\n ) external view returns (address[] memory rewardTokens, uint48[] memory allocPoints) {\\n uint256[] memory ids = self.byStake[stakingToken].values();\\n rewardTokens = new address[](ids.length);\\n allocPoints = new uint48[](ids.length);\\n for (uint256 i = 0; i < ids.length; i++) {\\n rewardTokens[i] = self.pools[ids[i]].rewardToken;\\n allocPoints[i] = self.pools[ids[i]].allocPoints;\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfd250353a77bf811effb0e35ac929509364b21410ba89b4c9a3b2eb38a3085b8\",\"license\":\"BUSL-1.1\"}},\"version\":1}",
|
|
24
|
+
"bytecode": "0x61065a61003a600b82828239805160001a60731461002d57634e487b7160e01b600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c80631ad197ea14610045578063b05548e51461006f575b600080fd5b6100586100533660046104e4565b610082565b604051610066929190610558565b60405180910390f35b61005861007d3660046104e4565b61026d565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600383016020526040812060609182916100b79061044f565b9050805167ffffffffffffffff8111156100d3576100d36105c6565b6040519080825280602002602001820160405280156100fc578160200160208202803683370190505b509250805167ffffffffffffffff811115610119576101196105c6565b604051908082528060200260200182016040528015610142578160200160208202803683370190505b50915060005b815181101561026457856001016000838381518110610169576101696105f5565b6020026020010151815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168482815181106101b5576101b56105f5565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050856001016000838381518110610207576102076105f5565b60200260200101518152602001908152602001600020600101601a9054906101000a900465ffffffffffff16838281518110610245576102456105f5565b65ffffffffffff90921660209283029190910190910152600101610148565b50509250929050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600283016020526040812060609182916102a29061044f565b9050805167ffffffffffffffff8111156102be576102be6105c6565b6040519080825280602002602001820160405280156102e7578160200160208202803683370190505b509250805167ffffffffffffffff811115610304576103046105c6565b60405190808252806020026020018201604052801561032d578160200160208202803683370190505b50915060005b815181101561026457856001016000838381518110610354576103546105f5565b6020026020010151815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168482815181106103a0576103a06105f5565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508560010160008383815181106103f2576103f26105f5565b60200260200101518152602001908152602001600020600101601a9054906101000a900465ffffffffffff16838281518110610430576104306105f5565b65ffffffffffff90921660209283029190910190910152600101610333565b6060600061045c83610463565b9392505050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156104b357602002820191906000526020600020905b81548152602001906001019080831161049f575b50505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811681146104e157600080fd5b50565b600080604083850312156104f757600080fd5b823591506020830135610509816104bf565b809150509250929050565b60008151808452602080850194506020840160005b8381101561054d57815165ffffffffffff1687529582019590820190600101610529565b509495945050505050565b604080825283519082018190526000906020906060840190828701845b828110156105a757815173ffffffffffffffffffffffffffffffffffffffff1684529284019290840190600101610575565b50505083810360208501526105bc8186610514565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea2646970667358221220e5501b8518a73c777e0b1047c17624a042bc203e3f7ef37684bf1325bba6950a64736f6c63430008160033",
|
|
25
|
+
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600436106100405760003560e01c80631ad197ea14610045578063b05548e51461006f575b600080fd5b6100586100533660046104e4565b610082565b604051610066929190610558565b60405180910390f35b61005861007d3660046104e4565b61026d565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600383016020526040812060609182916100b79061044f565b9050805167ffffffffffffffff8111156100d3576100d36105c6565b6040519080825280602002602001820160405280156100fc578160200160208202803683370190505b509250805167ffffffffffffffff811115610119576101196105c6565b604051908082528060200260200182016040528015610142578160200160208202803683370190505b50915060005b815181101561026457856001016000838381518110610169576101696105f5565b6020026020010151815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168482815181106101b5576101b56105f5565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050856001016000838381518110610207576102076105f5565b60200260200101518152602001908152602001600020600101601a9054906101000a900465ffffffffffff16838281518110610245576102456105f5565b65ffffffffffff90921660209283029190910190910152600101610148565b50509250929050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600283016020526040812060609182916102a29061044f565b9050805167ffffffffffffffff8111156102be576102be6105c6565b6040519080825280602002602001820160405280156102e7578160200160208202803683370190505b509250805167ffffffffffffffff811115610304576103046105c6565b60405190808252806020026020018201604052801561032d578160200160208202803683370190505b50915060005b815181101561026457856001016000838381518110610354576103546105f5565b6020026020010151815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168482815181106103a0576103a06105f5565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508560010160008383815181106103f2576103f26105f5565b60200260200101518152602001908152602001600020600101601a9054906101000a900465ffffffffffff16838281518110610430576104306105f5565b65ffffffffffff90921660209283029190910190910152600101610333565b6060600061045c83610463565b9392505050565b6060816000018054806020026020016040519081016040528092919081815260200182805480156104b357602002820191906000526020600020905b81548152602001906001019080831161049f575b50505050509050919050565b73ffffffffffffffffffffffffffffffffffffffff811681146104e157600080fd5b50565b600080604083850312156104f757600080fd5b823591506020830135610509816104bf565b809150509250929050565b60008151808452602080850194506020840160005b8381101561054d57815165ffffffffffff1687529582019590820190600101610529565b509495945050505050565b604080825283519082018190526000906020906060840190828701845b828110156105a757815173ffffffffffffffffffffffffffffffffffffffff1684529284019290840190600101610575565b50505083810360208501526105bc8186610514565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fdfea2646970667358221220e5501b8518a73c777e0b1047c17624a042bc203e3f7ef37684bf1325bba6950a64736f6c63430008160033",
|
|
26
|
+
"devdoc": {
|
|
27
|
+
"details": "Library for staking pool logic.",
|
|
28
|
+
"kind": "dev",
|
|
29
|
+
"methods": {},
|
|
30
|
+
"version": 1
|
|
31
|
+
},
|
|
32
|
+
"userdoc": {
|
|
33
|
+
"kind": "user",
|
|
34
|
+
"methods": {},
|
|
35
|
+
"version": 1
|
|
36
|
+
},
|
|
37
|
+
"storageLayout": {
|
|
38
|
+
"storage": [],
|
|
39
|
+
"types": null
|
|
40
|
+
}
|
|
41
|
+
}
|