Source Code
Overview
HYPE Balance
HYPE Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
Contract Name:
DataStore
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.26;
/**
* @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 Returns the balance of tokens.
*/
function decimals() external view returns (uint8);
/**
* @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
);
}
/**
* @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;
}
}
/**
* @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);
}
}
}
}
/**
* @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"
);
}
}
}
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
interface IPriceOracle {
function getPrice(address _token) external view returns (uint256);
}
interface IStaking {
function getAllInvestors() external view returns (address[] memory);
function getAllEarners() external view returns (address[] memory);
function getAllTraders() external view returns (address[] memory);
}
interface ITrading {
function getOpenedUsers() external view returns (address[] memory);
function getTradeCloseInfo(
address _user
) external view returns (TradeCloseInfo[] memory);
function getCurrentProfitUSD(address _user) external view returns (int256);
function getTradeInTokensUSD(address _user) external view returns (uint256);
}
interface IBorrowing {
function getAllBorrowers() external view returns (address[] memory);
function getCollateralsInUSD(address _user) external view returns (uint256);
function getBorrowsInUSD(address _user) external view returns (uint256);
}
struct TradeCloseInfo {
uint256 id;
address trader;
bool tradetype;
address indexToken;
uint256 indexAmount;
uint256 indexUSD;
uint256 closeTime;
uint256 openPrice;
uint256 closePrice;
int256 profitUSD;
}
contract DataStore {
using SafeMath for uint256;
using SafeERC20 for IERC20;
event Response(bool success, bytes data, uint256 buyAmt);
// Info of each user.
struct DataInfo {
uint256 timepoint;
uint256 amount;
}
struct PNLInfo {
uint256 timepoint;
uint256 volume;
int256 profit;
}
struct EarnInfo {
address earner;
uint256 lockUSD;
uint256 claimedUSD;
}
struct PoolEarnInfo {
uint256 timepoint;
uint256 totalstake;
uint256 totalreward;
}
struct TradeTableInfo {
address user;
int256 pnlAmount;
int256 pnlPercent;
uint256 volume;
uint256 wins;
uint256 trades;
uint256 winPercent;
}
struct BorrowTableInfo {
address user;
uint256 supply;
uint256 borrow;
}
address public staking;
address public trading;
address public borrowing;
address public operator;
uint256 public startTime;
DataInfo[] public poolLockData;
DataInfo[] public poolTradeCollateralData;
DataInfo[] public poolBorrowSupplyData;
DataInfo[] public poolTradeUsingData;
DataInfo[] public poolBorrowUsingData;
DataInfo[] public poolFeeData;
DataInfo[] public poolClaimedData;
DataInfo[] public poolTradingVolume;
mapping(address => PoolEarnInfo[]) public poolEarnData;
mapping(address => DataInfo[]) public poolAPRData;
mapping(address => DataInfo[]) public poolBorrowAPRData;
mapping(address => DataInfo[]) public userLockData;
mapping(address => DataInfo[]) public userTradeCollateralData;
mapping(address => DataInfo[]) public userBorrowSupplyData;
mapping(address => DataInfo[]) public userBorrowedData;
mapping(address => DataInfo[]) public userClaimedData;
mapping(address => DataInfo[]) public userTradingVolume;
constructor(address _staking, address _trading, address _borrowing) {
operator = msg.sender;
staking = _staking;
trading = _trading;
borrowing = _borrowing;
startTime = block.timestamp;
}
modifier onlyOperator() {
require(operator == msg.sender, "DataStore: caller is not the operator");
_;
}
function getPoolLockData() public view returns (DataInfo[] memory) {
return poolLockData;
}
function getPoolTradeCollateralData()
public
view
returns (DataInfo[] memory)
{
return poolTradeCollateralData;
}
function getPoolBorrowSupplyData() public view returns (DataInfo[] memory) {
return poolBorrowSupplyData;
}
function getPoolTradeUsingData() public view returns (DataInfo[] memory) {
return poolTradeUsingData;
}
function getPoolBorrowUsingData() public view returns (DataInfo[] memory) {
return poolBorrowUsingData;
}
function getPoolFeeData() public view returns (DataInfo[] memory) {
return poolFeeData;
}
function getPoolClaimedData() public view returns (DataInfo[] memory) {
return poolClaimedData;
}
function getPoolTradingVolume() public view returns (DataInfo[] memory) {
return poolTradingVolume;
}
function getUserLockData(
address _user
) public view returns (DataInfo[] memory) {
return userLockData[_user];
}
function getUserTradeCollateralData(
address _user
) public view returns (DataInfo[] memory) {
return userTradeCollateralData[_user];
}
function getUserBorrowSupplyData(
address _user
) public view returns (DataInfo[] memory) {
return userBorrowSupplyData[_user];
}
function getUserBorrowedData(
address _user
) public view returns (DataInfo[] memory) {
return userBorrowedData[_user];
}
function getUserClaimedData(
address _user
) public view returns (DataInfo[] memory) {
return userClaimedData[_user];
}
function getUserTradingVolume(
address _user
) public view returns (DataInfo[] memory) {
return userTradingVolume[_user];
}
function setOperator(address _operator) public onlyOperator {
operator = _operator;
}
function setStaking(address _staking) public onlyOperator {
staking = _staking;
}
function setTrading(address _trading) public onlyOperator {
trading = _trading;
}
function setBorrowing(address _borrowing) public onlyOperator {
borrowing = _borrowing;
}
function getPoolEarnData(
address _token
) public view returns (PoolEarnInfo[] memory) {
return poolEarnData[_token];
}
function getPoolAPRData(
address _token
) public view returns (DataInfo[] memory) {
return poolAPRData[_token];
}
function updateData(
uint256 _type,
address _user,
uint256 _userAmount,
uint256 _poolAmount
) public {
require(
msg.sender == staking ||
msg.sender == trading ||
msg.sender == borrowing
);
if (_type == 0) {
// update Lock Data
poolLockData.push(
DataInfo({timepoint: block.timestamp, amount: _poolAmount})
);
userLockData[_user].push(
DataInfo({timepoint: block.timestamp, amount: _userAmount})
);
} else if (_type == 1) {
// update Trade Collateral Data
poolTradeCollateralData.push(
DataInfo({timepoint: block.timestamp, amount: _poolAmount})
);
userTradeCollateralData[_user].push(
DataInfo({timepoint: block.timestamp, amount: _userAmount})
);
} else if (_type == 2) {
// update Borrow Collateral Data
poolBorrowSupplyData.push(
DataInfo({timepoint: block.timestamp, amount: _poolAmount})
);
userBorrowSupplyData[_user].push(
DataInfo({timepoint: block.timestamp, amount: _userAmount})
);
} else if (_type == 3) {
// update Trade Using Data
poolTradeUsingData.push(
DataInfo({timepoint: block.timestamp, amount: _poolAmount})
);
} else if (_type == 4) {
// update Borrow Using Data
poolBorrowUsingData.push(
DataInfo({timepoint: block.timestamp, amount: _poolAmount})
);
} else if (_type == 5) {
// update Fee(Trading Leverage and Borrow Fee) Data
poolFeeData.push(
DataInfo({timepoint: block.timestamp, amount: _poolAmount})
);
} else if (_type == 6) {
// update Stake Reward Claimed Data
poolClaimedData.push(
DataInfo({timepoint: block.timestamp, amount: _poolAmount})
);
userClaimedData[_user].push(
DataInfo({timepoint: block.timestamp, amount: _userAmount})
);
} else if (_type == 7) {
// update Trading Volume Data
poolTradingVolume.push(
DataInfo({timepoint: block.timestamp, amount: _poolAmount})
);
userTradingVolume[_user].push(
DataInfo({timepoint: block.timestamp, amount: _userAmount})
);
} else if (_type == 8) {
userBorrowedData[_user].push(
DataInfo({timepoint: block.timestamp, amount: _userAmount})
);
}
}
function updatePoolData(
address _token,
uint256 _stakeAmt,
uint256 _rewardAmt
) public {
require(msg.sender == staking);
poolEarnData[_token].push(
PoolEarnInfo({
timepoint: block.timestamp,
totalstake: _stakeAmt,
totalreward: _rewardAmt
})
);
}
function updateAPR(
address[] calldata _tokens,
uint256[] calldata _aprs
) public {
require(msg.sender == staking);
for (uint256 i = 0; i < _tokens.length; i++) {
poolAPRData[_tokens[i]].push(
DataInfo({timepoint: block.timestamp, amount: _aprs[i]})
);
}
}
function updateBorrowAPR(
address[] calldata _tokens,
uint256[] calldata _aprs
) public {
require(msg.sender == borrowing);
for (uint256 i = 0; i < _tokens.length; i++) {
poolBorrowAPRData[_tokens[i]].push(
DataInfo({timepoint: block.timestamp, amount: _aprs[i]})
);
}
}
}{
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": [
"forge-std/=lib/forge-std/src/"
],
"viaIR": true
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_staking","type":"address"},{"internalType":"address","name":"_trading","type":"address"},{"internalType":"address","name":"_borrowing","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"success","type":"bool"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"buyAmt","type":"uint256"}],"name":"Response","type":"event"},{"inputs":[],"name":"borrowing","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getPoolAPRData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolBorrowSupplyData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolBorrowUsingData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolClaimedData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"getPoolEarnData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"totalstake","type":"uint256"},{"internalType":"uint256","name":"totalreward","type":"uint256"}],"internalType":"struct DataStore.PoolEarnInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolFeeData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolLockData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolTradeCollateralData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolTradeUsingData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPoolTradingVolume","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserBorrowSupplyData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserBorrowedData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserClaimedData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserLockData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserTradeCollateralData","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"getUserTradingVolume","outputs":[{"components":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct DataStore.DataInfo[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"operator","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolAPRData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolBorrowAPRData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolBorrowSupplyData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolBorrowUsingData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolClaimedData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolEarnData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"totalstake","type":"uint256"},{"internalType":"uint256","name":"totalreward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolFeeData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolLockData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolTradeCollateralData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolTradeUsingData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolTradingVolume","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_borrowing","type":"address"}],"name":"setBorrowing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_operator","type":"address"}],"name":"setOperator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_staking","type":"address"}],"name":"setStaking","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_trading","type":"address"}],"name":"setTrading","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"staking","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"trading","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_aprs","type":"uint256[]"}],"name":"updateAPR","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"uint256[]","name":"_aprs","type":"uint256[]"}],"name":"updateBorrowAPR","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_type","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_userAmount","type":"uint256"},{"internalType":"uint256","name":"_poolAmount","type":"uint256"}],"name":"updateData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_stakeAmt","type":"uint256"},{"internalType":"uint256","name":"_rewardAmt","type":"uint256"}],"name":"updatePoolData","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userBorrowSupplyData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userBorrowedData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userClaimedData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userLockData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userTradeCollateralData","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"userTradingVolume","outputs":[{"internalType":"uint256","name":"timepoint","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60803460b157601f611abf38819003918201601f19168301916001600160401b0383118484101760b55780849260609460405283398101031260b15760428160c9565b906057604060516020840160c9565b920160c9565b600380546001600160a01b031990811633179091555f805482166001600160a01b0395861617905560018054821693851693909317909255600280549092169216919091179055426004556040516119e290816100dd8239f35b5f80fd5b634e487b7160e01b5f52604160045260245ffd5b51906001600160a01b038216820360b15756fe60806040526004361015610011575f80fd5b5f3560e01c80630129f706146116e15780630a3ebdf4146116965780631ef9cb3b1461164d5780631f7469c01461160257806329f88fee146115775780632f6a97541461152c5780633093f243146111d1578063343d4c63146111445780633a73146f146110fb578063402da1131461106e5780634a876a08146110255780634b45924514610f9a5780634cf088d914610f735780634fa38a7014610ee6578063570ca73514610ebe5780635f060d6d14610e545780635fda1ab314610dc957806360b415ed14610da15780636117c6b414610d5857806364a48f5914610ccb57806369d98e6014610c40578063785142b214610bd657806378e9792514610bb957806381ce05e314610afb5780638257f5ff14610ab257806382595a9914610a255780638b4fc9481461099a5780638da3dbe3146109515780638ff3909914610902578063917e05281461081e5780639ab44ee2146107985780639fbc914e1461070d578063a553906c146106bd578063abb3f05114610672578063b3ab15fb14610625578063c49e5651146105d5578063c70a958014610548578063c8fe572d146104ff578063c93762c214610472578063deacda7314610427578063e7052c06146103dc578063e8be72c614610391578063ec44acf214610369578063ee7bcb41146102d3578063fe21c110146102745763fe997d5b14610213575f80fd5b346102705760403660031901126102705761022c61176c565b6001600160a01b03165f908152601360205260409020805460243591908210156102705760409161025c916117c7565b506001815491015482519182526020820152f35b5f80fd5b3461027057602036600319011261027057600435600654811015610270576006548110156102bf5760409060065f5260205f209060011b016001815491015482519182526020820152f35b634e487b7160e01b5f52603260045260245ffd5b34610270575f36600319011261027057600b546102f76102f2826118e2565b6118bc565b9080825260208201600b5f527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db95f915b838310610340576040518061033c8782611782565b0390f35b6002602060019261034f61187c565b855481528486015483820152815201920192019190610327565b34610270575f366003190112610270576001546040516001600160a01b039091168152602090f35b3461027057602036600319011261027057600435600954811015610270576009548110156102bf5760409060095f5260205f209060011b016001815491015482519182526020820152f35b3461027057602036600319011261027057600435600754811015610270576007548110156102bf5760409060075f5260205f209060011b016001815491015482519182526020820152f35b3461027057602036600319011261027057600435600c5481101561027057600c548110156102bf57604090600c5f5260205f209060011b016001815491015482519182526020820152f35b34610270575f366003190112610270576005546104916102f2826118e2565b908082526020820160055f527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05f915b8383106104d6576040518061033c8782611782565b600260206001926104e561187c565b8554815284860154838201528152019201920191906104c1565b346102705760403660031901126102705761051861176c565b6001600160a01b03165f908152600f60205260409020805460243591908210156102705760409161025c916117c7565b34610270575f366003190112610270576008546105676102f2826118e2565b908082526020820160085f527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee35f915b8383106105ac576040518061033c8782611782565b600260206001926105bb61187c565b855481528486015483820152815201920192019190610597565b34610270576020366003190112610270576105ee61176c565b61060360018060a01b03600354163314611952565b600280546001600160a01b0319166001600160a01b0392909216919091179055005b346102705760203660031901126102705761063e61176c565b600354906106566001600160a01b0383163314611952565b6001600160a01b03166001600160a01b03199190911617600355005b3461027057602036600319011261027057600435600854811015610270576008548110156102bf5760409060085f5260205f209060011b016001815491015482519182526020820152f35b34610270576020366003190112610270576106d661176c565b6106eb60018060a01b03600354163314611952565b600180546001600160a01b0319166001600160a01b0392909216919091179055005b34610270576020366003190112610270576001600160a01b0361072e61176c565b165f52601460205260405f2080546107486102f2826118e2565b9181835260208301905f5260205f205f915b83831061076f576040518061033c8782611782565b6002602060019261077e61187c565b85548152848601548382015281520192019201919061075a565b34610270576107a63661182a565b5f549293929091906001600160a01b03163303610270575f5b8481106107c857005b6001906001600160a01b036107e66107e183898961192e565b61193e565b165f52600e60205261081860405f2061080083878761192e565b359061080a61187c565b9142835260208301526118fa565b016107bf565b34610270576020366003190112610270576001600160a01b0361083f61176c565b165f52600d60205260405f2080549061085a6102f2836118e2565b918083526020830180925f5260205f205f915b8383106108cf578486604051918291602083019060208452518091526040830191905f5b81811061089f575050500390f35b91935091602060606001926040875180518352848101518584015201516040820152019401910191849392610891565b600360206001926108de61189c565b8554815284860154838201526002860154604082015281520192019201919061086d565b346102705760203660031901126102705761091b61176c565b61093060018060a01b03600354163314611952565b5f80546001600160a01b0319166001600160a01b0392909216919091179055005b346102705760403660031901126102705761096a61176c565b6001600160a01b03165f908152601060205260409020805460243591908210156102705760409161025c916117c7565b34610270576020366003190112610270576001600160a01b036109bb61176c565b165f52601560205260405f2080546109d56102f2826118e2565b9181835260208301905f5260205f205f915b8383106109fc576040518061033c8782611782565b60026020600192610a0b61187c565b8554815284860154838201528152019201920191906109e7565b34610270575f36600319011261027057600c54610a446102f2826118e2565b9080825260208201600c5f527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c75f915b838310610a89576040518061033c8782611782565b60026020600192610a9861187c565b855481528486015483820152815201920192019190610a74565b3461027057604036600319011261027057610acb61176c565b6001600160a01b03165f908152600e60205260409020805460243591908210156102705760409161025c916117c7565b3461027057606036600319011261027057610b1461176c565b5f546001600160a01b03163303610270576001600160a01b03165f908152600d60205260409020610b4361189c565b42815260208101916024358352604082019060443582528054600160401b811015610ba557610b77916001820181556117e0565b939093610b9257600292518455516001840155519101555f80f35b634e487b7160e01b5f525f60045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b34610270575f366003190112610270576020600454604051908152f35b3461027057610be43661182a565b6002549293929091906001600160a01b03163303610270575f5b848110610c0757005b6001906001600160a01b03610c206107e183898961192e565b165f52600f602052610c3a60405f2061080083878761192e565b01610bfe565b34610270576020366003190112610270576001600160a01b03610c6161176c565b165f52601260205260405f208054610c7b6102f2826118e2565b9181835260208301905f5260205f205f915b838310610ca2576040518061033c8782611782565b60026020600192610cb161187c565b855481528486015483820152815201920192019190610c8d565b34610270575f36600319011261027057600654610cea6102f2826118e2565b908082526020820160065f527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f5f915b838310610d2f576040518061033c8782611782565b60026020600192610d3e61187c565b855481528486015483820152815201920192019190610d1a565b3461027057604036600319011261027057610d7161176c565b6001600160a01b03165f908152601160205260409020805460243591908210156102705760409161025c916117c7565b34610270575f366003190112610270576002546040516001600160a01b039091168152602090f35b34610270576020366003190112610270576001600160a01b03610dea61176c565b165f52600e60205260405f208054610e046102f2826118e2565b9181835260208301905f5260205f205f915b838310610e2b576040518061033c8782611782565b60026020600192610e3a61187c565b855481528486015483820152815201920192019190610e16565b3461027057604036600319011261027057610e6d61176c565b6001600160a01b03165f908152600d602052604090208054602435919082101561027057606091610e9d916117e0565b50805490600260018201549101549060405192835260208301526040820152f35b34610270575f366003190112610270576003546040516001600160a01b039091168152602090f35b34610270575f36600319011261027057600954610f056102f2826118e2565b908082526020820160095f527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af5f915b838310610f4a576040518061033c8782611782565b60026020600192610f5961187c565b855481528486015483820152815201920192019190610f35565b34610270575f366003190112610270575f546040516001600160a01b039091168152602090f35b34610270576020366003190112610270576001600160a01b03610fbb61176c565b165f52601360205260405f208054610fd56102f2826118e2565b9181835260208301905f5260205f205f915b838310610ffc576040518061033c8782611782565b6002602060019261100b61187c565b855481528486015483820152815201920192019190610fe7565b346102705760403660031901126102705761103e61176c565b6001600160a01b03165f908152601260205260409020805460243591908210156102705760409161025c916117c7565b34610270575f3660031901126102705760075461108d6102f2826118e2565b908082526020820160075f527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6885f915b8383106110d2576040518061033c8782611782565b600260206001926110e161187c565b8554815284860154838201528152019201920191906110bd565b346102705760403660031901126102705761111461176c565b6001600160a01b03165f908152601460205260409020805460243591908210156102705760409161025c916117c7565b34610270575f36600319011261027057600a546111636102f2826118e2565b9080825260208201600a5f527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a85f915b8383106111a8576040518061033c8782611782565b600260206001926111b761187c565b855481528486015483820152815201920192019190611193565b34610270576080366003190112610270576004356024356001600160a01b0381169081900361027057604435906064359260018060a01b035f541633148015611518575b8015611504575b156102705780611284575061122f61187c565b42815260208101938452600554600160401b811015610ba55780600161125a920160055560056117c7565b919091610b925761128294600191518355519101555f52601060205260405f2061080a61187c565b005b600181036112e8575061129561187c565b42815260208101938452600654600160401b811015610ba5578060016112c0920160065560066117c7565b919091610b925761128294600191518355519101555f52601160205260405f2061080a61187c565b6002810361134c57506112f961187c565b42815260208101938452600754600160401b811015610ba557806001611324920160075560076117c7565b919091610b925761128294600191518355519101555f52601260205260405f2061080a61187c565b6003810361139d5750505061135f61187c565b42815260208101918252600854600160401b811015610ba55780600161138a920160085560086117c7565b929092610b925760019151835551910155005b600481036113db575050506113b061187c565b42815260208101918252600954600160401b811015610ba55780600161138a920160095560096117c7565b60058103611419575050506113ee61187c565b42815260208101918252600a54600160401b811015610ba55780600161138a9201600a55600a6117c7565b6006810361147d575061142a61187c565b42815260208101938452600b54600160401b811015610ba5578060016114559201600b55600b6117c7565b919091610b925761128294600191518355519101555f52601460205260405f2061080a61187c565b600781036114e1575061148e61187c565b42815260208101938452600c54600160401b811015610ba5578060016114b99201600c55600c6117c7565b919091610b925761128294600191518355519101555f52601560205260405f2061080a61187c565b6008919350146114ed57005b611282915f52601360205260405f2061080a61187c565b506002546001600160a01b0316331461121c565b506001546001600160a01b03163314611215565b3461027057602036600319011261027057600435600b5481101561027057600b548110156102bf57604090600b5f5260205f209060011b016001815491015482519182526020820152f35b34610270576020366003190112610270576001600160a01b0361159861176c565b165f52601060205260405f2080546115b26102f2826118e2565b9181835260208301905f5260205f205f915b8383106115d9576040518061033c8782611782565b600260206001926115e861187c565b8554815284860154838201528152019201920191906115c4565b3461027057602036600319011261027057600435600554811015610270576005548110156102bf5760409060055f5260205f209060011b016001815491015482519182526020820152f35b346102705760403660031901126102705761166661176c565b6001600160a01b03165f908152601560205260409020805460243591908210156102705760409161025c916117c7565b3461027057602036600319011261027057600435600a5481101561027057600a548110156102bf57604090600a5f5260205f209060011b016001815491015482519182526020820152f35b34610270576020366003190112610270576001600160a01b0361170261176c565b165f52601160205260405f20805461171c6102f2826118e2565b9181835260208301905f5260205f205f915b838310611743576040518061033c8782611782565b6002602060019261175261187c565b85548152848601548382015281520192019201919061172e565b600435906001600160a01b038216820361027057565b60206040818301928281528451809452019201905f5b8181106117a55750505090565b8251805185526020908101518186015260409094019390920191600101611798565b80548210156102bf575f5260205f209060011b01905f90565b80548210156102bf575f52600360205f20910201905f90565b9181601f840112156102705782359167ffffffffffffffff8311610270576020808501948460051b01011161027057565b60406003198201126102705760043567ffffffffffffffff81116102705781611855916004016117f9565b929092916024359067ffffffffffffffff821161027057611878916004016117f9565b9091565b604051906040820182811067ffffffffffffffff821117610ba557604052565b604051906060820182811067ffffffffffffffff821117610ba557604052565b6040519190601f01601f1916820167ffffffffffffffff811183821017610ba557604052565b67ffffffffffffffff8111610ba55760051b60200190565b8054600160401b811015610ba557611917916001820181556117c7565b919091610b92576020816001925184550151910155565b91908110156102bf5760051b0190565b356001600160a01b03811681036102705790565b1561195957565b60405162461bcd60e51b815260206004820152602560248201527f4461746153746f72653a2063616c6c6572206973206e6f7420746865206f70656044820152643930ba37b960d91b6064820152608490fdfea2646970667358221220d71116561eef614cfabf2e487dc6b6fe9ff3fb610b7e0d10da9882342b16187064736f6c634300081a0033000000000000000000000000f21a1c9ff8b143615dbffba6c8f73965443500f7000000000000000000000000a11264035c4525a34f06961a935e98eed51f5b81000000000000000000000000d4ce32a99782bb334e308286b984843b37862d54
Deployed Bytecode
0x60806040526004361015610011575f80fd5b5f3560e01c80630129f706146116e15780630a3ebdf4146116965780631ef9cb3b1461164d5780631f7469c01461160257806329f88fee146115775780632f6a97541461152c5780633093f243146111d1578063343d4c63146111445780633a73146f146110fb578063402da1131461106e5780634a876a08146110255780634b45924514610f9a5780634cf088d914610f735780634fa38a7014610ee6578063570ca73514610ebe5780635f060d6d14610e545780635fda1ab314610dc957806360b415ed14610da15780636117c6b414610d5857806364a48f5914610ccb57806369d98e6014610c40578063785142b214610bd657806378e9792514610bb957806381ce05e314610afb5780638257f5ff14610ab257806382595a9914610a255780638b4fc9481461099a5780638da3dbe3146109515780638ff3909914610902578063917e05281461081e5780639ab44ee2146107985780639fbc914e1461070d578063a553906c146106bd578063abb3f05114610672578063b3ab15fb14610625578063c49e5651146105d5578063c70a958014610548578063c8fe572d146104ff578063c93762c214610472578063deacda7314610427578063e7052c06146103dc578063e8be72c614610391578063ec44acf214610369578063ee7bcb41146102d3578063fe21c110146102745763fe997d5b14610213575f80fd5b346102705760403660031901126102705761022c61176c565b6001600160a01b03165f908152601360205260409020805460243591908210156102705760409161025c916117c7565b506001815491015482519182526020820152f35b5f80fd5b3461027057602036600319011261027057600435600654811015610270576006548110156102bf5760409060065f5260205f209060011b016001815491015482519182526020820152f35b634e487b7160e01b5f52603260045260245ffd5b34610270575f36600319011261027057600b546102f76102f2826118e2565b6118bc565b9080825260208201600b5f527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db95f915b838310610340576040518061033c8782611782565b0390f35b6002602060019261034f61187c565b855481528486015483820152815201920192019190610327565b34610270575f366003190112610270576001546040516001600160a01b039091168152602090f35b3461027057602036600319011261027057600435600954811015610270576009548110156102bf5760409060095f5260205f209060011b016001815491015482519182526020820152f35b3461027057602036600319011261027057600435600754811015610270576007548110156102bf5760409060075f5260205f209060011b016001815491015482519182526020820152f35b3461027057602036600319011261027057600435600c5481101561027057600c548110156102bf57604090600c5f5260205f209060011b016001815491015482519182526020820152f35b34610270575f366003190112610270576005546104916102f2826118e2565b908082526020820160055f527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db05f915b8383106104d6576040518061033c8782611782565b600260206001926104e561187c565b8554815284860154838201528152019201920191906104c1565b346102705760403660031901126102705761051861176c565b6001600160a01b03165f908152600f60205260409020805460243591908210156102705760409161025c916117c7565b34610270575f366003190112610270576008546105676102f2826118e2565b908082526020820160085f527ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee35f915b8383106105ac576040518061033c8782611782565b600260206001926105bb61187c565b855481528486015483820152815201920192019190610597565b34610270576020366003190112610270576105ee61176c565b61060360018060a01b03600354163314611952565b600280546001600160a01b0319166001600160a01b0392909216919091179055005b346102705760203660031901126102705761063e61176c565b600354906106566001600160a01b0383163314611952565b6001600160a01b03166001600160a01b03199190911617600355005b3461027057602036600319011261027057600435600854811015610270576008548110156102bf5760409060085f5260205f209060011b016001815491015482519182526020820152f35b34610270576020366003190112610270576106d661176c565b6106eb60018060a01b03600354163314611952565b600180546001600160a01b0319166001600160a01b0392909216919091179055005b34610270576020366003190112610270576001600160a01b0361072e61176c565b165f52601460205260405f2080546107486102f2826118e2565b9181835260208301905f5260205f205f915b83831061076f576040518061033c8782611782565b6002602060019261077e61187c565b85548152848601548382015281520192019201919061075a565b34610270576107a63661182a565b5f549293929091906001600160a01b03163303610270575f5b8481106107c857005b6001906001600160a01b036107e66107e183898961192e565b61193e565b165f52600e60205261081860405f2061080083878761192e565b359061080a61187c565b9142835260208301526118fa565b016107bf565b34610270576020366003190112610270576001600160a01b0361083f61176c565b165f52600d60205260405f2080549061085a6102f2836118e2565b918083526020830180925f5260205f205f915b8383106108cf578486604051918291602083019060208452518091526040830191905f5b81811061089f575050500390f35b91935091602060606001926040875180518352848101518584015201516040820152019401910191849392610891565b600360206001926108de61189c565b8554815284860154838201526002860154604082015281520192019201919061086d565b346102705760203660031901126102705761091b61176c565b61093060018060a01b03600354163314611952565b5f80546001600160a01b0319166001600160a01b0392909216919091179055005b346102705760403660031901126102705761096a61176c565b6001600160a01b03165f908152601060205260409020805460243591908210156102705760409161025c916117c7565b34610270576020366003190112610270576001600160a01b036109bb61176c565b165f52601560205260405f2080546109d56102f2826118e2565b9181835260208301905f5260205f205f915b8383106109fc576040518061033c8782611782565b60026020600192610a0b61187c565b8554815284860154838201528152019201920191906109e7565b34610270575f36600319011261027057600c54610a446102f2826118e2565b9080825260208201600c5f527fdf6966c971051c3d54ec59162606531493a51404a002842f56009d7e5cf4a8c75f915b838310610a89576040518061033c8782611782565b60026020600192610a9861187c565b855481528486015483820152815201920192019190610a74565b3461027057604036600319011261027057610acb61176c565b6001600160a01b03165f908152600e60205260409020805460243591908210156102705760409161025c916117c7565b3461027057606036600319011261027057610b1461176c565b5f546001600160a01b03163303610270576001600160a01b03165f908152600d60205260409020610b4361189c565b42815260208101916024358352604082019060443582528054600160401b811015610ba557610b77916001820181556117e0565b939093610b9257600292518455516001840155519101555f80f35b634e487b7160e01b5f525f60045260245ffd5b634e487b7160e01b5f52604160045260245ffd5b34610270575f366003190112610270576020600454604051908152f35b3461027057610be43661182a565b6002549293929091906001600160a01b03163303610270575f5b848110610c0757005b6001906001600160a01b03610c206107e183898961192e565b165f52600f602052610c3a60405f2061080083878761192e565b01610bfe565b34610270576020366003190112610270576001600160a01b03610c6161176c565b165f52601260205260405f208054610c7b6102f2826118e2565b9181835260208301905f5260205f205f915b838310610ca2576040518061033c8782611782565b60026020600192610cb161187c565b855481528486015483820152815201920192019190610c8d565b34610270575f36600319011261027057600654610cea6102f2826118e2565b908082526020820160065f527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f5f915b838310610d2f576040518061033c8782611782565b60026020600192610d3e61187c565b855481528486015483820152815201920192019190610d1a565b3461027057604036600319011261027057610d7161176c565b6001600160a01b03165f908152601160205260409020805460243591908210156102705760409161025c916117c7565b34610270575f366003190112610270576002546040516001600160a01b039091168152602090f35b34610270576020366003190112610270576001600160a01b03610dea61176c565b165f52600e60205260405f208054610e046102f2826118e2565b9181835260208301905f5260205f205f915b838310610e2b576040518061033c8782611782565b60026020600192610e3a61187c565b855481528486015483820152815201920192019190610e16565b3461027057604036600319011261027057610e6d61176c565b6001600160a01b03165f908152600d602052604090208054602435919082101561027057606091610e9d916117e0565b50805490600260018201549101549060405192835260208301526040820152f35b34610270575f366003190112610270576003546040516001600160a01b039091168152602090f35b34610270575f36600319011261027057600954610f056102f2826118e2565b908082526020820160095f527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af5f915b838310610f4a576040518061033c8782611782565b60026020600192610f5961187c565b855481528486015483820152815201920192019190610f35565b34610270575f366003190112610270575f546040516001600160a01b039091168152602090f35b34610270576020366003190112610270576001600160a01b03610fbb61176c565b165f52601360205260405f208054610fd56102f2826118e2565b9181835260208301905f5260205f205f915b838310610ffc576040518061033c8782611782565b6002602060019261100b61187c565b855481528486015483820152815201920192019190610fe7565b346102705760403660031901126102705761103e61176c565b6001600160a01b03165f908152601260205260409020805460243591908210156102705760409161025c916117c7565b34610270575f3660031901126102705760075461108d6102f2826118e2565b908082526020820160075f527fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c6885f915b8383106110d2576040518061033c8782611782565b600260206001926110e161187c565b8554815284860154838201528152019201920191906110bd565b346102705760403660031901126102705761111461176c565b6001600160a01b03165f908152601460205260409020805460243591908210156102705760409161025c916117c7565b34610270575f36600319011261027057600a546111636102f2826118e2565b9080825260208201600a5f527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a85f915b8383106111a8576040518061033c8782611782565b600260206001926111b761187c565b855481528486015483820152815201920192019190611193565b34610270576080366003190112610270576004356024356001600160a01b0381169081900361027057604435906064359260018060a01b035f541633148015611518575b8015611504575b156102705780611284575061122f61187c565b42815260208101938452600554600160401b811015610ba55780600161125a920160055560056117c7565b919091610b925761128294600191518355519101555f52601060205260405f2061080a61187c565b005b600181036112e8575061129561187c565b42815260208101938452600654600160401b811015610ba5578060016112c0920160065560066117c7565b919091610b925761128294600191518355519101555f52601160205260405f2061080a61187c565b6002810361134c57506112f961187c565b42815260208101938452600754600160401b811015610ba557806001611324920160075560076117c7565b919091610b925761128294600191518355519101555f52601260205260405f2061080a61187c565b6003810361139d5750505061135f61187c565b42815260208101918252600854600160401b811015610ba55780600161138a920160085560086117c7565b929092610b925760019151835551910155005b600481036113db575050506113b061187c565b42815260208101918252600954600160401b811015610ba55780600161138a920160095560096117c7565b60058103611419575050506113ee61187c565b42815260208101918252600a54600160401b811015610ba55780600161138a9201600a55600a6117c7565b6006810361147d575061142a61187c565b42815260208101938452600b54600160401b811015610ba5578060016114559201600b55600b6117c7565b919091610b925761128294600191518355519101555f52601460205260405f2061080a61187c565b600781036114e1575061148e61187c565b42815260208101938452600c54600160401b811015610ba5578060016114b99201600c55600c6117c7565b919091610b925761128294600191518355519101555f52601560205260405f2061080a61187c565b6008919350146114ed57005b611282915f52601360205260405f2061080a61187c565b506002546001600160a01b0316331461121c565b506001546001600160a01b03163314611215565b3461027057602036600319011261027057600435600b5481101561027057600b548110156102bf57604090600b5f5260205f209060011b016001815491015482519182526020820152f35b34610270576020366003190112610270576001600160a01b0361159861176c565b165f52601060205260405f2080546115b26102f2826118e2565b9181835260208301905f5260205f205f915b8383106115d9576040518061033c8782611782565b600260206001926115e861187c565b8554815284860154838201528152019201920191906115c4565b3461027057602036600319011261027057600435600554811015610270576005548110156102bf5760409060055f5260205f209060011b016001815491015482519182526020820152f35b346102705760403660031901126102705761166661176c565b6001600160a01b03165f908152601560205260409020805460243591908210156102705760409161025c916117c7565b3461027057602036600319011261027057600435600a5481101561027057600a548110156102bf57604090600a5f5260205f209060011b016001815491015482519182526020820152f35b34610270576020366003190112610270576001600160a01b0361170261176c565b165f52601160205260405f20805461171c6102f2826118e2565b9181835260208301905f5260205f205f915b838310611743576040518061033c8782611782565b6002602060019261175261187c565b85548152848601548382015281520192019201919061172e565b600435906001600160a01b038216820361027057565b60206040818301928281528451809452019201905f5b8181106117a55750505090565b8251805185526020908101518186015260409094019390920191600101611798565b80548210156102bf575f5260205f209060011b01905f90565b80548210156102bf575f52600360205f20910201905f90565b9181601f840112156102705782359167ffffffffffffffff8311610270576020808501948460051b01011161027057565b60406003198201126102705760043567ffffffffffffffff81116102705781611855916004016117f9565b929092916024359067ffffffffffffffff821161027057611878916004016117f9565b9091565b604051906040820182811067ffffffffffffffff821117610ba557604052565b604051906060820182811067ffffffffffffffff821117610ba557604052565b6040519190601f01601f1916820167ffffffffffffffff811183821017610ba557604052565b67ffffffffffffffff8111610ba55760051b60200190565b8054600160401b811015610ba557611917916001820181556117c7565b919091610b92576020816001925184550151910155565b91908110156102bf5760051b0190565b356001600160a01b03811681036102705790565b1561195957565b60405162461bcd60e51b815260206004820152602560248201527f4461746153746f72653a2063616c6c6572206973206e6f7420746865206f70656044820152643930ba37b960d91b6064820152608490fdfea2646970667358221220d71116561eef614cfabf2e487dc6b6fe9ff3fb610b7e0d10da9882342b16187064736f6c634300081a0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000f21a1c9ff8b143615dbffba6c8f73965443500f7000000000000000000000000a11264035c4525a34f06961a935e98eed51f5b81000000000000000000000000d4ce32a99782bb334e308286b984843b37862d54
-----Decoded View---------------
Arg [0] : _staking (address): 0xF21A1c9Ff8b143615dbfFBa6C8f73965443500F7
Arg [1] : _trading (address): 0xA11264035c4525a34f06961a935E98eeD51F5b81
Arg [2] : _borrowing (address): 0xd4Ce32A99782bB334E308286B984843b37862D54
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000f21a1c9ff8b143615dbffba6c8f73965443500f7
Arg [1] : 000000000000000000000000a11264035c4525a34f06961a935e98eed51f5b81
Arg [2] : 000000000000000000000000d4ce32a99782bb334e308286b984843b37862d54
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in HYPE
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.