Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Method | Block |
From
|
To
|
|||
---|---|---|---|---|---|---|---|
0x60c06040 | 18337228 | 523 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xb04d1daE...101bEe140 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
DelegatedManager
Compiler Version
v0.6.10+commit.00c0fcaf
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 { AddressArrayUtils } from "../lib/AddressArrayUtils.sol"; import { ISetToken } from "../interfaces/ISetToken.sol"; import { PreciseUnitMath } from "../lib/PreciseUnitMath.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); } /** * MUTUAL UPGRADE: Update percent of fees that are sent to owner. Owner and Methodologist must each call this function to execute * the update. If Owner and Methodologist point to the same address, the update can be executed in a single call. * * @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.0 <0.8.0; import "../utils/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 virtual 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; /** * @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, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, 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 (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @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) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @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) { 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, reverting 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) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting 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) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * 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); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * 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); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * 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; /** * @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; } }
// 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 "./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"); } } }
// 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); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(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 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; } }
/* 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"; interface IGlobalExtension { function removeExtension() external; }
// 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; /** * @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 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; } }
/* 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 { 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 */ library PreciseUnitMath { using SafeMath for uint256; using SignedSafeMath 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 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; } }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
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"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102115760003560e01c80639f8e67bf11610125578063d0ebdbe7116100ad578063ed9cf58c1161007c578063ed9cf58c14610965578063f066eea01461096d578063f2fde38b14610975578063f7b40ca61461099b578063fc74ea88146109a357610211565b8063d0ebdbe714610870578063d113368514610896578063d365a377146108bc578063dc20f8bf1461095d57610211565b8063a8124e49116100f4578063a8124e49146107d7578063aa99c067146107fd578063c45a015514610823578063c537bed01461082b578063c566a2d11461085157610211565b80639f8e67bf146106d2578063a0632461146106da578063a07aea1c14610700578063a64b6e5f146107a157610211565b80634747b001116101a8578063660db48411610177578063660db484146105f3578063715018a61461061957806383b7db63146106215780638da5cb5b146106295780638fdcd4a81461063157610211565b80634747b001146104705780634be73881146105115780634cf4f63b1461052b5780635fe155f9146105a957610211565b806327a099d8116101e457806327a099d814610329578063365c0c5514610381578063389f1532146104225780633e82b43e1461045357610211565b8063012a7388146102165780630c207c481461023a5780630f93d622146102625780631ed86f1914610303575b600080fd5b61021e6109c9565b604080516001600160a01b039092168252519081900360200190f35b6102606004803603602081101561025057600080fd5b50356001600160a01b03166109d8565b005b6102606004803603602081101561027857600080fd5b810190602081018135600160201b81111561029257600080fd5b8201836020820111156102a457600080fd5b803590602001918460208302840111600160201b831117156102c557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610ad5945050505050565b6102606004803603602081101561031957600080fd5b50356001600160a01b0316610b43565b610331610c38565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561036d578181015183820152602001610355565b505050509050019250505060405180910390f35b6102606004803603602081101561039757600080fd5b810190602081018135600160201b8111156103b157600080fd5b8201836020820111156103c357600080fd5b803590602001918460208302840111600160201b831117156103e457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610c9a945050505050565b61043f6004803603602081101561043857600080fd5b5035610e64565b604080519115158252519081900360200190f35b6102606004803603602081101561046957600080fd5b5035610e79565b6102606004803603602081101561048657600080fd5b810190602081018135600160201b8111156104a057600080fd5b8201836020820111156104b257600080fd5b803590602001918460208302840111600160201b831117156104d357600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061115d945050505050565b6105196112b6565b60408051918252519081900360200190f35b6102606004803603604081101561054157600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561056b57600080fd5b82018360208201111561057d57600080fd5b803590602001918460018302840111600160201b8311171561059e57600080fd5b5090925090506112bc565b6105cf600480360360208110156105bf57600080fd5b50356001600160a01b031661140b565b604051808260028111156105df57fe5b60ff16815260200191505060405180910390f35b6102606004803603602081101561060957600080fd5b50356001600160a01b0316611420565b610260611512565b6103316115be565b61021e61161e565b6102606004803603602081101561064757600080fd5b810190602081018135600160201b81111561066157600080fd5b82018360208201111561067357600080fd5b803590602001918460208302840111600160201b8311171561069457600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061162d945050505050565b61021e611698565b610260600480360360208110156106f057600080fd5b50356001600160a01b03166116a7565b6102606004803603602081101561071657600080fd5b810190602081018135600160201b81111561073057600080fd5b82018360208201111561074257600080fd5b803590602001918460208302840111600160201b8311171561076357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611781945050505050565b610260600480360360608110156107b757600080fd5b506001600160a01b038135811691602081013590911690604001356117ec565b61043f600480360360208110156107ed57600080fd5b50356001600160a01b0316611878565b61043f6004803603602081101561081357600080fd5b50356001600160a01b031661188d565b61021e6118a2565b61043f6004803603602081101561084157600080fd5b50356001600160a01b03166118c6565b6102606004803603602081101561086757600080fd5b503515156118f9565b6102606004803603602081101561088657600080fd5b50356001600160a01b03166119a2565b61043f600480360360208110156108ac57600080fd5b50356001600160a01b0316611b25565b610260600480360360208110156108d257600080fd5b810190602081018135600160201b8111156108ec57600080fd5b8201836020820111156108fe57600080fd5b803590602001918460208302840111600160201b8311171561091f57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611b5a945050505050565b610260611cb3565b61021e611dab565b610331611dcf565b6102606004803603602081101561098b57600080fd5b50356001600160a01b0316611e2f565b61043f611f31565b61043f600480360360208110156109b957600080fd5b50356001600160a01b0316611f3a565b600a546001600160a01b031681565b6109e0611f43565b6001600160a01b03166109f161161e565b6001600160a01b031614610a3a576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b6001600160a01b038116610a8b576040805162461bcd60e51b8152602060048201526013602482015272139d5b1b081859191c995cdcc81c185cdcd959606a1b604482015290519081900360640190fd5b600a80546001600160a01b0319166001600160a01b0383169081179091556040517ff2c2b82b460daedf81b79433b66c2a7e81bed0ff7db4cf5f79de69d06d4f5dbd90600090a250565b610add611f43565b6001600160a01b0316610aee61161e565b6001600160a01b031614610b37576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b610b4081611f47565b50565b610b4b611f43565b6001600160a01b0316610b5c61161e565b6001600160a01b031614610ba5576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b7f00000000000000000000000055b2cfcfe99110c773f00b023560dd9ef6c8a13b6001600160a01b0316631ed86f19826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610c1d57600080fd5b505af1158015610c31573d6000803e3d6000fd5b5050505050565b60606005805480602002602001604051908101604052809291908181526020018280548015610c9057602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610c72575b5050505050905090565b610ca2611f43565b6001600160a01b0316610cb361161e565b6001600160a01b031614610cfc576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b60005b8151811015610e60576000828281518110610d1657fe5b60200260200101519050600280811115610d2c57fe5b6001600160a01b03821660009081526002602081905260409091205460ff1690811115610d5557fe5b14610da7576040805162461bcd60e51b815260206004820152601960248201527f457874656e73696f6e206e6f7420696e697469616c697a656400000000000000604482015290519081900360640190fd5b610db860038263ffffffff61206916565b6001600160a01b038116600081815260026020526040808220805460ff19169055805163100115bf60e11b815290516320022b7e9260048084019391929182900301818387803b158015610e0b57600080fd5b505af1158015610e1f573d6000803e3d6000fd5b50506040516001600160a01b03841692507fa8b8029a40c8e49166ec4fec5b557819f19f8b94d2d69f5c4beb606af5850d8c9150600090a250600101610cff565b5050565b60016020526000908152604090205460ff1681565b610e8161161e565b600b546001600160a01b03908116908216331480610ea75750336001600160a01b038216145b610ef8576040805162461bcd60e51b815260206004820152601a60248201527f4d75737420626520617574686f72697a65642061646472657373000000000000604482015290519081900360640190fd5b806001600160a01b0316826001600160a01b03161415610f9b57610f1a6121c2565b831115610f62576040805162461bcd60e51b8152602060048201526011602482015270125b9d985b1a5908199959481cdc1b1a5d607a1b604482015290519081900360640190fd5b60098390556040805184815290517f8ea07ac39a2a767fb9019e033e8c79910d8397688594a03dc736c341a5f867de9181900360200190a15b6000610fa783836121ce565b905060008036836040516020018084848082843760609490941b6bffffffffffffffffffffffff19169190930190815260408051808303600b190181526014909201815281516020928301206000818152600190935291205490955060ff1693506110b792505050576000803633604051602001808484808284376bffffffffffffffffffffffff1960609590951b949094169190930190815260408051600b198184030181526014830180835281516020928301206000818152600193849052849020805460ff191690931790925581905290519096507f2d8be207af2fa24175b649fe62755a7b86fb6cb82c6efbd96de7447196d652ff9550908190036034019350915050a1505050611158565b6000818152600160205260409020805460ff191690556110d56121c2565b85111561111d576040805162461bcd60e51b8152602060048201526011602482015270125b9d985b1a5908199959481cdc1b1a5d607a1b604482015290519081900360640190fd5b60098590556040805186815290517f8ea07ac39a2a767fb9019e033e8c79910d8397688594a03dc736c341a5f867de9181900360200190a150505b505050565b611165611f43565b6001600160a01b031661117661161e565b6001600160a01b0316146111bf576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b60005b8151811015610e605760008282815181106111d957fe5b6020908102919091018101516001600160a01b0381166000908152600690925260409091205490915060ff16611256576040805162461bcd60e51b815260206004820152601760248201527f4173736574206e6f7420616c7265616479206164646564000000000000000000604482015290519081900360640190fd5b61126760078263ffffffff61206916565b6001600160a01b038116600081815260066020526040808220805460ff19169055517f42b0b7ac99512227a8d5628513f76bfb615ec2bd2ab6aa7f7bd59ce762be8ac79190a2506001016111c2565b60095481565b3360009081526002602081905260409091205460ff16818111156112dc57fe5b1461132e576040805162461bcd60e51b815260206004820152601d60248201527f4d75737420626520696e697469616c697a656420657874656e73696f6e000000604482015290519081900360640190fd5b7f00000000000000000000000055b2cfcfe99110c773f00b023560dd9ef6c8a13b6001600160a01b0316836001600160a01b031614156113b5576040805162461bcd60e51b815260206004820152601f60248201527f457874656e73696f6e732063616e6e6f742063616c6c20536574546f6b656e00604482015290519081900360640190fd5b61140582828080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052506001600160a01b03891694935091505063ffffffff6121ef16565b50505050565b60026020526000908152604090205460ff1681565b600b546001600160a01b03163314611477576040805162461bcd60e51b8152602060048201526015602482015274135d5cdd081899481b595d1a1bd91bdb1bd9da5cdd605a1b604482015290519081900360640190fd5b6001600160a01b0381166114c8576040805162461bcd60e51b8152602060048201526013602482015272139d5b1b081859191c995cdcc81c185cdcd959606a1b604482015290519081900360640190fd5b600b80546001600160a01b0319166001600160a01b0383169081179091556040517f64a85109ae1e3b47ca256ecbe4fab3f9507630490c97b1146e6fca96c85aea1190600090a250565b61151a611f43565b6001600160a01b031661152b61161e565b6001600160a01b031614611574576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606003805480602002602001604051908101604052809291908181526020018280548015610c90576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c72575050505050905090565b6000546001600160a01b031690565b611635611f43565b6001600160a01b031661164661161e565b6001600160a01b03161461168f576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b610b408161221d565b600b546001600160a01b031681565b6116af611f43565b6001600160a01b03166116c061161e565b6001600160a01b031614611709576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b7f00000000000000000000000055b2cfcfe99110c773f00b023560dd9ef6c8a13b6001600160a01b031663a0632461826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610c1d57600080fd5b611789611f43565b6001600160a01b031661179a61161e565b6001600160a01b0316146117e3576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b610b408161231b565b3360009081526002602081905260409091205460ff168181111561180c57fe5b1461185e576040805162461bcd60e51b815260206004820152601d60248201527f4d75737420626520696e697469616c697a656420657874656e73696f6e000000604482015290519081900360640190fd5b6111586001600160a01b038416838363ffffffff61244116565b60066020526000908152604090205460ff1681565b60046020526000908152604090205460ff1681565b7f00000000000000000000000038d8fa043913e8ef6466d01bef4af42cafa3b23581565b60085460009060ff1615806118f357506001600160a01b03821660009081526006602052604090205460ff165b92915050565b611901611f43565b6001600160a01b031661191261161e565b6001600160a01b03161461195b576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b6008805482151560ff19909116811790915560408051918252517f7d0e7508f6ed7deeada7b44bda7fdc7b74833db5780604a293f40273f2af3b5e9181900360200190a150565b6119aa611f43565b6001600160a01b03166119bb61161e565b6001600160a01b031614611a04576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b6001600160a01b038116611a58576040805162461bcd60e51b815260206004820152601660248201527516995c9bc81859191c995cdcc81b9bdd081d985b1a5960521b604482015290519081900360640190fd5b60035415611aad576040805162461bcd60e51b815260206004820152601a60248201527f4d7573742072656d6f766520616c6c20657874656e73696f6e73000000000000604482015290519081900360640190fd5b7f00000000000000000000000055b2cfcfe99110c773f00b023560dd9ef6c8a13b6001600160a01b031663d0ebdbe7826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610c1d57600080fd5b600060025b6001600160a01b03831660009081526002602081905260409091205460ff1690811115611b5357fe5b1492915050565b611b62611f43565b6001600160a01b0316611b7361161e565b6001600160a01b031614611bbc576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b60005b8151811015610e60576000828281518110611bd657fe5b6020908102919091018101516001600160a01b0381166000908152600490925260409091205490915060ff16611c53576040805162461bcd60e51b815260206004820152601a60248201527f4f70657261746f72206e6f7420616c7265616479206164646564000000000000604482015290519081900360640190fd5b611c6460058263ffffffff61206916565b6001600160a01b038116600081815260046020526040808220805460ff19169055517f80c0b871b97b595b16a7741c1b06fed0c6f6f558639f18ccbce50724325dc40d9190a250600101611bbf565b60013360009081526002602081905260409091205460ff1690811115611cd557fe5b14611d27576040805162461bcd60e51b815260206004820152601960248201527f457874656e73696f6e206d7573742062652070656e64696e6700000000000000604482015290519081900360640190fd5b336000818152600260208190526040808320805460ff1916909217909155600380546001810182559083527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b0180546001600160a01b03191684179055517f6ca540f49568f08cdcd0a9cf9407bdef8890e2f8630fd2a95542a47deed904c69190a2565b7f00000000000000000000000055b2cfcfe99110c773f00b023560dd9ef6c8a13b81565b60606007805480602002602001604051908101604052809291908181526020018280548015610c90576020028201919060005260206000209081546001600160a01b03168152600190910190602001808311610c72575050505050905090565b611e37611f43565b6001600160a01b0316611e4861161e565b6001600160a01b031614611e91576040805162461bcd60e51b81526020600482018190526024820152600080516020612835833981519152604482015290519081900360640190fd5b6001600160a01b038116611ed65760405162461bcd60e51b81526004018080602001828103825260268152602001806127c06026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60085460ff1681565b60006001611b2a565b3390565b60005b8151811015610e60576000828281518110611f6157fe5b6020908102919091018101516001600160a01b0381166000908152600690925260409091205490915060ff1615611fd5576040805162461bcd60e51b8152602060048201526013602482015272105cdcd95d08185b1c9958591e481859191959606a1b604482015290519081900360640190fd5b6007805460018082019092557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6880180546001600160a01b0319166001600160a01b038416908117909155600081815260066020526040808220805460ff1916909417909355915190917e844926b92cb3e978a9e1c100ea92fdecda92b153f8b167fe3c17120beb128d91a250600101611f4a565b6000806120cf848054806020026020016040519081016040528092919081815260200182805480156120c457602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116120a6575b505050505084612493565b915091508061211d576040805162461bcd60e51b815260206004820152601560248201527420b2323932b9b9903737ba1034b71030b93930bc9760591b604482015290519081900360640190fd5b83546000190182811461218f5784818154811061213657fe5b9060005260206000200160009054906101000a90046001600160a01b031685848154811061216057fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b031602179055505b8480548061219957fe5b600082815260209020810160001990810180546001600160a01b03191690550190555050505050565b670de0b6b3a764000090565b6000336001600160a01b038416146121e657826121e8565b815b9392505050565b606061221584848460405180606001604052806029815260200161280c602991396124f9565b949350505050565b60005b8151811015610e6057600082828151811061223757fe5b602002602001015190506000600281111561224e57fe5b6001600160a01b03821660009081526002602081905260409091205460ff169081111561227757fe5b146122c9576040805162461bcd60e51b815260206004820152601860248201527f457874656e73696f6e20616c7265616479206578697374730000000000000000604482015290519081900360640190fd5b6001600160a01b038116600081815260026020526040808220805460ff19166001179055517f99c6112dbaef85e57ac8ca86dd23e3c785162b58a6e810e5d5e7455b568d66b19190a250600101612220565b60005b8151811015610e6057600082828151811061233557fe5b6020908102919091018101516001600160a01b0381166000908152600490925260409091205490915060ff16156123ac576040805162461bcd60e51b815260206004820152601660248201527513dc195c985d1bdc88185b1c9958591e48185919195960521b604482015290519081900360640190fd5b6005805460018082019092557f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319166001600160a01b038416908117909155600081815260046020526040808220805460ff1916909417909355915190917fac6fa858e9350a46cec16539926e0fde25b7629f84b5a72bffaae4df888ae86d91a25060010161231e565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611158908490612655565b81516000908190815b818110156124e657846001600160a01b03168682815181106124ba57fe5b60200260200101516001600160a01b031614156124de579250600191506124f29050565b60010161249c565b50600019600092509250505b9250929050565b60608247101561253a5760405162461bcd60e51b81526004018080602001828103825260268152602001806127e66026913960400191505060405180910390fd5b61254385612706565b612594576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b60006060866001600160a01b031685876040518082805190602001908083835b602083106125d35780518252601f1990920191602091820191016125b4565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612635576040519150601f19603f3d011682016040523d82523d6000602084013e61263a565b606091505b509150915061264a82828661270c565b979650505050505050565b60606126aa826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166127b09092919063ffffffff16565b805190915015611158578080602001905160208110156126c957600080fd5b50516111585760405162461bcd60e51b815260040180806020018281038252602a815260200180612855602a913960400191505060405180910390fd5b3b151590565b6060831561271b5750816121e8565b82511561272b5782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561277557818101518382015260200161275d565b50505050905090810190601f1680156127a25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b606061221584846000856124f956fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c65644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a26469706673582212209ef11e07794543e70e6afba3f700b52c1ff328fe6928cb6b0b5838bad70e4a2464736f6c634300060a0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.