Contract Overview
Balance:
0 ETH
ETH Value:
$0.00
My Name Tag:
Not Available
Txn Hash | Method |
Block
|
From
|
To
|
Value | [Txn Fee] | |||
---|---|---|---|---|---|---|---|---|---|
0x9804f4cbff2dd2fdb3e5667dc2fb6101859b9ff47aef0cfe86746ed1724a7524 | 0x60806040 | 219932 | 314 days 4 hrs ago | 0x904b5993fc92979eeedc19ccc58bed6b7216667c | IN | Create: SymbolService | 0 ETH | 0.005268207757 ETH |
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
SymbolService
Compiler Version
v0.7.4+commit.3f05b770
Optimization Enabled:
Yes with 1000 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "../interface/ILiquidityPoolGetter.sol"; contract SymbolService is Initializable, OwnableUpgradeable { using AddressUpgradeable for address; using SafeMathUpgradeable for uint256; using EnumerableSetUpgradeable for EnumerableSetUpgradeable.UintSet; using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet; struct PerpetualUID { address liquidityPool; uint256 perpetualIndex; } mapping(uint256 => PerpetualUID) internal _perpetualUIDs; mapping(bytes32 => EnumerableSetUpgradeable.UintSet) internal _perpetualSymbols; uint256 internal _nextSymbol; uint256 internal _reservedSymbolCount; EnumerableSetUpgradeable.AddressSet internal _whitelistedFactories; event AllocateSymbol(address liquidityPool, uint256 perpetualIndex, uint256 symbol); event AddWhitelistedFactory(address factory); event RemoveWhitelistedFactory(address factory); function initialize(uint256 reservedSymbolCount) external virtual initializer { __Ownable_init(); _nextSymbol = reservedSymbolCount; _reservedSymbolCount = reservedSymbolCount; } /** * @notice Check if the factory is whitelisted * @param factory The address of the factory * @return bool True if the factory is whitelisted */ function isWhitelistedFactory(address factory) public view returns (bool) { return _whitelistedFactories.contains(factory); } /** * @notice Add the factory to the whitelist. Can only called by owner * @param factory The address of the factory */ function addWhitelistedFactory(address factory) public onlyOwner { require(factory.isContract(), "factory must be a contract"); require(!isWhitelistedFactory(factory), "factory already exists"); _whitelistedFactories.add(factory); emit AddWhitelistedFactory(factory); } /** * @notice Remove the factory from the whitelist. Can only called by owner * @param factory The address of the factory */ function removeWhitelistedFactory(address factory) public onlyOwner { require(isWhitelistedFactory(factory), "factory not found"); _whitelistedFactories.remove(factory); emit RemoveWhitelistedFactory(factory); } modifier onlyWhitelisted(address liquidityPool) { require(AddressUpgradeable.isContract(liquidityPool), "must called by contract"); (, , address[7] memory addresses, , ) = ILiquidityPoolGetter(liquidityPool) .getLiquidityPoolInfo(); require(_whitelistedFactories.contains(addresses[0]), "wrong factory"); _; } /** * @notice Get the unique id(liquidity pool + perpetual index) of the perpetual by the symbol * @param symbol The symbol * @return liquidityPool The address of the liquidity pool * @return perpetualIndex The index of the perpetual in the liquidity pool */ function getPerpetualUID(uint256 symbol) public view returns (address liquidityPool, uint256 perpetualIndex) { PerpetualUID storage perpetualUID = _perpetualUIDs[symbol]; require(perpetualUID.liquidityPool != address(0), "symbol not found"); liquidityPool = perpetualUID.liquidityPool; perpetualIndex = perpetualUID.perpetualIndex; } /** * @notice Get the symbols of the perpetual by the unique id(liquidity pool + perpetual index) * @param liquidityPool The address of the liquidity pool * @param perpetualIndex The index of the perpetual in the liquidity pool * @return symbols The symbols of the perpetual */ function getSymbols(address liquidityPool, uint256 perpetualIndex) public view returns (uint256[] memory symbols) { bytes32 key = _getPerpetualKey(liquidityPool, perpetualIndex); uint256 length = _perpetualSymbols[key].length(); if (length == 0) { return symbols; } symbols = new uint256[](length); for (uint256 i = 0; i < length; i++) { symbols[i] = _perpetualSymbols[key].at(i); } } /** * @notice Allocate the perpetual an unreserved symbol The perpetual must have no symbol before. * Can only called by whitelisted factory * @param liquidityPool The address of the liquidity pool * @param perpetualIndex The index of the perpetual in the liquidity pool * @return symbol The symbol allocated */ function allocateSymbol(address liquidityPool, uint256 perpetualIndex) public onlyWhitelisted(msg.sender) returns (uint256 symbol) { bytes32 key = _getPerpetualKey(liquidityPool, perpetualIndex); require(_perpetualSymbols[key].length() == 0, "perpetual already exists"); symbol = _nextSymbol; require(symbol < type(uint256).max, "not enough symbol"); _perpetualUIDs[symbol] = PerpetualUID({ liquidityPool: liquidityPool, perpetualIndex: perpetualIndex }); _perpetualSymbols[key].add(symbol); _nextSymbol = _nextSymbol.add(1); emit AllocateSymbol(liquidityPool, perpetualIndex, symbol); } /** * @notice Assign perpetual a reserved symbol. The perpetual must have unreserved symbol * and not have reserved symbol before. Can only called by owner * @param liquidityPool The address of the liquidity pool * @param perpetualIndex The index of the perpetual in the liquidity pool * @param symbol The symbol assigned */ function assignReservedSymbol( address liquidityPool, uint256 perpetualIndex, uint256 symbol ) public onlyOwner onlyWhitelisted(liquidityPool) { require(symbol < _reservedSymbolCount, "symbol exceeds reserved symbol count"); require(_perpetualUIDs[symbol].liquidityPool == address(0), "symbol already exists"); bytes32 key = _getPerpetualKey(liquidityPool, perpetualIndex); require( _perpetualSymbols[key].length() == 1 && _perpetualSymbols[key].at(0) >= _reservedSymbolCount, "perpetual must have normal symbol and mustn't have reversed symbol" ); _perpetualUIDs[symbol] = PerpetualUID({ liquidityPool: liquidityPool, perpetualIndex: perpetualIndex }); _perpetualSymbols[key].add(symbol); emit AllocateSymbol(liquidityPool, perpetualIndex, symbol); } /** * @dev Get the key of the perpetual * @param liquidityPool The address of the liquidity pool which the perpetual belongs to * @param perpetualIndex The index of the perpetual in the liquidity pool * @return bytes32 The key of the perpetual */ function _getPerpetualKey(address liquidityPool, uint256 perpetualIndex) internal pure returns (bytes32) { return keccak256(abi.encodePacked(liquidityPool, perpetualIndex)); } }
// SPDX-License-Identifier: MIT // solhint-disable-next-line compiler-version pragma solidity >=0.4.24 <0.8.0; import "../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {UpgradeableProxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { require(_initializing || _isConstructor() || !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * 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 OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal initializer { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal initializer { 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; } uint256[49] private __gap; }
// 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 SafeMathUpgradeable { /** * @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; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ library EnumerableSetUpgradeable { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.2 <0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @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: GPL-2.0-or-later pragma solidity 0.7.4; pragma experimental ABIEncoderV2; import "../Type.sol"; interface ILiquidityPoolGetter { /** * @notice Get the info of the liquidity pool * @return isRunning True if the liquidity pool is running * @return isFastCreationEnabled True if the operator of the liquidity pool is allowed to create new perpetual * when the liquidity pool is running * @return addresses The related addresses of the liquidity pool * @return intNums Int type properties, see below for details. * @return uintNums Uint type properties, see below for details. */ function getLiquidityPoolInfo() external view returns ( bool isRunning, bool isFastCreationEnabled, // [0] creator, // [1] operator, // [2] transferringOperator, // [3] governor, // [4] shareToken, // [5] collateralToken, // [6] vault, address[7] memory addresses, // [0] vaultFeeRate, // [1] poolCash, // [2] insuranceFundCap, // [3] insuranceFund, // [4] donatedInsuranceFund, int256[5] memory intNums, // [0] collateralDecimals, // [1] perpetualCount // [2] fundingTime, // [3] operatorExpiration, uint256[4] memory uintNums ); /** * @notice Get the info of the perpetual. Need to update the funding state and the oracle price * of each perpetual before and update the funding rate of each perpetual after * @param perpetualIndex The index of the perpetual in the liquidity pool * @return state The state of the perpetual * @return oracle The oracle's address of the perpetual * @return nums The related numbers of the perpetual */ function getPerpetualInfo(uint256 perpetualIndex) external view returns ( PerpetualState state, address oracle, // [0] totalCollateral // [1] markPrice, (return settlementPrice if it is in EMERGENCY state) // [2] indexPrice, // [3] fundingRate, // [4] unitAccumulativeFunding, // [5] initialMarginRate, // [6] maintenanceMarginRate, // [7] operatorFeeRate, // [8] lpFeeRate, // [9] referralRebateRate, // [10] liquidationPenaltyRate, // [11] keeperGasReward, // [12] insuranceFundRate, // [13-15] halfSpread value, min, max, // [16-18] openSlippageFactor value, min, max, // [19-21] closeSlippageFactor value, min, max, // [22-24] fundingRateLimit value, min, max, // [25-27] ammMaxLeverage value, min, max, // [28-30] maxClosePriceDiscount value, min, max, // [31] openInterest, // [32] maxOpenInterestRate, // [33-35] fundingRateFactor value, min, max, // [36-38] defaultTargetLeverage value, min, max, int256[39] memory nums ); /** * @notice Get the account info of the trader. Need to update the funding state and the oracle price * of each perpetual before and update the funding rate of each perpetual after * @param perpetualIndex The index of the perpetual in the liquidity pool * @param trader The address of the trader * @return cash The cash(collateral) of the account * @return position The position of the account * @return availableMargin The available margin of the account * @return margin The margin of the account * @return settleableMargin The settleable margin of the account * @return isInitialMarginSafe True if the account is initial margin safe * @return isMaintenanceMarginSafe True if the account is maintenance margin safe * @return isMarginSafe True if the total value of margin account is beyond 0 * @return targetLeverage The target leverage for openning position. */ function getMarginAccount(uint256 perpetualIndex, address trader) external view returns ( int256 cash, int256 position, int256 availableMargin, int256 margin, int256 settleableMargin, bool isInitialMarginSafe, bool isMaintenanceMarginSafe, bool isMarginSafe, // bankrupt int256 targetLeverage ); /** * @notice Get the number of active accounts in the perpetual. * Active means the trader's account is not empty in the perpetual. * Empty means cash and position are zero * @param perpetualIndex The index of the perpetual in the liquidity pool * @return activeAccountCount The number of active accounts in the perpetual */ function getActiveAccountCount(uint256 perpetualIndex) external view returns (uint256); /** * @notice Get the active accounts in the perpetual whose index between begin and end. * Active means the trader's account is not empty in the perpetual. * Empty means cash and position are zero * @param perpetualIndex The index of the perpetual in the liquidity pool * @param begin The begin index * @param end The end index * @return result The active accounts in the perpetual whose index between begin and end */ function listActiveAccounts( uint256 perpetualIndex, uint256 begin, uint256 end ) external view returns (address[] memory result); /** * @notice Get the progress of clearing active accounts. * Return the number of total active accounts and the number of active accounts not cleared * @param perpetualIndex The index of the perpetual in the liquidity pool * @return left The left active accounts * @return total The total active accounts */ function getClearProgress(uint256 perpetualIndex) external view returns (uint256 left, uint256 total); /** * @notice Get the pool margin of the liquidity pool. * Pool margin is how much collateral of the pool considering the AMM's positions of perpetuals * @return poolMargin The pool margin of the liquidity pool */ function getPoolMargin() external view returns (int256 poolMargin, bool isSafe); /** * @notice Query the price, fees and cost when trade agaist amm. * The trading price is determined by the AMM based on the index price of the perpetual. * This method should returns the same result as a 'read-only' trade. * WARN: the result of this function is base on current storage of liquidityPool, not the latest. * To get the latest status, call `syncState` first. * * Flags is a 32 bit uint value which indicates: (from highest bit) * - close only only close position during trading; * - market order do not check limit price during trading; * - stop loss only available in brokerTrade mode; * - take profit only available in brokerTrade mode; * For stop loss and take profit, see `validateTriggerPrice` in OrderModule.sol for details. * * @param perpetualIndex The index of the perpetual in liquidity pool. * @param trader The address of trader. * @param amount The amount of position to trader, positive for buying and negative for selling. The amount always use decimals 18. * @param referrer The address of referrer who will get rebate from the deal. * @param flags The flags of the trade. * @return tradePrice The average fill price. * @return totalFee The total fee collected from the trader after the trade. * @return cost Deposit or withdraw to let effective leverage == targetLeverage if flags contain USE_TARGET_LEVERAGE. > 0 if deposit, < 0 if withdraw. */ function queryTrade( uint256 perpetualIndex, address trader, int256 amount, address referrer, uint32 flags ) external returns ( int256 tradePrice, int256 totalFee, int256 cost ); /** * @notice Query cash to add / share to mint when adding liquidity to the liquidity pool. * Only one of cashToAdd or shareToMint may be non-zero. * * @param cashToAdd The amount of cash to add, always use decimals 18. * @param shareToMint The amount of share token to mint, always use decimals 18. * @return cashToAddResult The amount of cash to add, always use decimals 18. Equal to cashToAdd if cashToAdd is non-zero. * @return shareToMintResult The amount of cash to add, always use decimals 18. Equal to shareToMint if shareToMint is non-zero. */ function queryAddLiquidity(int256 cashToAdd, int256 shareToMint) external view returns (int256 cashToAddResult, int256 shareToMintResult); /** * @notice Query cash to return / share to redeem when removing liquidity from the liquidity pool. * Only one of shareToRemove or cashToReturn may be non-zero. * Can only called when the pool is running. * * @param shareToRemove The amount of share token to redeem, always use decimals 18. * @param cashToReturn The amount of cash to return, always use decimals 18. * @return shareToRemoveResult The amount of share token to redeem, always use decimals 18. Equal to shareToRemove if shareToRemove is non-zero. * @return cashToReturnResult The amount of cash to return, always use decimals 18. Equal to cashToReturn if cashToReturn is non-zero. */ function queryRemoveLiquidity(int256 shareToRemove, int256 cashToReturn) external view returns (int256 shareToRemoveResult, int256 cashToReturnResult); }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "../proxy/Initializable.sol"; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with 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 ContextUpgradeable is Initializable { function __Context_init() internal initializer { __Context_init_unchained(); } function __Context_init_unchained() internal initializer { } 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; } uint256[50] private __gap; }
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.7.4; import "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; /** * @notice Perpetual state: * - INVALID: Uninitialized or not non-existent perpetual; * - INITIALIZING: Only when LiquidityPoolStorage.isRunning == false. Traders cannot perform operations; * - NORMAL: Full functional state. Traders is able to perform all operations; * - EMERGENCY: Perpetual is unsafe and only clear is available; * - CLEARED: All margin account is cleared. Trade could withdraw remaining margin balance. */ enum PerpetualState { INVALID, INITIALIZING, NORMAL, EMERGENCY, CLEARED } enum OrderType { LIMIT, MARKET, STOP } /** * @notice Data structure to store risk parameter value. */ struct Option { int256 value; int256 minValue; int256 maxValue; } /** * @notice Data structure to store oracle price data. */ struct OraclePriceData { int256 price; uint256 time; } /** * @notice Data structure to store user margin information. See MarginAccountModule.sol for details. */ struct MarginAccount { int256 cash; int256 position; int256 targetLeverage; } /** * @notice Data structure of an order object. */ struct Order { address trader; address broker; address relayer; address referrer; address liquidityPool; int256 minTradeAmount; int256 amount; int256 limitPrice; int256 triggerPrice; uint256 chainID; uint64 expiredAt; uint32 perpetualIndex; uint32 brokerFeeLimit; uint32 flags; uint32 salt; } /** * @notice Core data structure, a core . */ struct LiquidityPoolStorage { bool isRunning; bool isFastCreationEnabled; // addresses address creator; address operator; address transferringOperator; address governor; address shareToken; address accessController; bool reserved3; // isWrapped uint256 scaler; uint256 collateralDecimals; address collateralToken; // pool attributes int256 poolCash; uint256 fundingTime; uint256 reserved5; uint256 operatorExpiration; mapping(address => int256) reserved1; bytes32[] reserved2; // perpetuals uint256 perpetualCount; mapping(uint256 => PerpetualStorage) perpetuals; // insurance fund int256 insuranceFundCap; int256 insuranceFund; int256 donatedInsuranceFund; address reserved4; // reserved slot for future upgrade bytes32[16] reserved; } /** * @notice Core data structure, storing perpetual information. */ struct PerpetualStorage { uint256 id; PerpetualState state; address oracle; int256 totalCollateral; int256 openInterest; // prices OraclePriceData indexPriceData; OraclePriceData markPriceData; OraclePriceData settlementPriceData; // funding state int256 fundingRate; int256 unitAccumulativeFunding; // base parameters int256 initialMarginRate; int256 maintenanceMarginRate; int256 operatorFeeRate; int256 lpFeeRate; int256 referralRebateRate; int256 liquidationPenaltyRate; int256 keeperGasReward; int256 insuranceFundRate; int256 reserved1; int256 maxOpenInterestRate; // risk parameters Option halfSpread; Option openSlippageFactor; Option closeSlippageFactor; Option fundingRateLimit; Option fundingRateFactor; Option ammMaxLeverage; Option maxClosePriceDiscount; // users uint256 totalAccount; int256 totalMarginWithoutPosition; int256 totalMarginWithPosition; int256 redemptionRateWithoutPosition; int256 redemptionRateWithPosition; EnumerableSetUpgradeable.AddressSet activeAccounts; // insurance fund int256 reserved2; int256 reserved3; // accounts mapping(address => MarginAccount) marginAccounts; Option defaultTargetLeverage; // keeper address reserved4; EnumerableSetUpgradeable.AddressSet ammKeepers; EnumerableSetUpgradeable.AddressSet reserved5; // reserved slot for future upgrade bytes32[12] reserved; }
{ "optimizer": { "enabled": true, "runs": 1000 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "abi" ] } }, "libraries": {} }
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"factory","type":"address"}],"name":"AddWhitelistedFactory","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"liquidityPool","type":"address"},{"indexed":false,"internalType":"uint256","name":"perpetualIndex","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"symbol","type":"uint256"}],"name":"AllocateSymbol","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"factory","type":"address"}],"name":"RemoveWhitelistedFactory","type":"event"},{"inputs":[{"internalType":"address","name":"factory","type":"address"}],"name":"addWhitelistedFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"liquidityPool","type":"address"},{"internalType":"uint256","name":"perpetualIndex","type":"uint256"}],"name":"allocateSymbol","outputs":[{"internalType":"uint256","name":"symbol","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"liquidityPool","type":"address"},{"internalType":"uint256","name":"perpetualIndex","type":"uint256"},{"internalType":"uint256","name":"symbol","type":"uint256"}],"name":"assignReservedSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"symbol","type":"uint256"}],"name":"getPerpetualUID","outputs":[{"internalType":"address","name":"liquidityPool","type":"address"},{"internalType":"uint256","name":"perpetualIndex","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"liquidityPool","type":"address"},{"internalType":"uint256","name":"perpetualIndex","type":"uint256"}],"name":"getSymbols","outputs":[{"internalType":"uint256[]","name":"symbols","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"reservedSymbolCount","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"}],"name":"isWhitelistedFactory","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"factory","type":"address"}],"name":"removeWhitelistedFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b506117d8806100206000396000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c8063b719065811610081578063f2fde38b1161005b578063f2fde38b1461019d578063f3d15042146101b0578063fe4b84df146101c3576100c9565b8063b71906581461014a578063bd086b861461016a578063dcb7a3e01461017d576100c9565b8063735492f7116100b2578063735492f714610102578063745a3f74146101155780638da5cb5b14610135576100c9565b806355467ce1146100ce578063715018a6146100f8575b600080fd5b6100e16100dc366004611344565b6101d6565b6040516100ef929190611392565b60405180910390f35b610100610233565b005b610100610110366004611212565b6102f1565b61012861012336600461122e565b6103d0565b6040516100ef91906113cc565b61013d610497565b6040516100ef919061137e565b61015d61015836600461122e565b6104a6565b6040516100ef91906116ea565b610100610178366004611259565b6106a4565b61019061018b366004611212565b61094a565b6040516100ef9190611410565b6101006101ab366004611212565b61095f565b6101006101be366004611212565b610a74565b6101006101d1366004611344565b610b77565b600081815260656020526040812080548291906001600160a01b03166102175760405162461bcd60e51b815260040161020e9061160e565b60405180910390fd5b80546001909101546001600160a01b0390911694909350915050565b61023b610c2c565b6001600160a01b031661024c610497565b6001600160a01b0316146102a7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6033546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3603380546001600160a01b0319169055565b6102f9610c2c565b6001600160a01b031661030a610497565b6001600160a01b031614610365576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61036e8161094a565b61038a5760405162461bcd60e51b815260040161020e906115a0565b610395606982610c30565b507ff127e51db2d456506cf1c13b384bede8716dd162ed3ac47e59ba5d8f71e79c82816040516103c5919061137e565b60405180910390a150565b606060006103de8484610c4c565b6000818152606660205260408120919250906103f990610c7f565b905080610407575050610491565b8067ffffffffffffffff8111801561041e57600080fd5b50604051908082528060200260200182016040528015610448578160200160208202803683370190505b50925060005b8181101561048d57600083815260666020526040902061046e9082610c8a565b84828151811061047a57fe5b602090810291909101015260010161044e565b5050505b92915050565b6033546001600160a01b031690565b6000336104b281610c96565b6104ce5760405162461bcd60e51b815260040161020e90611645565b6104d6611118565b816001600160a01b0316630cdc105a6040518163ffffffff1660e01b81526004016102406040518083038186803b15801561051057600080fd5b505afa158015610524573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610548919061128d565b50509250505061056b8160006007811061055e57fe5b6020020151606990610c9c565b6105875760405162461bcd60e51b815260040161020e90611452565b60006105938686610c4c565b60008181526066602052604090209091506105ad90610c7f565b156105ca5760405162461bcd60e51b815260040161020e9061141b565b606754935060001984106105f05760405162461bcd60e51b815260040161020e906115d7565b6040805180820182526001600160a01b0388811682526020808301898152600089815260658352858120945185546001600160a01b03191694169390931784555160019093019290925583815260669091522061064d9085610cb1565b5060675461065c906001610cbd565b6067556040517f55f7c390672d1d8da79d269a8c6ed5c6bdedcd43ccd36a70772a517c169c52ac90610693908890889088906113ab565b60405180910390a150505092915050565b6106ac610c2c565b6001600160a01b03166106bd610497565b6001600160a01b031614610718576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b8261072281610c96565b61073e5760405162461bcd60e51b815260040161020e90611645565b610746611118565b816001600160a01b0316630cdc105a6040518163ffffffff1660e01b81526004016102406040518083038186803b15801561078057600080fd5b505afa158015610794573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b8919061128d565b5050925050506107ce8160006007811061055e57fe5b6107ea5760405162461bcd60e51b815260040161020e90611452565b606854831061080b5760405162461bcd60e51b815260040161020e90611489565b6000838152606560205260409020546001600160a01b0316156108405760405162461bcd60e51b815260040161020e906114e6565b600061084c8686610c4c565b600081815260666020526040902090915061086690610c7f565b600114801561088d5750606854600082815260666020526040812061088a91610c8a565b10155b6108a95760405162461bcd60e51b815260040161020e9061151d565b6040805180820182526001600160a01b0388811682526020808301898152600089815260658352858120945185546001600160a01b0319169416939093178455516001909301929092558381526066909152206109069085610cb1565b507f55f7c390672d1d8da79d269a8c6ed5c6bdedcd43ccd36a70772a517c169c52ac86868660405161093a939291906113ab565b60405180910390a1505050505050565b6000610957606983610c9c565b90505b919050565b610967610c2c565b6001600160a01b0316610978610497565b6001600160a01b0316146109d3576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610a185760405162461bcd60e51b815260040180806020018281038252602681526020018061174f6026913960400191505060405180910390fd5b6033546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3603380546001600160a01b0319166001600160a01b0392909216919091179055565b610a7c610c2c565b6001600160a01b0316610a8d610497565b6001600160a01b031614610ae8576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610afa816001600160a01b0316610c96565b610b165760405162461bcd60e51b815260040161020e9061167c565b610b1f8161094a565b15610b3c5760405162461bcd60e51b815260040161020e906116b3565b610b47606982610d17565b507fc8dfd666771ee017e7cf86b4e85b8a1e6a5e8a1b84e33914193996a94d02bb3f816040516103c5919061137e565b600054610100900460ff1680610b905750610b90610d2c565b80610b9e575060005460ff16155b610bd95760405162461bcd60e51b815260040180806020018281038252602e815260200180611775602e913960400191505060405180910390fd5b600054610100900460ff16158015610c04576000805460ff1961ff0019909116610100171660011790555b610c0c610d3d565b606782905560688290558015610c28576000805461ff00191690555b5050565b3390565b6000610c45836001600160a01b038416610def565b9392505050565b60008282604051602001610c6192919061135c565b60405160208183030381529060405280519060200120905092915050565b600061095782610eb5565b6000610c458383610eb9565b3b151590565b6000610c45836001600160a01b038416610f1d565b6000610c458383610f35565b600082820183811015610c45576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000610c45836001600160a01b038416610f35565b6000610d3730610c96565b15905090565b600054610100900460ff1680610d565750610d56610d2c565b80610d64575060005460ff16155b610d9f5760405162461bcd60e51b815260040180806020018281038252602e815260200180611775602e913960400191505060405180910390fd5b600054610100900460ff16158015610dca576000805460ff1961ff0019909116610100171660011790555b610dd2610f7f565b610dda61101f565b8015610dec576000805461ff00191690555b50565b60008181526001830160205260408120548015610eab5783546000198083019190810190600090879083908110610e2257fe5b9060005260206000200154905080876000018481548110610e3f57fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080610e6f57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610491565b6000915050610491565b5490565b81546000908210610efb5760405162461bcd60e51b815260040180806020018281038252602281526020018061172d6022913960400191505060405180910390fd5b826000018281548110610f0a57fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b6000610f418383610f1d565b610f7757508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610491565b506000610491565b600054610100900460ff1680610f985750610f98610d2c565b80610fa6575060005460ff16155b610fe15760405162461bcd60e51b815260040180806020018281038252602e815260200180611775602e913960400191505060405180910390fd5b600054610100900460ff16158015610dda576000805460ff1961ff0019909116610100171660011790558015610dec576000805461ff001916905550565b600054610100900460ff16806110385750611038610d2c565b80611046575060005460ff16155b6110815760405162461bcd60e51b815260040180806020018281038252602e815260200180611775602e913960400191505060405180910390fd5b600054610100900460ff161580156110ac576000805460ff1961ff0019909116610100171660011790555b60006110b6610c2c565b603380546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015610dec576000805461ff001916905550565b6040518060e001604052806007906020820280368337509192915050565b600082601f830112611146578081fd5b60405160a0810181811067ffffffffffffffff8211171561116357fe5b6040529050808260a0810185101561117a57600080fd5b60005b600581101561048d57815183526020928301929091019060010161117d565b600082601f8301126111ac578081fd5b6040516080810181811067ffffffffffffffff821117156111c957fe5b60405290508082608081018510156111e057600080fd5b60005b600481101561048d5781518352602092830192909101906001016111e3565b8051801515811461095a57600080fd5b600060208284031215611223578081fd5b8135610c4581611717565b60008060408385031215611240578081fd5b823561124b81611717565b946020939093013593505050565b60008060006060848603121561126d578081fd5b833561127881611717565b95602085013595506040909401359392505050565b600080600080600061024086880312156112a5578081fd5b6112ae86611202565b945060206112bd818801611202565b945087605f8801126112cd578182fd5b6112d760e06116f3565b80604089016101208a018b8111156112ed578586fd5b855b600781101561131557825161130381611717565b855293850193918501916001016112ef565b508297506113238c82611136565b96505050505050611338876101c0880161119c565b90509295509295909350565b600060208284031215611355578081fd5b5035919050565b60609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039390931683526020830191909152604082015260600190565b6020808252825182820181905260009190848201906040850190845b81811015611404578351835292840192918401916001016113e8565b50909695505050505050565b901515815260200190565b60208082526018908201527f70657270657475616c20616c7265616479206578697374730000000000000000604082015260600190565b6020808252600d908201527f77726f6e6720666163746f727900000000000000000000000000000000000000604082015260600190565b60208082526024908201527f73796d626f6c20657863656564732072657365727665642073796d626f6c206360408201527f6f756e7400000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526015908201527f73796d626f6c20616c7265616479206578697374730000000000000000000000604082015260600190565b60208082526042908201527f70657270657475616c206d7573742068617665206e6f726d616c2073796d626f60408201527f6c20616e64206d7573746e277420686176652072657665727365642073796d6260608201527f6f6c000000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526011908201527f666163746f7279206e6f7420666f756e64000000000000000000000000000000604082015260600190565b60208082526011908201527f6e6f7420656e6f7567682073796d626f6c000000000000000000000000000000604082015260600190565b60208082526010908201527f73796d626f6c206e6f7420666f756e6400000000000000000000000000000000604082015260600190565b60208082526017908201527f6d7573742063616c6c656420627920636f6e7472616374000000000000000000604082015260600190565b6020808252601a908201527f666163746f7279206d757374206265206120636f6e7472616374000000000000604082015260600190565b60208082526016908201527f666163746f727920616c72656164792065786973747300000000000000000000604082015260600190565b90815260200190565b60405181810167ffffffffffffffff8111828210171561170f57fe5b604052919050565b6001600160a01b0381168114610dec57600080fdfe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e64734f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564a2646970667358221220f1e9063b59d338c7d42403a729145a839ec44842bee25e1ab76f05b720cc80d464736f6c63430007040033
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.