Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
StrategyManager
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 50 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.28;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { IStrategyManager } from "../interfaces/positions/IStrategyManager.sol";
import { ZeroAddress } from "../utils/Helpers.sol";
contract StrategyManager is IStrategyManager, Initializable, OwnableUpgradeable {
/// @dev Storage slot for StrategyManager storage
bytes32 private constant STRATEGY_MANAGER_STORAGE_POSITION =
keccak256("strategy.manager.storage") & ~bytes32(uint256(0xff));
struct StrategyManagerStorage {
mapping(address => bool) strategyExists;
mapping(address => StrategyConfig) strategyConfigs;
mapping(address => mapping(address => mapping(uint64 => bool))) strategyTokenWhitelisting;
mapping(address => mapping(uint64 => bool)) whitelistedTransactionCodes;
}
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
function initialize(address _owner) public initializer {
__Ownable_init(_owner);
}
// === Read-only ===
function isTransactionCodeWhitelisted(
address strategyAddress,
uint64 transactionCode
)
external
view
returns (bool)
{
StrategyManagerStorage storage s = _getStrategyManagerStorage();
if (!s.strategyExists[strategyAddress]) revert StrategyDoesNotExist(strategyAddress);
return s.whitelistedTransactionCodes[strategyAddress][transactionCode];
}
function isDepositEnabled(address strategyAddress) external view returns (bool) {
StrategyManagerStorage storage s = _getStrategyManagerStorage();
if (!s.strategyExists[strategyAddress]) revert StrategyDoesNotExist(strategyAddress);
return s.strategyConfigs[strategyAddress].depositEnabled;
}
function assertStrategyExists(address strategyAddress) external view {
StrategyManagerStorage storage s = _getStrategyManagerStorage();
if (!s.strategyExists[strategyAddress]) revert StrategyDoesNotExist(strategyAddress);
}
function assertStrategyTokenWhitelisted(
address strategyAddress,
address tokenAddress,
uint64 purpose
)
external
view
{
StrategyManagerStorage storage s = _getStrategyManagerStorage();
if (!s.strategyExists[strategyAddress]) revert StrategyDoesNotExist(strategyAddress);
if (!s.strategyTokenWhitelisting[strategyAddress][tokenAddress][purpose]) {
revert StrategyTokenNotWhitelisted(strategyAddress, tokenAddress, purpose);
}
}
function getStrategyConfig(address strategyAddress) external view returns (StrategyConfig memory) {
StrategyManagerStorage storage s = _getStrategyManagerStorage();
if (!s.strategyExists[strategyAddress]) revert StrategyDoesNotExist(strategyAddress);
return s.strategyConfigs[strategyAddress];
}
// === Write-only (owner only) ===
function addStrategy(
address strategyAddress,
address underlying,
address primaryDepositToken,
address primaryWithdrawalToken,
bool loopingEnabled
)
external
onlyOwner
{
if (strategyAddress == address(0)) revert ZeroAddress();
require(strategyAddress.code.length != 0, InvalidStrategy());
StrategyManagerStorage storage s = _getStrategyManagerStorage();
if (s.strategyExists[strategyAddress]) revert StrategyAlreadyExist(strategyAddress);
StrategyConfig storage config = s.strategyConfigs[strategyAddress];
config.underlying = underlying;
config.primaryDepositToken = primaryDepositToken;
config.primaryWithdrawalToken = primaryWithdrawalToken;
config.loopingEnabled = loopingEnabled;
config.depositEnabled = true;
s.strategyExists[strategyAddress] = true;
emit StrategyAdded(strategyAddress, primaryDepositToken, primaryWithdrawalToken, underlying, loopingEnabled);
}
function updateTokenWhitelisting(
address strategyAddress,
address tokenAddress,
uint64 purpose,
bool flag
)
external
onlyOwner
{
if (strategyAddress == address(0)) revert ZeroAddress();
StrategyManagerStorage storage s = _getStrategyManagerStorage();
if (!s.strategyExists[strategyAddress]) revert StrategyDoesNotExist(strategyAddress);
s.strategyTokenWhitelisting[strategyAddress][tokenAddress][purpose] = flag;
emit StrategyTokenWhitelistingUpdated(strategyAddress, tokenAddress, purpose, flag);
}
function removeStrategy(address strategyAddress) external onlyOwner {
StrategyManagerStorage storage s = _getStrategyManagerStorage();
if (!s.strategyExists[strategyAddress]) revert StrategyDoesNotExist(strategyAddress);
s.strategyExists[strategyAddress] = false;
delete s.strategyConfigs[strategyAddress];
emit StrategyRemoved(strategyAddress);
}
function upsertDepositEnabled(address strategyAddress, bool flag) external onlyOwner {
if (strategyAddress == address(0)) revert ZeroAddress();
StrategyManagerStorage storage s = _getStrategyManagerStorage();
if (!s.strategyExists[strategyAddress]) revert StrategyDoesNotExist(strategyAddress);
s.strategyConfigs[strategyAddress].depositEnabled = flag;
emit StrategyDepositFlagUpdated(strategyAddress, flag);
}
function upsertTransactionCode(address strategyAddress, uint64 transactionCode, bool flag) external onlyOwner {
StrategyManagerStorage storage s = _getStrategyManagerStorage();
if (!s.strategyExists[strategyAddress]) revert StrategyDoesNotExist(strategyAddress);
s.whitelistedTransactionCodes[strategyAddress][transactionCode] = flag;
emit StrategyTransactionCodeUpdated(strategyAddress, transactionCode, flag);
}
/// @dev Internal getter for StrategyManagerStorage
function _getStrategyManagerStorage() private pure returns (StrategyManagerStorage storage s) {
bytes32 slot = STRATEGY_MANAGER_STORAGE_POSITION;
assembly {
s.slot := slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {ContextUpgradeable} from "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
/// @custom:storage-location erc7201:openzeppelin.storage.Ownable
struct OwnableStorage {
address _owner;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Ownable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant OwnableStorageLocation = 0x9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c199300;
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
function __Ownable_init(address initialOwner) internal onlyInitializing {
__Ownable_init_unchained(initialOwner);
}
function __Ownable_init_unchained(address initialOwner) internal onlyInitializing {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
OwnableStorage storage $ = _getOwnableStorage();
return $._owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
OwnableStorage storage $ = _getOwnableStorage();
address oldOwner = $._owner;
$._owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.28;
interface IStrategyManager {
struct StrategyConfig {
address underlying;
address primaryDepositToken; // useful in case of swapping token to primary token for deposits
address primaryWithdrawalToken; // useful in case of swapping token to primary token for withdrawals
bool depositEnabled;
bool loopingEnabled;
}
// event
event StrategyAdded(
address strategyAddress,
address primaryDepositToken,
address primaryWithdrawalToken,
address underlying,
bool loopingEnabled
);
event StrategyRemoved(address strategyAddress);
event StrategyDepositFlagUpdated(address strategyAddress, bool flag);
event StrategyTransactionCodeUpdated(address strategyAddress, uint64 transactionCode, bool flag);
event StrategyTokenWhitelistingUpdated(address strategyAddress, address tokenAddress, uint64 purpose, bool flag);
// error
error InvalidStrategy();
error StrategyAlreadyExist(address strategy);
error StrategyDoesNotExist(address strategy);
error StrategyTokenNotWhitelisted(address strategy, address token, uint64 purpose);
// read-only function
function isDepositEnabled(address strategyAddress) external view returns (bool);
function getStrategyConfig(address strategyAddress) external view returns (StrategyConfig memory);
function assertStrategyExists(address strategyAddress) external view;
function isTransactionCodeWhitelisted(
address strategyAddress,
uint64 transactionCode
)
external
view
returns (bool);
function assertStrategyTokenWhitelisted(
address strategyAddress,
address tokenAddress,
uint64 purpose
)
external
view;
// write-only functions
function addStrategy(
address strategyAddress,
address primaryDepositToken,
address primaryWithdrawalToken,
address underlying,
bool loopingEnabled
)
external;
function removeStrategy(address strategyAddress) external;
function upsertDepositEnabled(address strategyAddress, bool flag) external;
function upsertTransactionCode(address strategyAddress, uint64 transactionCode, bool flag) external;
function updateTokenWhitelisting(
address strategyAddress,
address tokenAddress,
uint64 purpose,
bool flag
)
external;
}// SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.28; // common errors error IncorrectTypeID(uint256 _typeId, address _sender); error NegativePriceError(); error PriceStaleError(); error CallFailed(); error NotDepositContract(address _address); error NotExecutor(address _address); error NotStrategyContract(address _address); error IncorrectTokenAddress(address _tokenAddress); error IncorrectValue(); error IncorrectMessageAddress(address _sender); error ZeroAddress(); error ZeroAmount(); error ZeroValue(); error MinimumDustAmountError(); error NonPayableFunction(); error DivideByZeroError(); error PermissionDenied(); error InvalidLendingThreshold(); error NotImplemented(); // common events //deposit events //deposit
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}{
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@spectra-core/src/=lib/spectra-core/src/",
"@pythnetwork/pyth-sdk-solidity/=node_modules/@pythnetwork/pyth-sdk-solidity/",
"hardhat/=node_modules/hardhat/",
"@morpho-blue/=lib/morpho-blue/",
"ds-test/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"halmos-cheatcodes/=lib/openzeppelin-contracts-upgradeable/lib/halmos-cheatcodes/src/",
"morpho-blue/=lib/morpho-blue/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"openzeppelin-erc20-basic/=lib/spectra-core/lib/openzeppelin-contracts/contracts/token/ERC20/",
"openzeppelin-erc20-extensions/=lib/spectra-core/lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/extensions/",
"openzeppelin-erc20/=lib/spectra-core/lib/openzeppelin-contracts-upgradeable/contracts/token/ERC20/",
"openzeppelin-foundry-upgrades/=lib/openzeppelin-foundry-upgrades/src/",
"openzeppelin-math/=lib/spectra-core/lib/openzeppelin-contracts/contracts/utils/math/",
"openzeppelin-proxy/=lib/spectra-core/lib/openzeppelin-contracts-upgradeable/contracts/proxy/utils/",
"openzeppelin-utils/=lib/spectra-core/lib/openzeppelin-contracts/contracts/utils/",
"solidity-stringutils/=lib/openzeppelin-foundry-upgrades/lib/solidity-stringutils/",
"spectra-core/=lib/spectra-core/",
"v3-core/=lib/v3-core/"
],
"optimizer": {
"enabled": true,
"runs": 50
},
"metadata": {
"useLiteralContent": false,
"bytecodeHash": "ipfs",
"appendCBOR": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"evmVersion": "cancun",
"viaIR": false
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidInitialization","type":"error"},{"inputs":[],"name":"InvalidStrategy","type":"error"},{"inputs":[],"name":"NotInitializing","type":"error"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"strategy","type":"address"}],"name":"StrategyAlreadyExist","type":"error"},{"inputs":[{"internalType":"address","name":"strategy","type":"address"}],"name":"StrategyDoesNotExist","type":"error"},{"inputs":[{"internalType":"address","name":"strategy","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint64","name":"purpose","type":"uint64"}],"name":"StrategyTokenNotWhitelisted","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"version","type":"uint64"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"strategyAddress","type":"address"},{"indexed":false,"internalType":"address","name":"primaryDepositToken","type":"address"},{"indexed":false,"internalType":"address","name":"primaryWithdrawalToken","type":"address"},{"indexed":false,"internalType":"address","name":"underlying","type":"address"},{"indexed":false,"internalType":"bool","name":"loopingEnabled","type":"bool"}],"name":"StrategyAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"strategyAddress","type":"address"},{"indexed":false,"internalType":"bool","name":"flag","type":"bool"}],"name":"StrategyDepositFlagUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"strategyAddress","type":"address"}],"name":"StrategyRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"strategyAddress","type":"address"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint64","name":"purpose","type":"uint64"},{"indexed":false,"internalType":"bool","name":"flag","type":"bool"}],"name":"StrategyTokenWhitelistingUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"strategyAddress","type":"address"},{"indexed":false,"internalType":"uint64","name":"transactionCode","type":"uint64"},{"indexed":false,"internalType":"bool","name":"flag","type":"bool"}],"name":"StrategyTransactionCodeUpdated","type":"event"},{"inputs":[{"internalType":"address","name":"strategyAddress","type":"address"},{"internalType":"address","name":"underlying","type":"address"},{"internalType":"address","name":"primaryDepositToken","type":"address"},{"internalType":"address","name":"primaryWithdrawalToken","type":"address"},{"internalType":"bool","name":"loopingEnabled","type":"bool"}],"name":"addStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"strategyAddress","type":"address"}],"name":"assertStrategyExists","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"strategyAddress","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint64","name":"purpose","type":"uint64"}],"name":"assertStrategyTokenWhitelisted","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"strategyAddress","type":"address"}],"name":"getStrategyConfig","outputs":[{"components":[{"internalType":"address","name":"underlying","type":"address"},{"internalType":"address","name":"primaryDepositToken","type":"address"},{"internalType":"address","name":"primaryWithdrawalToken","type":"address"},{"internalType":"bool","name":"depositEnabled","type":"bool"},{"internalType":"bool","name":"loopingEnabled","type":"bool"}],"internalType":"struct IStrategyManager.StrategyConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_owner","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"strategyAddress","type":"address"}],"name":"isDepositEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"strategyAddress","type":"address"},{"internalType":"uint64","name":"transactionCode","type":"uint64"}],"name":"isTransactionCodeWhitelisted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"strategyAddress","type":"address"}],"name":"removeStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"strategyAddress","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint64","name":"purpose","type":"uint64"},{"internalType":"bool","name":"flag","type":"bool"}],"name":"updateTokenWhitelisting","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"strategyAddress","type":"address"},{"internalType":"bool","name":"flag","type":"bool"}],"name":"upsertDepositEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"strategyAddress","type":"address"},{"internalType":"uint64","name":"transactionCode","type":"uint64"},{"internalType":"bool","name":"flag","type":"bool"}],"name":"upsertTransactionCode","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6080604052348015600e575f5ffd5b5060156019565b60c9565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00805468010000000000000000900460ff161560685760405163f92ee8a960e01b815260040160405180910390fd5b80546001600160401b039081161460c65780546001600160401b0319166001600160401b0390811782556040519081527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b50565b610f1a806100d65f395ff3fe608060405234801561000f575f5ffd5b50600436106100b8575f3560e01c8063088bbc0c146100bc578063175188e8146100d15780632deeb2d7146100e457806332814ef5146100f757806346edbe2a1461010a5780636a98bb601461011d578063715018a6146101305780638da5cb5b146101385780639d4c112814610156578063a14889fe14610179578063c4d66de8146101da578063d1cc64fe146101ed578063f2fde38b14610200578063f65eed5e14610213575b5f5ffd5b6100cf6100ca366004610d2e565b610226565b005b6100cf6100df366004610d6e565b6102ff565b6100cf6100f2366004610d8e565b6103df565b6100cf610105366004610def565b610566565b6100cf610118366004610e20565b61064f565b6100cf61012b366004610e57565b610715565b6100cf610822565b610140610835565b60405161014d9190610ea8565b60405180910390f35b610169610164366004610d6e565b61084f565b604051901515815260200161014d565b61018c610187366004610d6e565b6108c4565b6040805182516001600160a01b03908116825260208085015182169083015283830151169181019190915260608083015115159082015260809182015115159181019190915260a00161014d565b6100cf6101e8366004610d6e565b6109a0565b6100cf6101fb366004610d6e565b610a97565b6100cf61020e366004610d6e565b610ae1565b610169610221366004610ebc565b610b1e565b61022e610b9f565b5f610237610bd1565b6001600160a01b0385165f9081526020829052604090205490915060ff1661027d5783604051632452435f60e11b81526004016102749190610ea8565b60405180910390fd5b6001600160a01b0384165f81815260038301602090815260408083206001600160401b03881680855290835292819020805460ff1916871515908117909155815194855291840192909252908201527f31f27f08dd86f7709e04d27c92372ae8eece51908dc952a47f4f629cdec99a519060600160405180910390a150505050565b610307610b9f565b5f610310610bd1565b6001600160a01b0383165f9081526020829052604090205490915060ff1661034d5781604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b0382165f90815260208281526040808320805460ff1916905560018085019092529182902080546001600160a01b03199081168255918101805490921690915560020180546001600160b01b0319169055517f09a1db4b80c32706328728508c941a6b954f31eb5affd32f236c1fd405f8fea4906103d3908490610ea8565b60405180910390a15050565b6103e7610b9f565b6001600160a01b03851661040e5760405163d92e233d60e01b815260040160405180910390fd5b846001600160a01b03163b5f0361043857604051632711b74d60e11b815260040160405180910390fd5b5f610441610bd1565b6001600160a01b0387165f9081526020829052604090205490915060ff161561047f57856040516372b111af60e01b81526004016102749190610ea8565b6001600160a01b038681165f81815260018481016020908152604080842080546001600160a01b03199081168d8916908117835582860180549092168d8a16908117909255600283018054600160a01b9a8e16600161ff0160a01b03199091168117600160a81b8e15159081029190911760ff60a01b19169b909b179091558a865296849020805460ff1916909617909555825196875292860192909252840192909252606083015260808201929092527f1a6f64fb86223848042361a48738f2bd8f8b74c3d4830f695a89b3850f03e3169060a00160405180910390a150505050505050565b61056e610b9f565b6001600160a01b0382166105955760405163d92e233d60e01b815260040160405180910390fd5b5f61059e610bd1565b6001600160a01b0384165f9081526020829052604090205490915060ff166105db5782604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b0383165f818152600183016020908152604091829020600201805460ff60a01b1916600160a01b871515908102919091179091558251938452908301527fe0508b148170e6240389bc45de35c872bcf4c13c72e582048db3972dd3f8a0b1910160405180910390a1505050565b5f610658610bd1565b6001600160a01b0385165f9081526020829052604090205490915060ff166106955783604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b038085165f908152600283016020908152604080832093871683529281528282206001600160401b03861683529052205460ff1661070f57604051633cd8963360e01b81526001600160a01b038086166004830152841660248201526001600160401b0383166044820152606401610274565b50505050565b61071d610b9f565b6001600160a01b0384166107445760405163d92e233d60e01b815260040160405180910390fd5b5f61074d610bd1565b6001600160a01b0386165f9081526020829052604090205490915060ff1661078a5784604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b038581165f81815260028401602090815260408083209489168084529482528083206001600160401b03891680855290835292819020805460ff19168815159081179091558151948552918401949094529282015260608101919091527f3febc2e76e9131d5a9730a35c36bd82df9470e5065c085821aeee5a7e18df27a9060800160405180910390a15050505050565b61082a610b9f565b6108335f610bf5565b565b5f5f61083f610c4f565b546001600160a01b031692915050565b5f5f610859610bd1565b6001600160a01b0384165f9081526020829052604090205490915060ff166108965782604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b039092165f908152600190920160205250604090206002015460ff600160a01b9091041690565b6040805160a0810182525f808252602082018190529181018290526060810182905260808101829052906108f6610bd1565b6001600160a01b0384165f9081526020829052604090205490915060ff166109335782604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b039283165f90815260019182016020908152604091829020825160a08101845281548716815293810154861691840191909152600201549384169082015260ff600160a01b8404811615156060830152600160a81b909304909216151560808301525090565b5f6109a9610c73565b805490915060ff600160401b82041615906001600160401b03165f811580156109cf5750825b90505f826001600160401b031660011480156109ea5750303b155b9050811580156109f8575080155b15610a165760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a4057845460ff60401b1916600160401b1785555b610a4986610c97565b8315610a8f57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f610aa0610bd1565b6001600160a01b0383165f9081526020829052604090205490915060ff16610add5781604051632452435f60e11b81526004016102749190610ea8565b5050565b610ae9610b9f565b6001600160a01b038116610b12575f604051631e4fbdf760e01b81526004016102749190610ea8565b610b1b81610bf5565b50565b5f5f610b28610bd1565b6001600160a01b0385165f9081526020829052604090205490915060ff16610b655783604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b0384165f9081526003909101602090815260408083206001600160401b038616845290915290205460ff16905092915050565b33610ba8610835565b6001600160a01b031614610833573360405163118cdaa760e01b81526004016102749190610ea8565b7f5f24a50075938dfd8da964c77393bf6473ea141471f5786650baf8af2d01c20090565b5f610bfe610c4f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0090565b610c9f610ca8565b610b1b81610ccd565b610cb0610cd5565b61083357604051631afcd79f60e31b815260040160405180910390fd5b610ae9610ca8565b5f610cde610c73565b54600160401b900460ff16919050565b80356001600160a01b0381168114610d04575f5ffd5b919050565b80356001600160401b0381168114610d04575f5ffd5b80358015158114610d04575f5ffd5b5f5f5f60608486031215610d40575f5ffd5b610d4984610cee565b9250610d5760208501610d09565b9150610d6560408501610d1f565b90509250925092565b5f60208284031215610d7e575f5ffd5b610d8782610cee565b9392505050565b5f5f5f5f5f60a08688031215610da2575f5ffd5b610dab86610cee565b9450610db960208701610cee565b9350610dc760408701610cee565b9250610dd560608701610cee565b9150610de360808701610d1f565b90509295509295909350565b5f5f60408385031215610e00575f5ffd5b610e0983610cee565b9150610e1760208401610d1f565b90509250929050565b5f5f5f60608486031215610e32575f5ffd5b610e3b84610cee565b9250610e4960208501610cee565b9150610d6560408501610d09565b5f5f5f5f60808587031215610e6a575f5ffd5b610e7385610cee565b9350610e8160208601610cee565b9250610e8f60408601610d09565b9150610e9d60608601610d1f565b905092959194509250565b6001600160a01b0391909116815260200190565b5f5f60408385031215610ecd575f5ffd5b610ed683610cee565b9150610e1760208401610d0956fea2646970667358221220f062581ab95abd8c2141d36859223fe3ba43269adadd4a14f1a87a69a3e8608364736f6c634300081c0033
Deployed Bytecode
0x608060405234801561000f575f5ffd5b50600436106100b8575f3560e01c8063088bbc0c146100bc578063175188e8146100d15780632deeb2d7146100e457806332814ef5146100f757806346edbe2a1461010a5780636a98bb601461011d578063715018a6146101305780638da5cb5b146101385780639d4c112814610156578063a14889fe14610179578063c4d66de8146101da578063d1cc64fe146101ed578063f2fde38b14610200578063f65eed5e14610213575b5f5ffd5b6100cf6100ca366004610d2e565b610226565b005b6100cf6100df366004610d6e565b6102ff565b6100cf6100f2366004610d8e565b6103df565b6100cf610105366004610def565b610566565b6100cf610118366004610e20565b61064f565b6100cf61012b366004610e57565b610715565b6100cf610822565b610140610835565b60405161014d9190610ea8565b60405180910390f35b610169610164366004610d6e565b61084f565b604051901515815260200161014d565b61018c610187366004610d6e565b6108c4565b6040805182516001600160a01b03908116825260208085015182169083015283830151169181019190915260608083015115159082015260809182015115159181019190915260a00161014d565b6100cf6101e8366004610d6e565b6109a0565b6100cf6101fb366004610d6e565b610a97565b6100cf61020e366004610d6e565b610ae1565b610169610221366004610ebc565b610b1e565b61022e610b9f565b5f610237610bd1565b6001600160a01b0385165f9081526020829052604090205490915060ff1661027d5783604051632452435f60e11b81526004016102749190610ea8565b60405180910390fd5b6001600160a01b0384165f81815260038301602090815260408083206001600160401b03881680855290835292819020805460ff1916871515908117909155815194855291840192909252908201527f31f27f08dd86f7709e04d27c92372ae8eece51908dc952a47f4f629cdec99a519060600160405180910390a150505050565b610307610b9f565b5f610310610bd1565b6001600160a01b0383165f9081526020829052604090205490915060ff1661034d5781604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b0382165f90815260208281526040808320805460ff1916905560018085019092529182902080546001600160a01b03199081168255918101805490921690915560020180546001600160b01b0319169055517f09a1db4b80c32706328728508c941a6b954f31eb5affd32f236c1fd405f8fea4906103d3908490610ea8565b60405180910390a15050565b6103e7610b9f565b6001600160a01b03851661040e5760405163d92e233d60e01b815260040160405180910390fd5b846001600160a01b03163b5f0361043857604051632711b74d60e11b815260040160405180910390fd5b5f610441610bd1565b6001600160a01b0387165f9081526020829052604090205490915060ff161561047f57856040516372b111af60e01b81526004016102749190610ea8565b6001600160a01b038681165f81815260018481016020908152604080842080546001600160a01b03199081168d8916908117835582860180549092168d8a16908117909255600283018054600160a01b9a8e16600161ff0160a01b03199091168117600160a81b8e15159081029190911760ff60a01b19169b909b179091558a865296849020805460ff1916909617909555825196875292860192909252840192909252606083015260808201929092527f1a6f64fb86223848042361a48738f2bd8f8b74c3d4830f695a89b3850f03e3169060a00160405180910390a150505050505050565b61056e610b9f565b6001600160a01b0382166105955760405163d92e233d60e01b815260040160405180910390fd5b5f61059e610bd1565b6001600160a01b0384165f9081526020829052604090205490915060ff166105db5782604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b0383165f818152600183016020908152604091829020600201805460ff60a01b1916600160a01b871515908102919091179091558251938452908301527fe0508b148170e6240389bc45de35c872bcf4c13c72e582048db3972dd3f8a0b1910160405180910390a1505050565b5f610658610bd1565b6001600160a01b0385165f9081526020829052604090205490915060ff166106955783604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b038085165f908152600283016020908152604080832093871683529281528282206001600160401b03861683529052205460ff1661070f57604051633cd8963360e01b81526001600160a01b038086166004830152841660248201526001600160401b0383166044820152606401610274565b50505050565b61071d610b9f565b6001600160a01b0384166107445760405163d92e233d60e01b815260040160405180910390fd5b5f61074d610bd1565b6001600160a01b0386165f9081526020829052604090205490915060ff1661078a5784604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b038581165f81815260028401602090815260408083209489168084529482528083206001600160401b03891680855290835292819020805460ff19168815159081179091558151948552918401949094529282015260608101919091527f3febc2e76e9131d5a9730a35c36bd82df9470e5065c085821aeee5a7e18df27a9060800160405180910390a15050505050565b61082a610b9f565b6108335f610bf5565b565b5f5f61083f610c4f565b546001600160a01b031692915050565b5f5f610859610bd1565b6001600160a01b0384165f9081526020829052604090205490915060ff166108965782604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b039092165f908152600190920160205250604090206002015460ff600160a01b9091041690565b6040805160a0810182525f808252602082018190529181018290526060810182905260808101829052906108f6610bd1565b6001600160a01b0384165f9081526020829052604090205490915060ff166109335782604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b039283165f90815260019182016020908152604091829020825160a08101845281548716815293810154861691840191909152600201549384169082015260ff600160a01b8404811615156060830152600160a81b909304909216151560808301525090565b5f6109a9610c73565b805490915060ff600160401b82041615906001600160401b03165f811580156109cf5750825b90505f826001600160401b031660011480156109ea5750303b155b9050811580156109f8575080155b15610a165760405163f92ee8a960e01b815260040160405180910390fd5b845467ffffffffffffffff191660011785558315610a4057845460ff60401b1916600160401b1785555b610a4986610c97565b8315610a8f57845460ff60401b19168555604051600181527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d29060200160405180910390a15b505050505050565b5f610aa0610bd1565b6001600160a01b0383165f9081526020829052604090205490915060ff16610add5781604051632452435f60e11b81526004016102749190610ea8565b5050565b610ae9610b9f565b6001600160a01b038116610b12575f604051631e4fbdf760e01b81526004016102749190610ea8565b610b1b81610bf5565b50565b5f5f610b28610bd1565b6001600160a01b0385165f9081526020829052604090205490915060ff16610b655783604051632452435f60e11b81526004016102749190610ea8565b6001600160a01b0384165f9081526003909101602090815260408083206001600160401b038616845290915290205460ff16905092915050565b33610ba8610835565b6001600160a01b031614610833573360405163118cdaa760e01b81526004016102749190610ea8565b7f5f24a50075938dfd8da964c77393bf6473ea141471f5786650baf8af2d01c20090565b5f610bfe610c4f565b80546001600160a01b038481166001600160a01b031983168117845560405193945091169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a3505050565b7f9016d09d72d40fdae2fd8ceac6b6234c7706214fd39c1cd1e609a0528c19930090565b7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a0090565b610c9f610ca8565b610b1b81610ccd565b610cb0610cd5565b61083357604051631afcd79f60e31b815260040160405180910390fd5b610ae9610ca8565b5f610cde610c73565b54600160401b900460ff16919050565b80356001600160a01b0381168114610d04575f5ffd5b919050565b80356001600160401b0381168114610d04575f5ffd5b80358015158114610d04575f5ffd5b5f5f5f60608486031215610d40575f5ffd5b610d4984610cee565b9250610d5760208501610d09565b9150610d6560408501610d1f565b90509250925092565b5f60208284031215610d7e575f5ffd5b610d8782610cee565b9392505050565b5f5f5f5f5f60a08688031215610da2575f5ffd5b610dab86610cee565b9450610db960208701610cee565b9350610dc760408701610cee565b9250610dd560608701610cee565b9150610de360808701610d1f565b90509295509295909350565b5f5f60408385031215610e00575f5ffd5b610e0983610cee565b9150610e1760208401610d1f565b90509250929050565b5f5f5f60608486031215610e32575f5ffd5b610e3b84610cee565b9250610e4960208501610cee565b9150610d6560408501610d09565b5f5f5f5f60808587031215610e6a575f5ffd5b610e7385610cee565b9350610e8160208601610cee565b9250610e8f60408601610d09565b9150610e9d60608601610d1f565b905092959194509250565b6001600160a01b0391909116815260200190565b5f5f60408385031215610ecd575f5ffd5b610ed683610cee565b9150610e1760208401610d0956fea2646970667358221220f062581ab95abd8c2141d36859223fe3ba43269adadd4a14f1a87a69a3e8608364736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.