Source Code
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ConvexSidecarFactory
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;
import {SidecarFactory} from "src/SidecarFactory.sol";
import {IL2Booster} from "@interfaces/convex/IL2Booster.sol";
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
import {ConvexSidecar} from "src/integrations/curve/ConvexSidecar.sol";
/// @title ConvexSidecarFactory
/// @notice Factory contract for deploying ConvexSidecar instances
/// @dev Creates deterministic minimal proxies for ConvexSidecar implementation
contract ConvexSidecarFactory is SidecarFactory {
/// @notice The bytes4 ID of the Convex protocol
/// @dev Used to identify the Convex protocol in the registry
bytes4 private constant CURVE_PROTOCOL_ID = bytes4(keccak256("CURVE"));
/// @notice Convex Booster contract address
address public immutable BOOSTER;
/// @notice Error emitted when the pool is shutdown
error PoolShutdown();
/// @notice Error emitted when the reward receiver is not set
error VaultNotDeployed();
/// @notice Error emitted when the arguments are invalid
error InvalidArguments();
/// @notice Constructor
/// @param _implementation Address of the sidecar implementation
/// @param _protocolController Address of the protocol controller
/// @param _booster Address of the Convex Booster contract
constructor(address _implementation, address _protocolController, address _booster)
SidecarFactory(CURVE_PROTOCOL_ID, _implementation, _protocolController)
{
BOOSTER = _booster;
}
/// @notice Convenience function to create a sidecar with a uint256 pid parameter
/// @param pid Pool ID in Convex
/// @return sidecar Address of the created sidecar
function create(address gauge, uint256 pid) external returns (address sidecar) {
bytes memory args = abi.encode(pid);
return create(gauge, args);
}
/// @notice Validates the gauge and arguments for Convex
/// @param gauge The gauge to validate
/// @param args The arguments containing the pool ID
function _isValidGauge(address gauge, bytes memory args) internal view override {
require(args.length == 32, InvalidArguments());
uint256 pid = abi.decode(args, (uint256));
// Get the pool info from Convex
(, address curveGauge,, bool isShutdown,) = IL2Booster(BOOSTER).poolInfo(pid);
// Ensure the pool is not shutdown
if (isShutdown) revert PoolShutdown();
// Ensure the gauge matches
if (curveGauge != gauge) revert InvalidGauge();
}
/// @notice Creates a ConvexSidecar for a gauge
/// @param gauge The gauge to create a sidecar for
/// @param args The arguments containing the pool ID
/// @return sidecarAddress Address of the created sidecar
function _create(address gauge, bytes memory args) internal override returns (address sidecarAddress) {
uint256 pid = abi.decode(args, (uint256));
// Get the LP token and base reward pool from Convex
(address lpToken,, address baseRewardPool,,) = IL2Booster(BOOSTER).poolInfo(pid);
address rewardReceiver = PROTOCOL_CONTROLLER.rewardReceiver(gauge);
require(rewardReceiver != address(0), VaultNotDeployed());
// Encode the immutable arguments for the clone
bytes memory data = abi.encodePacked(lpToken, rewardReceiver, baseRewardPool, pid);
// Create a deterministic salt based on the arguments
bytes32 salt = keccak256(data);
// Clone the implementation contract
sidecarAddress = Clones.cloneDeterministicWithImmutableArgs(IMPLEMENTATION, data, salt);
// Initialize the sidecar
ConvexSidecar(sidecarAddress).initialize();
// Set the valid allocation target
PROTOCOL_CONTROLLER.setValidAllocationTarget(gauge, sidecarAddress);
return sidecarAddress;
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;
import {ISidecarFactory} from "src/interfaces/ISidecarFactory.sol";
import {IProtocolController} from "src/interfaces/IProtocolController.sol";
/// @title SidecarFactory
/// @notice Base factory contract for deploying protocol-specific sidecar instances
/// @dev Creates deterministic minimal proxies for sidecar implementations
abstract contract SidecarFactory is ISidecarFactory {
/// @notice The protocol ID
bytes4 public immutable PROTOCOL_ID;
/// @notice The protocol controller address
IProtocolController public immutable PROTOCOL_CONTROLLER;
/// @notice The implementation address
address public immutable IMPLEMENTATION;
/// @notice Mapping of gauges to sidecars
mapping(address => address) public sidecar;
/// @notice Error emitted when the gauge is invalid
error InvalidGauge();
/// @notice Error emitted when the token is invalid
error InvalidToken();
/// @notice Error emitted when a zero address is provided
error ZeroAddress();
/// @notice Error emitted when a protocol ID is zero
error InvalidProtocolId();
/// @notice Error emitted when the sidecar is already deployed
error SidecarAlreadyDeployed();
/// @notice Event emitted when a new sidecar is created
/// @param gauge Address of the gauge
/// @param sidecar Address of the created sidecar
/// @param args Additional arguments used for creation
event SidecarCreated(address indexed gauge, address indexed sidecar, bytes args);
/// @notice Constructor
/// @param _implementation Address of the sidecar implementation
/// @param _protocolController Address of the protocol controller
/// @param _protocolId Protocol ID
constructor(bytes4 _protocolId, address _implementation, address _protocolController) {
require(_implementation != address(0) && _protocolController != address(0), ZeroAddress());
require(_protocolId != bytes4(0), InvalidProtocolId());
PROTOCOL_ID = _protocolId;
IMPLEMENTATION = _implementation;
PROTOCOL_CONTROLLER = IProtocolController(_protocolController);
}
/// @notice Create a new sidecar for a gauge
/// @param gauge Gauge address
/// @param args Encoded arguments for sidecar creation
/// @return sidecarAddress Address of the created sidecar
function create(address gauge, bytes memory args) public virtual override returns (address sidecarAddress) {
require(sidecar[gauge] == address(0), SidecarAlreadyDeployed());
// Validate the gauge and args
_isValidGauge(gauge, args);
// Create the sidecar
sidecarAddress = _create(gauge, args);
// Store the sidecar address
sidecar[gauge] = sidecarAddress;
emit SidecarCreated(gauge, sidecarAddress, args);
}
/// @notice Validates the gauge and arguments
/// @dev Must be implemented by derived factories to handle protocol-specific validation
/// @param gauge The gauge to validate
/// @param args The arguments to validate
function _isValidGauge(address gauge, bytes memory args) internal virtual;
/// @notice Creates a sidecar for a gauge
/// @dev Must be implemented by derived factories to handle protocol-specific sidecar creation
/// @param gauge The gauge to create a sidecar for
/// @param args The arguments for sidecar creation
/// @return sidecarAddress Address of the created sidecar
function _create(address gauge, bytes memory args) internal virtual returns (address sidecarAddress);
}/// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
interface IL2Booster {
function poolLength() external view returns (uint256);
function poolInfo(uint256 pid)
external
view
returns (address lpToken, address gauge, address rewards, bool shutdown, address factory);
function deposit(uint256 _pid, uint256 _amount) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (proxy/Clones.sol)
pragma solidity ^0.8.20;
import {Create2} from "../utils/Create2.sol";
import {Errors} from "../utils/Errors.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-1167[ERC-1167] is a standard for
* deploying minimal proxy contracts, also known as "clones".
*
* > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
* > a minimal bytecode implementation that delegates all calls to a known, fixed address.
*
* The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
* (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
* deterministic method.
*/
library Clones {
error CloneArgumentsTooLong();
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create opcode, which should never revert.
*/
function clone(address implementation) internal returns (address instance) {
return clone(implementation, 0);
}
/**
* @dev Same as {xref-Clones-clone-address-}[clone], but with a `value` parameter to send native currency
* to the new contract.
*
* NOTE: Using a non-zero value at creation will require the contract using this function (e.g. a factory)
* to always have enough balance for new deployments. Consider exposing this function under a payable method.
*/
function clone(address implementation, uint256 value) internal returns (address instance) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
assembly ("memory-safe") {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create(value, 0x09, 0x37)
}
if (instance == address(0)) {
revert Errors.FailedDeployment();
}
}
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy
* the clone. Using the same `implementation` and `salt` multiple times will revert, since
* the clones cannot be deployed twice at the same address.
*/
function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
return cloneDeterministic(implementation, salt, 0);
}
/**
* @dev Same as {xref-Clones-cloneDeterministic-address-bytes32-}[cloneDeterministic], but with
* a `value` parameter to send native currency to the new contract.
*
* NOTE: Using a non-zero value at creation will require the contract using this function (e.g. a factory)
* to always have enough balance for new deployments. Consider exposing this function under a payable method.
*/
function cloneDeterministic(
address implementation,
bytes32 salt,
uint256 value
) internal returns (address instance) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
assembly ("memory-safe") {
// Cleans the upper 96 bits of the `implementation` word, then packs the first 3 bytes
// of the `implementation` address with the bytecode before the address.
mstore(0x00, or(shr(0xe8, shl(0x60, implementation)), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000))
// Packs the remaining 17 bytes of `implementation` with the bytecode after the address.
mstore(0x20, or(shl(0x78, implementation), 0x5af43d82803e903d91602b57fd5bf3))
instance := create2(value, 0x09, 0x37, salt)
}
if (instance == address(0)) {
revert Errors.FailedDeployment();
}
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(
address implementation,
bytes32 salt,
address deployer
) internal pure returns (address predicted) {
assembly ("memory-safe") {
let ptr := mload(0x40)
mstore(add(ptr, 0x38), deployer)
mstore(add(ptr, 0x24), 0x5af43d82803e903d91602b57fd5bf3ff)
mstore(add(ptr, 0x14), implementation)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73)
mstore(add(ptr, 0x58), salt)
mstore(add(ptr, 0x78), keccak256(add(ptr, 0x0c), 0x37))
predicted := and(keccak256(add(ptr, 0x43), 0x55), 0xffffffffffffffffffffffffffffffffffffffff)
}
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(
address implementation,
bytes32 salt
) internal view returns (address predicted) {
return predictDeterministicAddress(implementation, salt, address(this));
}
/**
* @dev Deploys and returns the address of a clone that mimics the behavior of `implementation` with custom
* immutable arguments. These are provided through `args` and cannot be changed after deployment. To
* access the arguments within the implementation, use {fetchCloneArgs}.
*
* This function uses the create opcode, which should never revert.
*/
function cloneWithImmutableArgs(address implementation, bytes memory args) internal returns (address instance) {
return cloneWithImmutableArgs(implementation, args, 0);
}
/**
* @dev Same as {xref-Clones-cloneWithImmutableArgs-address-bytes-}[cloneWithImmutableArgs], but with a `value`
* parameter to send native currency to the new contract.
*
* NOTE: Using a non-zero value at creation will require the contract using this function (e.g. a factory)
* to always have enough balance for new deployments. Consider exposing this function under a payable method.
*/
function cloneWithImmutableArgs(
address implementation,
bytes memory args,
uint256 value
) internal returns (address instance) {
if (address(this).balance < value) {
revert Errors.InsufficientBalance(address(this).balance, value);
}
bytes memory bytecode = _cloneCodeWithImmutableArgs(implementation, args);
assembly ("memory-safe") {
instance := create(value, add(bytecode, 0x20), mload(bytecode))
}
if (instance == address(0)) {
revert Errors.FailedDeployment();
}
}
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation` with custom
* immutable arguments. These are provided through `args` and cannot be changed after deployment. To
* access the arguments within the implementation, use {fetchCloneArgs}.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy the clone. Using the same
* `implementation`, `args` and `salt` multiple times will revert, since the clones cannot be deployed twice
* at the same address.
*/
function cloneDeterministicWithImmutableArgs(
address implementation,
bytes memory args,
bytes32 salt
) internal returns (address instance) {
return cloneDeterministicWithImmutableArgs(implementation, args, salt, 0);
}
/**
* @dev Same as {xref-Clones-cloneDeterministicWithImmutableArgs-address-bytes-bytes32-}[cloneDeterministicWithImmutableArgs],
* but with a `value` parameter to send native currency to the new contract.
*
* NOTE: Using a non-zero value at creation will require the contract using this function (e.g. a factory)
* to always have enough balance for new deployments. Consider exposing this function under a payable method.
*/
function cloneDeterministicWithImmutableArgs(
address implementation,
bytes memory args,
bytes32 salt,
uint256 value
) internal returns (address instance) {
bytes memory bytecode = _cloneCodeWithImmutableArgs(implementation, args);
return Create2.deploy(value, salt, bytecode);
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministicWithImmutableArgs}.
*/
function predictDeterministicAddressWithImmutableArgs(
address implementation,
bytes memory args,
bytes32 salt,
address deployer
) internal pure returns (address predicted) {
bytes memory bytecode = _cloneCodeWithImmutableArgs(implementation, args);
return Create2.computeAddress(salt, keccak256(bytecode), deployer);
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministicWithImmutableArgs}.
*/
function predictDeterministicAddressWithImmutableArgs(
address implementation,
bytes memory args,
bytes32 salt
) internal view returns (address predicted) {
return predictDeterministicAddressWithImmutableArgs(implementation, args, salt, address(this));
}
/**
* @dev Get the immutable args attached to a clone.
*
* - If `instance` is a clone that was deployed using `clone` or `cloneDeterministic`, this
* function will return an empty array.
* - If `instance` is a clone that was deployed using `cloneWithImmutableArgs` or
* `cloneDeterministicWithImmutableArgs`, this function will return the args array used at
* creation.
* - If `instance` is NOT a clone deployed using this library, the behavior is undefined. This
* function should only be used to check addresses that are known to be clones.
*/
function fetchCloneArgs(address instance) internal view returns (bytes memory) {
bytes memory result = new bytes(instance.code.length - 45); // revert if length is too short
assembly ("memory-safe") {
extcodecopy(instance, add(result, 32), 45, mload(result))
}
return result;
}
/**
* @dev Helper that prepares the initcode of the proxy with immutable args.
*
* An assembly variant of this function requires copying the `args` array, which can be efficiently done using
* `mcopy`. Unfortunately, that opcode is not available before cancun. A pure solidity implementation using
* abi.encodePacked is more expensive but also more portable and easier to review.
*
* NOTE: https://eips.ethereum.org/EIPS/eip-170[EIP-170] limits the length of the contract code to 24576 bytes.
* With the proxy code taking 45 bytes, that limits the length of the immutable args to 24531 bytes.
*/
function _cloneCodeWithImmutableArgs(
address implementation,
bytes memory args
) private pure returns (bytes memory) {
if (args.length > 24531) revert CloneArgumentsTooLong();
return
abi.encodePacked(
hex"61",
uint16(args.length + 45),
hex"3d81600a3d39f3363d3d373d3d3d363d73",
implementation,
hex"5af43d82803e903d91602b57fd5bf3",
args
);
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;
/// Interfaces
import {IBooster} from "@interfaces/convex/IBooster.sol";
import {IBaseRewardPool} from "@interfaces/convex/IBaseRewardPool.sol";
import {IStashTokenWrapper} from "@interfaces/convex/IStashTokenWrapper.sol";
/// Address Book
import {CurveProtocol} from "@address-book/src/CurveEthereum.sol";
/// OpenZeppelin
import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/// Project Contracts
import {Sidecar} from "src/Sidecar.sol";
import {ImmutableArgsParser} from "src/libraries/ImmutableArgsParser.sol";
/// @notice Sidecar for Convex.
/// @dev For each PID, a minimal proxy is deployed using this contract as implementation.
contract ConvexSidecar is Sidecar {
using SafeERC20 for IERC20;
using ImmutableArgsParser for address;
/// @notice The bytes4 ID of the Curve protocol
/// @dev Used to identify the Curve protocol in the registry
bytes4 private constant CURVE_PROTOCOL_ID = bytes4(keccak256("CURVE"));
//////////////////////////////////////////////////////
// --- IMPLEMENTATION CONSTANTS
//////////////////////////////////////////////////////
/// @notice Convex Reward Token address.
IERC20 public immutable CVX;
/// @notice Convex Booster address.
address public immutable BOOSTER;
//////////////////////////////////////////////////////
// --- ISIDECAR CLONE IMMUTABLES
//////////////////////////////////////////////////////
/// @notice Staking token address.
function asset() public view override returns (IERC20 _asset) {
return IERC20(address(this).readAddress(0));
}
function rewardReceiver() public view override returns (address _rewardReceiver) {
return address(this).readAddress(20);
}
//////////////////////////////////////////////////////
// --- CONVEX CLONE IMMUTABLES
//////////////////////////////////////////////////////
/// @notice Staking Convex LP contract address.
function baseRewardPool() public view returns (IBaseRewardPool _baseRewardPool) {
return IBaseRewardPool(address(this).readAddress(40));
}
/// @notice Identifier of the pool on Convex.
function pid() public view returns (uint256 _pid) {
return address(this).readUint256(60);
}
//////////////////////////////////////////////////////
// --- CONSTRUCTOR
//////////////////////////////////////////////////////
constructor(address _accountant, address _protocolController, address _cvx, address _booster)
Sidecar(CURVE_PROTOCOL_ID, _accountant, _protocolController)
{
CVX = IERC20(_cvx);
BOOSTER = _booster;
}
//////////////////////////////////////////////////////
// --- INITIALIZATION
//////////////////////////////////////////////////////
/// @notice Initialize the contract by approving the ConvexCurve booster to spend the LP token.
function _initialize() internal override {
require(asset().allowance(address(this), address(BOOSTER)) == 0, AlreadyInitialized());
asset().forceApprove(address(BOOSTER), type(uint256).max);
}
//////////////////////////////////////////////////////
// --- ISIDECAR OPERATIONS OVERRIDE
//////////////////////////////////////////////////////
/// @notice Deposit LP token into Convex.
/// @param amount Amount of LP token to deposit.
/// @dev The reason there's an empty address parameter is to keep flexibility for future implementations.
/// Not all fallbacks will be minimal proxies, so we need to keep the same function signature.
/// Only callable by the strategy.
function _deposit(uint256 amount) internal override {
/// Deposit the LP token into Convex and stake it (true) to receive rewards.
IBooster(BOOSTER).deposit(pid(), amount, true);
}
/// @notice Withdraw LP token from Convex.
/// @param amount Amount of LP token to withdraw.
/// @param receiver Address to receive the LP token.
function _withdraw(uint256 amount, address receiver) internal override {
/// Withdraw from Convex gauge without claiming rewards (false).
baseRewardPool().withdrawAndUnwrap(amount, false);
/// Send the LP token to the receiver.
asset().safeTransfer(receiver, amount);
}
/// @notice Claim rewards from Convex.
/// @return rewardTokenAmount Amount of reward token claimed.
function _claim() internal override returns (uint256 rewardTokenAmount) {
/// Claim rewardToken.
baseRewardPool().getReward(address(this), false);
rewardTokenAmount = REWARD_TOKEN.balanceOf(address(this));
/// Send the reward token to the accountant.
REWARD_TOKEN.safeTransfer(ACCOUNTANT, rewardTokenAmount);
}
/// @notice Get the balance of the LP token on Convex held by this contract.
function balanceOf() public view override returns (uint256) {
return baseRewardPool().balanceOf(address(this));
}
/// @notice Get the reward tokens from the base reward pool.
/// @return Array of all extra reward tokens.
function getRewardTokens() public view override returns (address[] memory) {
// Check if there is extra rewards
uint256 extraRewardsLength = baseRewardPool().extraRewardsLength();
address[] memory tokens = new address[](extraRewardsLength);
address _token;
for (uint256 i; i < extraRewardsLength;) {
/// Get the address of the virtual balance pool.
_token = baseRewardPool().extraRewards(i);
tokens[i] = IBaseRewardPool(_token).rewardToken();
/// For PIDs greater than 150, the virtual balance pool also has a wrapper.
/// So we need to get the token from the wrapper.
/// Try catch because pid 151 case is only on Mainnet, not on L2s.
/// More: https://docs.convexfinance.com/convexfinanceintegration/baserewardpool
try IStashTokenWrapper(tokens[i]).token() returns (address _t) {
tokens[i] = _t;
} catch {}
unchecked {
++i;
}
}
return tokens;
}
/// @notice Get the amount of reward token earned by the strategy.
/// @return The amount of reward token earned by the strategy.
function getPendingRewards() public view override returns (uint256) {
return baseRewardPool().earned(address(this)) + REWARD_TOKEN.balanceOf(address(this));
}
//////////////////////////////////////////////////////
// --- EXTRA CONVEX OPERATIONS
//////////////////////////////////////////////////////
function claimExtraRewards() external {
address[] memory extraRewardTokens = getRewardTokens();
/// It'll claim rewardToken but we'll leave it here for clarity until the claim() function is called by the strategy.
baseRewardPool().getReward(address(this), true);
/// Send the reward token to the reward receiver.
CVX.safeTransfer(rewardReceiver(), CVX.balanceOf(address(this)));
/// Handle the extra reward tokens.
for (uint256 i = 0; i < extraRewardTokens.length;) {
uint256 _balance = IERC20(extraRewardTokens[i]).balanceOf(address(this));
if (_balance > 0) {
/// Send the whole balance to the strategy.
IERC20(extraRewardTokens[i]).safeTransfer(rewardReceiver(), _balance);
}
unchecked {
++i;
}
}
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;
interface ISidecarFactory {
function sidecar(address gauge) external view returns (address);
function create(address token, bytes memory args) external returns (address);
}/// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;
interface IProtocolController {
function vaults(address) external view returns (address);
function asset(address) external view returns (address);
function rewardReceiver(address) external view returns (address);
function allowed(address, address, bytes4 selector) external view returns (bool);
function permissionSetters(address) external view returns (bool);
function isRegistrar(address) external view returns (bool);
function strategy(bytes4 protocolId) external view returns (address);
function allocator(bytes4 protocolId) external view returns (address);
function accountant(bytes4 protocolId) external view returns (address);
function feeReceiver(bytes4 protocolId) external view returns (address);
function isShutdown(address) external view returns (bool);
function isFullyWithdrawn(address) external view returns (bool);
function registerVault(address _gauge, address _vault, address _asset, address _rewardReceiver, bytes4 _protocolId)
external;
function setValidAllocationTarget(address _gauge, address _target) external;
function removeValidAllocationTarget(address _gauge, address _target) external;
function isValidAllocationTarget(address _gauge, address _target) external view returns (bool);
function shutdown(address _gauge) external;
function markGaugeAsFullyWithdrawn(address _gauge) external;
function setPermissionSetter(address _setter, bool _allowed) external;
function setPermission(address _contract, address _caller, bytes4 _selector, bool _allowed) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Create2.sol)
pragma solidity ^0.8.20;
import {Errors} from "./Errors.sol";
/**
* @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.
* `CREATE2` can be used to compute in advance the address where a smart
* contract will be deployed, which allows for interesting new mechanisms known
* as 'counterfactual interactions'.
*
* See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more
* information.
*/
library Create2 {
/**
* @dev There's no code to deploy.
*/
error Create2EmptyBytecode();
/**
* @dev Deploys a contract using `CREATE2`. The address where the contract
* will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCode`.
*
* Requirements:
*
* - `bytecode` must not be empty.
* - `salt` must have not been used for `bytecode` already.
* - the factory must have a balance of at least `amount`.
* - if `amount` is non-zero, `bytecode` must have a `payable` constructor.
*/
function deploy(uint256 amount, bytes32 salt, bytes memory bytecode) internal returns (address addr) {
if (address(this).balance < amount) {
revert Errors.InsufficientBalance(address(this).balance, amount);
}
if (bytecode.length == 0) {
revert Create2EmptyBytecode();
}
assembly ("memory-safe") {
addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)
// if no address was created, and returndata is not empty, bubble revert
if and(iszero(addr), not(iszero(returndatasize()))) {
let p := mload(0x40)
returndatacopy(p, 0, returndatasize())
revert(p, returndatasize())
}
}
if (addr == address(0)) {
revert Errors.FailedDeployment();
}
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the
* `bytecodeHash` or `salt` will result in a new destination address.
*/
function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {
return computeAddress(salt, bytecodeHash, address(this));
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at
* `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.
*/
function computeAddress(bytes32 salt, bytes32 bytecodeHash, address deployer) internal pure returns (address addr) {
assembly ("memory-safe") {
let ptr := mload(0x40) // Get free memory pointer
// | | ↓ ptr ... ↓ ptr + 0x0B (start) ... ↓ ptr + 0x20 ... ↓ ptr + 0x40 ... |
// |-------------------|---------------------------------------------------------------------------|
// | bytecodeHash | CCCCCCCCCCCCC...CC |
// | salt | BBBBBBBBBBBBB...BB |
// | deployer | 000000...0000AAAAAAAAAAAAAAAAAAA...AA |
// | 0xFF | FF |
// |-------------------|---------------------------------------------------------------------------|
// | memory | 000000...00FFAAAAAAAAAAAAAAAAAAA...AABBBBBBBBBBBBB...BBCCCCCCCCCCCCC...CC |
// | keccak(start, 85) | ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |
mstore(add(ptr, 0x40), bytecodeHash)
mstore(add(ptr, 0x20), salt)
mstore(ptr, deployer) // Right-aligned with 12 preceding garbage bytes
let start := add(ptr, 0x0b) // The hashed data starts at the final garbage byte which we will set to 0xff
mstore8(start, 0xff)
addr := and(keccak256(start, 85), 0xffffffffffffffffffffffffffffffffffffffff)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/Errors.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of common custom errors used in multiple contracts
*
* IMPORTANT: Backwards compatibility is not guaranteed in future versions of the library.
* It is recommended to avoid relying on the error API for critical functionality.
*
* _Available since v5.1._
*/
library Errors {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error InsufficientBalance(uint256 balance, uint256 needed);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedCall();
/**
* @dev The deployment failed.
*/
error FailedDeployment();
/**
* @dev A necessary precompile is missing.
*/
error MissingPrecompile(address);
}/// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
interface IBooster {
function poolLength() external view returns (uint256);
function poolInfo(uint256 pid)
external
view
returns (address lpToken, address token, address gauge, address crvRewards, address stash, bool shutdown);
function deposit(uint256 _pid, uint256 _amount, bool _stake) external returns (bool);
function earmarkRewards(uint256 _pid) external returns (bool);
function depositAll(uint256 _pid, bool _stake) external returns (bool);
function withdraw(uint256 _pid, uint256 _amount) external returns (bool);
function claimRewards(uint256 _pid, address gauge) external returns (bool);
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
interface IBaseRewardPool {
function rewardToken() external view returns (address);
function extraRewardsLength() external view returns (uint256);
function extraRewards(uint256 index) external view returns (address);
function withdrawAndUnwrap(uint256 amount, bool claim) external returns (bool);
function getReward(address _account, bool _claimExtras) external returns (bool);
function balanceOf(address _account) external view returns (uint256);
function earned(address _account) external view returns (uint256);
function rewardRate() external view returns (uint256);
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
interface IStashTokenWrapper {
function token() external view returns (address);
}// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;
library CurveProtocol {
address internal constant CRV = 0xD533a949740bb3306d119CC777fa900bA034cd52;
address internal constant VECRV = 0x5f3b5DfEb7B28CDbD7FAba78963EE202a494e2A2;
address internal constant CRV_USD = 0xf939E0A03FB07F59A73314E73794Be0E57ac1b4E;
address internal constant SD_VE_CRV = 0x478bBC744811eE8310B461514BDc29D03739084D;
address internal constant FEE_DISTRIBUTOR = 0xD16d5eC345Dd86Fb63C6a9C43c517210F1027914;
address internal constant GAUGE_CONTROLLER = 0x2F50D538606Fa9EDD2B11E2446BEb18C9D5846bB;
address internal constant SMART_WALLET_CHECKER = 0xca719728Ef172d0961768581fdF35CB116e0B7a4;
address internal constant VOTING_APP_OWNERSHIP = 0xE478de485ad2fe566d49342Cbd03E49ed7DB3356;
address internal constant VOTING_APP_PARAMETER = 0xBCfF8B0b9419b9A88c44546519b1e909cF330399;
address internal constant MINTER = 0xd061D61a4d941c39E5453435B6345Dc261C2fcE0;
address internal constant VE_BOOST = 0xD37A6aa3d8460Bd2b6536d608103D880695A23CD;
// Convex
address internal constant CONVEX_PROXY = 0x989AEb4d175e16225E39E87d0D97A3360524AD80;
address internal constant CONVEX_BOOSTER = 0xF403C135812408BFbE8713b5A23a04b3D48AAE31;
address internal constant CONVEX_TOKEN = 0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B; // CVX
}
library CurveLocker {
address internal constant TOKEN = 0xD533a949740bb3306d119CC777fa900bA034cd52;
address internal constant SDTOKEN = 0xD1b5651E55D4CeeD36251c61c50C889B36F6abB5;
address internal constant LOCKER = 0x52f541764E6e90eeBc5c21Ff570De0e2D63766B6;
address internal constant DEPOSITOR = 0x88C88Aa6a9cedc2aff9b4cA6820292F39cc64026;
address internal constant GAUGE = 0x7f50786A0b15723D741727882ee99a0BF34e3466;
address internal constant ACCUMULATOR = 0x615959a1d3E2740054d7130028613ECfa988056f;
address internal constant VOTER = 0x20b22019406Cf990F0569a6161cf30B8e6651dDa;
address internal constant STRATEGY = 0x69D61428d089C2F35Bf6a472F540D0F82D1EA2cd;
address internal constant FACTORY = 0xDC9718E7704f10DB1aFaad737f8A04bcd14C20AA;
address internal constant VE_BOOST_DELEGATION = 0xe1F9C8ebBC80A013cAf0940fdD1A8554d763b9cf;
}
// Preprod version
library CurveStrategy {
address internal constant ACCOUNTANT = 0x4813Ee3665D746264B035E49bDf81AD9c3904A3A;
address internal constant PROTOCOL_CONTROLLER = 0xC8beDF267fa6D4bE6d7C2146122936535130dd2B;
address internal constant LOCKER = 0x0000000000000000000000000000000000000000;
address internal constant GATEWAY = 0x9e75df8ee120c7342b634EE3c5A47015b399E321;
address internal constant STRATEGY = 0x0D40dB4f5eCe56FEe57fDef3Bf796AB943349C98;
address internal constant CONVEX_SIDECAR = 0x7fC725De09C05312D89066b3d14ffb4D87A38853;
address internal constant CONVEX_SIDECAR_FACTORY = 0x3D88bF4Ad8c119AD6Da3Ae44e1825AcDa85a377D;
address internal constant FACTORY = 0xF4CF447ef5f3668304eBeB3B5a4397c3dae1F31A;
address internal constant ALLOCATOR = 0xe8CCF44a276DCD9CD3ccE05483EFf1bb26637Cfc;
address internal constant REWARD_VAULT = 0x81E57d40a7D7900719C47963A76C2763C78b2af2;
address internal constant REWARD_RECEIVER = 0x2a6e4F61c3CF575e1561A45613B58b46C506b4Ad;
}
library CurveVotemarket {
address internal constant PLATFORM = 0x0000000895cB182E6f983eb4D8b4E0Aa0B31Ae4c;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
import {IERC1363} from "../../../interfaces/IERC1363.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC-20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
/**
* @dev An operation with an ERC-20 token failed.
*/
error SafeERC20FailedOperation(address token);
/**
* @dev Indicates a failed `decreaseAllowance` request.
*/
error SafeERC20FailedDecreaseAllowance(address spender, uint256 currentAllowance, uint256 requestedDecrease);
/**
* @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*/
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transfer, (to, value)));
}
/**
* @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the
* calling contract. If `token` returns no value, non-reverting calls are assumed to be successful.
*/
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeCall(token.transferFrom, (from, to, value)));
}
/**
* @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 oldAllowance = token.allowance(address(this), spender);
forceApprove(token, spender, oldAllowance + value);
}
/**
* @dev Decrease the calling contract's allowance toward `spender` by `requestedDecrease`. If `token` returns no
* value, non-reverting calls are assumed to be successful.
*
* IMPORTANT: If the token implements ERC-7674 (ERC-20 with temporary allowance), and if the "client"
* smart contract uses ERC-7674 to set temporary allowances, then the "client" smart contract should avoid using
* this function. Performing a {safeIncreaseAllowance} or {safeDecreaseAllowance} operation on a token contract
* that has a non-zero temporary allowance (for that particular owner-spender) will result in unexpected behavior.
*/
function safeDecreaseAllowance(IERC20 token, address spender, uint256 requestedDecrease) internal {
unchecked {
uint256 currentAllowance = token.allowance(address(this), spender);
if (currentAllowance < requestedDecrease) {
revert SafeERC20FailedDecreaseAllowance(spender, currentAllowance, requestedDecrease);
}
forceApprove(token, spender, currentAllowance - requestedDecrease);
}
}
/**
* @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value,
* non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval
* to be set to zero before setting it to a non-zero value, such as USDT.
*
* NOTE: If the token implements ERC-7674, this function will not modify any temporary allowance. This function
* only sets the "standard" allowance. Any temporary allowance will remain active, in addition to the value being
* set here.
*/
function forceApprove(IERC20 token, address spender, uint256 value) internal {
bytes memory approvalCall = abi.encodeCall(token.approve, (spender, value));
if (!_callOptionalReturnBool(token, approvalCall)) {
_callOptionalReturn(token, abi.encodeCall(token.approve, (spender, 0)));
_callOptionalReturn(token, approvalCall);
}
}
/**
* @dev Performs an {ERC1363} transferAndCall, with a fallback to the simple {ERC20} transfer if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
safeTransfer(token, to, value);
} else if (!token.transferAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} transferFromAndCall, with a fallback to the simple {ERC20} transferFrom if the target
* has no code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* Reverts if the returned value is other than `true`.
*/
function transferFromAndCallRelaxed(
IERC1363 token,
address from,
address to,
uint256 value,
bytes memory data
) internal {
if (to.code.length == 0) {
safeTransferFrom(token, from, to, value);
} else if (!token.transferFromAndCall(from, to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Performs an {ERC1363} approveAndCall, with a fallback to the simple {ERC20} approve if the target has no
* code. This can be used to implement an {ERC721}-like safe transfer that rely on {ERC1363} checks when
* targeting contracts.
*
* NOTE: When the recipient address (`to`) has no code (i.e. is an EOA), this function behaves as {forceApprove}.
* Opposedly, when the recipient address (`to`) has code, this function only attempts to call {ERC1363-approveAndCall}
* once without retrying, and relies on the returned value to be true.
*
* Reverts if the returned value is other than `true`.
*/
function approveAndCallRelaxed(IERC1363 token, address to, uint256 value, bytes memory data) internal {
if (to.code.length == 0) {
forceApprove(token, to, value);
} else if (!token.approveAndCall(to, value, data)) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturnBool} that reverts if call fails to meet the requirements.
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
let success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
// bubble errors
if iszero(success) {
let ptr := mload(0x40)
returndatacopy(ptr, 0, returndatasize())
revert(ptr, returndatasize())
}
returnSize := returndatasize()
returnValue := mload(0)
}
if (returnSize == 0 ? address(token).code.length == 0 : returnValue != 1) {
revert SafeERC20FailedOperation(address(token));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*
* This is a variant of {_callOptionalReturn} that silently catches all reverts and returns a bool instead.
*/
function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) {
bool success;
uint256 returnSize;
uint256 returnValue;
assembly ("memory-safe") {
success := call(gas(), token, 0, add(data, 0x20), mload(data), 0, 0x20)
returnSize := returndatasize()
returnValue := mload(0)
}
return success && (returnSize == 0 ? address(token).code.length > 0 : returnValue == 1);
}
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;
import {IERC20, SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {ISidecar} from "src/interfaces/ISidecar.sol";
import {IAccountant} from "src/interfaces/IAccountant.sol";
import {IProtocolController} from "src/interfaces/IProtocolController.sol";
/// @title Sidecar - Alternative yield source manager alongside main locker
/// @notice Base contract for protocol-specific yield sources that complement the main locker strategy
/// @dev Design rationale:
/// - Enables yield diversification beyond the main protocol locker (e.g., Convex alongside veCRV)
/// - Protocol-agnostic base allows extension for any yield source
/// - Managed by Strategy for unified deposit/withdraw/harvest operations
/// - Rewards flow through Accountant for consistent distribution
abstract contract Sidecar is ISidecar {
using SafeERC20 for IERC20;
//////////////////////////////////////////////////////
// --- IMMUTABLES
//////////////////////////////////////////////////////
/// @notice Protocol identifier matching the Strategy that manages this sidecar
bytes4 public immutable PROTOCOL_ID;
/// @notice Accountant that receives and distributes rewards from this sidecar
address public immutable ACCOUNTANT;
/// @notice Main protocol reward token claimed by this sidecar (e.g., CRV)
IERC20 public immutable REWARD_TOKEN;
/// @notice Registry used to verify the authorized strategy for this protocol
IProtocolController public immutable PROTOCOL_CONTROLLER;
//////////////////////////////////////////////////////
// --- STORAGE
//////////////////////////////////////////////////////
/// @notice Prevents double initialization in factory deployment pattern
bool private _initialized;
//////////////////////////////////////////////////////
// --- ERRORS
//////////////////////////////////////////////////////
error ZeroAddress();
error OnlyStrategy();
error OnlyAccountant();
error AlreadyInitialized();
error NotInitialized();
error InvalidProtocolId();
//////////////////////////////////////////////////////
// --- MODIFIERS
//////////////////////////////////////////////////////
/// @notice Restricts access to the authorized strategy for this protocol
/// @dev Prevents unauthorized manipulation of user funds
modifier onlyStrategy() {
require(PROTOCOL_CONTROLLER.strategy(PROTOCOL_ID) == msg.sender, OnlyStrategy());
_;
}
//////////////////////////////////////////////////////
// --- CONSTRUCTOR
//////////////////////////////////////////////////////
/// @notice Sets up immutable protocol connections
/// @dev Called by factory during deployment. Reward token fetched from accountant
/// @param _protocolId Protocol identifier for strategy verification
/// @param _accountant Where to send claimed rewards for distribution
/// @param _protocolController Registry for strategy lookup and validation
constructor(bytes4 _protocolId, address _accountant, address _protocolController) {
require(_protocolId != bytes4(0), InvalidProtocolId());
require(_accountant != address(0) && _protocolController != address(0), ZeroAddress());
PROTOCOL_ID = _protocolId;
ACCOUNTANT = _accountant;
PROTOCOL_CONTROLLER = IProtocolController(_protocolController);
REWARD_TOKEN = IERC20(IAccountant(_accountant).REWARD_TOKEN());
_initialized = true;
}
//////////////////////////////////////////////////////
// --- EXTERNAL FUNCTIONS
//////////////////////////////////////////////////////
/// @notice One-time setup for protocol-specific configuration
/// @dev Factory pattern: minimal proxy clones need post-deployment init
/// Base constructor sets _initialized=true, clones must call this
function initialize() external {
if (_initialized) revert AlreadyInitialized();
_initialized = true;
_initialize();
}
/// @notice Stakes LP tokens into the protocol-specific yield source
/// @dev Strategy transfers tokens here first, then calls deposit
/// @param amount LP tokens to stake (must already be transferred)
function deposit(uint256 amount) external onlyStrategy {
_deposit(amount);
}
/// @notice Unstakes LP tokens and sends directly to receiver
/// @dev Used during user withdrawals and emergency shutdowns
/// @param amount LP tokens to unstake from yield source
/// @param receiver Where to send the unstaked tokens (vault or user)
function withdraw(uint256 amount, address receiver) external onlyStrategy {
_withdraw(amount, receiver);
}
/// @notice Harvests rewards and transfers to accountant
/// @dev Part of Strategy's harvest flow. Returns amount for accounting
/// @return Amount of reward tokens sent to accountant
function claim() external onlyStrategy returns (uint256) {
return _claim();
}
//////////////////////////////////////////////////////
// --- IMMUTABLES
//////////////////////////////////////////////////////
/// @notice LP token this sidecar manages (e.g., CRV/ETH LP)
/// @dev Must match the asset used by the associated Strategy
function asset() public view virtual returns (IERC20);
/// @notice Where extra rewards (not main protocol rewards) should be sent
/// @dev Typically the RewardVault for the gauge this sidecar supports
function rewardReceiver() public view virtual returns (address);
//////////////////////////////////////////////////////
// --- INTERNAL VIRTUAL FUNCTIONS
//////////////////////////////////////////////////////
/// @dev Protocol-specific setup (approvals, staking contracts, etc.)
function _initialize() internal virtual;
/// @dev Stakes tokens in protocol-specific way (e.g., Convex deposit)
/// @param amount Tokens to stake (already transferred to this contract)
function _deposit(uint256 amount) internal virtual;
/// @dev Claims all available rewards and transfers to accountant
/// @return Total rewards claimed and transferred
function _claim() internal virtual returns (uint256);
/// @dev Unstakes from protocol and sends tokens to receiver
/// @param amount Tokens to unstake
/// @param receiver Destination for unstaked tokens
function _withdraw(uint256 amount, address receiver) internal virtual;
/// @notice Total LP tokens staked in this sidecar
/// @dev Used by Strategy to calculate total assets across all sources
/// @return Current staked balance
function balanceOf() public view virtual returns (uint256);
/// @notice Unclaimed rewards available for harvest
/// @dev May perform view-only simulation or on-chain checkpoint
/// @return Claimable reward token amount
function getPendingRewards() public virtual returns (uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Clones} from "@openzeppelin/contracts/proxy/Clones.sol";
/// @title ImmutableArgsParser
/// @notice A library for reading immutable arguments from a clone.
library ImmutableArgsParser {
/// @dev Safely read an `address` from `clone`'s immutable args at `offset`.
function readAddress(address clone, uint256 offset) internal view returns (address result) {
bytes memory args = Clones.fetchCloneArgs(clone);
assembly {
// Load 32 bytes starting at `args + offset + 32`. Then shift right
// by 96 bits (12 bytes) so that the address is right‐aligned and
// the high bits are cleared.
result := shr(96, mload(add(add(args, 0x20), offset)))
}
}
/// @dev Safely read a `uint256` from `clone`'s immutable args at `offset`.
function readUint256(address clone, uint256 offset) internal view returns (uint256 result) {
bytes memory args = Clones.fetchCloneArgs(clone);
assembly {
// Load the entire 32‐byte word directly.
result := mload(add(add(args, 0x20), offset))
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC1363.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC165} from "./IERC165.sol";
/**
* @title IERC1363
* @dev Interface of the ERC-1363 standard as defined in the https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
*
* Defines an extension interface for ERC-20 tokens that supports executing code on a recipient contract
* after `transfer` or `transferFrom`, or code on a spender contract after `approve`, in a single transaction.
*/
interface IERC1363 is IERC20, IERC165 {
/*
* Note: the ERC-165 identifier for this interface is 0xb0202a11.
* 0xb0202a11 ===
* bytes4(keccak256('transferAndCall(address,uint256)')) ^
* bytes4(keccak256('transferAndCall(address,uint256,bytes)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256)')) ^
* bytes4(keccak256('transferFromAndCall(address,address,uint256,bytes)')) ^
* bytes4(keccak256('approveAndCall(address,uint256)')) ^
* bytes4(keccak256('approveAndCall(address,uint256,bytes)'))
*/
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the allowance mechanism
* and then calls {IERC1363Receiver-onTransferReceived} on `to`.
* @param from The address which you want to send tokens from.
* @param to The address which you want to transfer to.
* @param value The amount of tokens to be transferred.
* @param data Additional data with no specified format, sent in call to `to`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function transferFromAndCall(address from, address to, uint256 value, bytes calldata data) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value) external returns (bool);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens and then calls {IERC1363Spender-onApprovalReceived} on `spender`.
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
* @param data Additional data with no specified format, sent in call to `spender`.
* @return A boolean value indicating whether the operation succeeded unless throwing.
*/
function approveAndCall(address spender, uint256 value, bytes calldata data) external returns (bool);
}/// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface ISidecar {
function balanceOf() external view returns (uint256);
function deposit(uint256 amount) external;
function withdraw(uint256 amount, address receiver) external;
function getPendingRewards() external returns (uint256);
function getRewardTokens() external view returns (address[] memory);
function claim() external returns (uint256);
function asset() external view returns (IERC20);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
import {IStrategy} from "src/interfaces/IStrategy.sol";
interface IAccountant {
function checkpoint(
address gauge,
address from,
address to,
uint128 amount,
IStrategy.PendingRewards calldata pendingRewards,
IStrategy.HarvestPolicy policy
) external;
function checkpoint(
address gauge,
address from,
address to,
uint128 amount,
IStrategy.PendingRewards calldata pendingRewards,
IStrategy.HarvestPolicy policy,
address referrer
) external;
function totalSupply(address asset) external view returns (uint128);
function balanceOf(address asset, address account) external view returns (uint128);
function claim(address[] calldata _vaults, bytes[] calldata harvestData) external;
function claim(address[] calldata _vaults, bytes[] calldata harvestData, address receiver) external;
function claim(address[] calldata _vaults, address account, bytes[] calldata harvestData) external;
function claim(address[] calldata _vaults, address account, bytes[] calldata harvestData, address receiver)
external;
function claimProtocolFees() external;
function harvest(address[] calldata _vaults, bytes[] calldata _harvestData, address _receiver) external;
function REWARD_TOKEN() external view returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../token/ERC20/IERC20.sol";// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC165.sol)
pragma solidity ^0.8.20;
import {IERC165} from "../utils/introspection/IERC165.sol";// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;
import "src/interfaces/IAllocator.sol";
interface IStrategy {
/// @notice The policy for harvesting rewards.
enum HarvestPolicy {
CHECKPOINT,
HARVEST
}
struct PendingRewards {
uint128 feeSubjectAmount;
uint128 totalAmount;
}
function deposit(IAllocator.Allocation calldata allocation, HarvestPolicy policy)
external
returns (PendingRewards memory pendingRewards);
function withdraw(IAllocator.Allocation calldata allocation, HarvestPolicy policy, address receiver)
external
returns (PendingRewards memory pendingRewards);
function balanceOf(address gauge) external view returns (uint256 balance);
function harvest(address gauge, bytes calldata extraData) external returns (PendingRewards memory pendingRewards);
function flush() external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[ERC].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[ERC section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.28;
interface IAllocator {
struct Allocation {
address asset;
address gauge;
address[] targets;
uint256[] amounts;
}
function getDepositAllocation(address asset, address gauge, uint256 amount)
external
view
returns (Allocation memory);
function getWithdrawalAllocation(address asset, address gauge, uint256 amount)
external
view
returns (Allocation memory);
function getRebalancedAllocation(address asset, address gauge, uint256 amount)
external
view
returns (Allocation memory);
function getAllocationTargets(address gauge) external view returns (address[] memory);
}{
"remappings": [
"forge-std/=node_modules/forge-std/",
"shared/=node_modules/@stake-dao/shared/",
"layerzerolabs/oft-evm/=node_modules/@layerzerolabs/oft-evm/",
"@safe/=node_modules/@safe-global/safe-smart-account/",
"@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/",
"@interfaces/=node_modules/@stake-dao/interfaces/src/interfaces/",
"@address-book/=node_modules/@stake-dao/address-book/",
"@layerzerolabs/=node_modules/@layerzerolabs/",
"@safe-global/=node_modules/@safe-global/",
"@solady/=node_modules/@solady/"
],
"optimizer": {
"enabled": true,
"runs": 200
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false,
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"address","name":"_protocolController","type":"address"},{"internalType":"address","name":"_booster","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"CloneArgumentsTooLong","type":"error"},{"inputs":[],"name":"Create2EmptyBytecode","type":"error"},{"inputs":[],"name":"FailedDeployment","type":"error"},{"inputs":[{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"InsufficientBalance","type":"error"},{"inputs":[],"name":"InvalidArguments","type":"error"},{"inputs":[],"name":"InvalidGauge","type":"error"},{"inputs":[],"name":"InvalidProtocolId","type":"error"},{"inputs":[],"name":"InvalidToken","type":"error"},{"inputs":[],"name":"PoolShutdown","type":"error"},{"inputs":[],"name":"SidecarAlreadyDeployed","type":"error"},{"inputs":[],"name":"VaultNotDeployed","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"gauge","type":"address"},{"indexed":true,"internalType":"address","name":"sidecar","type":"address"},{"indexed":false,"internalType":"bytes","name":"args","type":"bytes"}],"name":"SidecarCreated","type":"event"},{"inputs":[],"name":"BOOSTER","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"IMPLEMENTATION","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROTOCOL_CONTROLLER","outputs":[{"internalType":"contract IProtocolController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PROTOCOL_ID","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"gauge","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"create","outputs":[{"internalType":"address","name":"sidecar","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"gauge","type":"address"},{"internalType":"bytes","name":"args","type":"bytes"}],"name":"create","outputs":[{"internalType":"address","name":"sidecarAddress","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"sidecar","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
610100604052348015610010575f5ffd5b50604051610c2c380380610c2c83398101604081905261002f91610101565b7fc715e3736a8cb018f630cb9a1df908ad1629e9c2da4cd190b2dc83d6687ba16983836001600160a01b0382161580159061007257506001600160a01b03811615155b61008f5760405163d92e233d60e01b815260040160405180910390fd5b6001600160e01b031983166100b7576040516355e7c3d960e11b815260040160405180910390fd5b6001600160e01b03199092166080526001600160a01b0390811660c05290811660a0521660e052506101419050565b80516001600160a01b03811681146100fc575f5ffd5b919050565b5f5f5f60608486031215610113575f5ffd5b61011c846100e6565b925061012a602085016100e6565b9150610138604085016100e6565b90509250925092565b60805160a05160c05160e051610a966101965f395f8181610142015281816102d201526103d801525f818161011b015261057a01525f81816101690152818161048c015261061501525f60c80152610a965ff3fe608060405234801561000f575f5ffd5b506004361061007a575f3560e01c80633a4741bd116100585780633a4741bd1461011657806375b0ffd11461013d5780637aaf53e614610164578063a3f697ba1461018b575f5ffd5b806301c3cb5f1461007e5780630db41f31146100c35780630ecaea7314610103575b5f5ffd5b6100a661008c3660046107c1565b5f602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100ea7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160e01b031990911681526020016100ba565b6100a66101113660046107dc565b61019e565b6100a67f000000000000000000000000000000000000000000000000000000000000000081565b6100a67f000000000000000000000000000000000000000000000000000000000000000081565b6100a67f000000000000000000000000000000000000000000000000000000000000000081565b6100a661019936600461081a565b6101d8565b5f5f826040516020016101b391815260200190565b60405160208183030381529060405290506101ce84826101d8565b9150505b92915050565b6001600160a01b038281165f90815260208190526040812054909116156102125760405163127ce62960e21b815260040160405180910390fd5b61021c8383610295565b61022683836103bc565b6001600160a01b038481165f818152602081905260409081902080546001600160a01b03191693851693841790555192935090917fea4496c1b0d6ca0682b650f133b1ab3f6db9089b592b0d5d1d3a72b91a8c3e59906102879086906108e0565b60405180910390a392915050565b80516020146102b7576040516317dbc4cb60e21b815260040160405180910390fd5b5f818060200190518101906102cc9190610915565b90505f5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631526fe27846040518263ffffffff1660e01b815260040161031e91815260200190565b60a060405180830381865afa158015610339573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061035d919061092c565b50935050925050801561038357604051632a10c67560e11b815260040160405180910390fd5b846001600160a01b0316826001600160a01b0316146103b5576040516365da5bb960e11b815260040160405180910390fd5b5050505050565b5f5f828060200190518101906103d29190610915565b90505f5f7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631526fe27846040518263ffffffff1660e01b815260040161042491815260200190565b60a060405180830381865afa15801561043f573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610463919061092c565b5050604051630339050960e51b81526001600160a01b038a811660048301529395509093505f927f0000000000000000000000000000000000000000000000000000000000000000169150636720a12090602401602060405180830381865afa1580156104d2573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104f691906109a1565b90506001600160a01b03811661051f5760405163b802300360e01b815260040160405180910390fd5b6040516bffffffffffffffffffffffff19606085811b8216602084015283811b8216603484015284901b166048820152605c81018590525f90607c0160408051601f19818403018152919052805160208201209091506105a07f0000000000000000000000000000000000000000000000000000000000000000838361067a565b9650866001600160a01b0316638129fc1c6040518163ffffffff1660e01b81526004015f604051808303815f87803b1580156105da575f5ffd5b505af11580156105ec573d5f5f3e3d5ffd5b505060405163a129290360e01b81526001600160a01b038c811660048301528a811660248301527f000000000000000000000000000000000000000000000000000000000000000016925063a129290391506044015f604051808303815f87803b158015610658575f5ffd5b505af115801561066a573d5f5f3e3d5ffd5b5050505050505050505092915050565b5f6106878484845f610691565b90505b9392505050565b5f5f61069d86866106b4565b90506106aa838583610712565b9695505050505050565b6060615fd3825111156106da5760405163250a241560e21b815260040160405180910390fd5b81516106e790602d6109bc565b83836040516020016106fb939291906109db565b604051602081830303815290604052905092915050565b5f834710156107415760405163cf47918160e01b81524760048201526024810185905260440160405180910390fd5b81515f0361076257604051631328927760e21b815260040160405180910390fd5b8282516020840186f590503d151981151615610783576040513d5f823e3d81fd5b6001600160a01b03811661068a5760405163b06ebf3d60e01b815260040160405180910390fd5b6001600160a01b03811681146107be575f5ffd5b50565b5f602082840312156107d1575f5ffd5b813561068a816107aa565b5f5f604083850312156107ed575f5ffd5b82356107f8816107aa565b946020939093013593505050565b634e487b7160e01b5f52604160045260245ffd5b5f5f6040838503121561082b575f5ffd5b8235610836816107aa565b9150602083013567ffffffffffffffff811115610851575f5ffd5b8301601f81018513610861575f5ffd5b803567ffffffffffffffff81111561087b5761087b610806565b604051601f8201601f19908116603f0116810167ffffffffffffffff811182821017156108aa576108aa610806565b6040528181528282016020018710156108c1575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f60208284031215610925575f5ffd5b5051919050565b5f5f5f5f5f60a08688031215610940575f5ffd5b855161094b816107aa565b602087015190955061095c816107aa565b604087015190945061096d816107aa565b60608701519093508015158114610982575f5ffd5b6080870151909250610993816107aa565b809150509295509295909350565b5f602082840312156109b1575f5ffd5b815161068a816107aa565b808201808211156101d257634e487b7160e01b5f52601160045260245ffd5b606160f81b815260f084901b6001600160f01b0319166001820152703d81600a3d39f3363d3d373d3d3d363d7360781b6003820152606083901b6bffffffffffffffffffffffff191660148201526e5af43d82803e903d91602b57fd5bf360881b602882015281515f908060208501603785015e5f920160370191825250939250505056fea2646970667358221220d5bffa9aaeacd59ea300198f0a8172969ae0abc381263857ff0a9b57eaf7371264736f6c634300081c0033000000000000000000000000caf1ee88407ec0940e7bc4fe5917ab5f2e91f8a30000000000000000000000004d4c2c4777625e97be1985682fae5a53f5c44a80000000000000000000000000d3327cb05a8e0095a543d582b5b3ce3e19270389
Deployed Bytecode
0x608060405234801561000f575f5ffd5b506004361061007a575f3560e01c80633a4741bd116100585780633a4741bd1461011657806375b0ffd11461013d5780637aaf53e614610164578063a3f697ba1461018b575f5ffd5b806301c3cb5f1461007e5780630db41f31146100c35780630ecaea7314610103575b5f5ffd5b6100a661008c3660046107c1565b5f602081905290815260409020546001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6100ea7fc715e3730000000000000000000000000000000000000000000000000000000081565b6040516001600160e01b031990911681526020016100ba565b6100a66101113660046107dc565b61019e565b6100a67f000000000000000000000000caf1ee88407ec0940e7bc4fe5917ab5f2e91f8a381565b6100a67f000000000000000000000000d3327cb05a8e0095a543d582b5b3ce3e1927038981565b6100a67f0000000000000000000000004d4c2c4777625e97be1985682fae5a53f5c44a8081565b6100a661019936600461081a565b6101d8565b5f5f826040516020016101b391815260200190565b60405160208183030381529060405290506101ce84826101d8565b9150505b92915050565b6001600160a01b038281165f90815260208190526040812054909116156102125760405163127ce62960e21b815260040160405180910390fd5b61021c8383610295565b61022683836103bc565b6001600160a01b038481165f818152602081905260409081902080546001600160a01b03191693851693841790555192935090917fea4496c1b0d6ca0682b650f133b1ab3f6db9089b592b0d5d1d3a72b91a8c3e59906102879086906108e0565b60405180910390a392915050565b80516020146102b7576040516317dbc4cb60e21b815260040160405180910390fd5b5f818060200190518101906102cc9190610915565b90505f5f7f000000000000000000000000d3327cb05a8e0095a543d582b5b3ce3e192703896001600160a01b0316631526fe27846040518263ffffffff1660e01b815260040161031e91815260200190565b60a060405180830381865afa158015610339573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061035d919061092c565b50935050925050801561038357604051632a10c67560e11b815260040160405180910390fd5b846001600160a01b0316826001600160a01b0316146103b5576040516365da5bb960e11b815260040160405180910390fd5b5050505050565b5f5f828060200190518101906103d29190610915565b90505f5f7f000000000000000000000000d3327cb05a8e0095a543d582b5b3ce3e192703896001600160a01b0316631526fe27846040518263ffffffff1660e01b815260040161042491815260200190565b60a060405180830381865afa15801561043f573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610463919061092c565b5050604051630339050960e51b81526001600160a01b038a811660048301529395509093505f927f0000000000000000000000004d4c2c4777625e97be1985682fae5a53f5c44a80169150636720a12090602401602060405180830381865afa1580156104d2573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104f691906109a1565b90506001600160a01b03811661051f5760405163b802300360e01b815260040160405180910390fd5b6040516bffffffffffffffffffffffff19606085811b8216602084015283811b8216603484015284901b166048820152605c81018590525f90607c0160408051601f19818403018152919052805160208201209091506105a07f000000000000000000000000caf1ee88407ec0940e7bc4fe5917ab5f2e91f8a3838361067a565b9650866001600160a01b0316638129fc1c6040518163ffffffff1660e01b81526004015f604051808303815f87803b1580156105da575f5ffd5b505af11580156105ec573d5f5f3e3d5ffd5b505060405163a129290360e01b81526001600160a01b038c811660048301528a811660248301527f0000000000000000000000004d4c2c4777625e97be1985682fae5a53f5c44a8016925063a129290391506044015f604051808303815f87803b158015610658575f5ffd5b505af115801561066a573d5f5f3e3d5ffd5b5050505050505050505092915050565b5f6106878484845f610691565b90505b9392505050565b5f5f61069d86866106b4565b90506106aa838583610712565b9695505050505050565b6060615fd3825111156106da5760405163250a241560e21b815260040160405180910390fd5b81516106e790602d6109bc565b83836040516020016106fb939291906109db565b604051602081830303815290604052905092915050565b5f834710156107415760405163cf47918160e01b81524760048201526024810185905260440160405180910390fd5b81515f0361076257604051631328927760e21b815260040160405180910390fd5b8282516020840186f590503d151981151615610783576040513d5f823e3d81fd5b6001600160a01b03811661068a5760405163b06ebf3d60e01b815260040160405180910390fd5b6001600160a01b03811681146107be575f5ffd5b50565b5f602082840312156107d1575f5ffd5b813561068a816107aa565b5f5f604083850312156107ed575f5ffd5b82356107f8816107aa565b946020939093013593505050565b634e487b7160e01b5f52604160045260245ffd5b5f5f6040838503121561082b575f5ffd5b8235610836816107aa565b9150602083013567ffffffffffffffff811115610851575f5ffd5b8301601f81018513610861575f5ffd5b803567ffffffffffffffff81111561087b5761087b610806565b604051601f8201601f19908116603f0116810167ffffffffffffffff811182821017156108aa576108aa610806565b6040528181528282016020018710156108c1575f5ffd5b816020840160208301375f602083830101528093505050509250929050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f60208284031215610925575f5ffd5b5051919050565b5f5f5f5f5f60a08688031215610940575f5ffd5b855161094b816107aa565b602087015190955061095c816107aa565b604087015190945061096d816107aa565b60608701519093508015158114610982575f5ffd5b6080870151909250610993816107aa565b809150509295509295909350565b5f602082840312156109b1575f5ffd5b815161068a816107aa565b808201808211156101d257634e487b7160e01b5f52601160045260245ffd5b606160f81b815260f084901b6001600160f01b0319166001820152703d81600a3d39f3363d3d373d3d3d363d7360781b6003820152606083901b6bffffffffffffffffffffffff191660148201526e5af43d82803e903d91602b57fd5bf360881b602882015281515f908060208501603785015e5f920160370191825250939250505056fea2646970667358221220d5bffa9aaeacd59ea300198f0a8172969ae0abc381263857ff0a9b57eaf7371264736f6c634300081c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000caf1ee88407ec0940e7bc4fe5917ab5f2e91f8a30000000000000000000000004d4c2c4777625e97be1985682fae5a53f5c44a80000000000000000000000000d3327cb05a8e0095a543d582b5b3ce3e19270389
-----Decoded View---------------
Arg [0] : _implementation (address): 0xcAf1eE88407EC0940e7bc4Fe5917ab5f2E91f8a3
Arg [1] : _protocolController (address): 0x4D4c2C4777625e97be1985682fAE5A53f5C44A80
Arg [2] : _booster (address): 0xd3327cb05a8E0095A543D582b5B3Ce3e19270389
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000caf1ee88407ec0940e7bc4fe5917ab5f2e91f8a3
Arg [1] : 0000000000000000000000004d4c2c4777625e97be1985682fae5a53f5c44a80
Arg [2] : 000000000000000000000000d3327cb05a8e0095a543d582b5b3ce3e19270389
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in FRAX
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.