Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00Latest 1 from a total of 1 transactions
| Transaction Hash |
Method
|
Block
|
From
|
|
To
|
||||
|---|---|---|---|---|---|---|---|---|---|
| Transfer Ownersh... | 15601361 | 1254 days ago | IN | 0 ETH | 0.0001479 |
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
Contract Name:
DelegatedManager
Compiler Version
v0.6.10+commit.00c0fcaf
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/*
Copyright 2022 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
import { Address } from "@openzeppelin/contracts/utils/Address.sol";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import { ISetToken } from "@setprotocol/set-protocol-v2/contracts/interfaces/ISetToken.sol";
import { PreciseUnitMath } from "@setprotocol/set-protocol-v2/contracts/lib/PreciseUnitMath.sol";
import { AddressArrayUtils } from "../lib/AddressArrayUtils.sol";
import { IGlobalExtension } from "../interfaces/IGlobalExtension.sol";
import { MutualUpgradeV2 } from "../lib/MutualUpgradeV2.sol";
/**
* @title DelegatedManager
* @author Set Protocol
*
* Smart contract manager that maintains permissions and SetToken admin functionality via owner role. Owner
* works alongside methodologist to ensure business agreements are kept. Owner is able to delegate maintenance
* operations to operator(s). There can be more than one operator, however they have a global role so once
* delegated to they can perform any operator delegated roles. The owner is able to set restrictions on what
* operators can do in the form of asset whitelists. Operators cannot trade/wrap/claim/etc. an asset that is not
* a part of the asset whitelist, hence they are a semi-trusted party. It is recommended that the owner address
* be managed by a multi-sig or some form of permissioning system.
*/
contract DelegatedManager is Ownable, MutualUpgradeV2 {
using Address for address;
using AddressArrayUtils for address[];
using SafeERC20 for IERC20;
/* ============ Enums ============ */
enum ExtensionState {
NONE,
PENDING,
INITIALIZED
}
/* ============ Events ============ */
event MethodologistChanged(
address indexed _newMethodologist
);
event ExtensionAdded(
address indexed _extension
);
event ExtensionRemoved(
address indexed _extension
);
event ExtensionInitialized(
address indexed _extension
);
event OperatorAdded(
address indexed _operator
);
event OperatorRemoved(
address indexed _operator
);
event AllowedAssetAdded(
address indexed _asset
);
event AllowedAssetRemoved(
address indexed _asset
);
event UseAssetAllowlistUpdated(
bool _status
);
event OwnerFeeSplitUpdated(
uint256 _newFeeSplit
);
event OwnerFeeRecipientUpdated(
address indexed _newFeeRecipient
);
/* ============ Modifiers ============ */
/**
* Throws if the sender is not the SetToken methodologist
*/
modifier onlyMethodologist() {
require(msg.sender == methodologist, "Must be methodologist");
_;
}
/**
* Throws if the sender is not an initialized extension
*/
modifier onlyExtension() {
require(extensionAllowlist[msg.sender] == ExtensionState.INITIALIZED, "Must be initialized extension");
_;
}
/* ============ State Variables ============ */
// Instance of SetToken
ISetToken public immutable setToken;
// Address of factory contract used to deploy contract
address public immutable factory;
// Mapping to check which ExtensionState a given extension is in
mapping(address => ExtensionState) public extensionAllowlist;
// Array of initialized extensions
address[] internal extensions;
// Mapping indicating if address is an approved operator
mapping(address=>bool) public operatorAllowlist;
// List of approved operators
address[] internal operators;
// Mapping indicating if asset is approved to be traded for, wrapped into, claimed, etc.
mapping(address=>bool) public assetAllowlist;
// List of allowed assets
address[] internal allowedAssets;
// Toggle if asset allow list is being enforced
bool public useAssetAllowlist;
// Global owner fee split that can be referenced by Extensions
uint256 public ownerFeeSplit;
// Address owners portions of fees get sent to
address public ownerFeeRecipient;
// Address of methodologist which serves as providing methodology for the index and receives fee splits
address public methodologist;
/* ============ Constructor ============ */
constructor(
ISetToken _setToken,
address _factory,
address _methodologist,
address[] memory _extensions,
address[] memory _operators,
address[] memory _allowedAssets,
bool _useAssetAllowlist
)
public
{
setToken = _setToken;
factory = _factory;
methodologist = _methodologist;
useAssetAllowlist = _useAssetAllowlist;
emit UseAssetAllowlistUpdated(_useAssetAllowlist);
_addExtensions(_extensions);
_addOperators(_operators);
_addAllowedAssets(_allowedAssets);
}
/* ============ External Functions ============ */
/**
* ONLY EXTENSION: Interact with a module registered on the SetToken. In order to ensure SetToken admin
* functions can only be changed from this contract no calls to the SetToken can originate from Extensions.
* To transfer SetTokens use the `transferTokens` function.
*
* @param _module Module to interact with
* @param _data Byte data of function to call in module
*/
function interactManager(address _module, bytes calldata _data) external onlyExtension {
require(_module != address(setToken), "Extensions cannot call SetToken");
// Invoke call to module, assume value will always be 0
_module.functionCallWithValue(_data, 0);
}
/**
* EXTENSION ONLY: Transfers _tokens held by the manager to _destination. Can be used to
* distribute fees or recover anything sent here accidentally.
*
* @param _token ERC20 token to send
* @param _destination Address receiving the tokens
* @param _amount Quantity of tokens to send
*/
function transferTokens(address _token, address _destination, uint256 _amount) external onlyExtension {
IERC20(_token).safeTransfer(_destination, _amount);
}
/**
* Initializes an added extension from PENDING to INITIALIZED state and adds to extension array. An
* address can only enter a PENDING state if it is an enabled extension added by the manager. Only
* callable by the extension itself, hence msg.sender is the subject of update.
*/
function initializeExtension() external {
require(extensionAllowlist[msg.sender] == ExtensionState.PENDING, "Extension must be pending");
extensionAllowlist[msg.sender] = ExtensionState.INITIALIZED;
extensions.push(msg.sender);
emit ExtensionInitialized(msg.sender);
}
/**
* ONLY OWNER: Add new extension(s) that the DelegatedManager can call. Puts extensions into PENDING
* state, each must be initialized in order to be used.
*
* @param _extensions New extension(s) to add
*/
function addExtensions(address[] memory _extensions) external onlyOwner {
_addExtensions(_extensions);
}
/**
* ONLY OWNER: Remove existing extension(s) tracked by the DelegatedManager. Removed extensions are
* placed in NONE state.
*
* @param _extensions Old extension to remove
*/
function removeExtensions(address[] memory _extensions) external onlyOwner {
for (uint256 i = 0; i < _extensions.length; i++) {
address extension = _extensions[i];
require(extensionAllowlist[extension] == ExtensionState.INITIALIZED, "Extension not initialized");
extensions.removeStorage(extension);
extensionAllowlist[extension] = ExtensionState.NONE;
IGlobalExtension(extension).removeExtension();
emit ExtensionRemoved(extension);
}
}
/**
* ONLY OWNER: Add new operator(s) address(es)
*
* @param _operators New operator(s) to add
*/
function addOperators(address[] memory _operators) external onlyOwner {
_addOperators(_operators);
}
/**
* ONLY OWNER: Remove operator(s) from the allowlist
*
* @param _operators New operator(s) to remove
*/
function removeOperators(address[] memory _operators) external onlyOwner {
for (uint256 i = 0; i < _operators.length; i++) {
address operator = _operators[i];
require(operatorAllowlist[operator], "Operator not already added");
operators.removeStorage(operator);
operatorAllowlist[operator] = false;
emit OperatorRemoved(operator);
}
}
/**
* ONLY OWNER: Add new asset(s) that can be traded to, wrapped to, or claimed
*
* @param _assets New asset(s) to add
*/
function addAllowedAssets(address[] memory _assets) external onlyOwner {
_addAllowedAssets(_assets);
}
/**
* ONLY OWNER: Remove asset(s) so that it/they can't be traded to, wrapped to, or claimed
*
* @param _assets Asset(s) to remove
*/
function removeAllowedAssets(address[] memory _assets) external onlyOwner {
for (uint256 i = 0; i < _assets.length; i++) {
address asset = _assets[i];
require(assetAllowlist[asset], "Asset not already added");
allowedAssets.removeStorage(asset);
assetAllowlist[asset] = false;
emit AllowedAssetRemoved(asset);
}
}
/**
* ONLY OWNER: Toggle useAssetAllowlist on and off. When false asset allowlist is ignored
* when true it is enforced.
*
* @param _useAssetAllowlist Bool indicating whether to use asset allow list
*/
function updateUseAssetAllowlist(bool _useAssetAllowlist) external onlyOwner {
useAssetAllowlist = _useAssetAllowlist;
emit UseAssetAllowlistUpdated(_useAssetAllowlist);
}
/**
* ONLY OWNER: Update percent of fees that are sent to owner
*
* @param _newFeeSplit Percent in precise units (100% = 10**18) of fees that accrue to owner
*/
function updateOwnerFeeSplit(uint256 _newFeeSplit) external mutualUpgrade(owner(), methodologist) {
require(_newFeeSplit <= PreciseUnitMath.preciseUnit(), "Invalid fee split");
ownerFeeSplit = _newFeeSplit;
emit OwnerFeeSplitUpdated(_newFeeSplit);
}
/**
* ONLY OWNER: Update address owner receives fees at
*
* @param _newFeeRecipient Address to send owner fees to
*/
function updateOwnerFeeRecipient(address _newFeeRecipient) external onlyOwner {
require(_newFeeRecipient != address(0), "Null address passed");
ownerFeeRecipient = _newFeeRecipient;
emit OwnerFeeRecipientUpdated(_newFeeRecipient);
}
/**
* ONLY METHODOLOGIST: Update the methodologist address
*
* @param _newMethodologist New methodologist address
*/
function setMethodologist(address _newMethodologist) external onlyMethodologist {
require(_newMethodologist != address(0), "Null address passed");
methodologist = _newMethodologist;
emit MethodologistChanged(_newMethodologist);
}
/**
* ONLY OWNER: Update the SetToken manager address.
*
* @param _newManager New manager address
*/
function setManager(address _newManager) external onlyOwner {
require(_newManager != address(0), "Zero address not valid");
require(extensions.length == 0, "Must remove all extensions");
setToken.setManager(_newManager);
}
/**
* ONLY OWNER: Add a new module to the SetToken.
*
* @param _module New module to add
*/
function addModule(address _module) external onlyOwner {
setToken.addModule(_module);
}
/**
* ONLY OWNER: Remove a module from the SetToken.
*
* @param _module Module to remove
*/
function removeModule(address _module) external onlyOwner {
setToken.removeModule(_module);
}
/* ============ External View Functions ============ */
function isAllowedAsset(address _asset) external view returns(bool) {
return !useAssetAllowlist || assetAllowlist[_asset];
}
function isPendingExtension(address _extension) external view returns(bool) {
return extensionAllowlist[_extension] == ExtensionState.PENDING;
}
function isInitializedExtension(address _extension) external view returns(bool) {
return extensionAllowlist[_extension] == ExtensionState.INITIALIZED;
}
function getExtensions() external view returns(address[] memory) {
return extensions;
}
function getOperators() external view returns(address[] memory) {
return operators;
}
function getAllowedAssets() external view returns(address[] memory) {
return allowedAssets;
}
/* ============ Internal Functions ============ */
/**
* Add extensions that the DelegatedManager can call.
*
* @param _extensions New extension to add
*/
function _addExtensions(address[] memory _extensions) internal {
for (uint256 i = 0; i < _extensions.length; i++) {
address extension = _extensions[i];
require(extensionAllowlist[extension] == ExtensionState.NONE , "Extension already exists");
extensionAllowlist[extension] = ExtensionState.PENDING;
emit ExtensionAdded(extension);
}
}
/**
* Add new operator(s) address(es)
*
* @param _operators New operator to add
*/
function _addOperators(address[] memory _operators) internal {
for (uint256 i = 0; i < _operators.length; i++) {
address operator = _operators[i];
require(!operatorAllowlist[operator], "Operator already added");
operators.push(operator);
operatorAllowlist[operator] = true;
emit OperatorAdded(operator);
}
}
/**
* Add new assets that can be traded to, wrapped to, or claimed
*
* @param _assets New asset to add
*/
function _addAllowedAssets(address[] memory _assets) internal {
for (uint256 i = 0; i < _assets.length; i++) {
address asset = _assets[i];
require(!assetAllowlist[asset], "Asset already added");
allowedAssets.push(asset);
assetAllowlist[asset] = true;
emit AllowedAssetAdded(asset);
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.2 <0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) 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 `amount` 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 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @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);
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "../GSN/Context.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.
*
* By default, the owner account will be the one that deploys the contract. 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 Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = 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 {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 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 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @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).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/**
* @title ISetToken
* @author Set Protocol
*
* Interface for operating with SetTokens.
*/
interface ISetToken is IERC20 {
/* ============ Enums ============ */
enum ModuleState {
NONE,
PENDING,
INITIALIZED
}
/* ============ Structs ============ */
/**
* The base definition of a SetToken Position
*
* @param component Address of token in the Position
* @param module If not in default state, the address of associated module
* @param unit Each unit is the # of components per 10^18 of a SetToken
* @param positionState Position ENUM. Default is 0; External is 1
* @param data Arbitrary data
*/
struct Position {
address component;
address module;
int256 unit;
uint8 positionState;
bytes data;
}
/**
* A struct that stores a component's cash position details and external positions
* This data structure allows O(1) access to a component's cash position units and
* virtual units.
*
* @param virtualUnit Virtual value of a component's DEFAULT position. Stored as virtual for efficiency
* updating all units at once via the position multiplier. Virtual units are achieved
* by dividing a "real" value by the "positionMultiplier"
* @param componentIndex
* @param externalPositionModules List of external modules attached to each external position. Each module
* maps to an external position
* @param externalPositions Mapping of module => ExternalPosition struct for a given component
*/
struct ComponentPosition {
int256 virtualUnit;
address[] externalPositionModules;
mapping(address => ExternalPosition) externalPositions;
}
/**
* A struct that stores a component's external position details including virtual unit and any
* auxiliary data.
*
* @param virtualUnit Virtual value of a component's EXTERNAL position.
* @param data Arbitrary data
*/
struct ExternalPosition {
int256 virtualUnit;
bytes data;
}
/* ============ Functions ============ */
function addComponent(address _component) external;
function removeComponent(address _component) external;
function editDefaultPositionUnit(address _component, int256 _realUnit) external;
function addExternalPositionModule(address _component, address _positionModule) external;
function removeExternalPositionModule(address _component, address _positionModule) external;
function editExternalPositionUnit(address _component, address _positionModule, int256 _realUnit) external;
function editExternalPositionData(address _component, address _positionModule, bytes calldata _data) external;
function invoke(address _target, uint256 _value, bytes calldata _data) external returns(bytes memory);
function editPositionMultiplier(int256 _newMultiplier) external;
function mint(address _account, uint256 _quantity) external;
function burn(address _account, uint256 _quantity) external;
function lock() external;
function unlock() external;
function addModule(address _module) external;
function removeModule(address _module) external;
function initializeModule() external;
function setManager(address _manager) external;
function manager() external view returns (address);
function moduleStates(address _module) external view returns (ModuleState);
function getModules() external view returns (address[] memory);
function getDefaultPositionRealUnit(address _component) external view returns(int256);
function getExternalPositionRealUnit(address _component, address _positionModule) external view returns(int256);
function getComponents() external view returns(address[] memory);
function getExternalPositionModules(address _component) external view returns(address[] memory);
function getExternalPositionData(address _component, address _positionModule) external view returns(bytes memory);
function isExternalPositionModule(address _component, address _module) external view returns(bool);
function isComponent(address _component) external view returns(bool);
function positionMultiplier() external view returns (int256);
function getPositions() external view returns (Position[] memory);
function getTotalComponentRealUnits(address _component) external view returns(int256);
function isInitializedModule(address _module) external view returns(bool);
function isPendingModule(address _module) external view returns(bool);
function isLocked() external view returns (bool);
}/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
pragma experimental ABIEncoderV2;
import { SafeCast } from "@openzeppelin/contracts/utils/SafeCast.sol";
import { SafeMath } from "@openzeppelin/contracts/math/SafeMath.sol";
import { SignedSafeMath } from "@openzeppelin/contracts/math/SignedSafeMath.sol";
/**
* @title PreciseUnitMath
* @author Set Protocol
*
* Arithmetic for fixed-point numbers with 18 decimals of precision. Some functions taken from
* dYdX's BaseMath library.
*
* CHANGELOG:
* - 9/21/20: Added safePower function
* - 4/21/21: Added approximatelyEquals function
* - 12/13/21: Added preciseDivCeil (int overloads) function
* - 12/13/21: Added abs function
*/
library PreciseUnitMath {
using SafeMath for uint256;
using SignedSafeMath for int256;
using SafeCast for int256;
// The number One in precise units.
uint256 constant internal PRECISE_UNIT = 10 ** 18;
int256 constant internal PRECISE_UNIT_INT = 10 ** 18;
// Max unsigned integer value
uint256 constant internal MAX_UINT_256 = type(uint256).max;
// Max and min signed integer value
int256 constant internal MAX_INT_256 = type(int256).max;
int256 constant internal MIN_INT_256 = type(int256).min;
/**
* @dev Getter function since constants can't be read directly from libraries.
*/
function preciseUnit() internal pure returns (uint256) {
return PRECISE_UNIT;
}
/**
* @dev Getter function since constants can't be read directly from libraries.
*/
function preciseUnitInt() internal pure returns (int256) {
return PRECISE_UNIT_INT;
}
/**
* @dev Getter function since constants can't be read directly from libraries.
*/
function maxUint256() internal pure returns (uint256) {
return MAX_UINT_256;
}
/**
* @dev Getter function since constants can't be read directly from libraries.
*/
function maxInt256() internal pure returns (int256) {
return MAX_INT_256;
}
/**
* @dev Getter function since constants can't be read directly from libraries.
*/
function minInt256() internal pure returns (int256) {
return MIN_INT_256;
}
/**
* @dev Multiplies value a by value b (result is rounded down). It's assumed that the value b is the significand
* of a number with 18 decimals precision.
*/
function preciseMul(uint256 a, uint256 b) internal pure returns (uint256) {
return a.mul(b).div(PRECISE_UNIT);
}
/**
* @dev Multiplies value a by value b (result is rounded towards zero). It's assumed that the value b is the
* significand of a number with 18 decimals precision.
*/
function preciseMul(int256 a, int256 b) internal pure returns (int256) {
return a.mul(b).div(PRECISE_UNIT_INT);
}
/**
* @dev Multiplies value a by value b (result is rounded up). It's assumed that the value b is the significand
* of a number with 18 decimals precision.
*/
function preciseMulCeil(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0 || b == 0) {
return 0;
}
return a.mul(b).sub(1).div(PRECISE_UNIT).add(1);
}
/**
* @dev Divides value a by value b (result is rounded down).
*/
function preciseDiv(uint256 a, uint256 b) internal pure returns (uint256) {
return a.mul(PRECISE_UNIT).div(b);
}
/**
* @dev Divides value a by value b (result is rounded towards 0).
*/
function preciseDiv(int256 a, int256 b) internal pure returns (int256) {
return a.mul(PRECISE_UNIT_INT).div(b);
}
/**
* @dev Divides value a by value b (result is rounded up or away from 0).
*/
function preciseDivCeil(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "Cant divide by 0");
return a > 0 ? a.mul(PRECISE_UNIT).sub(1).div(b).add(1) : 0;
}
/**
* @dev Divides value a by value b (result is rounded up or away from 0). When `a` is 0, 0 is
* returned. When `b` is 0, method reverts with divide-by-zero error.
*/
function preciseDivCeil(int256 a, int256 b) internal pure returns (int256) {
require(b != 0, "Cant divide by 0");
a = a.mul(PRECISE_UNIT_INT);
int256 c = a.div(b);
if (a % b != 0) {
// a ^ b == 0 case is covered by the previous if statement, hence it won't resolve to --c
(a ^ b > 0) ? ++c : --c;
}
return c;
}
/**
* @dev Divides value a by value b (result is rounded down - positive numbers toward 0 and negative away from 0).
*/
function divDown(int256 a, int256 b) internal pure returns (int256) {
require(b != 0, "Cant divide by 0");
require(a != MIN_INT_256 || b != -1, "Invalid input");
int256 result = a.div(b);
if (a ^ b < 0 && a % b != 0) {
result -= 1;
}
return result;
}
/**
* @dev Multiplies value a by value b where rounding is towards the lesser number.
* (positive values are rounded towards zero and negative values are rounded away from 0).
*/
function conservativePreciseMul(int256 a, int256 b) internal pure returns (int256) {
return divDown(a.mul(b), PRECISE_UNIT_INT);
}
/**
* @dev Divides value a by value b where rounding is towards the lesser number.
* (positive values are rounded towards zero and negative values are rounded away from 0).
*/
function conservativePreciseDiv(int256 a, int256 b) internal pure returns (int256) {
return divDown(a.mul(PRECISE_UNIT_INT), b);
}
/**
* @dev Performs the power on a specified value, reverts on overflow.
*/
function safePower(
uint256 a,
uint256 pow
)
internal
pure
returns (uint256)
{
require(a > 0, "Value must be positive");
uint256 result = 1;
for (uint256 i = 0; i < pow; i++){
uint256 previousResult = result;
// Using safemath multiplication prevents overflows
result = previousResult.mul(a);
}
return result;
}
/**
* @dev Returns true if a =~ b within range, false otherwise.
*/
function approximatelyEquals(uint256 a, uint256 b, uint256 range) internal pure returns (bool) {
return a <= b.add(range) && a >= b.sub(range);
}
/**
* Returns the absolute value of int256 `a` as a uint256
*/
function abs(int256 a) internal pure returns (uint) {
return a >= 0 ? a.toUint256() : a.mul(-1).toUint256();
}
/**
* Returns the negation of a
*/
function neg(int256 a) internal pure returns (int256) {
require(a > MIN_INT_256, "Inversion overflow");
return -a;
}
}/*
Copyright 2020 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
/**
* @title AddressArrayUtils
* @author Set Protocol
*
* Utility functions to handle Address Arrays
*
* CHANGELOG:
* - 4/27/21: Added validatePairsWithArray methods
*/
library AddressArrayUtils {
/**
* Finds the index of the first occurrence of the given element.
* @param A The input array to search
* @param a The value to find
* @return Returns (index and isIn) for the first occurrence starting from index 0
*/
function indexOf(address[] memory A, address a) internal pure returns (uint256, bool) {
uint256 length = A.length;
for (uint256 i = 0; i < length; i++) {
if (A[i] == a) {
return (i, true);
}
}
return (uint256(-1), false);
}
/**
* Returns true if the value is present in the list. Uses indexOf internally.
* @param A The input array to search
* @param a The value to find
* @return Returns isIn for the first occurrence starting from index 0
*/
function contains(address[] memory A, address a) internal pure returns (bool) {
(, bool isIn) = indexOf(A, a);
return isIn;
}
/**
* Returns true if there are 2 elements that are the same in an array
* @param A The input array to search
* @return Returns boolean for the first occurrence of a duplicate
*/
function hasDuplicate(address[] memory A) internal pure returns(bool) {
require(A.length > 0, "A is empty");
for (uint256 i = 0; i < A.length - 1; i++) {
address current = A[i];
for (uint256 j = i + 1; j < A.length; j++) {
if (current == A[j]) {
return true;
}
}
}
return false;
}
/**
* @param A The input array to search
* @param a The address to remove
* @return Returns the array with the object removed.
*/
function remove(address[] memory A, address a)
internal
pure
returns (address[] memory)
{
(uint256 index, bool isIn) = indexOf(A, a);
if (!isIn) {
revert("Address not in array.");
} else {
(address[] memory _A,) = pop(A, index);
return _A;
}
}
/**
* @param A The input array to search
* @param a The address to remove
*/
function removeStorage(address[] storage A, address a)
internal
{
(uint256 index, bool isIn) = indexOf(A, a);
if (!isIn) {
revert("Address not in array.");
} else {
uint256 lastIndex = A.length - 1; // If the array would be empty, the previous line would throw, so no underflow here
if (index != lastIndex) { A[index] = A[lastIndex]; }
A.pop();
}
}
/**
* Removes specified index from array
* @param A The input array to search
* @param index The index to remove
* @return Returns the new array and the removed entry
*/
function pop(address[] memory A, uint256 index)
internal
pure
returns (address[] memory, address)
{
uint256 length = A.length;
require(index < A.length, "Index must be < A length");
address[] memory newAddresses = new address[](length - 1);
for (uint256 i = 0; i < index; i++) {
newAddresses[i] = A[i];
}
for (uint256 j = index + 1; j < length; j++) {
newAddresses[j - 1] = A[j];
}
return (newAddresses, A[index]);
}
/**
* Returns the combination of the two arrays
* @param A The first array
* @param B The second array
* @return Returns A extended by B
*/
function extend(address[] memory A, address[] memory B) internal pure returns (address[] memory) {
uint256 aLength = A.length;
uint256 bLength = B.length;
address[] memory newAddresses = new address[](aLength + bLength);
for (uint256 i = 0; i < aLength; i++) {
newAddresses[i] = A[i];
}
for (uint256 j = 0; j < bLength; j++) {
newAddresses[aLength + j] = B[j];
}
return newAddresses;
}
/**
* Validate that address and uint array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of uint
*/
function validatePairsWithArray(address[] memory A, uint[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address and bool array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of bool
*/
function validatePairsWithArray(address[] memory A, bool[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address and string array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of strings
*/
function validatePairsWithArray(address[] memory A, string[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address array lengths match, and calling address array are not empty
* and contain no duplicate elements.
*
* @param A Array of addresses
* @param B Array of addresses
*/
function validatePairsWithArray(address[] memory A, address[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate that address and bytes array lengths match. Validate address array is not empty
* and contains no duplicate elements.
*
* @param A Array of addresses
* @param B Array of bytes
*/
function validatePairsWithArray(address[] memory A, bytes[] memory B) internal pure {
require(A.length == B.length, "Array length mismatch");
_validateLengthAndUniqueness(A);
}
/**
* Validate address array is not empty and contains no duplicate elements.
*
* @param A Array of addresses
*/
function _validateLengthAndUniqueness(address[] memory A) internal pure {
require(A.length > 0, "Array length must be > 0");
require(!hasDuplicate(A), "Cannot duplicate addresses");
}
}/*
Copyright 2021 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
pragma experimental "ABIEncoderV2";
import { ISetToken } from "@setprotocol/set-protocol-v2/contracts/interfaces/ISetToken.sol";
interface IGlobalExtension {
function removeExtension() external;
}/*
Copyright 2022 Set Labs Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
SPDX-License-Identifier: Apache License, Version 2.0
*/
pragma solidity 0.6.10;
/**
* @title MutualUpgradeV2
* @author Set Protocol
*
* The MutualUpgradeV2 contract contains a modifier for handling mutual upgrades between two parties
*
* CHANGELOG:
* - Update mutualUpgrade to allow single transaction execution if the two signing addresses are the same
*/
contract MutualUpgradeV2 {
/* ============ State Variables ============ */
// Mapping of upgradable units and if upgrade has been initialized by other party
mapping(bytes32 => bool) public mutualUpgrades;
/* ============ Events ============ */
event MutualUpgradeRegistered(
bytes32 _upgradeHash
);
/* ============ Modifiers ============ */
modifier mutualUpgrade(address _signerOne, address _signerTwo) {
require(
msg.sender == _signerOne || msg.sender == _signerTwo,
"Must be authorized address"
);
// If the two signing addresses are the same, skip upgrade hash step
if (_signerOne == _signerTwo) {
_;
}
address nonCaller = _getNonCaller(_signerOne, _signerTwo);
// The upgrade hash is defined by the hash of the transaction call data and sender of msg,
// which uniquely identifies the function, arguments, and sender.
bytes32 expectedHash = keccak256(abi.encodePacked(msg.data, nonCaller));
if (!mutualUpgrades[expectedHash]) {
bytes32 newHash = keccak256(abi.encodePacked(msg.data, msg.sender));
mutualUpgrades[newHash] = true;
emit MutualUpgradeRegistered(newHash);
return;
}
delete mutualUpgrades[expectedHash];
// Run the rest of the upgrades
_;
}
/* ============ Internal Functions ============ */
function _getNonCaller(address _signerOne, address _signerTwo) internal view returns(address) {
return msg.sender == _signerOne ? _signerTwo : _signerOne;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/*
* @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 GSN 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 Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @dev Wrappers over Solidity's uintXX/intXX casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*
* Can be combined with {SafeMath} and {SignedSafeMath} to extend it to smaller types, by performing
* all math on `uint256` and `int256` and then downcasting.
*/
library SafeCast {
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
require(value < 2**128, "SafeCast: value doesn\'t fit in 128 bits");
return uint128(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
require(value < 2**64, "SafeCast: value doesn\'t fit in 64 bits");
return uint64(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
require(value < 2**32, "SafeCast: value doesn\'t fit in 32 bits");
return uint32(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
require(value < 2**16, "SafeCast: value doesn\'t fit in 16 bits");
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*/
function toUint8(uint256 value) internal pure returns (uint8) {
require(value < 2**8, "SafeCast: value doesn\'t fit in 8 bits");
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
require(value >= 0, "SafeCast: value must be positive");
return uint256(value);
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*
* _Available since v3.1._
*/
function toInt128(int256 value) internal pure returns (int128) {
require(value >= -2**127 && value < 2**127, "SafeCast: value doesn\'t fit in 128 bits");
return int128(value);
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*
* _Available since v3.1._
*/
function toInt64(int256 value) internal pure returns (int64) {
require(value >= -2**63 && value < 2**63, "SafeCast: value doesn\'t fit in 64 bits");
return int64(value);
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*
* _Available since v3.1._
*/
function toInt32(int256 value) internal pure returns (int32) {
require(value >= -2**31 && value < 2**31, "SafeCast: value doesn\'t fit in 32 bits");
return int32(value);
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*
* _Available since v3.1._
*/
function toInt16(int256 value) internal pure returns (int16) {
require(value >= -2**15 && value < 2**15, "SafeCast: value doesn\'t fit in 16 bits");
return int16(value);
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits.
*
* _Available since v3.1._
*/
function toInt8(int256 value) internal pure returns (int8) {
require(value >= -2**7 && value < 2**7, "SafeCast: value doesn\'t fit in 8 bits");
return int8(value);
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
require(value < 2**255, "SafeCast: value doesn't fit in an int256");
return int256(value);
}
}// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
/**
* @title SignedSafeMath
* @dev Signed math operations with safety checks that revert on error.
*/
library SignedSafeMath {
int256 constant private _INT256_MIN = -2**255;
/**
* @dev Returns the multiplication of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(int256 a, int256 b) internal pure returns (int256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
require(!(a == -1 && b == _INT256_MIN), "SignedSafeMath: multiplication overflow");
int256 c = a * b;
require(c / a == b, "SignedSafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two signed integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(int256 a, int256 b) internal pure returns (int256) {
require(b != 0, "SignedSafeMath: division by zero");
require(!(b == -1 && a == _INT256_MIN), "SignedSafeMath: division overflow");
int256 c = a / b;
return c;
}
/**
* @dev Returns the subtraction of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(int256 a, int256 b) internal pure returns (int256) {
int256 c = a - b;
require((b >= 0 && c <= a) || (b < 0 && c > a), "SignedSafeMath: subtraction overflow");
return c;
}
/**
* @dev Returns the addition of two signed integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(int256 a, int256 b) internal pure returns (int256) {
int256 c = a + b;
require((b >= 0 && c >= a) || (b < 0 && c < a), "SignedSafeMath: addition overflow");
return c;
}
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"metadata": {
"useLiteralContent": true
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"contract ISetToken","name":"_setToken","type":"address"},{"internalType":"address","name":"_factory","type":"address"},{"internalType":"address","name":"_methodologist","type":"address"},{"internalType":"address[]","name":"_extensions","type":"address[]"},{"internalType":"address[]","name":"_operators","type":"address[]"},{"internalType":"address[]","name":"_allowedAssets","type":"address[]"},{"internalType":"bool","name":"_useAssetAllowlist","type":"bool"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_asset","type":"address"}],"name":"AllowedAssetAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_asset","type":"address"}],"name":"AllowedAssetRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_extension","type":"address"}],"name":"ExtensionAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_extension","type":"address"}],"name":"ExtensionInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_extension","type":"address"}],"name":"ExtensionRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_newMethodologist","type":"address"}],"name":"MethodologistChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"_upgradeHash","type":"bytes32"}],"name":"MutualUpgradeRegistered","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"}],"name":"OperatorAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_operator","type":"address"}],"name":"OperatorRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_newFeeRecipient","type":"address"}],"name":"OwnerFeeRecipientUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"_newFeeSplit","type":"uint256"}],"name":"OwnerFeeSplitUpdated","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":"bool","name":"_status","type":"bool"}],"name":"UseAssetAllowlistUpdated","type":"event"},{"inputs":[{"internalType":"address[]","name":"_assets","type":"address[]"}],"name":"addAllowedAssets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_extensions","type":"address[]"}],"name":"addExtensions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_module","type":"address"}],"name":"addModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_operators","type":"address[]"}],"name":"addOperators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"assetAllowlist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"extensionAllowlist","outputs":[{"internalType":"enum DelegatedManager.ExtensionState","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getAllowedAssets","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getExtensions","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getOperators","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"initializeExtension","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_module","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"interactManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_asset","type":"address"}],"name":"isAllowedAsset","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_extension","type":"address"}],"name":"isInitializedExtension","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_extension","type":"address"}],"name":"isPendingExtension","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"methodologist","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"mutualUpgrades","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"operatorAllowlist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownerFeeRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ownerFeeSplit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_assets","type":"address[]"}],"name":"removeAllowedAssets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_extensions","type":"address[]"}],"name":"removeExtensions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_module","type":"address"}],"name":"removeModule","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_operators","type":"address[]"}],"name":"removeOperators","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newManager","type":"address"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newMethodologist","type":"address"}],"name":"setMethodologist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setToken","outputs":[{"internalType":"contract ISetToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"address","name":"_destination","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"transferTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_newFeeRecipient","type":"address"}],"name":"updateOwnerFeeRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_newFeeSplit","type":"uint256"}],"name":"updateOwnerFeeSplit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_useAssetAllowlist","type":"bool"}],"name":"updateUseAssetAllowlist","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"useAssetAllowlist","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c06040523480156200001157600080fd5b5060405162002efc38038062002efc833981810160405260e08110156200003757600080fd5b8151602083015160408085015160608601805192519496939591949391820192846401000000008211156200006b57600080fd5b9083019060208201858111156200008157600080fd5b82518660208202830111640100000000821117156200009f57600080fd5b82525081516020918201928201910280838360005b83811015620000ce578181015183820152602001620000b4565b5050505090500160405260200180516040519392919084640100000000821115620000f857600080fd5b9083019060208201858111156200010e57600080fd5b82518660208202830111640100000000821117156200012c57600080fd5b82525081516020918201928201910280838360005b838110156200015b57818101518382015260200162000141565b50505050905001604052602001805160405193929190846401000000008211156200018557600080fd5b9083019060208201858111156200019b57600080fd5b8251866020820283011164010000000082111715620001b957600080fd5b82525081516020918201928201910280838360005b83811015620001e8578181015183820152602001620001ce565b50505050919091016040525060200151915060009050620002116001600160e01b036200031f16565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506001600160601b0319606088811b821660805287901b1660a052600b80546001600160a01b0387166001600160a01b03199091161790556008805482151560ff19909116811790915560408051918252517f7d0e7508f6ed7deeada7b44bda7fdc7b74833db5780604a293f40273f2af3b5e9181900360200190a1620002ea846001600160e01b036200032316565b620002fe836001600160e01b036200042b16565b62000312826001600160e01b036200055c16565b505050505050506200068c565b3390565b60005b8151811015620004275760008282815181106200033f57fe5b60200260200101519050600060028111156200035757fe5b6001600160a01b03821660009081526002602081905260409091205460ff16908111156200038157fe5b14620003d4576040805162461bcd60e51b815260206004820152601860248201527f457874656e73696f6e20616c7265616479206578697374730000000000000000604482015290519081900360640190fd5b6001600160a01b038116600081815260026020526040808220805460ff19166001179055517f99c6112dbaef85e57ac8ca86dd23e3c785162b58a6e810e5d5e7455b568d66b19190a25060010162000326565b5050565b60005b8151811015620004275760008282815181106200044757fe5b6020908102919091018101516001600160a01b0381166000908152600490925260409091205490915060ff1615620004c6576040805162461bcd60e51b815260206004820152601660248201527f4f70657261746f7220616c726561647920616464656400000000000000000000604482015290519081900360640190fd5b6005805460018082019092557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b038416908117909155600081815260046020526040808220805460ff1916909417909355915190917fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d91a2506001016200042e565b60005b8151811015620004275760008282815181106200057857fe5b6020908102919091018101516001600160a01b0381166000908152600690925260409091205490915060ff1615620005f7576040805162461bcd60e51b815260206004820152601360248201527f417373657420616c726561647920616464656400000000000000000000000000604482015290519081900360640190fd5b6007805460018082019092557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319166001600160a01b038416908117909155600081815260066020526040808220805460ff1916909417909355915190917e844926b92cb3e978a9e1c100ea92fdecda92b153f8b167fe3c17120beb128d91a2506001016200055f565b60805160601c60a05160601c612832620006ca6000398061184a525080610b8952806112fe52806116bb5280611a415280611d3552506128326000f3fe608060405234801561001057600080fd5b50600436106102115760003560e01c80639f8e67bf11610125578063d0ebdbe7116100ad578063ed9cf58c1161007c578063ed9cf58c14610965578063f066eea01461096d578063f2fde38b14610975578063f7b40ca61461099b578063fc74ea88146109a357610211565b8063d0ebdbe714610870578063d113368514610896578063d365a377146108bc578063dc20f8bf1461095d57610211565b8063a8124e49116100f4578063a8124e49146107d7578063aa99c067146107fd578063c45a015514610823578063c537bed01461082b578063c566a2d11461085157610211565b80639f8e67bf146106d2578063a0632461146106da578063a07aea1c14610700578063a64b6e5f146107a157610211565b80634747b001116101a8578063660db48411610177578063660db484146105f3578063715018a61461061957806383b7db63146106215780638da5cb5b146106295780638fdcd4a81461063157610211565b80634747b001146104705780634be73881146105115780634cf4f63b1461052b5780635fe155f9146105a957610211565b806327a099d8116101e457806327a099d814610329578063365c0c5514610381578063389f1532146104225780633e82b43e1461045357610211565b8063012a7388146102165780630c207c481461023a5780630f93d622146102625780631ed86f1914610303575b600080fd5b61021e6109c9565b604080516001600160a01b039092168252519081900360200190f35b6102606004803603602081101561025057600080fd5b50356001600160a01b03166109d8565b005b6102606004803603602081101561027857600080fd5b810190602081018135600160201b81111561029257600080fd5b8201836020820111156102a457600080fd5b803590602001918460208302840111600160201b831117156102c557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610acb945050505050565b6102606004803603602081101561031957600080fd5b50356001600160a01b0316610b2f565b610331610c1a565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561036d578181015183820152602001610355565b505050509050019250505060405180910390f35b6102606004803603602081101561039757600080fd5b810190602081018135600160201b8111156103b157600080fd5b8201836020820111156103c357600080fd5b803590602001918460208302840111600160201b831117156103e457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610c7c945050505050565b61043f6004803603602081101561043857600080fd5b5035610e3c565b604080519115158252519081900360200190f35b6102606004803603602081101561046957600080fd5b5035610e51565b6102606004803603602081101561048657600080fd5b810190602081018135600160201b8111156104a057600080fd5b8201836020820111156104b257600080fd5b803590602001918460208302840111600160201b831117156104d357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611135945050505050565b610519611284565b60408051918252519081900360200190f35b6102606004803603604081101561054157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561056b57600080fd5b82018360208201111561057d57600080fd5b803590602001918460018302840111600160201b8311171561059e57600080fd5b50909250905061128a565b6105cf600480360360208110156105bf57600080fd5b50356001600160a01b03166113d9565b604051808260028111156105df57fe5b60ff16815260200191505060405180910390f35b6102606004803603602081101561060957600080fd5b50356001600160a01b03166113ee565b6102606114e0565b610331611582565b61021e6115e2565b6102606004803603602081101561064757600080fd5b810190602081018135600160201b81111561066157600080fd5b82018360208201111561067357600080fd5b803590602001918460208302840111600160201b8311171561069457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506115f1945050505050565b61021e611652565b610260600480360360208110156106f057600080fd5b50356001600160a01b0316611661565b6102606004803603602081101561071657600080fd5b810190602081018135600160201b81111561073057600080fd5b82018360208201111561074257600080fd5b803590602001918460208302840111600160201b8311171561076357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611731945050505050565b610260600480360360608110156107b757600080fd5b506001600160a01b03813581169160208101359091169060400135611792565b61043f600480360360208110156107ed57600080fd5b50356001600160a01b031661181e565b61043f6004803603602081101561081357600080fd5b50356001600160a01b0316611833565b61021e611848565b61043f6004803603602081101561084157600080fd5b50356001600160a01b031661186c565b6102606004803603602081101561086757600080fd5b5035151561189f565b6102606004803603602081101561088657600080fd5b50356001600160a01b031661193e565b61043f600480360360208110156108ac57600080fd5b50356001600160a01b0316611ab7565b610260600480360360208110156108d257600080fd5b810190602081018135600160201b8111156108ec57600080fd5b8201836020820111156108fe57600080fd5b803590602001918460208302840111600160201b8311171561091f57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611aec945050505050565b610260611c3b565b61021e611d33565b610331611d57565b6102606004803603602081101561098b57600080fd5b50356001600160a01b0316611db7565b61043f611eaf565b61043f600480360360208110156109b957600080fd5b50356001600160a01b0316611eb8565b600a546001600160a01b031681565b6109e0611ec1565b6000546001600160a01b03908116911614610a30576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b6001600160a01b038116610a81576040805162461bcd60e51b8152602060048201526013602482015272139d5b1b081859191c995cdcc81c185cdcd959606a1b604482015290519081900360640190fd5b600a80546001600160a01b0319166001600160a01b0383169081179091556040517ff2c2b82b460daedf81b79433b66c2a7e81bed0ff7db4cf5f79de69d06d4f5dbd90600090a250565b610ad3611ec1565b6000546001600160a01b03908116911614610b23576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b610b2c81611ec5565b50565b610b37611ec1565b6000546001600160a01b03908116911614610b87576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316631ed86f19826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610bff57600080fd5b505af1158015610c13573d6000803e3d6000fd5b5050505050565b60606005805480602002602001604051908101604052809291908181526020018280548015610c7257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c54575b5050505050905090565b610c84611ec1565b6000546001600160a01b03908116911614610cd4576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b60005b8151811015610e38576000828281518110610cee57fe5b60200260200101519050600280811115610d0457fe5b6001600160a01b03821660009081526002602081905260409091205460ff1690811115610d2d57fe5b14610d7f576040805162461bcd60e51b815260206004820152601960248201527f457874656e73696f6e206e6f7420696e697469616c697a656400000000000000604482015290519081900360640190fd5b610d9060038263ffffffff611fe716565b6001600160a01b038116600081815260026020526040808220805460ff19169055805163100115bf60e11b815290516320022b7e9260048084019391929182900301818387803b158015610de357600080fd5b505af1158015610df7573d6000803e3d6000fd5b50506040516001600160a01b03841692507fa8b8029a40c8e49166ec4fec5b557819f19f8b94d2d69f5c4beb606af5850d8c9150600090a250600101610cd7565b5050565b60016020526000908152604090205460ff1681565b610e596115e2565b600b546001600160a01b03908116908216331480610e7f5750336001600160a01b038216145b610ed0576040805162461bcd60e51b815260206004820152601a60248201527f4d75737420626520617574686f72697a65642061646472657373000000000000604482015290519081900360640190fd5b806001600160a01b0316826001600160a01b03161415610f7357610ef2612140565b831115610f3a576040805162461bcd60e51b8152602060048201526011602482015270125b9d985b1a5908199959481cdc1b1a5d607a1b604482015290519081900360640190fd5b60098390556040805184815290517f8ea07ac39a2a767fb9019e033e8c79910d8397688594a03dc736c341a5f867de9181900360200190a15b6000610f7f838361214c565b905060008036836040516020018084848082843760609490941b6bffffffffffffffffffffffff19169190930190815260408051808303600b190181526014909201815281516020928301206000818152600190935291205490955060ff16935061108f92505050576000803633604051602001808484808284376bffffffffffffffffffffffff1960609590951b949094169190930190815260408051600b198184030181526014830180835281516020928301206000818152600193849052849020805460ff191690931790925581905290519096507f2d8be207af2fa24175b649fe62755a7b86fb6cb82c6efbd96de7447196d652ff9550908190036034019350915050a1505050611130565b6000818152600160205260409020805460ff191690556110ad612140565b8511156110f5576040805162461bcd60e51b8152602060048201526011602482015270125b9d985b1a5908199959481cdc1b1a5d607a1b604482015290519081900360640190fd5b60098590556040805186815290517f8ea07ac39a2a767fb9019e033e8c79910d8397688594a03dc736c341a5f867de9181900360200190a150505b505050565b61113d611ec1565b6000546001600160a01b0390811691161461118d576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b60005b8151811015610e385760008282815181106111a757fe5b6020908102919091018101516001600160a01b0381166000908152600690925260409091205490915060ff16611224576040805162461bcd60e51b815260206004820152601760248201527f4173736574206e6f7420616c7265616479206164646564000000000000000000604482015290519081900360640190fd5b61123560078263ffffffff611fe716565b6001600160a01b038116600081815260066020526040808220805460ff19169055517f42b0b7ac99512227a8d5628513f76bfb615ec2bd2ab6aa7f7bd59ce762be8ac79190a250600101611190565b60095481565b3360009081526002602081905260409091205460ff16818111156112aa57fe5b146112fc576040805162461bcd60e51b815260206004820152601d60248201527f4d75737420626520696e697469616c697a656420657874656e73696f6e000000604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316836001600160a01b03161415611383576040805162461bcd60e51b815260206004820152601f60248201527f457874656e73696f6e732063616e6e6f742063616c6c20536574546f6b656e00604482015290519081900360640190fd5b6113d382828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052506001600160a01b03891694935091505063ffffffff61216d16565b50505050565b60026020526000908152604090205460ff1681565b600b546001600160a01b03163314611445576040805162461bcd60e51b8152602060048201526015602482015274135d5cdd081899481b595d1a1bd91bdb1bd9da5cdd605a1b604482015290519081900360640190fd5b6001600160a01b038116611496576040805162461bcd60e51b8152602060048201526013602482015272139d5b1b081859191c995cdcc81c185cdcd959606a1b604482015290519081900360640190fd5b600b80546001600160a01b0319166001600160a01b0383169081179091556040517f64a85109ae1e3b47ca256ecbe4fab3f9507630490c97b1146e6fca96c85aea1190600090a250565b6114e8611ec1565b6000546001600160a01b03908116911614611538576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606003805480602002602001604051908101604052809291908181526020018280548015610c72576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c54575050505050905090565b6000546001600160a01b031690565b6115f9611ec1565b6000546001600160a01b03908116911614611649576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b610b2c8161219b565b600b546001600160a01b031681565b611669611ec1565b6000546001600160a01b039081169116146116b9576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a0632461826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610bff57600080fd5b611739611ec1565b6000546001600160a01b03908116911614611789576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b610b2c81612299565b3360009081526002602081905260409091205460ff16818111156117b257fe5b14611804576040805162461bcd60e51b815260206004820152601d60248201527f4d75737420626520696e697469616c697a656420657874656e73696f6e000000604482015290519081900360640190fd5b6111306001600160a01b038416838363ffffffff6123bf16565b60066020526000908152604090205460ff1681565b60046020526000908152604090205460ff1681565b7f000000000000000000000000000000000000000000000000000000000000000081565b60085460009060ff16158061189957506001600160a01b03821660009081526006602052604090205460ff165b92915050565b6118a7611ec1565b6000546001600160a01b039081169116146118f7576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b6008805482151560ff19909116811790915560408051918252517f7d0e7508f6ed7deeada7b44bda7fdc7b74833db5780604a293f40273f2af3b5e9181900360200190a150565b611946611ec1565b6000546001600160a01b03908116911614611996576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b6001600160a01b0381166119ea576040805162461bcd60e51b815260206004820152601660248201527516995c9bc81859191c995cdcc81b9bdd081d985b1a5960521b604482015290519081900360640190fd5b60035415611a3f576040805162461bcd60e51b815260206004820152601a60248201527f4d7573742072656d6f766520616c6c20657874656e73696f6e73000000000000604482015290519081900360640190fd5b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663d0ebdbe7826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610bff57600080fd5b600060025b6001600160a01b03831660009081526002602081905260409091205460ff1690811115611ae557fe5b1492915050565b611af4611ec1565b6000546001600160a01b03908116911614611b44576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b60005b8151811015610e38576000828281518110611b5e57fe5b6020908102919091018101516001600160a01b0381166000908152600490925260409091205490915060ff16611bdb576040805162461bcd60e51b815260206004820152601a60248201527f4f70657261746f72206e6f7420616c7265616479206164646564000000000000604482015290519081900360640190fd5b611bec60058263ffffffff611fe716565b6001600160a01b038116600081815260046020526040808220805460ff19169055517f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d9190a250600101611b47565b60013360009081526002602081905260409091205460ff1690811115611c5d57fe5b14611caf576040805162461bcd60e51b815260206004820152601960248201527f457874656e73696f6e206d7573742062652070656e64696e6700000000000000604482015290519081900360640190fd5b336000818152600260208190526040808320805460ff1916909217909155600380546001810182559083527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b03191684179055517f6ca540f49568f08cdcd0a9cf9407bdef8890e2f8630fd2a95542a47deed904c69190a2565b7f000000000000000000000000000000000000000000000000000000000000000081565b60606007805480602002602001604051908101604052809291908181526020018280548015610c72576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c54575050505050905090565b611dbf611ec1565b6000546001600160a01b03908116911614611e0f576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b6001600160a01b038116611e545760405162461bcd60e51b815260040180806020018281038252602681526020018061273e6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60085460ff1681565b60006001611abc565b3390565b60005b8151811015610e38576000828281518110611edf57fe5b6020908102919091018101516001600160a01b0381166000908152600690925260409091205490915060ff1615611f53576040805162461bcd60e51b8152602060048201526013602482015272105cdcd95d08185b1c9958591e481859191959606a1b604482015290519081900360640190fd5b6007805460018082019092557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319166001600160a01b038416908117909155600081815260066020526040808220805460ff1916909417909355915190917e844926b92cb3e978a9e1c100ea92fdecda92b153f8b167fe3c17120beb128d91a250600101611ec8565b60008061204d8480548060200260200160405190810160405280929190818152602001828054801561204257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612024575b505050505084612411565b915091508061209b576040805162461bcd60e51b815260206004820152601560248201527420b2323932b9b9903737ba1034b71030b93930bc9760591b604482015290519081900360640190fd5b83546000190182811461210d578481815481106120b457fe5b9060005260206000200160009054906101000a90046001600160a01b03168584815481106120de57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b8480548061211757fe5b600082815260209020810160001990810180546001600160a01b03191690550190555050505050565b670de0b6b3a764000090565b6000336001600160a01b038416146121645782612166565b815b9392505050565b606061219384848460405180606001604052806029815260200161278a60299139612477565b949350505050565b60005b8151811015610e385760008282815181106121b557fe5b60200260200101519050600060028111156121cc57fe5b6001600160a01b03821660009081526002602081905260409091205460ff16908111156121f557fe5b14612247576040805162461bcd60e51b815260206004820152601860248201527f457874656e73696f6e20616c7265616479206578697374730000000000000000604482015290519081900360640190fd5b6001600160a01b038116600081815260026020526040808220805460ff19166001179055517f99c6112dbaef85e57ac8ca86dd23e3c785162b58a6e810e5d5e7455b568d66b19190a25060010161219e565b60005b8151811015610e385760008282815181106122b357fe5b6020908102919091018101516001600160a01b0381166000908152600490925260409091205490915060ff161561232a576040805162461bcd60e51b815260206004820152601660248201527513dc195c985d1bdc88185b1c9958591e48185919195960521b604482015290519081900360640190fd5b6005805460018082019092557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b038416908117909155600081815260046020526040808220805460ff1916909417909355915190917fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d91a25060010161229c565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526111309084906125d3565b81516000908190815b8181101561246457846001600160a01b031686828151811061243857fe5b60200260200101516001600160a01b0316141561245c579250600191506124709050565b60010161241a565b50600019600092509250505b9250929050565b6060824710156124b85760405162461bcd60e51b81526004018080602001828103825260268152602001806127646026913960400191505060405180910390fd5b6124c185612684565b612512576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106125515780518252601f199092019160209182019101612532565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146125b3576040519150601f19603f3d011682016040523d82523d6000602084013e6125b8565b606091505b50915091506125c882828661268a565b979650505050505050565b6060612628826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661272e9092919063ffffffff16565b8051909150156111305780806020019051602081101561264757600080fd5b50516111305760405162461bcd60e51b815260040180806020018281038252602a8152602001806127d3602a913960400191505060405180910390fd5b3b151590565b60608315612699575081612166565b8251156126a95782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156126f35781810151838201526020016126db565b50505050905090810190601f1680156127205780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6060612193848460008561247756fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c65644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212204c3a9db13c0d4e7dc47df264ef836ce5901e26edd2b5a70efb3c869dfe6a129d64736f6c634300060a003300000000000000000000000002f04dd09a9074ba25c5fddda8998ddf8994f1f00000000000000000000000002899384007fc7eff519745140e8c05bc5ff5f0c5000000000000000000000000ae5ef86dacaa88668c640cd59e99580ecba35f3b00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102115760003560e01c80639f8e67bf11610125578063d0ebdbe7116100ad578063ed9cf58c1161007c578063ed9cf58c14610965578063f066eea01461096d578063f2fde38b14610975578063f7b40ca61461099b578063fc74ea88146109a357610211565b8063d0ebdbe714610870578063d113368514610896578063d365a377146108bc578063dc20f8bf1461095d57610211565b8063a8124e49116100f4578063a8124e49146107d7578063aa99c067146107fd578063c45a015514610823578063c537bed01461082b578063c566a2d11461085157610211565b80639f8e67bf146106d2578063a0632461146106da578063a07aea1c14610700578063a64b6e5f146107a157610211565b80634747b001116101a8578063660db48411610177578063660db484146105f3578063715018a61461061957806383b7db63146106215780638da5cb5b146106295780638fdcd4a81461063157610211565b80634747b001146104705780634be73881146105115780634cf4f63b1461052b5780635fe155f9146105a957610211565b806327a099d8116101e457806327a099d814610329578063365c0c5514610381578063389f1532146104225780633e82b43e1461045357610211565b8063012a7388146102165780630c207c481461023a5780630f93d622146102625780631ed86f1914610303575b600080fd5b61021e6109c9565b604080516001600160a01b039092168252519081900360200190f35b6102606004803603602081101561025057600080fd5b50356001600160a01b03166109d8565b005b6102606004803603602081101561027857600080fd5b810190602081018135600160201b81111561029257600080fd5b8201836020820111156102a457600080fd5b803590602001918460208302840111600160201b831117156102c557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610acb945050505050565b6102606004803603602081101561031957600080fd5b50356001600160a01b0316610b2f565b610331610c1a565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561036d578181015183820152602001610355565b505050509050019250505060405180910390f35b6102606004803603602081101561039757600080fd5b810190602081018135600160201b8111156103b157600080fd5b8201836020820111156103c357600080fd5b803590602001918460208302840111600160201b831117156103e457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610c7c945050505050565b61043f6004803603602081101561043857600080fd5b5035610e3c565b604080519115158252519081900360200190f35b6102606004803603602081101561046957600080fd5b5035610e51565b6102606004803603602081101561048657600080fd5b810190602081018135600160201b8111156104a057600080fd5b8201836020820111156104b257600080fd5b803590602001918460208302840111600160201b831117156104d357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611135945050505050565b610519611284565b60408051918252519081900360200190f35b6102606004803603604081101561054157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561056b57600080fd5b82018360208201111561057d57600080fd5b803590602001918460018302840111600160201b8311171561059e57600080fd5b50909250905061128a565b6105cf600480360360208110156105bf57600080fd5b50356001600160a01b03166113d9565b604051808260028111156105df57fe5b60ff16815260200191505060405180910390f35b6102606004803603602081101561060957600080fd5b50356001600160a01b03166113ee565b6102606114e0565b610331611582565b61021e6115e2565b6102606004803603602081101561064757600080fd5b810190602081018135600160201b81111561066157600080fd5b82018360208201111561067357600080fd5b803590602001918460208302840111600160201b8311171561069457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506115f1945050505050565b61021e611652565b610260600480360360208110156106f057600080fd5b50356001600160a01b0316611661565b6102606004803603602081101561071657600080fd5b810190602081018135600160201b81111561073057600080fd5b82018360208201111561074257600080fd5b803590602001918460208302840111600160201b8311171561076357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611731945050505050565b610260600480360360608110156107b757600080fd5b506001600160a01b03813581169160208101359091169060400135611792565b61043f600480360360208110156107ed57600080fd5b50356001600160a01b031661181e565b61043f6004803603602081101561081357600080fd5b50356001600160a01b0316611833565b61021e611848565b61043f6004803603602081101561084157600080fd5b50356001600160a01b031661186c565b6102606004803603602081101561086757600080fd5b5035151561189f565b6102606004803603602081101561088657600080fd5b50356001600160a01b031661193e565b61043f600480360360208110156108ac57600080fd5b50356001600160a01b0316611ab7565b610260600480360360208110156108d257600080fd5b810190602081018135600160201b8111156108ec57600080fd5b8201836020820111156108fe57600080fd5b803590602001918460208302840111600160201b8311171561091f57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611aec945050505050565b610260611c3b565b61021e611d33565b610331611d57565b6102606004803603602081101561098b57600080fd5b50356001600160a01b0316611db7565b61043f611eaf565b61043f600480360360208110156109b957600080fd5b50356001600160a01b0316611eb8565b600a546001600160a01b031681565b6109e0611ec1565b6000546001600160a01b03908116911614610a30576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b6001600160a01b038116610a81576040805162461bcd60e51b8152602060048201526013602482015272139d5b1b081859191c995cdcc81c185cdcd959606a1b604482015290519081900360640190fd5b600a80546001600160a01b0319166001600160a01b0383169081179091556040517ff2c2b82b460daedf81b79433b66c2a7e81bed0ff7db4cf5f79de69d06d4f5dbd90600090a250565b610ad3611ec1565b6000546001600160a01b03908116911614610b23576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b610b2c81611ec5565b50565b610b37611ec1565b6000546001600160a01b03908116911614610b87576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b7f00000000000000000000000002f04dd09a9074ba25c5fddda8998ddf8994f1f06001600160a01b0316631ed86f19826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610bff57600080fd5b505af1158015610c13573d6000803e3d6000fd5b5050505050565b60606005805480602002602001604051908101604052809291908181526020018280548015610c7257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c54575b5050505050905090565b610c84611ec1565b6000546001600160a01b03908116911614610cd4576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b60005b8151811015610e38576000828281518110610cee57fe5b60200260200101519050600280811115610d0457fe5b6001600160a01b03821660009081526002602081905260409091205460ff1690811115610d2d57fe5b14610d7f576040805162461bcd60e51b815260206004820152601960248201527f457874656e73696f6e206e6f7420696e697469616c697a656400000000000000604482015290519081900360640190fd5b610d9060038263ffffffff611fe716565b6001600160a01b038116600081815260026020526040808220805460ff19169055805163100115bf60e11b815290516320022b7e9260048084019391929182900301818387803b158015610de357600080fd5b505af1158015610df7573d6000803e3d6000fd5b50506040516001600160a01b03841692507fa8b8029a40c8e49166ec4fec5b557819f19f8b94d2d69f5c4beb606af5850d8c9150600090a250600101610cd7565b5050565b60016020526000908152604090205460ff1681565b610e596115e2565b600b546001600160a01b03908116908216331480610e7f5750336001600160a01b038216145b610ed0576040805162461bcd60e51b815260206004820152601a60248201527f4d75737420626520617574686f72697a65642061646472657373000000000000604482015290519081900360640190fd5b806001600160a01b0316826001600160a01b03161415610f7357610ef2612140565b831115610f3a576040805162461bcd60e51b8152602060048201526011602482015270125b9d985b1a5908199959481cdc1b1a5d607a1b604482015290519081900360640190fd5b60098390556040805184815290517f8ea07ac39a2a767fb9019e033e8c79910d8397688594a03dc736c341a5f867de9181900360200190a15b6000610f7f838361214c565b905060008036836040516020018084848082843760609490941b6bffffffffffffffffffffffff19169190930190815260408051808303600b190181526014909201815281516020928301206000818152600190935291205490955060ff16935061108f92505050576000803633604051602001808484808284376bffffffffffffffffffffffff1960609590951b949094169190930190815260408051600b198184030181526014830180835281516020928301206000818152600193849052849020805460ff191690931790925581905290519096507f2d8be207af2fa24175b649fe62755a7b86fb6cb82c6efbd96de7447196d652ff9550908190036034019350915050a1505050611130565b6000818152600160205260409020805460ff191690556110ad612140565b8511156110f5576040805162461bcd60e51b8152602060048201526011602482015270125b9d985b1a5908199959481cdc1b1a5d607a1b604482015290519081900360640190fd5b60098590556040805186815290517f8ea07ac39a2a767fb9019e033e8c79910d8397688594a03dc736c341a5f867de9181900360200190a150505b505050565b61113d611ec1565b6000546001600160a01b0390811691161461118d576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b60005b8151811015610e385760008282815181106111a757fe5b6020908102919091018101516001600160a01b0381166000908152600690925260409091205490915060ff16611224576040805162461bcd60e51b815260206004820152601760248201527f4173736574206e6f7420616c7265616479206164646564000000000000000000604482015290519081900360640190fd5b61123560078263ffffffff611fe716565b6001600160a01b038116600081815260066020526040808220805460ff19169055517f42b0b7ac99512227a8d5628513f76bfb615ec2bd2ab6aa7f7bd59ce762be8ac79190a250600101611190565b60095481565b3360009081526002602081905260409091205460ff16818111156112aa57fe5b146112fc576040805162461bcd60e51b815260206004820152601d60248201527f4d75737420626520696e697469616c697a656420657874656e73696f6e000000604482015290519081900360640190fd5b7f00000000000000000000000002f04dd09a9074ba25c5fddda8998ddf8994f1f06001600160a01b0316836001600160a01b03161415611383576040805162461bcd60e51b815260206004820152601f60248201527f457874656e73696f6e732063616e6e6f742063616c6c20536574546f6b656e00604482015290519081900360640190fd5b6113d382828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052506001600160a01b03891694935091505063ffffffff61216d16565b50505050565b60026020526000908152604090205460ff1681565b600b546001600160a01b03163314611445576040805162461bcd60e51b8152602060048201526015602482015274135d5cdd081899481b595d1a1bd91bdb1bd9da5cdd605a1b604482015290519081900360640190fd5b6001600160a01b038116611496576040805162461bcd60e51b8152602060048201526013602482015272139d5b1b081859191c995cdcc81c185cdcd959606a1b604482015290519081900360640190fd5b600b80546001600160a01b0319166001600160a01b0383169081179091556040517f64a85109ae1e3b47ca256ecbe4fab3f9507630490c97b1146e6fca96c85aea1190600090a250565b6114e8611ec1565b6000546001600160a01b03908116911614611538576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606003805480602002602001604051908101604052809291908181526020018280548015610c72576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c54575050505050905090565b6000546001600160a01b031690565b6115f9611ec1565b6000546001600160a01b03908116911614611649576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b610b2c8161219b565b600b546001600160a01b031681565b611669611ec1565b6000546001600160a01b039081169116146116b9576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b7f00000000000000000000000002f04dd09a9074ba25c5fddda8998ddf8994f1f06001600160a01b031663a0632461826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610bff57600080fd5b611739611ec1565b6000546001600160a01b03908116911614611789576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b610b2c81612299565b3360009081526002602081905260409091205460ff16818111156117b257fe5b14611804576040805162461bcd60e51b815260206004820152601d60248201527f4d75737420626520696e697469616c697a656420657874656e73696f6e000000604482015290519081900360640190fd5b6111306001600160a01b038416838363ffffffff6123bf16565b60066020526000908152604090205460ff1681565b60046020526000908152604090205460ff1681565b7f0000000000000000000000002899384007fc7eff519745140e8c05bc5ff5f0c581565b60085460009060ff16158061189957506001600160a01b03821660009081526006602052604090205460ff165b92915050565b6118a7611ec1565b6000546001600160a01b039081169116146118f7576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b6008805482151560ff19909116811790915560408051918252517f7d0e7508f6ed7deeada7b44bda7fdc7b74833db5780604a293f40273f2af3b5e9181900360200190a150565b611946611ec1565b6000546001600160a01b03908116911614611996576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b6001600160a01b0381166119ea576040805162461bcd60e51b815260206004820152601660248201527516995c9bc81859191c995cdcc81b9bdd081d985b1a5960521b604482015290519081900360640190fd5b60035415611a3f576040805162461bcd60e51b815260206004820152601a60248201527f4d7573742072656d6f766520616c6c20657874656e73696f6e73000000000000604482015290519081900360640190fd5b7f00000000000000000000000002f04dd09a9074ba25c5fddda8998ddf8994f1f06001600160a01b031663d0ebdbe7826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610bff57600080fd5b600060025b6001600160a01b03831660009081526002602081905260409091205460ff1690811115611ae557fe5b1492915050565b611af4611ec1565b6000546001600160a01b03908116911614611b44576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b60005b8151811015610e38576000828281518110611b5e57fe5b6020908102919091018101516001600160a01b0381166000908152600490925260409091205490915060ff16611bdb576040805162461bcd60e51b815260206004820152601a60248201527f4f70657261746f72206e6f7420616c7265616479206164646564000000000000604482015290519081900360640190fd5b611bec60058263ffffffff611fe716565b6001600160a01b038116600081815260046020526040808220805460ff19169055517f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d9190a250600101611b47565b60013360009081526002602081905260409091205460ff1690811115611c5d57fe5b14611caf576040805162461bcd60e51b815260206004820152601960248201527f457874656e73696f6e206d7573742062652070656e64696e6700000000000000604482015290519081900360640190fd5b336000818152600260208190526040808320805460ff1916909217909155600380546001810182559083527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b03191684179055517f6ca540f49568f08cdcd0a9cf9407bdef8890e2f8630fd2a95542a47deed904c69190a2565b7f00000000000000000000000002f04dd09a9074ba25c5fddda8998ddf8994f1f081565b60606007805480602002602001604051908101604052809291908181526020018280548015610c72576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c54575050505050905090565b611dbf611ec1565b6000546001600160a01b03908116911614611e0f576040805162461bcd60e51b815260206004820181905260248201526000805160206127b3833981519152604482015290519081900360640190fd5b6001600160a01b038116611e545760405162461bcd60e51b815260040180806020018281038252602681526020018061273e6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60085460ff1681565b60006001611abc565b3390565b60005b8151811015610e38576000828281518110611edf57fe5b6020908102919091018101516001600160a01b0381166000908152600690925260409091205490915060ff1615611f53576040805162461bcd60e51b8152602060048201526013602482015272105cdcd95d08185b1c9958591e481859191959606a1b604482015290519081900360640190fd5b6007805460018082019092557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319166001600160a01b038416908117909155600081815260066020526040808220805460ff1916909417909355915190917e844926b92cb3e978a9e1c100ea92fdecda92b153f8b167fe3c17120beb128d91a250600101611ec8565b60008061204d8480548060200260200160405190810160405280929190818152602001828054801561204257602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311612024575b505050505084612411565b915091508061209b576040805162461bcd60e51b815260206004820152601560248201527420b2323932b9b9903737ba1034b71030b93930bc9760591b604482015290519081900360640190fd5b83546000190182811461210d578481815481106120b457fe5b9060005260206000200160009054906101000a90046001600160a01b03168584815481106120de57fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b8480548061211757fe5b600082815260209020810160001990810180546001600160a01b03191690550190555050505050565b670de0b6b3a764000090565b6000336001600160a01b038416146121645782612166565b815b9392505050565b606061219384848460405180606001604052806029815260200161278a60299139612477565b949350505050565b60005b8151811015610e385760008282815181106121b557fe5b60200260200101519050600060028111156121cc57fe5b6001600160a01b03821660009081526002602081905260409091205460ff16908111156121f557fe5b14612247576040805162461bcd60e51b815260206004820152601860248201527f457874656e73696f6e20616c7265616479206578697374730000000000000000604482015290519081900360640190fd5b6001600160a01b038116600081815260026020526040808220805460ff19166001179055517f99c6112dbaef85e57ac8ca86dd23e3c785162b58a6e810e5d5e7455b568d66b19190a25060010161219e565b60005b8151811015610e385760008282815181106122b357fe5b6020908102919091018101516001600160a01b0381166000908152600490925260409091205490915060ff161561232a576040805162461bcd60e51b815260206004820152601660248201527513dc195c985d1bdc88185b1c9958591e48185919195960521b604482015290519081900360640190fd5b6005805460018082019092557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b038416908117909155600081815260046020526040808220805460ff1916909417909355915190917fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d91a25060010161229c565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526111309084906125d3565b81516000908190815b8181101561246457846001600160a01b031686828151811061243857fe5b60200260200101516001600160a01b0316141561245c579250600191506124709050565b60010161241a565b50600019600092509250505b9250929050565b6060824710156124b85760405162461bcd60e51b81526004018080602001828103825260268152602001806127646026913960400191505060405180910390fd5b6124c185612684565b612512576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106125515780518252601f199092019160209182019101612532565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d80600081146125b3576040519150601f19603f3d011682016040523d82523d6000602084013e6125b8565b606091505b50915091506125c882828661268a565b979650505050505050565b6060612628826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661272e9092919063ffffffff16565b8051909150156111305780806020019051602081101561264757600080fd5b50516111305760405162461bcd60e51b815260040180806020018281038252602a8152602001806127d3602a913960400191505060405180910390fd5b3b151590565b60608315612699575081612166565b8251156126a95782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156126f35781810151838201526020016126db565b50505050905090810190601f1680156127205780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b6060612193848460008561247756fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c65644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212204c3a9db13c0d4e7dc47df264ef836ce5901e26edd2b5a70efb3c869dfe6a129d64736f6c634300060a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000002f04dd09a9074ba25c5fddda8998ddf8994f1f00000000000000000000000002899384007fc7eff519745140e8c05bc5ff5f0c5000000000000000000000000ae5ef86dacaa88668c640cd59e99580ecba35f3b00000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : _setToken (address): 0x02f04dD09a9074ba25C5fddDA8998ddF8994f1F0
Arg [1] : _factory (address): 0x2899384007FC7eFF519745140e8c05bc5FF5f0C5
Arg [2] : _methodologist (address): 0xaE5Ef86DaCaa88668c640cD59e99580ECbA35f3b
Arg [3] : _extensions (address[]):
Arg [4] : _operators (address[]):
Arg [5] : _allowedAssets (address[]):
Arg [6] : _useAssetAllowlist (bool): False
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 00000000000000000000000002f04dd09a9074ba25c5fddda8998ddf8994f1f0
Arg [1] : 0000000000000000000000002899384007fc7eff519745140e8c05bc5ff5f0c5
Arg [2] : 000000000000000000000000ae5ef86dacaa88668c640cd59e99580ecba35f3b
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000e0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000120
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [9] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 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.