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
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
BridgeCoreWriterController
Compiler Version
v0.8.20+commit.a1b79de6
Optimization Enabled:
Yes with 99999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
pragma solidity 0.8.20;
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {ReentrancyGuardUpgradeable} from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import {SafeTransferLib} from "solady/utils/SafeTransferLib.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "../../../interfaces/IBridgeCoreWriterController.sol";
import "../../../interfaces/IRelayCaller.sol";
import "../../../interfaces/IHyperCoreWriter.sol";
import "../../../interfaces/IWETH.sol";
import "../../../lib/HyperCoreRead.sol";
import {SafeERC20} from "../../../lib/SafeERC20.sol";
// helper contract to call swap through aggregator and directly interact with hyperCore (bridge/send/place-order) through CoreWriter
contract BridgeCoreWriterController is Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable, IBridgeCoreWriterController {
using SafeERC20 for IERC20;
using SafeTransferLib for address;
address private constant ETH_ADDRESS = address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE);
address public swapCaller;
address public WETH;
address public coreWriter;
address public hypeCoreSystem;
mapping(address => bool) public isExecutor;
constructor() {
_disableInitializers();
}
receive() external payable {}
/// @param _swapCaller The address for caller.
/// @param _WETH The address of WETH.
/// @param _coreWriter The address of CoreWriter.
/// @param _hypeCoreSystem The address of HYPE system (for deposit/withdraw HyperCore).
function initialize(
address _swapCaller,
address _WETH,
address _coreWriter,
address _hypeCoreSystem
) external initializer {
__Ownable_init();
__ReentrancyGuard_init();
swapCaller = _swapCaller;
WETH = _WETH;
coreWriter = _coreWriter;
hypeCoreSystem = _hypeCoreSystem;
}
modifier onlyExecutor() {
if (!isExecutor[msg.sender] && owner() != msg.sender) revert Unauthorized();
_;
}
function targetBridge(
uint256 amountIn, IERC20 tokenIn, IERC20 tokenBridge,
SwapData calldata swapData,
BridgeCoreData calldata bridgeCoreData,
bytes calldata auxiliaryData
) external nonReentrant payable {
if (isETH(tokenIn)) {
if (amountIn > msg.value) revert InvalidAmount();
} else {
amountIn = _pullToken(tokenIn, msg.sender, amountIn);
}
uint balanceReceived = _targetBridge(amountIn, tokenIn, tokenBridge, swapData, bridgeCoreData, msg.sender);
emit Sent(msg.sender, address(tokenIn), amountIn, address(tokenBridge), balanceReceived, auxiliaryData, block.timestamp);
}
function executorTargetBridge(
uint256 amountIn, IERC20 tokenIn, IERC20 tokenBridge,
SwapData calldata swapData,
BridgeCoreData calldata bridgeCoreData,
bytes calldata auxiliaryData,
address receiver
) external onlyExecutor {
uint balanceReceived = _targetBridge(amountIn, tokenIn, tokenBridge, swapData, bridgeCoreData, receiver);
emit ExecutorSent(receiver, address(tokenIn), amountIn, address(tokenBridge), balanceReceived, auxiliaryData, block.timestamp);
}
// for erc20 tokenIndex only, not supported HYPE token
function executorWithdrawFromCore(uint32 tokenIndex, uint64 amt) external onlyExecutor {
address coreSystemToken = _getCoreSystemAddress(tokenIndex);
_transferOnHyperCore(coreSystemToken, tokenIndex, amt);
emit ExecutorWithdrawFromCore(tokenIndex, amt, block.timestamp);
}
function executorSpotSendOnCore(address receiver, uint64 tokenIndex, uint64 amt) external onlyExecutor {
_transferOnHyperCore(receiver, tokenIndex, amt);
emit ExecutorSpotSendOnCore(receiver, tokenIndex, amt, block.timestamp);
}
function executorAddAPIWallet(address apiWallet, string calldata walletName) external onlyExecutor {
bytes memory addAPIWalletData = buildAddAPIWalletData(apiWallet, walletName);
IHyperCoreWriter(coreWriter).sendRawAction(addAPIWalletData);
emit ExecutorAddAPIWallet(apiWallet, walletName, block.timestamp);
}
function executorMulticall(bytes[] calldata data) external onlyExecutor {
for (uint256 i = 0; i < data.length; i++) {
(bool success, bytes memory result) = address(this).delegatecall(data[i]);
if (!success) {
emit ExecuteFailedMulticall(data[i], block.timestamp);
}
}
}
// execute without pull tokenIn
function _targetBridge(
uint256 amountIn, IERC20 tokenIn, IERC20 tokenBridge,
SwapData calldata swapData,
BridgeCoreData calldata bridgeCoreData,
address receiver
) internal returns (uint256 balanceReceived) {
if (swapCaller == address(0)) revert InvalidAddress();
// swap on hyperEVM
if (address(tokenIn) == WETH && isETH(tokenBridge)) {
IWETH(WETH).withdraw(amountIn);
balanceReceived = amountIn;
} else if (tokenIn != tokenBridge) {
balanceReceived = _executeSwap(tokenIn, tokenBridge, swapData.router, address(this), amountIn, swapData.minSwapAmountOut, swapData.swapData);
// claim fund stuck in caller
IRelayCaller(swapCaller).claimFund(tokenIn, 0);
emit Swapped(receiver, address(tokenIn), address(tokenBridge), amountIn, balanceReceived, block.timestamp);
} else {
balanceReceived = amountIn;
}
// return funds to user
if (bridgeCoreData.transferReturnOnHyperEVM) {
_transferTokenTo(tokenBridge, receiver, balanceReceived);
} else {
// bridge to hyperCore then transfer on core if need
(address evmContract, uint8 weiDecimals, int8 evmExtraWeiDecimals) = _getCoreTokenInfo(bridgeCoreData.tokenIndex);
address coreSystemToken;
if (isETH(tokenBridge)) {
if (!isETH(IERC20(evmContract)) || weiDecimals != 8) revert InvalidCoreTokenIndex();
coreSystemToken = hypeCoreSystem; // HYPE use hypeCoreSystem for deposit
evmExtraWeiDecimals = 10;
} else {
if (evmContract != address(tokenBridge)) revert InvalidCoreTokenIndex();
coreSystemToken = _getCoreSystemAddress(bridgeCoreData.tokenIndex);
}
balanceReceived = _trimDecimals(balanceReceived, evmExtraWeiDecimals);
_transferTokenTo(tokenBridge, coreSystemToken, balanceReceived);
if (bridgeCoreData.transferReturnOnCore) {
uint64 amtInCore = uint64(_convertDecimals(balanceReceived, evmExtraWeiDecimals));
_transferOnHyperCore(receiver, bridgeCoreData.tokenIndex, amtInCore);
}
}
}
function _executeSwap(
IERC20 inputToken, IERC20 outputToken, address router, address receiver, uint256 amountSwap, uint256 minAmountOut, bytes memory swapData
) internal returns (uint256 balanceReceived) {
// Execute the token swap
if (minAmountOut < 1) revert InvalidAmount();
uint balanceBefore = getBalance(outputToken, receiver);
uint amtETH;
if (isETH(inputToken)) {
amtETH = amountSwap;
} else {
_transferTokenTo(inputToken, swapCaller, amountSwap);
}
IRelayCaller(swapCaller).executeCall{value : amtETH}(inputToken, amountSwap, swapData, router, router);
balanceReceived = getBalance(outputToken, receiver) - balanceBefore;
if (balanceReceived < minAmountOut) revert SwapSlippage();
}
// for erc20 index only, not supported HYPE token
function _getCoreSystemAddress(uint32 index) internal pure returns (address coreSystem) {
coreSystem = address(uint160(index + uint160(0x2000000000000000000000000000000000000000)));
}
function _getCoreTokenInfo(uint32 index) internal view returns (address evmContract, uint8 weiDecimals, int8 evmExtraWeiDecimals) {
HyperCoreRead.TokenInfo memory tokenInfo = HyperCoreRead.tokenInfo(index);
return (tokenInfo.evmContract, tokenInfo.weiDecimals, tokenInfo.evmExtraWeiDecimals);
}
function _transferOnHyperCore(address destination, uint64 token, uint64 amt) internal {
bytes memory transferData = buildSpotSendCoreData(destination, token, amt);
IHyperCoreWriter(coreWriter).sendRawAction(transferData);
}
function buildSpotSendCoreData(address destination, uint64 token, uint64 amt) internal pure returns (bytes memory) {
bytes memory encodedAction = abi.encode(destination, token, amt);
return buildCoreData(encodedAction, 0x06);
}
function buildAddAPIWalletData(address apiWallet, string calldata walletName) internal pure returns (bytes memory) {
bytes memory encodedAction = abi.encode(apiWallet, walletName);
return buildCoreData(encodedAction, 0x09);
}
function buildCoreData(bytes memory encodedAction, bytes1 actionId) internal pure returns (bytes memory) {
bytes memory data = new bytes(4 + encodedAction.length);
data[0] = 0x01;
data[1] = 0x00;
data[2] = 0x00;
data[3] = actionId;
for (uint256 i = 0; i < encodedAction.length; i++) {
data[4 + i] = encodedAction[i];
}
return data;
}
function getBalance(address token, address account) internal view returns (uint) {
return getBalance(IERC20(token), account);
}
function getBalance(IERC20 token, address account) internal view returns (uint) {
if (isETH(token)) {
return account.balance;
} else {
return token.balanceOf(account);
}
}
function isETH(IERC20 token) internal pure returns (bool) {
return (address(token) == address(0) || address(token) == ETH_ADDRESS);
}
// convert from evm wei amt to core wei amt
function _convertDecimals(uint256 evmAmount, int8 evmExtraWeiDecimals) internal pure returns (uint256) {
if (evmExtraWeiDecimals == 0) {
return evmAmount;
} else if (evmExtraWeiDecimals > 0) {
return evmAmount / (10 ** uint8(evmExtraWeiDecimals));
} else {
return evmAmount * (10 ** uint8(-evmExtraWeiDecimals));
}
}
// remove dust decimal amt when bridge to core. return evm wei amt
function _trimDecimals(uint256 evmAmount, int8 evmExtraWeiDecimals) internal pure returns (uint256) {
if (evmExtraWeiDecimals > 0) {
return evmAmount / (10 ** uint8(evmExtraWeiDecimals)) * (10 ** uint8(evmExtraWeiDecimals));
} else {
return evmAmount;
}
}
/// @dev Pulls the token from the sender.
function _pullToken(IERC20 token, address user, uint256 amount) internal returns (uint256 amountPulled) {
uint256 balanceBefore = token.balanceOf(address(this));
token.safeTransferFrom(user, address(this), amount);
amountPulled = token.balanceOf(address(this)) - balanceBefore;
}
function _transferTokenTo(IERC20 token, address to, uint256 amount) internal returns (uint256 amountSent) {
uint256 balanceBefore = getBalance(token, to);
if (isETH(token)) {
to.safeTransferETH(amount);
} else {
token.safeTransfer(to, amount);
}
amountSent = getBalance(token, to) - balanceBefore;
}
function setExecutor(address _executor, bool _isAdd) external onlyOwner {
if (_executor == address(0)) revert InvalidAddress();
isExecutor[_executor] = _isAdd;
emit ExecutorSet(_executor, _isAdd);
}
function setSwapCaller(address _swapCaller) external onlyOwner {
swapCaller = _swapCaller;
}
function rescueFunds(IERC20 token, uint256 amount) external onlyOwner {
_transferTokenTo(token, msg.sender, amount);
}
}pragma solidity 0.8.20;
interface IBridgeCoreWriterController {
struct SwapData {
uint256 minSwapAmountOut;
address router;
bytes swapData;
}
struct BridgeCoreData {
uint32 tokenIndex;
bool transferReturnOnHyperEVM;
bool transferReturnOnCore;
}
// ========== EVENTS =========
event ExecutorSet(address indexed, bool isAdd);
event Swapped(address indexed user, address tokenIn, address tokenOut, uint256 amountSwap, uint256 amountReceived, uint256 timestamp);
event Sent(
address sender,
address srcToken,
uint256 srcAmount,
address hubToken,
uint256 hubAmount,
bytes auxiliaryData,
uint256 timestamp
);
event ExecutorSent(
address sender,
address srcToken,
uint256 srcAmount,
address hubToken,
uint256 hubAmount,
bytes auxiliaryData,
uint256 timestamp
);
event ExecutorWithdrawFromCore(
uint64 tokenIndex,
uint64 amt,
uint256 timestamp
);
event ExecutorSpotSendOnCore(
address receiver,
uint64 tokenIndex,
uint64 amt,
uint256 timestamp
);
event ExecutorAddAPIWallet(
address apiWallet,
string walletName,
uint256 timestamp
);
event ExecuteFailedMulticall(
bytes callData,
uint256 timestamp
);
// ======= ERRORS ========
error InvalidAmount();
error InvalidAddress();
error InvalidCoreTokenIndex();
error SwapSlippage();
error BeforeBridgeSlippage();
error Unauthorized();
error Timeout();
error OrderExisted();
}pragma solidity 0.8.20;
interface IHyperCoreWriter {
function sendRawAction(bytes calldata data) external;
}pragma solidity 0.8.20;
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface IRelayCaller {
function executeCall(IERC20 fromToken, uint amountIn, bytes calldata data, address bridgeCallee, address targetApprove) external payable;
function claimFund(IERC20 token, uint256 amount) external returns (uint256);
}pragma solidity >=0.8.0;
interface IUSDCPermit {
/**
* @notice Update allowance with a signed permit
* @dev EOA wallet signatures should be packed in the order of r, s, v.
* @param owner Token owner's address (Authorizer)
* @param spender Spender's address
* @param value Amount of allowance
* @param deadline The time at which the signature expires (unix time), or max uint256 value to signal no expiration
* @param signature Signature bytes signed by an EOA wallet or a contract wallet
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
bytes memory signature
) external;
/**
* @notice Update allowance with a signed permit
* @param owner Token owner's address (Authorizer)
* @param spender Spender's address
* @param value Amount of allowance
* @param deadline The time at which the signature expires (unix time), or max uint256 value to signal no expiration
* @param v v of the signature
* @param r r of the signature
* @param s s of the signature
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/// @notice Returns the remaining number of tokens that `spender` is allowed
/// to spend on behalf of `owner`
function allowance(address owner, address spender) external view returns (uint256);
}pragma solidity >= 0.8.0;
import {IERC20} from "@openzeppelin/contracts/interfaces/IERC20.sol";
interface IWETH is IERC20 {
function deposit() external payable;
function transfer(address to, uint256 value) external returns (bool);
function withdraw(uint256) external;
}pragma solidity 0.8.20;
/*
precompile contract on hyperEVM to querying HyperCore information
These addresses don't correspond to regular smart contracts; instead, they trigger native code execution on the validator node
For example, when a contract on HyperEVM queries a token balance by calling a designated read precompile, it bypasses standard EVM execution.
The call is handled directly by the validator, which fetches the requested data from HyperCore in real time.
This mechanism provides secure, gas-efficient, read-only access to the core exchange state
*/
library HyperCoreRead {
struct Position {
int64 szi;
uint64 entryNtl;
int64 isolatedRawUsd;
uint32 leverage;
bool isIsolated;
}
struct SpotBalance {
uint64 total;
uint64 hold;
uint64 entryNtl;
}
struct UserVaultEquity {
uint64 equity;
uint64 lockedUntilTimestamp;
}
struct Withdrawable {
uint64 withdrawable;
}
struct Delegation {
address validator;
uint64 amount;
uint64 lockedUntilTimestamp;
}
struct DelegatorSummary {
uint64 delegated;
uint64 undelegated;
uint64 totalPendingWithdrawal;
uint64 nPendingWithdrawals;
}
struct PerpAssetInfo {
string coin;
uint32 marginTableId;
uint8 szDecimals;
uint8 maxLeverage;
bool onlyIsolated;
}
struct SpotInfo {
string name;
uint64[2] tokens;
}
struct TokenInfo {
string name;
uint64[] spots;
uint64 deployerTradingFeeShare;
address deployer;
address evmContract;
uint8 szDecimals;
uint8 weiDecimals;
int8 evmExtraWeiDecimals;
}
struct UserBalance {
address user;
uint64 balance;
}
struct TokenSupply {
uint64 maxSupply;
uint64 totalSupply;
uint64 circulatingSupply;
uint64 futureEmissions;
UserBalance[] nonCirculatingUserBalances;
}
struct Bbo {
uint64 bid;
uint64 ask;
}
struct AccountMarginSummary {
int64 accountValue;
uint64 marginUsed;
uint64 ntlPos;
int64 rawUsd;
}
struct CoreUserExists {
bool exists;
}
address constant POSITION_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000800;
address constant SPOT_BALANCE_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000801;
address constant VAULT_EQUITY_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000802;
address constant WITHDRAWABLE_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000803;
address constant DELEGATIONS_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000804;
address constant DELEGATOR_SUMMARY_PRECOMPILE_ADDRESS =
0x0000000000000000000000000000000000000805;
address constant MARK_PX_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000806;
address constant ORACLE_PX_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000807;
address constant SPOT_PX_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000808;
address constant L1_BLOCK_NUMBER_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000809;
address constant PERP_ASSET_INFO_PRECOMPILE_ADDRESS = 0x000000000000000000000000000000000000080a;
address constant SPOT_INFO_PRECOMPILE_ADDRESS = 0x000000000000000000000000000000000000080b;
address constant TOKEN_INFO_PRECOMPILE_ADDRESS = 0x000000000000000000000000000000000000080C;
address constant TOKEN_SUPPLY_PRECOMPILE_ADDRESS = 0x000000000000000000000000000000000000080D;
address constant BBO_PRECOMPILE_ADDRESS = 0x000000000000000000000000000000000000080e;
address constant ACCOUNT_MARGIN_SUMMARY_PRECOMPILE_ADDRESS =
0x000000000000000000000000000000000000080F;
address constant CORE_USER_EXISTS_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000810;
function position(address user, uint16 perp) internal view returns (Position memory) {
bool success;
bytes memory result;
(success, result) = POSITION_PRECOMPILE_ADDRESS.staticcall(abi.encode(user, perp));
require(success, "Position precompile call failed");
return abi.decode(result, (Position));
}
function spotBalance(address user, uint64 token) internal view returns (SpotBalance memory) {
bool success;
bytes memory result;
(success, result) = SPOT_BALANCE_PRECOMPILE_ADDRESS.staticcall(abi.encode(user, token));
require(success, "SpotBalance precompile call failed");
return abi.decode(result, (SpotBalance));
}
function userVaultEquity(
address user,
address vault
) internal view returns (UserVaultEquity memory) {
bool success;
bytes memory result;
(success, result) = VAULT_EQUITY_PRECOMPILE_ADDRESS.staticcall(abi.encode(user, vault));
require(success, "VaultEquity precompile call failed");
return abi.decode(result, (UserVaultEquity));
}
function withdrawable(address user) internal view returns (Withdrawable memory) {
bool success;
bytes memory result;
(success, result) = WITHDRAWABLE_PRECOMPILE_ADDRESS.staticcall(abi.encode(user));
require(success, "Withdrawable precompile call failed");
return abi.decode(result, (Withdrawable));
}
function delegations(address user) internal view returns (Delegation[] memory) {
bool success;
bytes memory result;
(success, result) = DELEGATIONS_PRECOMPILE_ADDRESS.staticcall(abi.encode(user));
require(success, "Delegations precompile call failed");
return abi.decode(result, (Delegation[]));
}
function delegatorSummary(address user) internal view returns (DelegatorSummary memory) {
bool success;
bytes memory result;
(success, result) = DELEGATOR_SUMMARY_PRECOMPILE_ADDRESS.staticcall(abi.encode(user));
require(success, "DelegatorySummary precompile call failed");
return abi.decode(result, (DelegatorSummary));
}
function markPx(uint32 index) internal view returns (uint64) {
bool success;
bytes memory result;
(success, result) = MARK_PX_PRECOMPILE_ADDRESS.staticcall(abi.encode(index));
require(success, "MarkPx precompile call failed");
return abi.decode(result, (uint64));
}
function oraclePx(uint32 index) internal view returns (uint64) {
bool success;
bytes memory result;
(success, result) = ORACLE_PX_PRECOMPILE_ADDRESS.staticcall(abi.encode(index));
require(success, "OraclePx precompile call failed");
return abi.decode(result, (uint64));
}
function spotPx(uint32 index) internal view returns (uint64) {
bool success;
bytes memory result;
(success, result) = SPOT_PX_PRECOMPILE_ADDRESS.staticcall(abi.encode(index));
require(success, "SpotPx precompile call failed");
return abi.decode(result, (uint64));
}
function l1BlockNumber() internal view returns (uint64) {
bool success;
bytes memory result;
(success, result) = L1_BLOCK_NUMBER_PRECOMPILE_ADDRESS.staticcall(abi.encode());
require(success, "L1BlockNumber precompile call failed");
return abi.decode(result, (uint64));
}
function perpAssetInfo(uint32 perp) internal view returns (PerpAssetInfo memory) {
bool success;
bytes memory result;
(success, result) = PERP_ASSET_INFO_PRECOMPILE_ADDRESS.staticcall(abi.encode(perp));
require(success, "PerpAssetInfo precompile call failed");
return abi.decode(result, (PerpAssetInfo));
}
function spotInfo(uint32 spot) internal view returns (SpotInfo memory) {
bool success;
bytes memory result;
(success, result) = SPOT_INFO_PRECOMPILE_ADDRESS.staticcall(abi.encode(spot));
require(success, "SpotInfo precompile call failed");
return abi.decode(result, (SpotInfo));
}
function tokenInfo(uint32 token) internal view returns (TokenInfo memory) {
bool success;
bytes memory result;
(success, result) = TOKEN_INFO_PRECOMPILE_ADDRESS.staticcall(abi.encode(token));
require(success, "TokenInfo precompile call failed");
return abi.decode(result, (TokenInfo));
}
function tokenSupply(uint32 token) internal view returns (TokenSupply memory) {
bool success;
bytes memory result;
(success, result) = TOKEN_SUPPLY_PRECOMPILE_ADDRESS.staticcall(abi.encode(token));
require(success, "TokenSupply precompile call failed");
return abi.decode(result, (TokenSupply));
}
function bbo(uint32 asset) internal view returns (Bbo memory) {
bool success;
bytes memory result;
(success, result) = BBO_PRECOMPILE_ADDRESS.staticcall(abi.encode(asset));
require(success, "Bbo precompile call failed");
return abi.decode(result, (Bbo));
}
function accountMarginSummary(
uint32 perp_dex_index,
address user
) internal view returns (AccountMarginSummary memory) {
bool success;
bytes memory result;
(success, result) = ACCOUNT_MARGIN_SUMMARY_PRECOMPILE_ADDRESS.staticcall(
abi.encode(perp_dex_index, user)
);
require(success, "Account margin summary precompile call failed");
return abi.decode(result, (AccountMarginSummary));
}
function coreUserExists(address user) internal view returns (CoreUserExists memory) {
bool success;
bytes memory result;
(success, result) = CORE_USER_EXISTS_PRECOMPILE_ADDRESS.staticcall(abi.encode(user));
require(success, "Core user exists precompile call failed");
return abi.decode(result, (CoreUserExists));
}
}pragma solidity >=0.8.0;
import {SafeTransferLib} from "solady/utils/SafeTransferLib.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IUSDCPermit} from "../interfaces/IUSDCPermit.sol";
/**
* wrap SafeTransferLib to retain oz SafeERC20 signature
*/
library SafeERC20 {
function safeTransferFrom(IERC20 token, address from, address to, uint256 amount) internal {
SafeTransferLib.safeTransferFrom(address(token), from, to, amount);
}
function safeTransfer(IERC20 token, address to, uint256 amount) internal {
SafeTransferLib.safeTransfer(address(token), to, amount);
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 amount) internal {
uint256 newAllowance = token.allowance(address(this), spender) + amount;
SafeTransferLib.safeApprove(address(token), spender, newAllowance);
}
function safePermit(
IERC20 token,
address owner,
address spender,
uint256 value,
uint256 deadline,
bytes memory signature
) internal {
IUSDCPermit tokenPermit = IUSDCPermit(address(token));
try tokenPermit.permit(owner, spender, value, deadline, signature) {} catch {
if (tokenPermit.allowance(owner, spender) < value) {
revert("SafeERC20: permit did not succeed");
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* 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 onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
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 {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
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 proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuardUpgradeable is Initializable {
// 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;
function __ReentrancyGuard_init() internal onlyInitializing {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal onlyInitializing {
_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() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @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
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 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");
(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 functionCallWithValue(target, data, 0, "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");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, 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) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` 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 from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/utils/SafeTransferLib.sol)
/// @author Modified from Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Caution! This library won't check that a token has code, responsibility is delegated to the caller.
library SafeTransferLib {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The ETH transfer has failed.
error ETHTransferFailed();
/// @dev The ERC20 `transferFrom` has failed.
error TransferFromFailed();
/// @dev The ERC20 `transfer` has failed.
error TransferFailed();
/// @dev The ERC20 `approve` has failed.
error ApproveFailed();
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CONSTANTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Suggested gas stipend for contract receiving ETH
/// that disallows any storage writes.
uint256 internal constant _GAS_STIPEND_NO_STORAGE_WRITES = 2300;
/// @dev Suggested gas stipend for contract receiving ETH to perform a few
/// storage reads and writes, but low enough to prevent griefing.
/// Multiply by a small constant (e.g. 2), if needed.
uint256 internal constant _GAS_STIPEND_NO_GRIEF = 100000;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* ETH OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Sends `amount` (in wei) ETH to `to`.
/// Reverts upon failure.
function safeTransferETH(address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
// Transfer the ETH and check if it succeeded or not.
if iszero(call(gas(), to, amount, 0, 0, 0, 0)) {
// Store the function selector of `ETHTransferFailed()`.
mstore(0x00, 0xb12d13eb)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
}
}
/// @dev Force sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
/// The `gasStipend` can be set to a low enough value to prevent
/// storage writes or gas griefing.
///
/// If sending via the normal procedure fails, force sends the ETH by
/// creating a temporary contract which uses `SELFDESTRUCT` to force send the ETH.
///
/// Reverts if the current contract has insufficient balance.
function forceSafeTransferETH(address to, uint256 amount, uint256 gasStipend) internal {
/// @solidity memory-safe-assembly
assembly {
// If insufficient balance, revert.
if lt(selfbalance(), amount) {
// Store the function selector of `ETHTransferFailed()`.
mstore(0x00, 0xb12d13eb)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
// Transfer the ETH and check if it succeeded or not.
if iszero(call(gasStipend, to, amount, 0, 0, 0, 0)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
// We can directly use `SELFDESTRUCT` in the contract creation.
// Compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758
if iszero(create(amount, 0x0b, 0x16)) {
// For better gas estimation.
if iszero(gt(gas(), 1000000)) { revert(0, 0) }
}
}
}
}
/// @dev Force sends `amount` (in wei) ETH to `to`, with a gas stipend
/// equal to `_GAS_STIPEND_NO_GRIEF`. This gas stipend is a reasonable default
/// for 99% of cases and can be overriden with the three-argument version of this
/// function if necessary.
///
/// If sending via the normal procedure fails, force sends the ETH by
/// creating a temporary contract which uses `SELFDESTRUCT` to force send the ETH.
///
/// Reverts if the current contract has insufficient balance.
function forceSafeTransferETH(address to, uint256 amount) internal {
// Manually inlined because the compiler doesn't inline functions with branches.
/// @solidity memory-safe-assembly
assembly {
// If insufficient balance, revert.
if lt(selfbalance(), amount) {
// Store the function selector of `ETHTransferFailed()`.
mstore(0x00, 0xb12d13eb)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
// Transfer the ETH and check if it succeeded or not.
if iszero(call(_GAS_STIPEND_NO_GRIEF, to, amount, 0, 0, 0, 0)) {
mstore(0x00, to) // Store the address in scratch space.
mstore8(0x0b, 0x73) // Opcode `PUSH20`.
mstore8(0x20, 0xff) // Opcode `SELFDESTRUCT`.
// We can directly use `SELFDESTRUCT` in the contract creation.
// Compatible with `SENDALL`: https://eips.ethereum.org/EIPS/eip-4758
if iszero(create(amount, 0x0b, 0x16)) {
// For better gas estimation.
if iszero(gt(gas(), 1000000)) { revert(0, 0) }
}
}
}
}
/// @dev Sends `amount` (in wei) ETH to `to`, with a `gasStipend`.
/// The `gasStipend` can be set to a low enough value to prevent
/// storage writes or gas griefing.
///
/// Simply use `gasleft()` for `gasStipend` if you don't need a gas stipend.
///
/// Note: Does NOT revert upon failure.
/// Returns whether the transfer of ETH is successful instead.
function trySafeTransferETH(address to, uint256 amount, uint256 gasStipend)
internal
returns (bool success)
{
/// @solidity memory-safe-assembly
assembly {
// Transfer the ETH and check if it succeeded or not.
success := call(gasStipend, to, amount, 0, 0, 0, 0)
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* ERC20 OPERATIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Sends `amount` of ERC20 `token` from `from` to `to`.
/// Reverts upon failure.
///
/// The `from` account must have at least `amount` approved for
/// the current contract to manage.
function safeTransferFrom(address token, address from, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x60, amount) // Store the `amount` argument.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
// Store the function selector of `transferFrom(address,address,uint256)`.
mstore(0x0c, 0x23b872dd000000000000000000000000)
if iszero(
and( // The arguments of `and` are evaluated from right to left.
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(eq(mload(0x00), 1), iszero(returndatasize())),
call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
)
) {
// Store the function selector of `TransferFromFailed()`.
mstore(0x00, 0x7939f424)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends all of ERC20 `token` from `from` to `to`.
/// Reverts upon failure.
///
/// The `from` account must have at least `amount` approved for
/// the current contract to manage.
function safeTransferAllFrom(address token, address from, address to)
internal
returns (uint256 amount)
{
/// @solidity memory-safe-assembly
assembly {
let m := mload(0x40) // Cache the free memory pointer.
mstore(0x40, to) // Store the `to` argument.
mstore(0x2c, shl(96, from)) // Store the `from` argument.
// Store the function selector of `balanceOf(address)`.
mstore(0x0c, 0x70a08231000000000000000000000000)
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x1c, 0x24, 0x60, 0x20)
)
) {
// Store the function selector of `TransferFromFailed()`.
mstore(0x00, 0x7939f424)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
// Store the function selector of `transferFrom(address,address,uint256)`.
mstore(0x00, 0x23b872dd)
// The `amount` argument is already written to the memory word at 0x6c.
amount := mload(0x60)
if iszero(
and( // The arguments of `and` are evaluated from right to left.
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(eq(mload(0x00), 1), iszero(returndatasize())),
call(gas(), token, 0, 0x1c, 0x64, 0x00, 0x20)
)
) {
// Store the function selector of `TransferFromFailed()`.
mstore(0x00, 0x7939f424)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
mstore(0x60, 0) // Restore the zero slot to zero.
mstore(0x40, m) // Restore the free memory pointer.
}
}
/// @dev Sends `amount` of ERC20 `token` from the current contract to `to`.
/// Reverts upon failure.
function safeTransfer(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
// Store the function selector of `transfer(address,uint256)`.
mstore(0x00, 0xa9059cbb000000000000000000000000)
if iszero(
and( // The arguments of `and` are evaluated from right to left.
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(eq(mload(0x00), 1), iszero(returndatasize())),
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
// Store the function selector of `TransferFailed()`.
mstore(0x00, 0x90b8ec18)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
// Restore the part of the free memory pointer that was overwritten.
mstore(0x34, 0)
}
}
/// @dev Sends all of ERC20 `token` from the current contract to `to`.
/// Reverts upon failure.
function safeTransferAll(address token, address to) internal returns (uint256 amount) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, 0x70a08231) // Store the function selector of `balanceOf(address)`.
mstore(0x20, address()) // Store the address of the current contract.
if iszero(
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x1c, 0x24, 0x34, 0x20)
)
) {
// Store the function selector of `TransferFailed()`.
mstore(0x00, 0x90b8ec18)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
mstore(0x14, to) // Store the `to` argument.
// The `amount` argument is already written to the memory word at 0x34.
amount := mload(0x34)
// Store the function selector of `transfer(address,uint256)`.
mstore(0x00, 0xa9059cbb000000000000000000000000)
if iszero(
and( // The arguments of `and` are evaluated from right to left.
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(eq(mload(0x00), 1), iszero(returndatasize())),
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
// Store the function selector of `TransferFailed()`.
mstore(0x00, 0x90b8ec18)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
// Restore the part of the free memory pointer that was overwritten.
mstore(0x34, 0)
}
}
/// @dev Sets `amount` of ERC20 `token` for `to` to manage on behalf of the current contract.
/// Reverts upon failure.
function safeApprove(address token, address to, uint256 amount) internal {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, to) // Store the `to` argument.
mstore(0x34, amount) // Store the `amount` argument.
// Store the function selector of `approve(address,uint256)`.
mstore(0x00, 0x095ea7b3000000000000000000000000)
if iszero(
and( // The arguments of `and` are evaluated from right to left.
// Set success to whether the call reverted, if not we check it either
// returned exactly 1 (can't just be non-zero data), or had no return data.
or(eq(mload(0x00), 1), iszero(returndatasize())),
call(gas(), token, 0, 0x10, 0x44, 0x00, 0x20)
)
) {
// Store the function selector of `ApproveFailed()`.
mstore(0x00, 0x3e3f8f73)
// Revert with (offset, size).
revert(0x1c, 0x04)
}
// Restore the part of the free memory pointer that was overwritten.
mstore(0x34, 0)
}
}
/// @dev Returns the amount of ERC20 `token` owned by `account`.
/// Returns zero if the `token` does not exist.
function balanceOf(address token, address account) internal view returns (uint256 amount) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x14, account) // Store the `account` argument.
// Store the function selector of `balanceOf(address)`.
mstore(0x00, 0x70a08231000000000000000000000000)
amount :=
mul(
mload(0x20),
and( // The arguments of `and` are evaluated from right to left.
gt(returndatasize(), 0x1f), // At least 32 bytes returned.
staticcall(gas(), token, 0x10, 0x24, 0x20, 0x20)
)
)
}
}
}{
"optimizer": {
"enabled": true,
"runs": 99999
},
"metadata": {
"bytecodeHash": "none",
"useLiteralContent": true
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": [
"@chainlink/contracts-ccip/=lib/ccip/contracts/",
"@layerzerolabs/lz-evm-oapp-v2/=lib/layerzero-v2/packages/layerzero-v2/evm/oapp/",
"@layerzerolabs/lz-evm-protocol-v2/=lib/layerzero-v2/packages/layerzero-v2/evm/protocol/",
"@layerzerolabs/oapp-evm/=lib/devtools/packages/oapp-evm/",
"@layerzerolabs/oft-evm/=lib/devtools/packages/oft-evm/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"ccip/=lib/ccip/contracts/",
"devtools/=lib/devtools/packages/toolbox-foundry/src/",
"ds-test/=lib/forge-std/lib/ds-test/src/",
"forge-std/=lib/forge-std/src/",
"layerzero-v2/=lib/layerzero-v2/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"solady/=lib/solady/src/",
"solmate/=lib/solady/lib/solmate/src/"
]
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"BeforeBridgeSlippage","type":"error"},{"inputs":[],"name":"InvalidAddress","type":"error"},{"inputs":[],"name":"InvalidAmount","type":"error"},{"inputs":[],"name":"InvalidCoreTokenIndex","type":"error"},{"inputs":[],"name":"OrderExisted","type":"error"},{"inputs":[],"name":"SwapSlippage","type":"error"},{"inputs":[],"name":"Timeout","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes","name":"callData","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ExecuteFailedMulticall","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"apiWallet","type":"address"},{"indexed":false,"internalType":"string","name":"walletName","type":"string"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ExecutorAddAPIWallet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"srcToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"hubToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"hubAmount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"auxiliaryData","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ExecutorSent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"","type":"address"},{"indexed":false,"internalType":"bool","name":"isAdd","type":"bool"}],"name":"ExecutorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"receiver","type":"address"},{"indexed":false,"internalType":"uint64","name":"tokenIndex","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"amt","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ExecutorSpotSendOnCore","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint64","name":"tokenIndex","type":"uint64"},{"indexed":false,"internalType":"uint64","name":"amt","type":"uint64"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"ExecutorWithdrawFromCore","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"address","name":"srcToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"hubToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"hubAmount","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"auxiliaryData","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Sent","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"address","name":"tokenIn","type":"address"},{"indexed":false,"internalType":"address","name":"tokenOut","type":"address"},{"indexed":false,"internalType":"uint256","name":"amountSwap","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amountReceived","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"}],"name":"Swapped","type":"event"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"coreWriter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"apiWallet","type":"address"},{"internalType":"string","name":"walletName","type":"string"}],"name":"executorAddAPIWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"executorMulticall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"},{"internalType":"uint64","name":"tokenIndex","type":"uint64"},{"internalType":"uint64","name":"amt","type":"uint64"}],"name":"executorSpotSendOnCore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"tokenBridge","type":"address"},{"components":[{"internalType":"uint256","name":"minSwapAmountOut","type":"uint256"},{"internalType":"address","name":"router","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"}],"internalType":"struct IBridgeCoreWriterController.SwapData","name":"swapData","type":"tuple"},{"components":[{"internalType":"uint32","name":"tokenIndex","type":"uint32"},{"internalType":"bool","name":"transferReturnOnHyperEVM","type":"bool"},{"internalType":"bool","name":"transferReturnOnCore","type":"bool"}],"internalType":"struct IBridgeCoreWriterController.BridgeCoreData","name":"bridgeCoreData","type":"tuple"},{"internalType":"bytes","name":"auxiliaryData","type":"bytes"},{"internalType":"address","name":"receiver","type":"address"}],"name":"executorTargetBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"tokenIndex","type":"uint32"},{"internalType":"uint64","name":"amt","type":"uint64"}],"name":"executorWithdrawFromCore","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"hypeCoreSystem","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_swapCaller","type":"address"},{"internalType":"address","name":"_WETH","type":"address"},{"internalType":"address","name":"_coreWriter","type":"address"},{"internalType":"address","name":"_hypeCoreSystem","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isExecutor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"rescueFunds","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_executor","type":"address"},{"internalType":"bool","name":"_isAdd","type":"bool"}],"name":"setExecutor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_swapCaller","type":"address"}],"name":"setSwapCaller","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"swapCaller","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountIn","type":"uint256"},{"internalType":"contract IERC20","name":"tokenIn","type":"address"},{"internalType":"contract IERC20","name":"tokenBridge","type":"address"},{"components":[{"internalType":"uint256","name":"minSwapAmountOut","type":"uint256"},{"internalType":"address","name":"router","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"}],"internalType":"struct IBridgeCoreWriterController.SwapData","name":"swapData","type":"tuple"},{"components":[{"internalType":"uint32","name":"tokenIndex","type":"uint32"},{"internalType":"bool","name":"transferReturnOnHyperEVM","type":"bool"},{"internalType":"bool","name":"transferReturnOnCore","type":"bool"}],"internalType":"struct IBridgeCoreWriterController.BridgeCoreData","name":"bridgeCoreData","type":"tuple"},{"internalType":"bytes","name":"auxiliaryData","type":"bytes"}],"name":"targetBridge","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]Contract Creation Code
608060405234801562000010575f80fd5b506200001b62000021565b620000e0565b5f54610100900460ff16156200008d5760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b5f5460ff9081161015620000de575f805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b612e3080620000ee5f395ff3fe608060405260043610610126575f3560e01c80639125ab6f116100a1578063debfda3011610071578063f420d00f11610057578063f420d00f1461035b578063f8c8765e14610387578063fd3f8ca0146103a6575f80fd5b8063debfda30146102fe578063f2fde38b1461033c575f80fd5b80639125ab6f14610275578063ad5c464814610294578063c7838412146102c0578063d4441d08146102df575f80fd5b80636a2ce929116100f657806373ea197b116100dc57806373ea197b146101d657806378e3214f1461022c5780638da5cb5b1461024b575f80fd5b80636a2ce929146101a3578063715018a6146101c2575f80fd5b8063144ccd65146101315780631916cd0d146101525780631e1bff3f1461017157806327f9e40914610190575f80fd5b3661012d57005b5f80fd5b34801561013c575f80fd5b5061015061014b3660046121a9565b6103d2565b005b34801561015d575f80fd5b5061015061016c366004612245565b61055a565b34801561017c575f80fd5b5061015061018b3660046122aa565b610659565b61015061019e366004612338565b610737565b3480156101ae575f80fd5b506101506101bd3660046123dd565b610804565b3480156101cd575f80fd5b506101506108ef565b3480156101e1575f80fd5b506099546102029073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b348015610237575f80fd5b50610150610246366004612496565b610902565b348015610256575f80fd5b5060335473ffffffffffffffffffffffffffffffffffffffff16610202565b348015610280575f80fd5b5061015061028f3660046124c0565b610915565b34801561029f575f80fd5b506098546102029073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102cb575f80fd5b506101506102da366004612508565b610a11565b3480156102ea575f80fd5b506101506102f936600461252a565b610a60565b348015610309575f80fd5b5061032c610318366004612508565b609b6020525f908152604090205460ff1681565b6040519015158152602001610223565b348015610347575f80fd5b50610150610356366004612508565b610bbd565b348015610366575f80fd5b506097546102029073ffffffffffffffffffffffffffffffffffffffff1681565b348015610392575f80fd5b506101506103a136600461257b565b610c79565b3480156103b1575f80fd5b50609a546102029073ffffffffffffffffffffffffffffffffffffffff1681565b335f908152609b602052604090205460ff1615801561042557503361040c60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561045c576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b81811015610555575f803085858581811061047b5761047b6125d4565b905060200281019061048d9190612601565b60405161049b929190612662565b5f60405180830381855af49150503d805f81146104d3576040519150601f19603f3d011682016040523d82523d5f602084013e6104d8565b606091505b509150915081610540577f0395173c23e48cb319ff34a7e9b22b154faea035d29fbcc294c8742ad3917f39858585818110610515576105156125d4565b90506020028101906105279190612601565b42604051610537939291906126b8565b60405180910390a15b5050808061054d90612708565b91505061045e565b505050565b335f908152609b602052604090205460ff161580156105ad57503361059460335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b156105e4576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6105ee83610e80565b9050610601818463ffffffff1684610eab565b6040805163ffffffff8516815267ffffffffffffffff8416602082015242918101919091527f893e708b386d22e6cea302488ef946aef03a7c21e56a5519297068b80de3a317906060015b60405180910390a1505050565b610661610f41565b73ffffffffffffffffffffffffffffffffffffffff82166106ae576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82165f818152609b602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f278b09622564dd3991fe7744514513d64ea2c8ed2b2b9ec1150ad964fde80a99910160405180910390a25050565b61073f610fc2565b61074886611035565b1561078c5734871115610787576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61079a565b610797863389611087565b96505b5f6107a98888888888336111dc565b90507ff6a40b80c9a3cc8399553d42a99ec7975282051bb4bcb3bd77971829afa1e6a533888a89858888426040516107e898979695949392919061273f565b60405180910390a1506107fb6001606555565b50505050505050565b335f908152609b602052604090205460ff1615801561085757503361083e60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561088e576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61089d8989898989876111dc565b90507fb58f3245aae5aeccf3f322db1355a35547b71f00db5408219c7b377814b9fd7582898b8a858989426040516108dc98979695949392919061273f565b60405180910390a1505050505050505050565b6108f7610f41565b6109005f611639565b565b61090a610f41565b6105558233836116af565b335f908152609b602052604090205460ff1615801561096857503361094f60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561099f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109aa838383610eab565b6040805173ffffffffffffffffffffffffffffffffffffffff8516815267ffffffffffffffff80851660208301528316918101919091524260608201527f7450f0085e7bd2a647c4e18c67c2693e78af4907f4219bfa1c68c6920843d70a9060800161064c565b610a19610f41565b609780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b335f908152609b602052604090205460ff16158015610ab3575033610a9a60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610aea576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610af684848461171c565b6099546040517f17938e1300000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff16906317938e1390610b4d90849060040161280c565b5f604051808303815f87803b158015610b64575f80fd5b505af1158015610b76573d5f803e3d5ffd5b505050507ff16b9c48b172cd9fa6be25a49fde5fc00454a3a09e452f2489ddd101195dabcf84848442604051610baf949392919061281e565b60405180910390a150505050565b610bc5610f41565b73ffffffffffffffffffffffffffffffffffffffff8116610c6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610c7681611639565b50565b5f54610100900460ff1615808015610c9757505f54600160ff909116105b80610cb05750303b158015610cb057505f5460ff166001145b610d3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c64565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610d98575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610da061178e565b610da861182c565b6097805473ffffffffffffffffffffffffffffffffffffffff8088167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179092556098805487841690831617905560998054868416908316179055609a8054928516929091169190911790558015610e79575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b5f610ea573200000000000000000000000000000000000000063ffffffff841661285e565b92915050565b5f610eb78484846118ca565b6099546040517f17938e1300000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff16906317938e1390610f0e90849060040161280c565b5f604051808303815f87803b158015610f25575f80fd5b505af1158015610f37573d5f803e3d5ffd5b5050505050505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610900576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c64565b60026065540361102e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c64565b6002606555565b5f73ffffffffffffffffffffffffffffffffffffffff82161580610ea5575073ffffffffffffffffffffffffffffffffffffffff821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f90819073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa1580156110f3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111179190612892565b905061113b73ffffffffffffffffffffffffffffffffffffffff861685308661196f565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152819073ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa1580156111a5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111c99190612892565b6111d391906128a9565b95945050505050565b6097545f9073ffffffffffffffffffffffffffffffffffffffff1661122d576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60985473ffffffffffffffffffffffffffffffffffffffff878116911614801561125b575061125b85611035565b156112e7576098546040517f2e1a7d4d0000000000000000000000000000000000000000000000000000000081526004810189905273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d906024015f604051808303815f87803b1580156112c9575f80fd5b505af11580156112db573d5f803e3d5ffd5b50505050869050611487565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461148457611379868661132f6040880160208901612508565b308b893561134060408c018c612601565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061198192505050565b6097546040517f1eba0f4800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301525f6024830152929350911690631eba0f48906044016020604051808303815f875af11580156113f0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114149190612892565b506040805173ffffffffffffffffffffffffffffffffffffffff8881168252878116602083015291810189905260608101839052426080820152908316907fc9163c3bdf7263acf1bb3d24072cc7da025f7181c31e2edc7e1673edf5e0ca329060a00160405180910390a2611487565b50855b61149760408401602085016128bc565b156114ad576114a78583836116af565b50611628565b5f80806114c56114c060208801886128d5565b611af3565b9250925092505f6114d589611035565b1561154d576114e384611035565b15806114f357508260ff16600814155b1561152a576040517f219da34b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050609a54600a9073ffffffffffffffffffffffffffffffffffffffff166115ca565b8873ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146115b2576040517f219da34b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115c76115c260208901896128d5565b610e80565b90505b6115d48583611b1d565b94506115e18982876116af565b506115f260608801604089016128bc565b15611623575f6116028684611b60565b90506116218761161560208b018b6128d5565b63ffffffff1683610eab565b505b505050505b9695505050505050565b6001606555565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f806116bb8585611bae565b90506116c685611035565b156116f0576116eb73ffffffffffffffffffffffffffffffffffffffff851684611c69565b611711565b61171173ffffffffffffffffffffffffffffffffffffffff86168585611c86565b806111c98686611bae565b60605f848484604051602001611734939291906128ee565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905290506111d3817f0900000000000000000000000000000000000000000000000000000000000000611c91565b5f54610100900460ff16611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c64565b610900611ea0565b5f54610100900460ff166118c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c64565b610900611f3f565b60605f8484846040516020016119159392919073ffffffffffffffffffffffffffffffffffffffff93909316835267ffffffffffffffff918216602084015216604082015260600190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905290506111d3817f0600000000000000000000000000000000000000000000000000000000000000611c91565b61197b84848484611fd5565b50505050565b5f60018310156119bd576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6119c88887611bae565b90505f6119d48a611035565b156119e0575084611a07565b609754611a05908b9073ffffffffffffffffffffffffffffffffffffffff16886116af565b505b6097546040517fb820ec3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063b820ec3e908390611a67908e908b908a908f90819060040161291d565b5f604051808303818588803b158015611a7e575f80fd5b505af1158015611a90573d5f803e3d5ffd5b505050505081611aa08a89611bae565b611aaa91906128a9565b925084831015611ae6576040517fe378141d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050979650505050505050565b5f805f80611b008561202d565b608081015160c082015160e0909201519097919650945092505050565b5f80825f0b1315611b5957611b3382600a612a8a565b611b3e83600a612a8a565b611b489085612a98565b611b529190612ad0565b9050610ea5565b5090919050565b5f815f0b5f03611b71575081610ea5565b5f825f0b1315611b9057611b8682600a612a8a565b611b529084612a98565b611b9982612ae7565b611ba490600a612a8a565b611b529084612ad0565b5f611bb883611035565b15611bdb575073ffffffffffffffffffffffffffffffffffffffff811631610ea5565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906370a0823190602401602060405180830381865afa158015611c45573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b529190612892565b5f805f8084865af1611c825763b12d13eb5f526004601cfd5b5050565b610555838383612160565b60605f83516004611ca29190612b22565b67ffffffffffffffff811115611cba57611cba612b35565b6040519080825280601f01601f191660200182016040528015611ce4576020820181803683370190505b509050600160f81b815f81518110611cfe57611cfe6125d4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f60f81b81600181518110611d4357611d436125d4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f60f81b81600281518110611d8857611d886125d4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053508281600381518110611dca57611dca6125d4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f5b8451811015611e9857848181518110611e1557611e156125d4565b01602001517fff000000000000000000000000000000000000000000000000000000000000001682611e48836004612b22565b81518110611e5857611e586125d4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a90535080611e9081612708565b915050611dfa565b509392505050565b5f54610100900460ff16611f36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c64565b61090033611639565b5f54610100900460ff16611632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c64565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f5114171661202057637939f4245f526004601cfd5b5f60605260405250505050565b6040805161010081018252606080825260208083018290525f8385018190528284018190526080840181905260a0840181905260c0840181905260e08401819052845163ffffffff87168184015285518082039093018352850194859052929361080c9161209a91612b62565b5f60405180830381855afa9150503d805f81146120d2576040519150601f19603f3d011682016040523d82523d5f602084013e6120d7565b606091505b50909250905081612144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f546f6b656e496e666f20707265636f6d70696c652063616c6c206661696c65646044820152606401610c64565b808060200190518101906121589190612d31565b949350505050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166121a0576390b8ec185f526004601cfd5b5f603452505050565b5f80602083850312156121ba575f80fd5b823567ffffffffffffffff808211156121d1575f80fd5b818501915085601f8301126121e4575f80fd5b8135818111156121f2575f80fd5b8660208260051b8501011115612206575f80fd5b60209290920196919550909350505050565b803563ffffffff8116811461222b575f80fd5b919050565b67ffffffffffffffff81168114610c76575f80fd5b5f8060408385031215612256575f80fd5b61225f83612218565b9150602083013561226f81612230565b809150509250929050565b73ffffffffffffffffffffffffffffffffffffffff81168114610c76575f80fd5b8035801515811461222b575f80fd5b5f80604083850312156122bb575f80fd5b82356122c68161227a565b91506122d46020840161229b565b90509250929050565b5f606082840312156122ed575f80fd5b50919050565b5f8083601f840112612303575f80fd5b50813567ffffffffffffffff81111561231a575f80fd5b602083019150836020828501011115612331575f80fd5b9250929050565b5f805f805f805f610100888a03121561234f575f80fd5b8735965060208801356123618161227a565b955060408801356123718161227a565b9450606088013567ffffffffffffffff8082111561238d575f80fd5b6123998b838c016122dd565b95506123a88b60808c016122dd565b945060e08a01359150808211156123bd575f80fd5b506123ca8a828b016122f3565b989b979a50959850939692959293505050565b5f805f805f805f80610120898b0312156123f5575f80fd5b8835975060208901356124078161227a565b965060408901356124178161227a565b9550606089013567ffffffffffffffff80821115612433575f80fd5b61243f8c838d016122dd565b965061244e8c60808d016122dd565b955060e08b0135915080821115612463575f80fd5b506124708b828c016122f3565b9094509250506101008901356124858161227a565b809150509295985092959890939650565b5f80604083850312156124a7575f80fd5b82356124b28161227a565b946020939093013593505050565b5f805f606084860312156124d2575f80fd5b83356124dd8161227a565b925060208401356124ed81612230565b915060408401356124fd81612230565b809150509250925092565b5f60208284031215612518575f80fd5b81356125238161227a565b9392505050565b5f805f6040848603121561253c575f80fd5b83356125478161227a565b9250602084013567ffffffffffffffff811115612562575f80fd5b61256e868287016122f3565b9497909650939450505050565b5f805f806080858703121561258e575f80fd5b84356125998161227a565b935060208501356125a98161227a565b925060408501356125b98161227a565b915060608501356125c98161227a565b939692955090935050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612634575f80fd5b83018035915067ffffffffffffffff82111561264e575f80fd5b602001915036819003821315612331575f80fd5b818382375f9101908152919050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b604081525f6126cb604083018587612671565b9050826020830152949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612738576127386126db565b5060010190565b5f73ffffffffffffffffffffffffffffffffffffffff808b168352808a16602084015288604084015280881660608401525085608083015260e060a083015261278c60e083018587612671565b90508260c08301529998505050505050505050565b5f5b838110156127bb5781810151838201526020016127a3565b50505f910152565b5f81518084526127da8160208601602086016127a1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f61252360208301846127c3565b73ffffffffffffffffffffffffffffffffffffffff85168152606060208201525f61284d606083018587612671565b905082604083015295945050505050565b73ffffffffffffffffffffffffffffffffffffffff81811683821601908082111561288b5761288b6126db565b5092915050565b5f602082840312156128a2575f80fd5b5051919050565b81810381811115610ea557610ea56126db565b5f602082840312156128cc575f80fd5b6125238261229b565b5f602082840312156128e5575f80fd5b61252382612218565b73ffffffffffffffffffffffffffffffffffffffff84168152604060208201525f6111d3604083018486612671565b5f73ffffffffffffffffffffffffffffffffffffffff808816835286602084015260a0604084015261295260a08401876127c3565b948116606084015292909216608090910152509392505050565b600181815b808511156129c557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156129ab576129ab6126db565b808516156129b857918102915b93841c9390800290612971565b509250929050565b5f826129db57506001610ea5565b816129e757505f610ea5565b81600181146129fd5760028114612a0757612a23565b6001915050610ea5565b60ff841115612a1857612a186126db565b50506001821b610ea5565b5060208310610133831016604e8410600b8410161715612a46575081810a610ea5565b612a50838361296c565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612a8257612a826126db565b029392505050565b5f61252360ff8416836129cd565b5f82612acb577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b8082028115828204841417610ea557610ea56126db565b5f815f0b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808103612b1a57612b1a6126db565b5f0392915050565b80820180821115610ea557610ea56126db565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f8251612b738184602087016127a1565b9190910192915050565b604051610100810167ffffffffffffffff81118282101715612ba157612ba1612b35565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612bee57612bee612b35565b604052919050565b5f82601f830112612c05575f80fd5b815167ffffffffffffffff811115612c1f57612c1f612b35565b612c5060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612ba7565b818152846020838601011115612c64575f80fd5b6121588260208301602087016127a1565b805161222b81612230565b5f82601f830112612c8f575f80fd5b8151602067ffffffffffffffff821115612cab57612cab612b35565b8160051b612cba828201612ba7565b9283528481018201928281019087851115612cd3575f80fd5b83870192505b84831015612cfb578251612cec81612230565b82529183019190830190612cd9565b979650505050505050565b805161222b8161227a565b805160ff8116811461222b575f80fd5b80515f81900b811461222b575f80fd5b5f60208284031215612d41575f80fd5b815167ffffffffffffffff80821115612d58575f80fd5b908301906101008286031215612d6c575f80fd5b612d74612b7d565b825182811115612d82575f80fd5b612d8e87828601612bf6565b825250602083015182811115612da2575f80fd5b612dae87828601612c80565b602083015250612dc060408401612c75565b6040820152612dd160608401612d06565b6060820152612de260808401612d06565b6080820152612df360a08401612d11565b60a0820152612e0460c08401612d11565b60c0820152612e1560e08401612d21565b60e08201529594505050505056fea164736f6c6343000814000a
Deployed Bytecode
0x608060405260043610610126575f3560e01c80639125ab6f116100a1578063debfda3011610071578063f420d00f11610057578063f420d00f1461035b578063f8c8765e14610387578063fd3f8ca0146103a6575f80fd5b8063debfda30146102fe578063f2fde38b1461033c575f80fd5b80639125ab6f14610275578063ad5c464814610294578063c7838412146102c0578063d4441d08146102df575f80fd5b80636a2ce929116100f657806373ea197b116100dc57806373ea197b146101d657806378e3214f1461022c5780638da5cb5b1461024b575f80fd5b80636a2ce929146101a3578063715018a6146101c2575f80fd5b8063144ccd65146101315780631916cd0d146101525780631e1bff3f1461017157806327f9e40914610190575f80fd5b3661012d57005b5f80fd5b34801561013c575f80fd5b5061015061014b3660046121a9565b6103d2565b005b34801561015d575f80fd5b5061015061016c366004612245565b61055a565b34801561017c575f80fd5b5061015061018b3660046122aa565b610659565b61015061019e366004612338565b610737565b3480156101ae575f80fd5b506101506101bd3660046123dd565b610804565b3480156101cd575f80fd5b506101506108ef565b3480156101e1575f80fd5b506099546102029073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b348015610237575f80fd5b50610150610246366004612496565b610902565b348015610256575f80fd5b5060335473ffffffffffffffffffffffffffffffffffffffff16610202565b348015610280575f80fd5b5061015061028f3660046124c0565b610915565b34801561029f575f80fd5b506098546102029073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102cb575f80fd5b506101506102da366004612508565b610a11565b3480156102ea575f80fd5b506101506102f936600461252a565b610a60565b348015610309575f80fd5b5061032c610318366004612508565b609b6020525f908152604090205460ff1681565b6040519015158152602001610223565b348015610347575f80fd5b50610150610356366004612508565b610bbd565b348015610366575f80fd5b506097546102029073ffffffffffffffffffffffffffffffffffffffff1681565b348015610392575f80fd5b506101506103a136600461257b565b610c79565b3480156103b1575f80fd5b50609a546102029073ffffffffffffffffffffffffffffffffffffffff1681565b335f908152609b602052604090205460ff1615801561042557503361040c60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561045c576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5b81811015610555575f803085858581811061047b5761047b6125d4565b905060200281019061048d9190612601565b60405161049b929190612662565b5f60405180830381855af49150503d805f81146104d3576040519150601f19603f3d011682016040523d82523d5f602084013e6104d8565b606091505b509150915081610540577f0395173c23e48cb319ff34a7e9b22b154faea035d29fbcc294c8742ad3917f39858585818110610515576105156125d4565b90506020028101906105279190612601565b42604051610537939291906126b8565b60405180910390a15b5050808061054d90612708565b91505061045e565b505050565b335f908152609b602052604090205460ff161580156105ad57503361059460335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b156105e4576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6105ee83610e80565b9050610601818463ffffffff1684610eab565b6040805163ffffffff8516815267ffffffffffffffff8416602082015242918101919091527f893e708b386d22e6cea302488ef946aef03a7c21e56a5519297068b80de3a317906060015b60405180910390a1505050565b610661610f41565b73ffffffffffffffffffffffffffffffffffffffff82166106ae576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82165f818152609b602090815260409182902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001685151590811790915591519182527f278b09622564dd3991fe7744514513d64ea2c8ed2b2b9ec1150ad964fde80a99910160405180910390a25050565b61073f610fc2565b61074886611035565b1561078c5734871115610787576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61079a565b610797863389611087565b96505b5f6107a98888888888336111dc565b90507ff6a40b80c9a3cc8399553d42a99ec7975282051bb4bcb3bd77971829afa1e6a533888a89858888426040516107e898979695949392919061273f565b60405180910390a1506107fb6001606555565b50505050505050565b335f908152609b602052604090205460ff1615801561085757503361083e60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561088e576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61089d8989898989876111dc565b90507fb58f3245aae5aeccf3f322db1355a35547b71f00db5408219c7b377814b9fd7582898b8a858989426040516108dc98979695949392919061273f565b60405180910390a1505050505050505050565b6108f7610f41565b6109005f611639565b565b61090a610f41565b6105558233836116af565b335f908152609b602052604090205460ff1615801561096857503361094f60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b1561099f576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6109aa838383610eab565b6040805173ffffffffffffffffffffffffffffffffffffffff8516815267ffffffffffffffff80851660208301528316918101919091524260608201527f7450f0085e7bd2a647c4e18c67c2693e78af4907f4219bfa1c68c6920843d70a9060800161064c565b610a19610f41565b609780547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b335f908152609b602052604090205460ff16158015610ab3575033610a9a60335473ffffffffffffffffffffffffffffffffffffffff1690565b73ffffffffffffffffffffffffffffffffffffffff1614155b15610aea576040517f82b4290000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f610af684848461171c565b6099546040517f17938e1300000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff16906317938e1390610b4d90849060040161280c565b5f604051808303815f87803b158015610b64575f80fd5b505af1158015610b76573d5f803e3d5ffd5b505050507ff16b9c48b172cd9fa6be25a49fde5fc00454a3a09e452f2489ddd101195dabcf84848442604051610baf949392919061281e565b60405180910390a150505050565b610bc5610f41565b73ffffffffffffffffffffffffffffffffffffffff8116610c6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610c7681611639565b50565b5f54610100900460ff1615808015610c9757505f54600160ff909116105b80610cb05750303b158015610cb057505f5460ff166001145b610d3c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610c64565b5f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790558015610d98575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b610da061178e565b610da861182c565b6097805473ffffffffffffffffffffffffffffffffffffffff8088167fffffffffffffffffffffffff0000000000000000000000000000000000000000928316179092556098805487841690831617905560998054868416908316179055609a8054928516929091169190911790558015610e79575f80547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050505050565b5f610ea573200000000000000000000000000000000000000063ffffffff841661285e565b92915050565b5f610eb78484846118ca565b6099546040517f17938e1300000000000000000000000000000000000000000000000000000000815291925073ffffffffffffffffffffffffffffffffffffffff16906317938e1390610f0e90849060040161280c565b5f604051808303815f87803b158015610f25575f80fd5b505af1158015610f37573d5f803e3d5ffd5b5050505050505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314610900576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610c64565b60026065540361102e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610c64565b6002606555565b5f73ffffffffffffffffffffffffffffffffffffffff82161580610ea5575073ffffffffffffffffffffffffffffffffffffffff821673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1492915050565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201525f90819073ffffffffffffffffffffffffffffffffffffffff8616906370a0823190602401602060405180830381865afa1580156110f3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111179190612892565b905061113b73ffffffffffffffffffffffffffffffffffffffff861685308661196f565b6040517f70a08231000000000000000000000000000000000000000000000000000000008152306004820152819073ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa1580156111a5573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111c99190612892565b6111d391906128a9565b95945050505050565b6097545f9073ffffffffffffffffffffffffffffffffffffffff1661122d576040517fe6c4247b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60985473ffffffffffffffffffffffffffffffffffffffff878116911614801561125b575061125b85611035565b156112e7576098546040517f2e1a7d4d0000000000000000000000000000000000000000000000000000000081526004810189905273ffffffffffffffffffffffffffffffffffffffff90911690632e1a7d4d906024015f604051808303815f87803b1580156112c9575f80fd5b505af11580156112db573d5f803e3d5ffd5b50505050869050611487565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161461148457611379868661132f6040880160208901612508565b308b893561134060408c018c612601565b8080601f0160208091040260200160405190810160405280939291908181526020018383808284375f9201919091525061198192505050565b6097546040517f1eba0f4800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff89811660048301525f6024830152929350911690631eba0f48906044016020604051808303815f875af11580156113f0573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906114149190612892565b506040805173ffffffffffffffffffffffffffffffffffffffff8881168252878116602083015291810189905260608101839052426080820152908316907fc9163c3bdf7263acf1bb3d24072cc7da025f7181c31e2edc7e1673edf5e0ca329060a00160405180910390a2611487565b50855b61149760408401602085016128bc565b156114ad576114a78583836116af565b50611628565b5f80806114c56114c060208801886128d5565b611af3565b9250925092505f6114d589611035565b1561154d576114e384611035565b15806114f357508260ff16600814155b1561152a576040517f219da34b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050609a54600a9073ffffffffffffffffffffffffffffffffffffffff166115ca565b8873ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146115b2576040517f219da34b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6115c76115c260208901896128d5565b610e80565b90505b6115d48583611b1d565b94506115e18982876116af565b506115f260608801604089016128bc565b15611623575f6116028684611b60565b90506116218761161560208b018b6128d5565b63ffffffff1683610eab565b505b505050505b9695505050505050565b6001606555565b6033805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0905f90a35050565b5f806116bb8585611bae565b90506116c685611035565b156116f0576116eb73ffffffffffffffffffffffffffffffffffffffff851684611c69565b611711565b61171173ffffffffffffffffffffffffffffffffffffffff86168585611c86565b806111c98686611bae565b60605f848484604051602001611734939291906128ee565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905290506111d3817f0900000000000000000000000000000000000000000000000000000000000000611c91565b5f54610100900460ff16611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c64565b610900611ea0565b5f54610100900460ff166118c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c64565b610900611f3f565b60605f8484846040516020016119159392919073ffffffffffffffffffffffffffffffffffffffff93909316835267ffffffffffffffff918216602084015216604082015260600190565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905290506111d3817f0600000000000000000000000000000000000000000000000000000000000000611c91565b61197b84848484611fd5565b50505050565b5f60018310156119bd576040517f2c5211c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6119c88887611bae565b90505f6119d48a611035565b156119e0575084611a07565b609754611a05908b9073ffffffffffffffffffffffffffffffffffffffff16886116af565b505b6097546040517fb820ec3e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9091169063b820ec3e908390611a67908e908b908a908f90819060040161291d565b5f604051808303818588803b158015611a7e575f80fd5b505af1158015611a90573d5f803e3d5ffd5b505050505081611aa08a89611bae565b611aaa91906128a9565b925084831015611ae6576040517fe378141d00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5050979650505050505050565b5f805f80611b008561202d565b608081015160c082015160e0909201519097919650945092505050565b5f80825f0b1315611b5957611b3382600a612a8a565b611b3e83600a612a8a565b611b489085612a98565b611b529190612ad0565b9050610ea5565b5090919050565b5f815f0b5f03611b71575081610ea5565b5f825f0b1315611b9057611b8682600a612a8a565b611b529084612a98565b611b9982612ae7565b611ba490600a612a8a565b611b529084612ad0565b5f611bb883611035565b15611bdb575073ffffffffffffffffffffffffffffffffffffffff811631610ea5565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301528416906370a0823190602401602060405180830381865afa158015611c45573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611b529190612892565b5f805f8084865af1611c825763b12d13eb5f526004601cfd5b5050565b610555838383612160565b60605f83516004611ca29190612b22565b67ffffffffffffffff811115611cba57611cba612b35565b6040519080825280601f01601f191660200182016040528015611ce4576020820181803683370190505b509050600160f81b815f81518110611cfe57611cfe6125d4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f60f81b81600181518110611d4357611d436125d4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f60f81b81600281518110611d8857611d886125d4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053508281600381518110611dca57611dca6125d4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f5b8451811015611e9857848181518110611e1557611e156125d4565b01602001517fff000000000000000000000000000000000000000000000000000000000000001682611e48836004612b22565b81518110611e5857611e586125d4565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a90535080611e9081612708565b915050611dfa565b509392505050565b5f54610100900460ff16611f36576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c64565b61090033611639565b5f54610100900460ff16611632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610c64565b60405181606052826040528360601b602c526f23b872dd000000000000000000000000600c5260205f6064601c5f895af13d1560015f5114171661202057637939f4245f526004601cfd5b5f60605260405250505050565b6040805161010081018252606080825260208083018290525f8385018190528284018190526080840181905260a0840181905260c0840181905260e08401819052845163ffffffff87168184015285518082039093018352850194859052929361080c9161209a91612b62565b5f60405180830381855afa9150503d805f81146120d2576040519150601f19603f3d011682016040523d82523d5f602084013e6120d7565b606091505b50909250905081612144576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f546f6b656e496e666f20707265636f6d70696c652063616c6c206661696c65646044820152606401610c64565b808060200190518101906121589190612d31565b949350505050565b81601452806034526fa9059cbb0000000000000000000000005f5260205f604460105f875af13d1560015f511417166121a0576390b8ec185f526004601cfd5b5f603452505050565b5f80602083850312156121ba575f80fd5b823567ffffffffffffffff808211156121d1575f80fd5b818501915085601f8301126121e4575f80fd5b8135818111156121f2575f80fd5b8660208260051b8501011115612206575f80fd5b60209290920196919550909350505050565b803563ffffffff8116811461222b575f80fd5b919050565b67ffffffffffffffff81168114610c76575f80fd5b5f8060408385031215612256575f80fd5b61225f83612218565b9150602083013561226f81612230565b809150509250929050565b73ffffffffffffffffffffffffffffffffffffffff81168114610c76575f80fd5b8035801515811461222b575f80fd5b5f80604083850312156122bb575f80fd5b82356122c68161227a565b91506122d46020840161229b565b90509250929050565b5f606082840312156122ed575f80fd5b50919050565b5f8083601f840112612303575f80fd5b50813567ffffffffffffffff81111561231a575f80fd5b602083019150836020828501011115612331575f80fd5b9250929050565b5f805f805f805f610100888a03121561234f575f80fd5b8735965060208801356123618161227a565b955060408801356123718161227a565b9450606088013567ffffffffffffffff8082111561238d575f80fd5b6123998b838c016122dd565b95506123a88b60808c016122dd565b945060e08a01359150808211156123bd575f80fd5b506123ca8a828b016122f3565b989b979a50959850939692959293505050565b5f805f805f805f80610120898b0312156123f5575f80fd5b8835975060208901356124078161227a565b965060408901356124178161227a565b9550606089013567ffffffffffffffff80821115612433575f80fd5b61243f8c838d016122dd565b965061244e8c60808d016122dd565b955060e08b0135915080821115612463575f80fd5b506124708b828c016122f3565b9094509250506101008901356124858161227a565b809150509295985092959890939650565b5f80604083850312156124a7575f80fd5b82356124b28161227a565b946020939093013593505050565b5f805f606084860312156124d2575f80fd5b83356124dd8161227a565b925060208401356124ed81612230565b915060408401356124fd81612230565b809150509250925092565b5f60208284031215612518575f80fd5b81356125238161227a565b9392505050565b5f805f6040848603121561253c575f80fd5b83356125478161227a565b9250602084013567ffffffffffffffff811115612562575f80fd5b61256e868287016122f3565b9497909650939450505050565b5f805f806080858703121561258e575f80fd5b84356125998161227a565b935060208501356125a98161227a565b925060408501356125b98161227a565b915060608501356125c98161227a565b939692955090935050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f8083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612634575f80fd5b83018035915067ffffffffffffffff82111561264e575f80fd5b602001915036819003821315612331575f80fd5b818382375f9101908152919050565b81835281816020850137505f602082840101525f60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b604081525f6126cb604083018587612671565b9050826020830152949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612738576127386126db565b5060010190565b5f73ffffffffffffffffffffffffffffffffffffffff808b168352808a16602084015288604084015280881660608401525085608083015260e060a083015261278c60e083018587612671565b90508260c08301529998505050505050505050565b5f5b838110156127bb5781810151838201526020016127a3565b50505f910152565b5f81518084526127da8160208601602086016127a1565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b602081525f61252360208301846127c3565b73ffffffffffffffffffffffffffffffffffffffff85168152606060208201525f61284d606083018587612671565b905082604083015295945050505050565b73ffffffffffffffffffffffffffffffffffffffff81811683821601908082111561288b5761288b6126db565b5092915050565b5f602082840312156128a2575f80fd5b5051919050565b81810381811115610ea557610ea56126db565b5f602082840312156128cc575f80fd5b6125238261229b565b5f602082840312156128e5575f80fd5b61252382612218565b73ffffffffffffffffffffffffffffffffffffffff84168152604060208201525f6111d3604083018486612671565b5f73ffffffffffffffffffffffffffffffffffffffff808816835286602084015260a0604084015261295260a08401876127c3565b948116606084015292909216608090910152509392505050565b600181815b808511156129c557817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048211156129ab576129ab6126db565b808516156129b857918102915b93841c9390800290612971565b509250929050565b5f826129db57506001610ea5565b816129e757505f610ea5565b81600181146129fd5760028114612a0757612a23565b6001915050610ea5565b60ff841115612a1857612a186126db565b50506001821b610ea5565b5060208310610133831016604e8410600b8410161715612a46575081810a610ea5565b612a50838361296c565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115612a8257612a826126db565b029392505050565b5f61252360ff8416836129cd565b5f82612acb577f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b500490565b8082028115828204841417610ea557610ea56126db565b5f815f0b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff808103612b1a57612b1a6126db565b5f0392915050565b80820180821115610ea557610ea56126db565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f8251612b738184602087016127a1565b9190910192915050565b604051610100810167ffffffffffffffff81118282101715612ba157612ba1612b35565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715612bee57612bee612b35565b604052919050565b5f82601f830112612c05575f80fd5b815167ffffffffffffffff811115612c1f57612c1f612b35565b612c5060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601612ba7565b818152846020838601011115612c64575f80fd5b6121588260208301602087016127a1565b805161222b81612230565b5f82601f830112612c8f575f80fd5b8151602067ffffffffffffffff821115612cab57612cab612b35565b8160051b612cba828201612ba7565b9283528481018201928281019087851115612cd3575f80fd5b83870192505b84831015612cfb578251612cec81612230565b82529183019190830190612cd9565b979650505050505050565b805161222b8161227a565b805160ff8116811461222b575f80fd5b80515f81900b811461222b575f80fd5b5f60208284031215612d41575f80fd5b815167ffffffffffffffff80821115612d58575f80fd5b908301906101008286031215612d6c575f80fd5b612d74612b7d565b825182811115612d82575f80fd5b612d8e87828601612bf6565b825250602083015182811115612da2575f80fd5b612dae87828601612c80565b602083015250612dc060408401612c75565b6040820152612dd160608401612d06565b6060820152612de260808401612d06565b6080820152612df360a08401612d11565b60a0820152612e0460c08401612d11565b60c0820152612e1560e08401612d21565b60e08201529594505050505056fea164736f6c6343000814000a
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.