Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60806040 | 16233442 | 621 days ago | IN | 0 ETH | 0.06627587 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
PerpetualTokensAndRamping
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "PerpetualTokenRegister.sol"; import "TokenTransfers.sol"; import "ERC721Receiver.sol"; import "Freezable.sol"; import "KeyGetters.sol"; import "MainGovernance.sol"; import "AcceptModifications.sol"; import "Deposits.sol"; import "TokenAssetData.sol"; import "TokenQuantization.sol"; import "Withdrawals.sol"; import "SubContractor.sol"; contract PerpetualTokensAndRamping is ERC721Receiver, SubContractor, Freezable, MainGovernance, AcceptModifications, TokenAssetData, TokenQuantization, TokenTransfers, PerpetualTokenRegister, KeyGetters, Deposits, Withdrawals { function initialize( bytes calldata /* data */ ) external override { revert("NOT_IMPLEMENTED"); } function initializerSize() external view override returns (uint256) { return 0; } function validatedSelectors() external pure override returns (bytes4[] memory selectors) { uint256 len_ = 3; uint256 index_ = 0; selectors = new bytes4[](len_); selectors[index_++] = Deposits.depositCancel.selector; selectors[index_++] = Deposits.depositReclaim.selector; selectors[index_++] = Withdrawals.withdraw.selector; require(index_ == len_, "INCORRECT_SELECTORS_ARRAY_LENGTH"); } function identify() external pure override returns (string memory) { return "StarkWare_PerpetualTokensAndRamping_2022_2"; } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "LibConstants.sol"; import "MAcceptModifications.sol"; import "MTokenQuantization.sol"; import "MainStorage.sol"; /* Interface containing actions a verifier can invoke on the state. The contract containing the state should implement these and verify correctness. */ abstract contract AcceptModifications is MainStorage, LibConstants, MAcceptModifications, MTokenQuantization { event LogWithdrawalAllowed( uint256 ownerKey, uint256 assetType, uint256 nonQuantizedAmount, uint256 quantizedAmount ); event LogNftWithdrawalAllowed(uint256 ownerKey, uint256 assetId); event LogAssetWithdrawalAllowed(uint256 ownerKey, uint256 assetId, uint256 quantizedAmount); event LogMintableWithdrawalAllowed(uint256 ownerKey, uint256 assetId, uint256 quantizedAmount); /* Transfers funds from the on-chain deposit area to the off-chain area. Implemented in the Deposits contracts. */ function acceptDeposit( uint256 ownerKey, uint256 vaultId, uint256 assetId, uint256 quantizedAmount ) internal virtual override { // Fetch deposit. require( pendingDeposits[ownerKey][assetId][vaultId] >= quantizedAmount, "DEPOSIT_INSUFFICIENT" ); // Subtract accepted quantized amount. pendingDeposits[ownerKey][assetId][vaultId] -= quantizedAmount; } /* Transfers funds from the off-chain area to the on-chain withdrawal area. */ function allowWithdrawal( uint256 ownerKey, uint256 assetId, uint256 quantizedAmount ) internal override { // Fetch withdrawal. uint256 withdrawal = pendingWithdrawals[ownerKey][assetId]; // Add accepted quantized amount. withdrawal += quantizedAmount; require(withdrawal >= quantizedAmount, "WITHDRAWAL_OVERFLOW"); // Store withdrawal. pendingWithdrawals[ownerKey][assetId] = withdrawal; // Log event. uint256 presumedAssetType = assetId; if (registeredAssetType[presumedAssetType]) { emit LogWithdrawalAllowed( ownerKey, presumedAssetType, fromQuantized(presumedAssetType, quantizedAmount), quantizedAmount ); } else if (assetId == ((assetId & MASK_240) | MINTABLE_ASSET_ID_FLAG)) { emit LogMintableWithdrawalAllowed(ownerKey, assetId, quantizedAmount); } else { // Default case is Non-Mintable ERC721 or ERC1155 asset id. // In ERC721 and ERC1155 cases, assetId is not the assetType. require(assetId == assetId & MASK_250, "INVALID_ASSET_ID"); // If withdrawal amount is 1, the asset could be either NFT or SFT. In that case, both // NFT and general events will be emitted so that the listened for event is captured. // When withdrawal is greater than 1, it must be SFT and only one event will be emitted. if (withdrawal <= 1) { emit LogNftWithdrawalAllowed(ownerKey, assetId); } emit LogAssetWithdrawalAllowed(ownerKey, assetId, quantizedAmount); } } // Verifier authorizes withdrawal. function acceptWithdrawal( uint256 ownerKey, uint256 assetId, uint256 quantizedAmount ) internal virtual override { allowWithdrawal(ownerKey, assetId, quantizedAmount); } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; /* Common Utility Libraries. I. Addresses (extending address). */ library Addresses { /* Note: isContract function has some known limitation. See https://github.com/OpenZeppelin/ openzeppelin-contracts/blob/master/contracts/utils/Address.sol. */ function isContract(address account) internal view returns (bool) { uint256 size; assembly { size := extcodesize(account) } return size > 0; } function performEthTransfer(address recipient, uint256 amount) internal { if (amount == 0) return; (bool success, ) = recipient.call{value: amount}(""); // NOLINT: low-level-calls. require(success, "ETH_TRANSFER_FAILED"); } /* Safe wrapper around ERC20/ERC721 calls. This is required because many deployed ERC20 contracts don't return a value. See https://github.com/ethereum/solidity/issues/4116. */ function safeTokenContractCall(address tokenAddress, bytes memory callData) internal { require(isContract(tokenAddress), "BAD_TOKEN_ADDRESS"); // NOLINTNEXTLINE: low-level-calls. (bool success, bytes memory returndata) = tokenAddress.call(callData); require(success, string(returndata)); if (returndata.length > 0) { require(abi.decode(returndata, (bool)), "TOKEN_OPERATION_FAILED"); } } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "LibConstants.sol"; import "MAcceptModifications.sol"; import "MDeposits.sol"; import "MTokenQuantization.sol"; import "MTokenAssetData.sol"; import "MFreezable.sol"; import "MKeyGetters.sol"; import "MTokenTransfers.sol"; import "MainStorage.sol"; /** For a user to perform a deposit to the contract two calls need to take place: 1. A call to an ERC20 contract, authorizing this contract to transfer funds on behalf of the user. 2. A call to :sol:func:`deposit` indicating the starkKey, amount, asset type and target vault ID to which to send the deposit. The amount should be quantized, according to the specific quantization defined for the asset type. The result of the operation, assuming all requirements are met, is that an amount of ERC20 tokens equaling the amount specified in the :sol:func:`deposit` call times the quantization factor is transferred on behalf of the user to the contract. In addition, the contract adds the funds to an accumulator of pending deposits for the provided user, asset ID and vault ID. Once a deposit is made, the exchange may include it in a proof which will result in addition of the amount(s) deposited to the off-chain vault with the specified ID. When the contract receives such valid proof, it deducts the transfered funds from the pending deposits for the specified Stark key, asset ID and vault ID. The exchange will not be able to move the deposited funds to the off-chain vault if the Stark key is not registered in the system. Until that point, the user may cancel the deposit by performing a time-locked cancel-deposit operation consisting of two calls: 1. A call to :sol:func:`depositCancel`, setting a timer to enable reclaiming the deposit. Until this timer expires the user cannot reclaim funds as the exchange may still be processing the deposit for inclusion in the off chain vault. 2. A call to :sol:func:`depositReclaim`, to perform the actual transfer of funds from the contract back to the ERC20 contract. This will only succeed if the timer set in the previous call has expired. The result should be the transfer of all funds not accounted for in proofs for off-chain inclusion, back to the user account on the ERC20 contract. Calling depositCancel and depositReclaim can only be done via an ethKey that is associated with that vault's starkKey. This is enforced by the contract. */ abstract contract Deposits is MainStorage, LibConstants, MAcceptModifications, MDeposits, MTokenQuantization, MTokenAssetData, MFreezable, MKeyGetters, MTokenTransfers { event LogDeposit( address depositorEthKey, uint256 starkKey, uint256 vaultId, uint256 assetType, uint256 nonQuantizedAmount, uint256 quantizedAmount ); event LogNftDeposit( address depositorEthKey, uint256 starkKey, uint256 vaultId, uint256 assetType, uint256 tokenId, uint256 assetId ); event LogDepositWithTokenId( address depositorEthKey, uint256 starkKey, uint256 vaultId, uint256 assetType, uint256 tokenId, uint256 assetId, uint256 nonQuantizedAmount, uint256 quantizedAmount ); event LogDepositCancel(uint256 starkKey, uint256 vaultId, uint256 assetId); event LogDepositCancelReclaimed( uint256 starkKey, uint256 vaultId, uint256 assetType, uint256 nonQuantizedAmount, uint256 quantizedAmount ); event LogDepositNftCancelReclaimed( uint256 starkKey, uint256 vaultId, uint256 assetType, uint256 tokenId, uint256 assetId ); event LogDepositWithTokenIdCancelReclaimed( uint256 starkKey, uint256 vaultId, uint256 assetType, uint256 tokenId, uint256 assetId, uint256 nonQuantizedAmount, uint256 quantizedAmount ); function getDepositBalance( uint256 starkKey, uint256 assetId, uint256 vaultId ) external view returns (uint256) { uint256 presumedAssetType = assetId; return fromQuantized(presumedAssetType, pendingDeposits[starkKey][assetId][vaultId]); } function getQuantizedDepositBalance( uint256 starkKey, uint256 assetId, uint256 vaultId ) external view returns (uint256) { return pendingDeposits[starkKey][assetId][vaultId]; } function depositNft( uint256 starkKey, uint256 assetType, uint256 vaultId, uint256 tokenId ) external notFrozen { require(isERC721(assetType), "NOT_ERC721_TOKEN"); depositWithTokenId(starkKey, assetType, tokenId, vaultId, 1); } function depositERC1155( uint256 starkKey, uint256 assetType, uint256 tokenId, uint256 vaultId, uint256 quantizedAmount ) external notFrozen { require(isERC1155(assetType), "NOT_ERC1155_TOKEN"); depositWithTokenId(starkKey, assetType, tokenId, vaultId, quantizedAmount); } function depositStateUpdate( uint256 starkKey, uint256 assetId, uint256 vaultId, uint256 quantizedAmount ) private returns (uint256) { // Checks for overflow and updates the pendingDeposits balance. uint256 vaultBalance = pendingDeposits[starkKey][assetId][vaultId]; vaultBalance += quantizedAmount; require(vaultBalance >= quantizedAmount, "DEPOSIT_OVERFLOW"); pendingDeposits[starkKey][assetId][vaultId] = vaultBalance; // Disable the cancellationRequest timeout when users deposit into their own account. if ( isMsgSenderKeyOwner(starkKey) && cancellationRequests[starkKey][assetId][vaultId] != 0 ) { delete cancellationRequests[starkKey][assetId][vaultId]; } // Returns the updated vault balance. return vaultBalance; } function depositWithTokenId( uint256 starkKey, uint256 assetType, uint256 tokenId, uint256 vaultId, uint256 quantizedAmount ) public notFrozen { // The vaultId is not validated but should be in the allowed range supported by the // exchange. If not, it will be ignored by the exchange and the starkKey owner may reclaim // the funds by using depositCancel + depositReclaim. require(isAssetTypeWithTokenId(assetType), "INVALID_ASSET_TYPE"); uint256 assetId = calculateAssetIdWithTokenId(assetType, tokenId); // Updates the pendingDeposits balance and clears cancellationRequests when applicable. uint256 newVaultBalance = depositStateUpdate(starkKey, assetId, vaultId, quantizedAmount); // No need to verify amount > 0, a deposit with amount = 0 can be used to undo cancellation. if (isERC721(assetType)) { require(newVaultBalance <= 1, "ILLEGAL_ERC721_AMOUNT"); emit LogNftDeposit(msg.sender, starkKey, vaultId, assetType, tokenId, assetId); } // Transfer the tokens to the Deposit contract. transferInWithTokenId(assetType, tokenId, quantizedAmount); // Log event. emit LogDepositWithTokenId( msg.sender, starkKey, vaultId, assetType, tokenId, assetId, fromQuantized(assetType, quantizedAmount), quantizedAmount ); } function getCancellationRequest( uint256 starkKey, uint256 assetId, uint256 vaultId ) external view returns (uint256 request) { request = cancellationRequests[starkKey][assetId][vaultId]; } function depositERC20( uint256 starkKey, uint256 assetType, uint256 vaultId, uint256 quantizedAmount ) public override { deposit(starkKey, assetType, vaultId, quantizedAmount); } // NOLINTNEXTLINE: locked-ether. function depositEth( uint256 starkKey, uint256 assetType, uint256 vaultId ) public payable override { require(isEther(assetType), "INVALID_ASSET_TYPE"); deposit(starkKey, assetType, vaultId, toQuantized(assetType, msg.value)); } function deposit( uint256 starkKey, uint256 assetType, uint256 vaultId, uint256 quantizedAmount ) public notFrozen { // The vaultId is not validated but should be in the allowed range supported by the // exchange. If not, it will be ignored by the exchange and the starkKey owner may reclaim // the funds by using depositCancel + depositReclaim. // No need to verify amount > 0, a deposit with amount = 0 can be used to undo cancellation. require(!isMintableAssetType(assetType), "MINTABLE_ASSET_TYPE"); require(isFungibleAssetType(assetType), "NON_FUNGIBLE_ASSET_TYPE"); uint256 assetId = assetType; // Updates the pendingDeposits balance and clears cancellationRequests when applicable. depositStateUpdate(starkKey, assetId, vaultId, quantizedAmount); // Transfer the tokens to the Deposit contract. transferIn(assetType, quantizedAmount); // Log event. emit LogDeposit( msg.sender, starkKey, vaultId, assetType, fromQuantized(assetType, quantizedAmount), quantizedAmount ); } function deposit( // NOLINT: locked-ether. uint256 starkKey, uint256 assetType, uint256 vaultId ) external payable { require(isEther(assetType), "INVALID_ASSET_TYPE"); deposit(starkKey, assetType, vaultId, toQuantized(assetType, msg.value)); } function depositCancel( uint256 starkKey, uint256 assetId, uint256 vaultId ) external onlyKeyOwner(starkKey) // No notFrozen modifier: This function can always be used, even when frozen. { // Start the timeout. cancellationRequests[starkKey][assetId][vaultId] = block.timestamp; // Log event. emit LogDepositCancel(starkKey, vaultId, assetId); } function clearCancelledDeposit( uint256 starkKey, uint256 assetId, uint256 vaultId ) private returns (uint256) { // Make sure enough time has passed. uint256 requestTime = cancellationRequests[starkKey][assetId][vaultId]; require(requestTime != 0, "DEPOSIT_NOT_CANCELED"); uint256 freeTime = requestTime + DEPOSIT_CANCEL_DELAY; assert(freeTime >= DEPOSIT_CANCEL_DELAY); require(block.timestamp >= freeTime, "DEPOSIT_LOCKED"); // NOLINT: timestamp. // Clear deposit. uint256 quantizedAmount = pendingDeposits[starkKey][assetId][vaultId]; delete pendingDeposits[starkKey][assetId][vaultId]; delete cancellationRequests[starkKey][assetId][vaultId]; // Return the cleared amount so it can be transferred back to the reclaimer. return quantizedAmount; } function depositReclaim( uint256 starkKey, uint256 assetType, uint256 vaultId ) external onlyKeyOwner(starkKey) // No notFrozen modifier: This function can always be used, even when frozen. { require(isFungibleAssetType(assetType), "NON_FUNGIBLE_ASSET_TYPE"); // Clear deposit and attain the cleared amount to be transferred out. uint256 assetId = assetType; uint256 quantizedAmount = clearCancelledDeposit(starkKey, assetId, vaultId); // Refund deposit. transferOut(msg.sender, assetType, quantizedAmount); // Log event. emit LogDepositCancelReclaimed( starkKey, vaultId, assetType, fromQuantized(assetType, quantizedAmount), quantizedAmount ); } function depositWithTokenIdReclaim( uint256 starkKey, uint256 assetType, uint256 tokenId, uint256 vaultId ) public onlyKeyOwner(starkKey) // No notFrozen modifier: This function can always be used, even when frozen. { require(isAssetTypeWithTokenId(assetType), "INVALID_ASSET_TYPE"); // Clear deposit and attain the cleared amount to be transferred out. uint256 assetId = calculateAssetIdWithTokenId(assetType, tokenId); uint256 quantizedAmount = clearCancelledDeposit(starkKey, assetId, vaultId); if (quantizedAmount > 0) { // Refund deposit. transferOutWithTokenId(msg.sender, assetType, tokenId, quantizedAmount); } // Log event. if (isERC721(assetType)) { emit LogDepositNftCancelReclaimed(starkKey, vaultId, assetType, tokenId, assetId); } emit LogDepositWithTokenIdCancelReclaimed( starkKey, vaultId, assetType, tokenId, assetId, fromQuantized(assetType, quantizedAmount), quantizedAmount ); } function depositNftReclaim( uint256 starkKey, uint256 assetType, uint256 vaultId, uint256 tokenId ) external onlyKeyOwner(starkKey) // No notFrozen modifier: This function can always be used, even when frozen. { depositWithTokenIdReclaim(starkKey, assetType, tokenId, vaultId); } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "IERC721Receiver.sol"; /* ERC721 token receiver interface EIP-721 requires any contract receiving ERC721 tokens to implement IERC721Receiver interface. By EIP, safeTransferFrom API of ERC721 shall call onERC721Received on the receiving contract. Have the receiving contract failed to respond as expected, the safeTransferFrom shall be reverted. Params: `operator` The address which called `safeTransferFrom` function `from` The address which previously owned the token `tokenId` The NFT identifier which is being transferred `data` Additional data with no specified format Returns: When invoked by the main contract, following the deposit pattern: `bytes4(keccak256("onERC721Received(address,address,uint256,bytes)"))`, which indicates success. In all other cases: `bytes4(0)`, which should fail ERC721's safeTransferFrom. */ contract ERC721Receiver is IERC721Receiver { function onERC721Received( address operator, // The address which called `safeTransferFrom` function. address, // from - The address which previously owned the token. uint256, // tokenId - The NFT identifier which is being transferred. bytes calldata // data - Additional data with no specified format. ) external override returns (bytes4) { return (operator == address(this) ? this.onERC721Received.selector : bytes4(0)); } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "LibConstants.sol"; import "MFreezable.sol"; import "MGovernance.sol"; import "MainStorage.sol"; /* Implements MFreezable. */ abstract contract Freezable is MainStorage, LibConstants, MGovernance, MFreezable { event LogFrozen(); event LogUnFrozen(); function isFrozen() public view override returns (bool) { return stateFrozen; } function validateFreezeRequest(uint256 requestTime) internal override { require(requestTime != 0, "FORCED_ACTION_UNREQUESTED"); // Verify timer on escape request. uint256 freezeTime = requestTime + FREEZE_GRACE_PERIOD; // Prevent wraparound. assert(freezeTime >= FREEZE_GRACE_PERIOD); require(block.timestamp >= freezeTime, "FORCED_ACTION_PENDING"); // NOLINT: timestamp. // Forced action requests placed before freeze, are no longer valid after the un-freeze. require(freezeTime > unFreezeTime, "REFREEZE_ATTEMPT"); } function freeze() internal override notFrozen { unFreezeTime = block.timestamp + UNFREEZE_DELAY; // Update state. stateFrozen = true; // Log event. emit LogFrozen(); } function unFreeze() external onlyFrozen onlyGovernance { require(block.timestamp >= unFreezeTime, "UNFREEZE_NOT_ALLOWED_YET"); // Update state. stateFrozen = false; // Increment roots to invalidate them, w/o losing information. validiumVaultRoot += 1; rollupVaultRoot += 1; orderRoot += 1; // Log event. emit LogUnFrozen(); } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "MGovernance.sol"; /* Implements Generic Governance, applicable for both proxy and main contract, and possibly others. Notes: The use of the same function names by both the Proxy and a delegated implementation is not possible since calling the implementation functions is done via the default function of the Proxy. For this reason, for example, the implementation of MainContract (MainGovernance) exposes mainIsGovernor, which calls the internal _isGovernor method. */ struct GovernanceInfoStruct { mapping(address => bool) effectiveGovernors; address candidateGovernor; bool initialized; } abstract contract Governance is MGovernance { event LogNominatedGovernor(address nominatedGovernor); event LogNewGovernorAccepted(address acceptedGovernor); event LogRemovedGovernor(address removedGovernor); event LogNominationCancelled(); function getGovernanceInfo() internal view virtual returns (GovernanceInfoStruct storage); /* Current code intentionally prevents governance re-initialization. This may be a problem in an upgrade situation, in a case that the upgrade-to implementation performs an initialization (for real) and within that calls initGovernance(). Possible workarounds: 1. Clearing the governance info altogether by changing the MAIN_GOVERNANCE_INFO_TAG. This will remove existing main governance information. 2. Modify the require part in this function, so that it will exit quietly when trying to re-initialize (uncomment the lines below). */ function initGovernance() internal { GovernanceInfoStruct storage gub = getGovernanceInfo(); require(!gub.initialized, "ALREADY_INITIALIZED"); gub.initialized = true; // to ensure acceptNewGovernor() won't fail. // Add the initial governer. acceptNewGovernor(msg.sender); } function _isGovernor(address user) internal view override returns (bool) { GovernanceInfoStruct storage gub = getGovernanceInfo(); return gub.effectiveGovernors[user]; } /* Cancels the nomination of a governor candidate. */ function _cancelNomination() internal onlyGovernance { GovernanceInfoStruct storage gub = getGovernanceInfo(); if (gub.candidateGovernor != address(0x0)) { gub.candidateGovernor = address(0x0); emit LogNominationCancelled(); } } function _nominateNewGovernor(address newGovernor) internal onlyGovernance { GovernanceInfoStruct storage gub = getGovernanceInfo(); require(newGovernor != address(0x0), "BAD_ADDRESS"); require(!_isGovernor(newGovernor), "ALREADY_GOVERNOR"); require(gub.candidateGovernor == address(0x0), "OTHER_CANDIDATE_PENDING"); gub.candidateGovernor = newGovernor; emit LogNominatedGovernor(newGovernor); } /* The acceptNewGovernor is called in two cases: 1. by _acceptGovernance when a new governor accepts its role. 2. by initGovernance to add the initial governor. The difference is that the init path skips the nominate step that would fail because of the onlyGovernance modifier. */ function acceptNewGovernor(address newGovernor) private { require(!_isGovernor(newGovernor), "ALREADY_GOVERNOR"); GovernanceInfoStruct storage gub = getGovernanceInfo(); gub.effectiveGovernors[newGovernor] = true; // Emit governance information. emit LogNewGovernorAccepted(newGovernor); } function _acceptGovernance() internal { // The new governor was proposed as a candidate by the current governor. GovernanceInfoStruct storage gub = getGovernanceInfo(); require(msg.sender == gub.candidateGovernor, "ONLY_CANDIDATE_GOVERNOR"); // Update state. acceptNewGovernor(msg.sender); gub.candidateGovernor = address(0x0); } /* Remove a governor from office. */ function _removeGovernor(address governorForRemoval) internal onlyGovernance { require(msg.sender != governorForRemoval, "GOVERNOR_SELF_REMOVE"); GovernanceInfoStruct storage gub = getGovernanceInfo(); require(_isGovernor(governorForRemoval), "NOT_GOVERNOR"); gub.effectiveGovernors[governorForRemoval] = false; emit LogRemovedGovernor(governorForRemoval); } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import {GovernanceInfoStruct} from "Governance.sol"; /* Holds the governance slots for ALL entities, including proxy and the main contract. */ contract GovernanceStorage { // A map from a Governor tag to its own GovernanceInfoStruct. mapping(string => GovernanceInfoStruct) internal governanceInfo; //NOLINT uninitialized-state. }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: MIT. pragma solidity ^0.6.12; /** Required interface of an ERC1155 compliant contract, as defined in the https://eips.ethereum.org/EIPS/eip-1155[EIP]. _Available since v3.1. */ interface IERC1155 { /** Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`. */ event TransferSingle( address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value ); /** Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all transfers. */ event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); /** Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to `approved`. */ event ApprovalForAll(address indexed account, address indexed operator, bool approved); /** Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI. If an {URI} event was emitted for `id`, the standard https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value returned by {IERC1155MetadataURI-uri}. */ event URI(string value, uint256 indexed id); /** Returns the amount of tokens of token type `id` owned by `account`. Requirements: - `account` cannot be the zero address. */ function balanceOf(address account, uint256 id) external view returns (uint256); /** Requirements: - `accounts` and `ids` must have the same length. */ function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); /** Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`, Emits an {ApprovalForAll} event. Requirements: - `operator` cannot be the caller. */ function setApprovalForAll(address operator, bool approved) external; /** Returns true if `operator` is approved to transfer ``account``'s tokens. See {setApprovalForAll}. */ function isApprovedForAll(address account, address operator) external view returns (bool); /** Transfers `amount` tokens of token type `id` from `from` to `to`. Emits a {TransferSingle} event. Requirements: - `to` cannot be the zero address. - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}. - `from` must have a balance of tokens of type `id` of at least `amount`. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the acceptance magic value. */ function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; /** Emits a {TransferBatch} event. Requirements: - `ids` and `amounts` must have the same length. - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value. */ function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; /** Interface of the ERC20 standard as defined in the EIP. Does not include the optional functions; to access them see {ERC20Detailed}. */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; interface IERC721Receiver { function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; interface Identity { /* Allows a caller to ensure that the provided address is of the expected type and version. */ function identify() external pure returns (string memory); }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "MainStorage.sol"; import "MKeyGetters.sol"; /* Implements MKeyGetters. */ contract KeyGetters is MainStorage, MKeyGetters { uint256 internal constant MASK_ADDRESS = (1 << 160) - 1; /* Returns the Ethereum public key (address) that owns the given ownerKey. If the ownerKey size is within the range of an Ethereum address (i.e. < 2**160) it returns the owner key itself. If the ownerKey is larger than a potential eth address, the eth address for which the starkKey was registered is returned, and 0 if the starkKey is not registered. Note - prior to version 4.0 this function reverted on an unregistered starkKey. For a variant of this function that reverts on an unregistered starkKey, use strictGetEthKey. */ function getEthKey(uint256 ownerKey) public view override returns (address) { address registeredEth = ethKeys[ownerKey]; if (registeredEth != address(0x0)) { return registeredEth; } return ownerKey == (ownerKey & MASK_ADDRESS) ? address(ownerKey) : address(0x0); } /* Same as getEthKey, but fails when a stark key is not registered. */ function strictGetEthKey(uint256 ownerKey) internal view override returns (address ethKey) { ethKey = getEthKey(ownerKey); require(ethKey != address(0x0), "USER_UNREGISTERED"); } function isMsgSenderKeyOwner(uint256 ownerKey) internal view override returns (bool) { return msg.sender == getEthKey(ownerKey); } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; contract LibConstants { // Durations for time locked mechanisms (in seconds). // Note that it is known that miners can manipulate block timestamps // up to a deviation of a few seconds. // This mechanism should not be used for fine grained timing. // The time required to cancel a deposit, in the case the operator does not move the funds // to the off-chain storage. uint256 public constant DEPOSIT_CANCEL_DELAY = 2 days; // The time required to freeze the exchange, in the case the operator does not execute a // requested full withdrawal. uint256 public constant FREEZE_GRACE_PERIOD = 7 days; // The time after which the exchange may be unfrozen after it froze. This should be enough time // for users to perform escape hatches to get back their funds. uint256 public constant UNFREEZE_DELAY = 365 days; // Maximal number of verifiers which may co-exist. uint256 public constant MAX_VERIFIER_COUNT = uint256(64); // The time required to remove a verifier in case of a verifier upgrade. uint256 public constant VERIFIER_REMOVAL_DELAY = FREEZE_GRACE_PERIOD + (21 days); address constant ZERO_ADDRESS = address(0x0); uint256 constant K_MODULUS = 0x800000000000011000000000000000000000000000000000000000000000001; uint256 constant K_BETA = 0x6f21413efbe40de150e596d72f7a8c5609ad26c15c915c1f4cdfcb99cee9e89; uint256 internal constant MASK_250 = 0x03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; uint256 internal constant MASK_240 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; uint256 public constant MAX_FORCED_ACTIONS_REQS_PER_BLOCK = 10; uint256 constant QUANTUM_UPPER_BOUND = 2**128; uint256 internal constant MINTABLE_ASSET_ID_FLAG = 1 << 250; // The 64th bit (indexed 63, counting from 0) is a flag indicating a rollup vault id. uint256 constant ROLLUP_VAULTS_BIT = 63; }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; /* Interface containing actions a verifier can invoke on the state. The contract containing the state should implement these and verify correctness. */ abstract contract MAcceptModifications { function acceptDeposit( uint256 ownerKey, uint256 vaultId, uint256 assetId, uint256 quantizedAmount ) internal virtual; function allowWithdrawal( uint256 ownerKey, uint256 assetId, uint256 quantizedAmount ) internal virtual; function acceptWithdrawal( uint256 ownerKey, uint256 assetId, uint256 quantizedAmount ) internal virtual; }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; abstract contract MDeposits { function depositERC20( // NOLINT external-function. uint256 starkKey, uint256 assetType, uint256 vaultId, uint256 quantizedAmount ) public virtual; function depositEth( // NOLINT external-function. uint256 starkKey, uint256 assetType, uint256 vaultId ) public payable virtual; }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; abstract contract MFreezable { /* Returns true if the exchange is frozen. */ function isFrozen() public view virtual returns (bool); // NOLINT: external-function. /* Forbids calling the function if the exchange is frozen. */ modifier notFrozen() { require(!isFrozen(), "STATE_IS_FROZEN"); _; } function validateFreezeRequest(uint256 requestTime) internal virtual; /* Allows calling the function only if the exchange is frozen. */ modifier onlyFrozen() { require(isFrozen(), "STATE_NOT_FROZEN"); _; } /* Freezes the exchange. */ function freeze() internal virtual; }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; abstract contract MGovernance { function _isGovernor(address user) internal view virtual returns (bool); /* Allows calling the function only by a Governor. */ modifier onlyGovernance() { require(_isGovernor(msg.sender), "ONLY_GOVERNANCE"); _; } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; abstract contract MKeyGetters { // NOLINTNEXTLINE: external-function. function getEthKey(uint256 ownerKey) public view virtual returns (address); function strictGetEthKey(uint256 ownerKey) internal view virtual returns (address); function isMsgSenderKeyOwner(uint256 ownerKey) internal view virtual returns (bool); /* Allows calling the function only if ownerKey is registered to msg.sender. */ modifier onlyKeyOwner(uint256 ownerKey) { // Require the calling user to own the stark key. require(msg.sender == strictGetEthKey(ownerKey), "MISMATCHING_STARK_ETH_KEYS"); _; } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; abstract contract MTokenAssetData { // NOLINTNEXTLINE: external-function. function getAssetInfo(uint256 assetType) public view virtual returns (bytes memory); function isEther(uint256 assetType) internal view virtual returns (bool); function isERC20(uint256 assetType) internal view virtual returns (bool); function isERC721(uint256 assetType) internal view virtual returns (bool); function isERC1155(uint256 assetType) internal view virtual returns (bool); function isFungibleAssetType(uint256 assetType) internal view virtual returns (bool); function isMintableAssetType(uint256 assetType) internal view virtual returns (bool); function isAssetTypeWithTokenId(uint256 assetType) internal view virtual returns (bool); function extractContractAddress(uint256 assetType) internal view virtual returns (address); function verifyAssetInfo(bytes memory assetInfo) internal view virtual; function isNonFungibleAssetInfo(bytes memory assetInfo) internal pure virtual returns (bool); function calculateAssetIdWithTokenId(uint256 assetType, uint256 tokenId) public view virtual returns (uint256); function calculateMintableAssetId(uint256 assetType, bytes memory mintingBlob) public pure virtual returns (uint256); }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; abstract contract MTokenQuantization { function fromQuantized(uint256 presumedAssetType, uint256 quantizedAmount) internal view virtual returns (uint256 amount); // NOLINTNEXTLINE: external-function. function getQuantum(uint256 presumedAssetType) public view virtual returns (uint256 quantum); function toQuantized(uint256 presumedAssetType, uint256 amount) internal view virtual returns (uint256 quantizedAmount); }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; abstract contract MTokenTransfers { function transferIn(uint256 assetType, uint256 quantizedAmount) internal virtual; function transferInWithTokenId( uint256 assetType, uint256 tokenId, uint256 quantizedAmount ) internal virtual; function transferOut( address payable recipient, uint256 assetType, uint256 quantizedAmount ) internal virtual; function transferOutWithTokenId( address recipient, uint256 assetType, uint256 tokenId, uint256 quantizedAmount ) internal virtual; function transferOutMint( uint256 assetType, uint256 quantizedAmount, address recipient, bytes calldata mintingBlob ) internal virtual; }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "Governance.sol"; import "GovernanceStorage.sol"; /** The StarkEx contract is governed by one or more Governors of which the initial one is the deployer of the contract. A governor has the sole authority to perform the following operations: 1. Nominate additional governors (:sol:func:`mainNominateNewGovernor`) 2. Remove other governors (:sol:func:`mainRemoveGovernor`) 3. Add new :sol:mod:`Verifiers` and :sol:mod:`AvailabilityVerifiers` 4. Remove :sol:mod:`Verifiers` and :sol:mod:`AvailabilityVerifiers` after a timelock allows it 5. Nominate Operators (see :sol:mod:`Operator`) and Token Administrators (see :sol:mod:`TokenRegister`) Adding governors is performed in a two step procedure: 1. First, an existing governor nominates a new governor (:sol:func:`mainNominateNewGovernor`) 2. Then, the new governor must accept governance to become a governor (:sol:func:`mainAcceptGovernance`) This two step procedure ensures that a governor public key cannot be nominated unless there is an entity that has the corresponding private key. This is intended to prevent errors in the addition process. The governor private key should typically be held in a secure cold wallet. */ /* Implements Governance for the StarkDex main contract. The wrapper methods (e.g. mainIsGovernor wrapping _isGovernor) are needed to give the method unique names. Both Proxy and StarkExchange inherit from Governance. Thus, the logical contract method names must have unique names in order for the proxy to successfully delegate to them. */ contract MainGovernance is GovernanceStorage, Governance { // The tag is the sting key that is used in the Governance storage mapping. string public constant MAIN_GOVERNANCE_INFO_TAG = "StarkEx.Main.2019.GovernorsInformation"; /* Returns the GovernanceInfoStruct associated with the governance tag. */ function getGovernanceInfo() internal view override returns (GovernanceInfoStruct storage) { return governanceInfo[MAIN_GOVERNANCE_INFO_TAG]; } function mainIsGovernor(address user) external view returns (bool) { return _isGovernor(user); } function mainNominateNewGovernor(address newGovernor) external { _nominateNewGovernor(newGovernor); } function mainRemoveGovernor(address governorForRemoval) external { _removeGovernor(governorForRemoval); } function mainAcceptGovernance() external { _acceptGovernance(); } function mainCancelNomination() external { _cancelNomination(); } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "ProxyStorage.sol"; import "Addresses.sol"; import {ApprovalChainData} from "StarkExTypes.sol"; /* Holds ALL the main contract state (storage) variables. */ contract MainStorage is ProxyStorage { uint256 internal constant LAYOUT_LENGTH = 2**64; address escapeVerifierAddress; // NOLINT: constable-states. // Global dex-frozen flag. bool stateFrozen; // NOLINT: constable-states. // Time when unFreeze can be successfully called (UNFREEZE_DELAY after freeze). uint256 unFreezeTime; // NOLINT: constable-states. // Pending deposits. // A map STARK key => asset id => vault id => quantized amount. mapping(uint256 => mapping(uint256 => mapping(uint256 => uint256))) pendingDeposits; // Cancellation requests. // A map STARK key => asset id => vault id => request timestamp. mapping(uint256 => mapping(uint256 => mapping(uint256 => uint256))) cancellationRequests; // Pending withdrawals. // A map STARK key => asset id => quantized amount. mapping(uint256 => mapping(uint256 => uint256)) pendingWithdrawals; // vault_id => escape used boolean. mapping(uint256 => bool) escapesUsed; // Number of escapes that were performed when frozen. uint256 escapesUsedCount; // NOLINT: constable-states. // NOTE: fullWithdrawalRequests is deprecated, and replaced by forcedActionRequests. // NOLINTNEXTLINE naming-convention. mapping(uint256 => mapping(uint256 => uint256)) fullWithdrawalRequests_DEPRECATED; // State sequence number. uint256 sequenceNumber; // NOLINT: constable-states uninitialized-state. // Validium Vaults Tree Root & Height. uint256 validiumVaultRoot; // NOLINT: constable-states uninitialized-state. uint256 validiumTreeHeight; // NOLINT: constable-states uninitialized-state. // Order Tree Root & Height. uint256 orderRoot; // NOLINT: constable-states uninitialized-state. uint256 orderTreeHeight; // NOLINT: constable-states uninitialized-state. // True if and only if the address is allowed to add tokens. mapping(address => bool) tokenAdmins; // This mapping is no longer in use, remains for backwards compatibility. mapping(address => bool) userAdmins_DEPRECATED; // NOLINT: naming-convention. // True if and only if the address is an operator (allowed to update state). mapping(address => bool) operators; // NOLINT: uninitialized-state. // Mapping of contract ID to asset data. mapping(uint256 => bytes) assetTypeToAssetInfo; // NOLINT: uninitialized-state. // Mapping of registered contract IDs. mapping(uint256 => bool) registeredAssetType; // NOLINT: uninitialized-state. // Mapping from contract ID to quantum. mapping(uint256 => uint256) assetTypeToQuantum; // NOLINT: uninitialized-state. // This mapping is no longer in use, remains for backwards compatibility. mapping(address => uint256) starkKeys_DEPRECATED; // NOLINT: naming-convention. // Mapping from STARK public key to the Ethereum public key of its owner. mapping(uint256 => address) ethKeys; // NOLINT: uninitialized-state. // Timelocked state transition and availability verification chain. ApprovalChainData verifiersChain; ApprovalChainData availabilityVerifiersChain; // Batch id of last accepted proof. uint256 lastBatchId; // NOLINT: constable-states uninitialized-state. // Mapping between sub-contract index to sub-contract address. mapping(uint256 => address) subContracts; // NOLINT: uninitialized-state. mapping(uint256 => bool) permissiveAssetType_DEPRECATED; // NOLINT: naming-convention. // ---- END OF MAIN STORAGE AS DEPLOYED IN STARKEX2.0 ---- // Onchain-data version configured for the system. uint256 onchainDataVersion_DEPRECATED; // NOLINT: naming-convention constable-states. // Counter of forced action request in block. The key is the block number. mapping(uint256 => uint256) forcedRequestsInBlock; // ForcedAction requests: actionHash => requestTime. mapping(bytes32 => uint256) forcedActionRequests; // Mapping for timelocked actions. // A actionKey => activation time. mapping(bytes32 => uint256) actionsTimeLock; // Append only list of requested forced action hashes. bytes32[] actionHashList; // ---- END OF MAIN STORAGE AS DEPLOYED IN STARKEX3.0 ---- // ---- END OF MAIN STORAGE AS DEPLOYED IN STARKEX4.0 ---- // Rollup Vaults Tree Root & Height. uint256 rollupVaultRoot; // NOLINT: constable-states uninitialized-state. uint256 rollupTreeHeight; // NOLINT: constable-states uninitialized-state. uint256 globalConfigCode; // NOLINT: constable-states uninitialized-state. // Reserved storage space for Extensibility. // Every added MUST be added above the end gap, and the __endGap size must be reduced // accordingly. // NOLINTNEXTLINE: naming-convention. uint256[LAYOUT_LENGTH - 40] private __endGap; // __endGap complements layout to LAYOUT_LENGTH. }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "MainStorage.sol"; /* Extends MainStorage, holds Perpetual App specific state (storage) variables. ALL State variables that are common to all applications, reside in MainStorage, whereas ALL the Perpetual app specific ones reside here. */ contract PerpetualStorage is MainStorage { uint256 systemAssetType; // NOLINT: constable-states uninitialized-state. bytes32 public globalConfigurationHash; // NOLINT: constable-states uninitialized-state. mapping(uint256 => bytes32) public configurationHash; // NOLINT: uninitialized-state. bytes32 sharedStateHash; // NOLINT: constable-states uninitialized-state. // Configuration apply time-lock. // The delay is held in storage (and not constant) // So that it can be modified during upgrade. uint256 public configurationDelay; // NOLINT: constable-states. // Reserved storage space for Extensibility. // Every added MUST be added above the end gap, and the __endGap size must be reduced // accordingly. // NOLINTNEXTLINE: naming-convention shadowing-abstract. uint256[LAYOUT_LENGTH - 5] private __endGap; // __endGap complements layout to LAYOUT_LENGTH. }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "TokenRegister.sol"; import "PerpetualStorage.sol"; /** Extension of the TokenRegister contract for StarkPerpetual. The change is that asset registration defines the system asset, and permitted only once. */ abstract contract PerpetualTokenRegister is PerpetualStorage, TokenRegister { event LogSystemAssetType(uint256 assetType); function registerToken( uint256, /* assetType */ bytes calldata /* assetInfo */ ) external override { revert("UNSUPPORTED_FUNCTION"); } function registerToken( uint256, /* assetType */ bytes memory, /* assetInfo */ uint256 /* quantum */ ) public override { revert("UNSUPPORTED_FUNCTION"); } // NOLINTNEXTLINE external-function. function getSystemAssetType() public view returns (uint256) { return systemAssetType; } function registerSystemAssetType(uint256 assetType, bytes calldata assetInfo) external onlyTokensAdmin { require(systemAssetType == uint256(0), "SYSTEM_ASSET_TYPE_ALREADY_SET"); systemAssetType = assetType; super.registerToken(assetType, assetInfo, 1); emit LogSystemAssetType(assetType); } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "GovernanceStorage.sol"; /* Holds the Proxy-specific state variables. This contract is inherited by the GovernanceStorage (and indirectly by MainStorage) to prevent collision hazard. */ contract ProxyStorage is GovernanceStorage { // NOLINTNEXTLINE: naming-convention uninitialized-state. mapping(address => bytes32) internal initializationHash_DEPRECATED; // The time after which we can switch to the implementation. // Hash(implementation, data, finalize) => time. mapping(bytes32 => uint256) internal enabledTime; // A central storage of the flags whether implementation has been initialized. // Note - it can be used flexibly enough to accommodate multiple levels of initialization // (i.e. using different key salting schemes for different initialization levels). mapping(bytes32 => bool) internal initialized; }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; // Structure representing a list of verifiers (validity/availability). // A statement is valid only if all the verifiers in the list agree on it. // Adding a verifier to the list is immediate - this is used for fast resolution of // any soundness issues. // Removing a verifier from the list is time-locked, to ensure that any user of the system // not content with the announced removal has ample time to leave the system before it is // removed. struct ApprovalChainData { address[] verifiers; // Represents the time after which the verifier with the given address can be removed. // Removal of the verifier with address A is allowed only in the case the value // of verifierAllowedRemovalTime[A] != 0 and verifierAllowedRemovalTime[A] < (current time). mapping(address => uint256) verifierAllowedRemovalTime; }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "Identity.sol"; interface SubContractor is Identity { function initialize(bytes calldata data) external; function initializerSize() external view returns (uint256); /* Returns an array with selectors for validation. These selectors are the critical ones for maintaining self custody and anti censorship. During the upgrade process, as part of the sub-contract validation, the MainDispatcher validates that the selectos are mapped to the correct sub-contract. */ function validatedSelectors() external pure returns (bytes4[] memory); }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "MainStorage.sol"; import "MTokenAssetData.sol"; import "Addresses.sol"; import "LibConstants.sol"; contract TokenAssetData is MainStorage, LibConstants, MTokenAssetData { bytes4 internal constant ERC20_SELECTOR = bytes4(keccak256("ERC20Token(address)")); bytes4 internal constant ETH_SELECTOR = bytes4(keccak256("ETH()")); bytes4 internal constant ERC721_SELECTOR = bytes4(keccak256("ERC721Token(address,uint256)")); bytes4 internal constant ERC1155_SELECTOR = bytes4(keccak256("ERC1155Token(address,uint256)")); bytes4 internal constant MINTABLE_ERC20_SELECTOR = bytes4(keccak256("MintableERC20Token(address)")); bytes4 internal constant MINTABLE_ERC721_SELECTOR = bytes4(keccak256("MintableERC721Token(address,uint256)")); // The selector follows the 0x20 bytes assetInfo.length field. uint256 internal constant SELECTOR_OFFSET = 0x20; uint256 internal constant SELECTOR_SIZE = 4; uint256 internal constant TOKEN_CONTRACT_ADDRESS_OFFSET = SELECTOR_OFFSET + SELECTOR_SIZE; string internal constant NFT_ASSET_ID_PREFIX = "NFT:"; string internal constant NON_MINTABLE_PREFIX = "NON_MINTABLE:"; string internal constant MINTABLE_PREFIX = "MINTABLE:"; using Addresses for address; /* Extract the tokenSelector from assetInfo. Works like bytes4 tokenSelector = abi.decode(assetInfo, (bytes4)) but does not revert when assetInfo.length < SELECTOR_OFFSET. */ function extractTokenSelectorFromAssetInfo(bytes memory assetInfo) private pure returns (bytes4 selector) { assembly { selector := and( 0xffffffff00000000000000000000000000000000000000000000000000000000, mload(add(assetInfo, SELECTOR_OFFSET)) ) } } function getAssetInfo(uint256 assetType) public view override returns (bytes memory assetInfo) { // Verify that the registration is set and valid. require(registeredAssetType[assetType], "ASSET_TYPE_NOT_REGISTERED"); // Retrieve registration. assetInfo = assetTypeToAssetInfo[assetType]; } function extractTokenSelectorFromAssetType(uint256 assetType) private view returns (bytes4) { return extractTokenSelectorFromAssetInfo(getAssetInfo(assetType)); } function isEther(uint256 assetType) internal view override returns (bool) { return extractTokenSelectorFromAssetType(assetType) == ETH_SELECTOR; } function isERC20(uint256 assetType) internal view override returns (bool) { return extractTokenSelectorFromAssetType(assetType) == ERC20_SELECTOR; } function isERC721(uint256 assetType) internal view override returns (bool) { return extractTokenSelectorFromAssetType(assetType) == ERC721_SELECTOR; } function isERC1155(uint256 assetType) internal view override returns (bool) { return extractTokenSelectorFromAssetType(assetType) == ERC1155_SELECTOR; } function isFungibleAssetType(uint256 assetType) internal view override returns (bool) { bytes4 tokenSelector = extractTokenSelectorFromAssetType(assetType); return tokenSelector == ETH_SELECTOR || tokenSelector == ERC20_SELECTOR || tokenSelector == MINTABLE_ERC20_SELECTOR; } function isMintableAssetType(uint256 assetType) internal view override returns (bool) { bytes4 tokenSelector = extractTokenSelectorFromAssetType(assetType); return tokenSelector == MINTABLE_ERC20_SELECTOR || tokenSelector == MINTABLE_ERC721_SELECTOR; } function isAssetTypeWithTokenId(uint256 assetType) internal view override returns (bool) { bytes4 tokenSelector = extractTokenSelectorFromAssetType(assetType); return tokenSelector == ERC721_SELECTOR || tokenSelector == ERC1155_SELECTOR; } function isTokenSupported(bytes4 tokenSelector) private pure returns (bool) { return tokenSelector == ETH_SELECTOR || tokenSelector == ERC20_SELECTOR || tokenSelector == ERC721_SELECTOR || tokenSelector == MINTABLE_ERC20_SELECTOR || tokenSelector == MINTABLE_ERC721_SELECTOR || tokenSelector == ERC1155_SELECTOR; } function extractContractAddressFromAssetInfo(bytes memory assetInfo) private pure returns (address) { uint256 offset = TOKEN_CONTRACT_ADDRESS_OFFSET; uint256 res; assembly { res := mload(add(assetInfo, offset)) } return address(res); } function extractContractAddress(uint256 assetType) internal view override returns (address) { return extractContractAddressFromAssetInfo(getAssetInfo(assetType)); } function verifyAssetInfo(bytes memory assetInfo) internal view override { bytes4 tokenSelector = extractTokenSelectorFromAssetInfo(assetInfo); // Ensure the selector is of an asset type we know. require(isTokenSupported(tokenSelector), "UNSUPPORTED_TOKEN_TYPE"); if (tokenSelector == ETH_SELECTOR) { // Assset info for ETH assetType is only a selector, i.e. 4 bytes length. require(assetInfo.length == 4, "INVALID_ASSET_STRING"); } else { // Assset info for other asset types are a selector + uint256 concatanation. // We pass the address as a uint256 (zero padded), // thus its length is 0x04 + 0x20 = 0x24. require(assetInfo.length == 0x24, "INVALID_ASSET_STRING"); address tokenAddress = extractContractAddressFromAssetInfo(assetInfo); require(tokenAddress.isContract(), "BAD_TOKEN_ADDRESS"); } } function isNonFungibleAssetInfo(bytes memory assetInfo) internal pure override returns (bool) { bytes4 tokenSelector = extractTokenSelectorFromAssetInfo(assetInfo); return tokenSelector == ERC721_SELECTOR || tokenSelector == MINTABLE_ERC721_SELECTOR; } function calculateAssetIdWithTokenId(uint256 assetType, uint256 tokenId) public view override returns (uint256) { require(isAssetTypeWithTokenId(assetType), "ASSET_TYPE_DOES_NOT_TAKE_TOKEN_ID"); string memory prefix = isERC721(assetType) ? NFT_ASSET_ID_PREFIX : NON_MINTABLE_PREFIX; return uint256(keccak256(abi.encodePacked(prefix, assetType, tokenId))) & MASK_250; } function calculateMintableAssetId(uint256 assetType, bytes memory mintingBlob) public pure override returns (uint256 assetId) { uint256 blobHash = uint256(keccak256(mintingBlob)); assetId = (uint256(keccak256(abi.encodePacked(MINTABLE_PREFIX, assetType, blobHash))) & MASK_240) | MINTABLE_ASSET_ID_FLAG; } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "MainStorage.sol"; import "MTokenQuantization.sol"; contract TokenQuantization is MainStorage, MTokenQuantization { function fromQuantized(uint256 presumedAssetType, uint256 quantizedAmount) internal view override returns (uint256 amount) { uint256 quantum = getQuantum(presumedAssetType); amount = quantizedAmount * quantum; require(amount / quantum == quantizedAmount, "DEQUANTIZATION_OVERFLOW"); } function getQuantum(uint256 presumedAssetType) public view override returns (uint256 quantum) { if (!registeredAssetType[presumedAssetType]) { // Default quantization, for NFTs etc. quantum = 1; } else { // Retrieve registration. quantum = assetTypeToQuantum[presumedAssetType]; } } function toQuantized(uint256 presumedAssetType, uint256 amount) internal view override returns (uint256 quantizedAmount) { uint256 quantum = getQuantum(presumedAssetType); require(amount % quantum == 0, "INVALID_AMOUNT"); quantizedAmount = amount / quantum; } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "LibConstants.sol"; import "MGovernance.sol"; import "MTokenAssetData.sol"; import "IERC20.sol"; import "MainStorage.sol"; /** Registration of a new token (:sol:func:`registerToken`) entails defining a new asset type within the system, and associating it with an `assetInfo` array of bytes and a quantization factor (`quantum`). The `assetInfo` is a byte array, with a size depending on the token. For ETH, assetInfo is 4 bytes long. For ERC20 tokens, it is 36 bytes long. For each token type, the following constant 4-byte hash is defined, called the `selector`: | `ETH_SELECTOR = bytes4(keccak256("ETH()"));` | `ERC20_SELECTOR = bytes4(keccak256("ERC20Token(address)"));` | `ERC721_SELECTOR = bytes4(keccak256("ERC721Token(address,uint256)"));` | `ERC1155_SELECTOR = bytes4(keccak256("ERC1155Token(address,uint256)"));` | `MINTABLE_ERC20_SELECTOR = bytes4(keccak256("MintableERC20Token(address)"));` | `MINTABLE_ERC721_SELECTOR = bytes4(keccak256("MintableERC721Token(address,uint256)"));` For each token type, `assetInfo` is defined as follows: For ETH, | `assetInfo = ETH_SELECTOR;` For all other selectors: | `assetInfo = abi.encodePacked(SELECTOR, address);` Where 'address' is a 32 byte representation of the ERC20 token contract address, padded with leading zeros. The `quantum` quantization factor defines the multiplicative transformation from the native token denomination as a 256b unsigned integer to a 63b unsigned integer representation as used by the Stark exchange. Only amounts in the native representation that represent an integer number of quanta are allowed in the system. The asset type is restricted to be the result of a hash of the `assetInfo` and the `quantum` masked to 250 bits (to be less than the prime used) according to the following formula: | ``uint256 assetType = uint256(keccak256(abi.encodePacked(assetInfo, quantum))) &`` | ``0x03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;`` Once registered, tokens cannot be removed from the system, as their IDs may be used by off-chain accounts. New tokens may only be registered by a Token Administrator. A Token Administrator may be instantly appointed or removed by the contract Governor (see :sol:mod:`MainGovernance`). Typically, the Token Administrator's private key should be kept in a cold wallet. */ abstract contract TokenRegister is MainStorage, LibConstants, MGovernance, MTokenAssetData { event LogTokenRegistered(uint256 assetType, bytes assetInfo, uint256 quantum); event LogTokenAdminAdded(address tokenAdmin); event LogTokenAdminRemoved(address tokenAdmin); modifier onlyTokensAdmin() { require(isTokenAdmin(msg.sender), "ONLY_TOKENS_ADMIN"); _; } function isTokenAdmin(address testedAdmin) public view returns (bool) { return tokenAdmins[testedAdmin]; } function registerTokenAdmin(address newAdmin) external onlyGovernance { tokenAdmins[newAdmin] = true; emit LogTokenAdminAdded(newAdmin); } function unregisterTokenAdmin(address oldAdmin) external onlyGovernance { tokenAdmins[oldAdmin] = false; emit LogTokenAdminRemoved(oldAdmin); } function isAssetRegistered(uint256 assetType) public view returns (bool) { return registeredAssetType[assetType]; } /* Registers a new asset to the system. Once added, it can not be removed and there is a limited number of slots available. */ function registerToken( uint256 assetType, bytes calldata assetInfo, uint256 quantum ) public virtual onlyTokensAdmin { // Make sure it is not invalid or already registered. require(!isAssetRegistered(assetType), "ASSET_ALREADY_REGISTERED"); require(assetType < K_MODULUS, "INVALID_ASSET_TYPE"); require(quantum > 0, "INVALID_QUANTUM"); require(quantum < QUANTUM_UPPER_BOUND, "INVALID_QUANTUM"); // Require that the assetType is the hash of the assetInfo and quantum truncated to 250 bits. uint256 enforcedId = uint256(keccak256(abi.encodePacked(assetInfo, quantum))) & MASK_250; require(assetType == enforcedId, "INVALID_ASSET_TYPE"); verifyAssetInfo(assetInfo); // NFTs quantum must equal one. if (isNonFungibleAssetInfo(assetInfo)) { require(quantum == 1, "INVALID_NFT_QUANTUM"); } // Add token to the in-storage structures. registeredAssetType[assetType] = true; assetTypeToAssetInfo[assetType] = assetInfo; assetTypeToQuantum[assetType] = quantum; // Log the registration of a new token. emit LogTokenRegistered(assetType, assetInfo, quantum); } function registerToken(uint256 assetType, bytes calldata assetInfo) external virtual { registerToken(assetType, assetInfo, 1); } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "Addresses.sol"; import "MTokenTransfers.sol"; import "MTokenAssetData.sol"; import "MTokenQuantization.sol"; import "IERC1155.sol"; import "IERC20.sol"; /* Implements various transferIn and transferOut functionalities. */ abstract contract TokenTransfers is MTokenQuantization, MTokenAssetData, MTokenTransfers { using Addresses for address; using Addresses for address payable; /* Transfers funds from msg.sender to the exchange. */ function transferIn(uint256 assetType, uint256 quantizedAmount) internal override { uint256 amount = fromQuantized(assetType, quantizedAmount); if (isERC20(assetType)) { if (quantizedAmount == 0) return; address tokenAddress = extractContractAddress(assetType); IERC20 token = IERC20(tokenAddress); uint256 exchangeBalanceBefore = token.balanceOf(address(this)); bytes memory callData = abi.encodeWithSelector( token.transferFrom.selector, msg.sender, address(this), amount ); tokenAddress.safeTokenContractCall(callData); uint256 exchangeBalanceAfter = token.balanceOf(address(this)); require(exchangeBalanceAfter >= exchangeBalanceBefore, "OVERFLOW"); // NOLINTNEXTLINE(incorrect-equality): strict equality needed. require( exchangeBalanceAfter == exchangeBalanceBefore + amount, "INCORRECT_AMOUNT_TRANSFERRED" ); } else if (isEther(assetType)) { require(msg.value == amount, "INCORRECT_DEPOSIT_AMOUNT"); } else { revert("UNSUPPORTED_TOKEN_TYPE"); } } /* Transfers non fungible and semi fungible tokens from a user to the exchange. */ function transferInWithTokenId( uint256 assetType, uint256 tokenId, uint256 quantizedAmount ) internal override { require(isAssetTypeWithTokenId(assetType), "FUNGIBLE_ASSET_TYPE"); if (isERC721(assetType)) { require(quantizedAmount == 1, "ILLEGAL_NFT_BALANCE"); transferInNft(assetType, tokenId); } else if (quantizedAmount > 0) { transferInSft(assetType, tokenId, quantizedAmount); } } function transferInNft(uint256 assetType, uint256 tokenId) private { require(isERC721(assetType), "NOT_ERC721_TOKEN"); address tokenAddress = extractContractAddress(assetType); tokenAddress.safeTokenContractCall( abi.encodeWithSignature( "safeTransferFrom(address,address,uint256)", msg.sender, address(this), tokenId ) ); } function transferInSft( uint256 assetType, uint256 tokenId, uint256 quantizedAmount ) private { require(isERC1155(assetType), "NOT_ERC1155_TOKEN"); if (quantizedAmount == 0) return; uint256 amount = fromQuantized(assetType, quantizedAmount); address tokenAddress = extractContractAddress(assetType); IERC1155 token = IERC1155(tokenAddress); uint256 exchangeBalanceBefore = token.balanceOf(address(this), tokenId); // Call an ERC1155 token transfer. tokenAddress.safeTokenContractCall( abi.encodeWithSelector( token.safeTransferFrom.selector, msg.sender, address(this), tokenId, amount, bytes("") ) ); uint256 exchangeBalanceAfter = token.balanceOf(address(this), tokenId); require(exchangeBalanceAfter >= exchangeBalanceBefore, "OVERFLOW"); // NOLINTNEXTLINE(incorrect-equality): strict equality needed. require( exchangeBalanceAfter == exchangeBalanceBefore + amount, "INCORRECT_AMOUNT_TRANSFERRED" ); } /* Transfers funds from the exchange to recipient. */ function transferOut( address payable recipient, uint256 assetType, uint256 quantizedAmount ) internal override { // Make sure we don't accidentally burn funds. require(recipient != address(0x0), "INVALID_RECIPIENT"); uint256 amount = fromQuantized(assetType, quantizedAmount); if (isERC20(assetType)) { if (quantizedAmount == 0) return; address tokenAddress = extractContractAddress(assetType); IERC20 token = IERC20(tokenAddress); uint256 exchangeBalanceBefore = token.balanceOf(address(this)); bytes memory callData = abi.encodeWithSelector( token.transfer.selector, recipient, amount ); tokenAddress.safeTokenContractCall(callData); uint256 exchangeBalanceAfter = token.balanceOf(address(this)); require(exchangeBalanceAfter <= exchangeBalanceBefore, "UNDERFLOW"); // NOLINTNEXTLINE(incorrect-equality): strict equality needed. require( exchangeBalanceAfter == exchangeBalanceBefore - amount, "INCORRECT_AMOUNT_TRANSFERRED" ); } else if (isEther(assetType)) { if (quantizedAmount == 0) return; recipient.performEthTransfer(amount); } else { revert("UNSUPPORTED_TOKEN_TYPE"); } } /* Transfers non fungible and semi fungible tokens from the exchange to recipient. */ function transferOutWithTokenId( address recipient, uint256 assetType, uint256 tokenId, uint256 quantizedAmount ) internal override { require(isAssetTypeWithTokenId(assetType), "FUNGIBLE_ASSET_TYPE"); if (isERC721(assetType)) { require(quantizedAmount == 1, "ILLEGAL_NFT_BALANCE"); transferOutNft(recipient, assetType, tokenId); } else if (quantizedAmount > 0) { transferOutSft(recipient, assetType, tokenId, quantizedAmount); } } /* Transfers NFT from the exchange to recipient. */ function transferOutNft( address recipient, uint256 assetType, uint256 tokenId ) private { // Make sure we don't accidentally burn funds. require(recipient != address(0x0), "INVALID_RECIPIENT"); require(isERC721(assetType), "NOT_ERC721_TOKEN"); address tokenAddress = extractContractAddress(assetType); tokenAddress.safeTokenContractCall( abi.encodeWithSignature( "safeTransferFrom(address,address,uint256)", address(this), recipient, tokenId ) ); } /* Transfers Semi Fungible Tokens from the exchange to recipient. */ function transferOutSft( address recipient, uint256 assetType, uint256 tokenId, uint256 quantizedAmount ) private { // Make sure we don't accidentally burn funds. require(recipient != address(0x0), "INVALID_RECIPIENT"); require(isERC1155(assetType), "NOT_ERC1155_TOKEN"); if (quantizedAmount == 0) return; uint256 amount = fromQuantized(assetType, quantizedAmount); address tokenAddress = extractContractAddress(assetType); IERC1155 token = IERC1155(tokenAddress); uint256 exchangeBalanceBefore = token.balanceOf(address(this), tokenId); // Call an ERC1155 token transfer. tokenAddress.safeTokenContractCall( abi.encodeWithSelector( token.safeTransferFrom.selector, address(this), recipient, tokenId, amount, bytes("") ) ); uint256 exchangeBalanceAfter = token.balanceOf(address(this), tokenId); require(exchangeBalanceAfter <= exchangeBalanceBefore, "UNDERFLOW"); // NOLINTNEXTLINE(incorrect-equality): strict equality needed. require( exchangeBalanceAfter == exchangeBalanceBefore - amount, "INCORRECT_AMOUNT_TRANSFERRED" ); } function transferOutMint( uint256 assetType, uint256 quantizedAmount, address recipient, bytes calldata mintingBlob ) internal override { // Make sure we don't accidentally burn funds. require(recipient != address(0x0), "INVALID_RECIPIENT"); require(isMintableAssetType(assetType), "NON_MINTABLE_ASSET_TYPE"); require(quantizedAmount > 0, "INVALID_MINT_AMOUNT"); uint256 amount = fromQuantized(assetType, quantizedAmount); address tokenAddress = extractContractAddress(assetType); tokenAddress.safeTokenContractCall( abi.encodeWithSignature( "mintFor(address,uint256,bytes)", recipient, amount, mintingBlob ) ); } }
/* Copyright 2019-2022 StarkWare Industries Ltd. Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.starkware.co/open-source-license/ Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // SPDX-License-Identifier: Apache-2.0. pragma solidity ^0.6.12; import "MAcceptModifications.sol"; import "MTokenQuantization.sol"; import "MTokenAssetData.sol"; import "MFreezable.sol"; import "MKeyGetters.sol"; import "MTokenTransfers.sol"; import "MainStorage.sol"; /** For a user to perform a withdrawal operation from the Stark Exchange during normal operation two calls are required: 1. A call to an offchain exchange API, requesting a withdrawal from a user account (vault). 2. A call to the on-chain :sol:func:`withdraw` function to perform the actual withdrawal of funds transferring them to the users Eth or ERC20 account (depending on the token type). For simplicity, hereafter it is assumed that all tokens are ERC20 tokens but the text below applies to Eth in the same manner. In the first call mentioned above, anyone can call the API to request the withdrawal of an amount from a given vault. Following the request, the exchange may include the withdrawal in a STARK proof. The submission of a proof then results in the addition of the amount(s) withdrawn to an on-chain pending withdrawals account under the stark key of the vault owner and the appropriate asset ID. At the same time, this also implies that this amount is deducted from the off-chain vault. Once the amount to be withdrawn has been transfered to the on-chain pending withdrawals account, the user may perform the second call mentioned above to complete the transfer of funds from the Stark Exchange contract to the appropriate ERC20 account. Only a user holding the Eth key corresponding to the Stark Key of a pending withdrawals account may perform this operation. It is possible that for multiple withdrawal calls to the API, a single withdrawal call to the contract may retrieve all funds, as long as they are all for the same asset ID. The result of the operation, assuming all requirements are met, is that an amount of ERC20 tokens in the pending withdrawal account times the quantization factor is transferred to the ERC20 account of the user. A withdrawal request cannot be cancelled. Once funds reach the pending withdrawals account on-chain, they cannot be moved back into an off-chain vault before completion of the withdrawal to the ERC20 account of the user. In the event that the exchange reaches a frozen state the user may perform a withdrawal operation via an alternative flow, known as the "Escape" flow. In this flow, the API call above is replaced with an :sol:func:`escape` call to the on-chain contract (see :sol:mod:`Escapes`) proving the ownership of off-chain funds. If such proof is accepted, the user may proceed as above with the :sol:func:`withdraw` call to the contract to complete the operation. */ abstract contract Withdrawals is MainStorage, MAcceptModifications, MTokenQuantization, MTokenAssetData, MFreezable, MKeyGetters, MTokenTransfers { event LogWithdrawalPerformed( uint256 ownerKey, uint256 assetType, uint256 nonQuantizedAmount, uint256 quantizedAmount, address recipient ); event LogNftWithdrawalPerformed( uint256 ownerKey, uint256 assetType, uint256 tokenId, uint256 assetId, address recipient ); event LogWithdrawalWithTokenIdPerformed( uint256 ownerKey, uint256 assetType, uint256 tokenId, uint256 assetId, uint256 nonQuantizedAmount, uint256 quantizedAmount, address recipient ); event LogMintWithdrawalPerformed( uint256 ownerKey, uint256 assetType, uint256 nonQuantizedAmount, uint256 quantizedAmount, uint256 assetId ); function getWithdrawalBalance(uint256 ownerKey, uint256 assetId) external view returns (uint256) { uint256 presumedAssetType = assetId; return fromQuantized(presumedAssetType, pendingWithdrawals[ownerKey][assetId]); } /* Moves funds from the pending withdrawal account to the owner address. Note: this function can be called by anyone. Can be called normally while frozen. */ function withdraw(uint256 ownerKey, uint256 assetType) external { address payable recipient = payable(strictGetEthKey(ownerKey)); require(!isMintableAssetType(assetType), "MINTABLE_ASSET_TYPE"); require(isFungibleAssetType(assetType), "NON_FUNGIBLE_ASSET_TYPE"); uint256 assetId = assetType; // Fetch and clear quantized amount. uint256 quantizedAmount = pendingWithdrawals[ownerKey][assetId]; pendingWithdrawals[ownerKey][assetId] = 0; // Transfer funds. transferOut(recipient, assetType, quantizedAmount); emit LogWithdrawalPerformed( ownerKey, assetType, fromQuantized(assetType, quantizedAmount), quantizedAmount, recipient ); } /* Allows withdrawal of tokens to their owner's account. Note: this function can be called by anyone. This function can be called normally while frozen. */ function withdrawWithTokenId( uint256 ownerKey, uint256 assetType, uint256 tokenId // No notFrozen modifier: This function can always be used, even when frozen. ) public { require(isAssetTypeWithTokenId(assetType), "INVALID_ASSET_TYPE"); uint256 assetId = calculateAssetIdWithTokenId(assetType, tokenId); address recipient = strictGetEthKey(ownerKey); uint256 quantizedAmount = pendingWithdrawals[ownerKey][assetId]; pendingWithdrawals[ownerKey][assetId] = 0; // Transfer funds. transferOutWithTokenId(recipient, assetType, tokenId, quantizedAmount); if (isERC721(assetType)) { emit LogNftWithdrawalPerformed(ownerKey, assetType, tokenId, assetId, recipient); } emit LogWithdrawalWithTokenIdPerformed( ownerKey, assetType, tokenId, assetId, fromQuantized(assetType, quantizedAmount), quantizedAmount, recipient ); } /* Allows withdrawal of an NFT to its owner's account. Note: this function can be called by anyone. This function can be called normally while frozen. */ function withdrawNft( uint256 ownerKey, uint256 assetType, uint256 tokenId // No notFrozen modifier: This function can always be used, even when frozen. ) external { withdrawWithTokenId(ownerKey, assetType, tokenId); } function withdrawAndMint( uint256 ownerKey, uint256 assetType, bytes calldata mintingBlob ) external { address recipient = strictGetEthKey(ownerKey); require(registeredAssetType[assetType], "INVALID_ASSET_TYPE"); require(isMintableAssetType(assetType), "NON_MINTABLE_ASSET_TYPE"); uint256 assetId = calculateMintableAssetId(assetType, mintingBlob); require(pendingWithdrawals[ownerKey][assetId] > 0, "NO_PENDING_WITHDRAWAL_BALANCE"); uint256 quantizedAmount = pendingWithdrawals[ownerKey][assetId]; pendingWithdrawals[ownerKey][assetId] = 0; // Transfer funds. transferOutMint(assetType, quantizedAmount, recipient, mintingBlob); emit LogMintWithdrawalPerformed( ownerKey, assetType, fromQuantized(assetType, quantizedAmount), quantizedAmount, assetId ); } }
{ "metadata": { "useLiteralContent": true }, "libraries": {}, "remappings": [], "optimizer": { "enabled": true, "runs": 100 }, "evmVersion": "istanbul", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ownerKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"LogAssetWithdrawalAllowed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"depositorEthKey","type":"address"},{"indexed":false,"internalType":"uint256","name":"starkKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonQuantizedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"LogDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"starkKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"}],"name":"LogDepositCancel","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"starkKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonQuantizedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"LogDepositCancelReclaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"starkKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"}],"name":"LogDepositNftCancelReclaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"depositorEthKey","type":"address"},{"indexed":false,"internalType":"uint256","name":"starkKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonQuantizedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"LogDepositWithTokenId","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"starkKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonQuantizedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"LogDepositWithTokenIdCancelReclaimed","type":"event"},{"anonymous":false,"inputs":[],"name":"LogFrozen","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ownerKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonQuantizedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantizedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"}],"name":"LogMintWithdrawalPerformed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ownerKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"LogMintableWithdrawalAllowed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"acceptedGovernor","type":"address"}],"name":"LogNewGovernorAccepted","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"depositorEthKey","type":"address"},{"indexed":false,"internalType":"uint256","name":"starkKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"vaultId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"}],"name":"LogNftDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ownerKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"}],"name":"LogNftWithdrawalAllowed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ownerKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"LogNftWithdrawalPerformed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"nominatedGovernor","type":"address"}],"name":"LogNominatedGovernor","type":"event"},{"anonymous":false,"inputs":[],"name":"LogNominationCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"removedGovernor","type":"address"}],"name":"LogRemovedGovernor","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"}],"name":"LogSystemAssetType","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAdmin","type":"address"}],"name":"LogTokenAdminAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"tokenAdmin","type":"address"}],"name":"LogTokenAdminRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"assetInfo","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"quantum","type":"uint256"}],"name":"LogTokenRegistered","type":"event"},{"anonymous":false,"inputs":[],"name":"LogUnFrozen","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ownerKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonQuantizedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"LogWithdrawalAllowed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ownerKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonQuantizedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantizedAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"LogWithdrawalPerformed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"ownerKey","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetType","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"assetId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonQuantizedAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"quantizedAmount","type":"uint256"},{"indexed":false,"internalType":"address","name":"recipient","type":"address"}],"name":"LogWithdrawalWithTokenIdPerformed","type":"event"},{"inputs":[],"name":"DEPOSIT_CANCEL_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FREEZE_GRACE_PERIOD","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAIN_GOVERNANCE_INFO_TAG","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_FORCED_ACTIONS_REQS_PER_BLOCK","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_VERIFIER_COUNT","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNFREEZE_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERIFIER_REMOVAL_DELAY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"calculateAssetIdWithTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"bytes","name":"mintingBlob","type":"bytes"}],"name":"calculateMintableAssetId","outputs":[{"internalType":"uint256","name":"assetId","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"configurationDelay","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"configurationHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"depositCancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"depositERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"depositERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"depositEth","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"depositNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"depositNftReclaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"depositReclaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"},{"internalType":"uint256","name":"quantizedAmount","type":"uint256"}],"name":"depositWithTokenId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"depositWithTokenIdReclaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assetType","type":"uint256"}],"name":"getAssetInfo","outputs":[{"internalType":"bytes","name":"assetInfo","type":"bytes"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"getCancellationRequest","outputs":[{"internalType":"uint256","name":"request","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"getDepositBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ownerKey","type":"uint256"}],"name":"getEthKey","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"starkKey","type":"uint256"},{"internalType":"uint256","name":"assetId","type":"uint256"},{"internalType":"uint256","name":"vaultId","type":"uint256"}],"name":"getQuantizedDepositBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"presumedAssetType","type":"uint256"}],"name":"getQuantum","outputs":[{"internalType":"uint256","name":"quantum","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getSystemAssetType","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ownerKey","type":"uint256"},{"internalType":"uint256","name":"assetId","type":"uint256"}],"name":"getWithdrawalBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"globalConfigurationHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"identify","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"","type":"bytes"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initializerSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assetType","type":"uint256"}],"name":"isAssetRegistered","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isFrozen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"testedAdmin","type":"address"}],"name":"isTokenAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"mainAcceptGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"mainCancelNomination","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"mainIsGovernor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newGovernor","type":"address"}],"name":"mainNominateNewGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"governorForRemoval","type":"address"}],"name":"mainRemoveGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"bytes","name":"assetInfo","type":"bytes"}],"name":"registerSystemAssetType","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"registerToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"registerToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAdmin","type":"address"}],"name":"registerTokenAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unFreeze","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"oldAdmin","type":"address"}],"name":"unregisterTokenAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"validatedSelectors","outputs":[{"internalType":"bytes4[]","name":"selectors","type":"bytes4[]"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"uint256","name":"ownerKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ownerKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"bytes","name":"mintingBlob","type":"bytes"}],"name":"withdrawAndMint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ownerKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawNft","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ownerKey","type":"uint256"},{"internalType":"uint256","name":"assetType","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawWithTokenId","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
608060405234801561001057600080fd5b50614c8c806100206000396000f3fe6080604052600436106102d35760003560e01c80638c4bce1c1161017b578063be2b1105116100d7578063e30a5cff11610085578063e30a5cff14610e5e578063e6de628214610e73578063ec3161b014610e88578063eeb7286614610eb8578063f2011f6614610ecd578063f637d95014610ef7578063fcb0582214610f21576102d3565b8063be2b110514610b96578063c1a8513014610bd2578063c23b60ef14610be7578063c8b1031a14610c71578063d88d8b3814610cf3578063d91443b714610dad578063dd7202d814610e34576102d3565b8063a6fa6e9011610134578063a6fa6e90146109d9578063abf98fe114610a0c578063adac3e1514610a42578063ae1cdde614610a57578063ae87381614610a93578063b12773fb14610ac9578063b766311214610b81576102d3565b80638c4bce1c146108bf578063993f3639146108f25780639ed1708414610907578063a1cc5e1314610943578063a1cc921e14610973578063a2bdde3d146109a6576102d3565b806333eeb1471161023557806364d84842116101e357806364d84842146107925780636ce5d957146102ff57806372eb3688146107c857806377e84e0d146107dd5780637cf12b90146107f25780637df7dc04146108075780637fbf9ba91461083d576102d3565b806333eeb147146106125780633cc660ad14610627578063439fab911461063c578063441a3e70146106b757806345f5cd97146106e757806349325bac1461071a5780634e8912da1461075c576102d3565b8063150b7a0211610292578063150b7a02146104365780631dbd1da7146104ee5780632505c3d91461053457806327b66a4d1461057057806328700a151461058557806329e411ac1461059a578063333ac20b146105dc576102d3565b8062717542146102d8578062aeef8a146102ff578063019b417a1461032a578063049f5ade146103605780630b3a2d211461039e5780630ebdac03146103d1575b600080fd5b3480156102e457600080fd5b506102ed610f5d565b60408051918252519081900360200190f35b6103286004803603606081101561031557600080fd5b5080359060208101359060400135610f64565b005b34801561033657600080fd5b506103286004803603606081101561034d57600080fd5b5080359060208101359060400135610fcd565b34801561036c57600080fd5b5061038a6004803603602081101561038357600080fd5b5035610fd8565b604080519115158252519081900360200190f35b3480156103aa57600080fd5b50610328600480360360208110156103c157600080fd5b50356001600160a01b0316610ff0565b3480156103dd57600080fd5b506103e6611097565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561042257818101518382015260200161040a565b505050509050019250505060405180910390f35b34801561044257600080fd5b506104d16004803603608081101561045957600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561049357600080fd5b8201836020820111156104a557600080fd5b803590602001918460018302840111600160201b831117156104c657600080fd5b5090925090506111b3565b604080516001600160e01b03199092168252519081900360200190f35b3480156104fa57600080fd5b506105186004803603602081101561051157600080fd5b50356111df565b604080516001600160a01b039092168252519081900360200190f35b34801561054057600080fd5b506103286004803603608081101561055757600080fd5b5080359060208101359060408101359060600135611224565b34801561057c57600080fd5b506102ed61139e565b34801561059157600080fd5b506103286113a7565b3480156105a657600080fd5b50610328600480360360a08110156105bd57600080fd5b50803590602081013590604081013590606081013590608001356113b1565b3480156105e857600080fd5b506102ed600480360360608110156105ff57600080fd5b50803590602081013590604001356115aa565b34801561061e57600080fd5b5061038a6115ce565b34801561063357600080fd5b506102ed6115de565b34801561064857600080fd5b506103286004803603602081101561065f57600080fd5b810190602081018135600160201b81111561067957600080fd5b82018360208201111561068b57600080fd5b803590602001918460018302840111600160201b831117156106ac57600080fd5b5090925090506115e3565b3480156106c357600080fd5b50610328600480360360408110156106da57600080fd5b5080359060200135611622565b3480156106f357600080fd5b5061038a6004803603602081101561070a57600080fd5b50356001600160a01b0316611766565b34801561072657600080fd5b50610328600480360360a081101561073d57600080fd5b5080359060208101359060408101359060608101359060800135611777565b34801561076857600080fd5b506102ed6004803603606081101561077f57600080fd5b5080359060208101359060400135611825565b34801561079e57600080fd5b50610328600480360360608110156107b557600080fd5b5080359060208101359060400135611849565b3480156107d457600080fd5b506103286119ba565b3480156107e957600080fd5b506102ed6119c2565b3480156107fe57600080fd5b506103286119c9565b34801561081357600080fd5b506103286004803603606081101561082a57600080fd5b5080359060208101359060400135611b08565b34801561084957600080fd5b506103286004803603604081101561086057600080fd5b81359190810190604081016020820135600160201b81111561088157600080fd5b82018360208201111561089357600080fd5b803590602001918460018302840111600160201b831117156108b457600080fd5b509092509050611bcd565b3480156108cb57600080fd5b50610328600480360360208110156108e257600080fd5b50356001600160a01b0316611cc0565b3480156108fe57600080fd5b506102ed611ccc565b34801561091357600080fd5b506103286004803603608081101561092a57600080fd5b5080359060208101359060408101359060600135611cd4565b34801561094f57600080fd5b506102ed6004803603604081101561096657600080fd5b5080359060200135611ce6565b34801561097f57600080fd5b506103286004803603602081101561099657600080fd5b50356001600160a01b0316611e0d565b3480156109b257600080fd5b5061038a600480360360208110156109c957600080fd5b50356001600160a01b0316611e16565b3480156109e557600080fd5b50610328600480360360208110156109fc57600080fd5b50356001600160a01b0316611e34565b348015610a1857600080fd5b506102ed60048036036060811015610a2f57600080fd5b5080359060208101359060400135611ed8565b348015610a4e57600080fd5b506102ed611f10565b348015610a6357600080fd5b5061032860048036036080811015610a7a57600080fd5b5080359060208101359060408101359060600135611f1e565b348015610a9f57600080fd5b5061032860048036036060811015610ab657600080fd5b5080359060208101359060400135611fc5565b348015610ad557600080fd5b506102ed60048036036040811015610aec57600080fd5b81359190810190604081016020820135600160201b811115610b0d57600080fd5b820183602082011115610b1f57600080fd5b803590602001918460018302840111600160201b83111715610b4057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506120f3945050505050565b348015610b8d57600080fd5b506102ed6121b4565b348015610ba257600080fd5b5061032860048036036080811015610bb957600080fd5b50803590602081013590604081013590606001356121bb565b348015610bde57600080fd5b506102ed612365565b348015610bf357600080fd5b50610bfc612373565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610c36578181015183820152602001610c1e565b50505050905090810190601f168015610c635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610c7d57600080fd5b5061032860048036036040811015610c9457600080fd5b81359190810190604081016020820135600160201b811115610cb557600080fd5b820183602082011115610cc757600080fd5b803590602001918460018302840111600160201b83111715610ce857600080fd5b50909250905061238f565b348015610cff57600080fd5b5061032860048036036060811015610d1657600080fd5b81359190810190604081016020820135600160201b811115610d3757600080fd5b820183602082011115610d4957600080fd5b803590602001918460018302840111600160201b83111715610d6a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061238f915050565b348015610db957600080fd5b5061032860048036036060811015610dd057600080fd5b813591602081013591810190606081016040820135600160201b811115610df657600080fd5b820183602082011115610e0857600080fd5b803590602001918460018302840111600160201b83111715610e2957600080fd5b5090925090506123d3565b348015610e4057600080fd5b506102ed60048036036020811015610e5757600080fd5b50356125c9565b348015610e6a57600080fd5b506102ed6125fa565b348015610e7f57600080fd5b506102ed6125ff565b348015610e9457600080fd5b506102ed60048036036040811015610eab57600080fd5b5080359060200135612604565b348015610ec457600080fd5b50610bfc612633565b348015610ed957600080fd5b506102ed60048036036020811015610ef057600080fd5b5035612653565b348015610f0357600080fd5b50610bfc60048036036020811015610f1a57600080fd5b503561266d565b348015610f2d57600080fd5b5061032860048036036080811015610f4457600080fd5b508035906020810135906040810135906060013561276e565b62093a8081565b610f6d826127d7565b610fb3576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b610fc8838383610fc386346127fb565b611224565b505050565b610fc8838383611849565b60008181526015602052604090205460ff165b919050565b610ff933612868565b61103c576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6001600160a01b038116600081815260116020908152604091829020805460ff19166001179055815192835290517f9085a9044aeb6daeeb5b4bf84af42b1a1613d4056f503c4e992b6396c16bd52f9281900390910190a150565b60408051600380825260808201909252606091906000908260208201858036833750508151919450506001820191631f7df70160e21b9185919081106110d957fe5b6001600160e01b031990921660209283029190910190910152825160018201916357439c0b60e11b91859190811061110d57fe5b6001600160e01b03199092166020928302919091019091015282516001820191630441a3e760e41b91859190811061114157fe5b6001600160e01b0319909216602092830291909101909101528082146111ae576040805162461bcd60e51b815260206004820181905260248201527f494e434f52524543545f53454c4543544f52535f41525241595f4c454e475448604482015290519081900360640190fd5b505090565b60006001600160a01b03861630146111cc5760006111d5565b630a85bd0160e11b5b9695505050505050565b6000818152601860205260408120546001600160a01b03168015611204579050610feb565b6001600160a01b038316831461121b57600061121d565b825b9392505050565b61122c6115ce565b15611270576040805162461bcd60e51b815260206004820152600f60248201526e29aa20aa22afa4a9afa32927ad22a760891b604482015290519081900360640190fd5b61127983612897565b156112c1576040805162461bcd60e51b81526020600482015260136024820152724d494e5441424c455f41535345545f5459504560681b604482015290519081900360640190fd5b6112ca836128db565b611315576040805162461bcd60e51b81526020600482015260176024820152764e4f4e5f46554e4749424c455f41535345545f5459504560481b604482015290519081900360640190fd5b826113228582858561293a565b5061132d8483612a2f565b7f06724742ccc8c330a39a641ef02a0b419bd09248360680bb38159b0a8c2635d63386858761135c8988612cf4565b604080516001600160a01b0390961686526020860194909452848401929092526060840152608083015260a08201859052519081900360c00190a15050505050565b600160401b5490565b6113af612d65565b565b6113b96115ce565b156113fd576040805162461bcd60e51b815260206004820152600f60248201526e29aa20aa22afa4a9afa32927ad22a760891b604482015290519081900360640190fd5b61140684612de9565b61144c576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b60006114588585611ce6565b905060006114688783868661293a565b905061147386612e2d565b1561151c5760018111156114c6576040805162461bcd60e51b81526020600482015260156024820152741253131151d05317d15490cdcc8c57d05353d55395605a1b604482015290519081900360640190fd5b6040805133815260208101899052808201869052606081018890526080810187905260a0810184905290517f0fcf2162832b2d6033d4d34d2f45a28d9cfee523f1899945bbdd32529cfda67b9181900360c00190a15b611527868685612e40565b7fed94dc026fa9364c53bc0af51cde7f54f3109b3f31fceb26d01396d80e20453b3388868989876115588d8b612cf4565b604080516001600160a01b0390981688526020880196909652868601949094526060860192909252608085015260a084015260c083015260e0820186905251908190036101000190a150505050505050565b60009283526007602090815260408085209385529281528284209184525290205490565b600454600160a01b900460ff1690565b600090565b6040805162461bcd60e51b815260206004820152600f60248201526e1393d517d253541311535153951151608a1b604482015290519081900360640190fd5b600061162d83612f04565b905061163882612897565b15611680576040805162461bcd60e51b81526020600482015260136024820152724d494e5441424c455f41535345545f5459504560681b604482015290519081900360640190fd5b611689826128db565b6116d4576040805162461bcd60e51b81526020600482015260176024820152764e4f4e5f46554e4749424c455f41535345545f5459504560481b604482015290519081900360640190fd5b60008381526008602090815260408083208584529091528120805491905582906116ff838383612f60565b7fb7477a7b93b2addc5272bbd7ad0986ef1c0d0bd265f26c3dc4bbe42727c2ac0c858561172c8785612cf4565b60408051938452602084019290925282820152606082018490526001600160a01b0386166080830152519081900360a00190a15050505050565b600061177182612868565b92915050565b61177f6115ce565b156117c3576040805162461bcd60e51b815260206004820152600f60248201526e29aa20aa22afa4a9afa32927ad22a760891b604482015290519081900360640190fd5b6117cc846131f7565b611811576040805162461bcd60e51b81526020600482015260116024820152702727aa2fa2a92198989a9aafaa27a5a2a760791b604482015290519081900360640190fd5b61181e85858585856113b1565b5050505050565b60009283526006602090815260408085209385529281528284209184525290205490565b61185282612de9565b611898576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b60006118a48383611ce6565b905060006118b185612f04565b6000868152600860209081526040808320868452909152812080549190559091506118de8286868461320a565b6118e785612e2d565b15611943576040805187815260208101879052808201869052606081018590526001600160a01b038416608082015290517fa5cfa8e2199ec5b8ca319288bcab72734207d30569756ee594a74b4df7abbf419181900360a00190a15b7fc6ba68235f3229e53f3a95cda25543ad54c0f6df2493a06c05fb930bea7966fe868686866119728a87612cf4565b604080519586526020860194909452848401929092526060840152608083015260a082018490526001600160a01b03851660c0830152519081900360e00190a1505050505050565b6113af6132d0565b6202a30081565b6119d16115ce565b611a15576040805162461bcd60e51b815260206004820152601060248201526f29aa20aa22afa727aa2fa32927ad22a760811b604482015290519081900360640190fd5b611a1e33612868565b611a61576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b600554421015611ab3576040805162461bcd60e51b8152602060048201526018602482015277155391949151569157d393d517d0531313d5d15117d6515560421b604482015290519081900360640190fd5b6004805460ff60a01b19169055600d805460019081019091556025805482019055600f805490910190556040517f07017fe9180629cfffba412f65a9affcf9a121de02294179f5c058f881dcc9f890600090a1565b82611b1281612f04565b6001600160a01b0316336001600160a01b031614611b65576040805162461bcd60e51b815260206004820152601a6024820152600080516020614bc6833981519152604482015290519081900360640190fd5b60008481526007602090815260408083208684528252808320858452825291829020429055815186815290810184905280820185905290517f0bc1df35228095c37da66a6ffcc755ea79dfc437345685f618e05fafad6b445e9181900360600190a150505050565b611bd633611e16565b611c1b576040805162461bcd60e51b815260206004820152601160248201527027a7262cafaa27a5a2a729afa0a226a4a760791b604482015290519081900360640190fd5b600160401b5415611c73576040805162461bcd60e51b815260206004820152601d60248201527f53595354454d5f41535345545f545950455f414c52454144595f534554000000604482015290519081900360640190fd5b600160401b839055611c88838383600161337a565b6040805184815290517f51f48293a5ef1940e2b4eb2580372cf384aaa5bc739639e4624ce8d18c9644ab9181900360200190a1505050565b611cc98161371c565b50565b6301e1338081565b611ce084848484611224565b50505050565b6000611cf183612de9565b611d2c5760405162461bcd60e51b8152600401808060200182810382526021815260200180614c106021913960400191505060405180910390fd5b6060611d3784612e2d565b611d66576040518060400160405280600d81526020016c2727a72fa6a4a72a20a126229d60991b815250611d84565b6040518060400160405280600481526020016327232a1d60e11b8152505b90506001600160fa1b038185856040516020018084805190602001908083835b60208310611dc35780518252601f199092019160209182019101611da4565b51815160209384036101000a600019018019909216911617905292019485525083810192909252506040805180840383018152928101905281519101209190911695945050505050565b611cc9816138bc565b6001600160a01b031660009081526011602052604090205460ff1690565b611e3d33612868565b611e80576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6001600160a01b038116600081815260116020908152604091829020805460ff19169055815192835290517ffa49aecb996ea8d99950bb051552dfcc0b5460a0bb209867a1ed8067c32c21779281900390910190a150565b600083815260066020908152604080832085845282528083208484529091528120548390611f07908290612cf4565b95945050505050565b680100000000000000015481565b611f266115ce565b15611f6a576040805162461bcd60e51b815260206004820152600f60248201526e29aa20aa22afa4a9afa32927ad22a760891b604482015290519081900360640190fd5b611f7383612e2d565b611fb7576040805162461bcd60e51b815260206004820152601060248201526f2727aa2fa2a9219b9918afaa27a5a2a760811b604482015290519081900360640190fd5b611ce08484838560016113b1565b82611fcf81612f04565b6001600160a01b0316336001600160a01b031614612022576040805162461bcd60e51b815260206004820152601a6024820152600080516020614bc6833981519152604482015290519081900360640190fd5b61202b836128db565b612076576040805162461bcd60e51b81526020600482015260176024820152764e4f4e5f46554e4749424c455f41535345545f5459504560481b604482015290519081900360640190fd5b826000612084868386613a09565b9050612091338683612f60565b7fe3e46ecf1138180bf93cba62a0b7e661d976a8ab3d40243f7b082667d8f500af8685876120bf8986612cf4565b60408051948552602085019390935283830191909152606083015260808201849052519081900360a00190a1505050505050565b600080828051906020012060001c9050600160fa1b6001600160f01b036040518060400160405280600981526020016826a4a72a20a126229d60b91b81525086846040516020018084805190602001908083835b602083106121665780518252601f199092019160209182019101612147565b51815160209384036101000a60001901801990921691161790529201948552508381019290925250604080518084038301815292810190528151910120919091169190911795945050505050565b6224ea0081565b836121c581612f04565b6001600160a01b0316336001600160a01b031614612218576040805162461bcd60e51b815260206004820152601a6024820152600080516020614bc6833981519152604482015290519081900360640190fd5b61222184612de9565b612267576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b60006122738585611ce6565b90506000612282878386613a09565b90508015612296576122963387878461320a565b61229f86612e2d565b156122f3576040805188815260208101869052808201889052606081018790526080810184905290517ff00c0c1a754f6df7545d96a7e12aad552728b94ca6aa94f81e297bdbcf1dab9c9181900360a00190a15b7fcc00f2179d127845242252f3c3b6b238c5ed33c2e933179f09653cfb1cdee7ca87858888866123238c88612cf4565b604080519687526020870195909552858501939093526060850191909152608084015260a083015260c08201849052519081900360e00190a150505050505050565b680100000000000000045481565b604051806060016040528060268152602001614c316026913981565b6040805162461bcd60e51b81526020600482015260146024820152732aa729aaa82827a92a22a22fa32aa721aa24a7a760611b604482015290519081900360640190fd5b60006123de85612f04565b60008581526015602052604090205490915060ff16612439576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b61244284612897565b61248d576040805162461bcd60e51b81526020600482015260176024820152764e4f4e5f4d494e5441424c455f41535345545f5459504560481b604482015290519081900360640190fd5b60006124cf8585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506120f392505050565b600087815260086020908152604080832084845290915290205490915061253d576040805162461bcd60e51b815260206004820152601d60248201527f4e4f5f50454e44494e475f5749544844524157414c5f42414c414e4345000000604482015290519081900360640190fd5b6000868152600860209081526040808320848452909152812080549190556125688682858888613b16565b7f7e6e15df814c1a309a57686de672b2bedd128eacde35c5370c36d6840d4e9a9287876125958985612cf4565b604080519384526020840192909252828201526060820184905260808201859052519081900360a00190a150505050505050565b60008181526015602052604081205460ff166125e757506001610feb565b5060009081526016602052604090205490565b600a81565b604081565b6000828152600860209081526040808320848452909152812054829061262b908290612cf4565b949350505050565b60606040518060600160405280602a8152602001614be6602a9139905090565b680100000000000000026020526000908152604090205481565b60008181526015602052604090205460609060ff166126cf576040805162461bcd60e51b81526020600482015260196024820152781054d4d15517d516541157d393d517d49151d254d511549151603a1b604482015290519081900360640190fd5b60008281526014602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156127625780601f1061273757610100808354040283529160200191612762565b820191906000526020600020905b81548152906001019060200180831161274557829003601f168201915b50505050509050919050565b8361277881612f04565b6001600160a01b0316336001600160a01b0316146127cb576040805162461bcd60e51b815260206004820152601a6024820152600080516020614bc6833981519152604482015290519081900360640190fd5b61181e858584866121bb565b60006341917ff960e11b6127ea83613cb8565b6001600160e01b0319161492915050565b600080612807846125c9565b905080838161281257fe5b0615612856576040805162461bcd60e51b815260206004820152600e60248201526d1253959053125117d05353d5539560921b604482015290519081900360640190fd5b80838161285f57fe5b04949350505050565b600080612873613ccb565b6001600160a01b039390931660009081526020939093525050604090205460ff1690565b6000806128a383613cb8565b90506001600160e01b031981166368646e2d60e01b148061121d57506001600160e01b03198116635c5c333960e11b14915050919050565b6000806128e783613cb8565b90506001600160e01b031981166341917ff960e11b148061291857506001600160e01b03198116630f47261b60e41b145b8061121d57506001600160e01b031981166368646e2d60e01b14915050919050565b600084815260066020908152604080832086845282528083208584529091528120548201828110156129a6576040805162461bcd60e51b815260206004820152601060248201526f4445504f5349545f4f564552464c4f5760801b604482015290519081900360640190fd5b6000868152600660209081526040808320888452825280832087845290915290208190556129d386613d48565b80156129ff57506000868152600760209081526040808320888452825280832087845290915290205415155b15611f07576000868152600760209081526040808320888452825280832087845290915281205595945050505050565b6000612a3b8383612cf4565b9050612a4683613d6e565b15612c485781612a565750612cf0565b6000612a6184613d81565b905060008190506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015612ab757600080fd5b505afa158015612acb573d6000803e3d6000fd5b505050506040513d6020811015612ae157600080fd5b50516040805133602482015230604482015260648082018890528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052909150612b3d6001600160a01b03851682613d94565b6000836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015612b8c57600080fd5b505afa158015612ba0573d6000803e3d6000fd5b505050506040513d6020811015612bb657600080fd5b5051905082811015612bfa576040805162461bcd60e51b81526020600482015260086024820152674f564552464c4f5760c01b604482015290519081900360640190fd5b8583018114612c3e576040805162461bcd60e51b815260206004820152601c6024820152600080516020614ba6833981519152604482015290519081900360640190fd5b5050505050610fc8565b612c51836127d7565b15612caa57803414612ca5576040805162461bcd60e51b8152602060048201526018602482015277125390d3d4949150d517d1115413d4d25517d05353d5539560421b604482015290519081900360640190fd5b610fc8565b6040805162461bcd60e51b8152602060048201526016602482015275554e535550504f525445445f544f4b454e5f5459504560501b604482015290519081900360640190fd5b5050565b600080612d00846125c9565b9050808302915082818381612d1157fe5b0414612d5e576040805162461bcd60e51b815260206004820152601760248201527644455155414e54495a4154494f4e5f4f564552464c4f5760481b604482015290519081900360640190fd5b5092915050565b6000612d6f613ccb565b60018101549091506001600160a01b03163314612dcd576040805162461bcd60e51b815260206004820152601760248201527627a7262cafa1a0a72224a220aa22afa3a7ab22a92727a960491b604482015290519081900360640190fd5b612dd633613f80565b60010180546001600160a01b0319169055565b600080612df583613cb8565b90506001600160e01b0319811663012b8bc960e11b148061121d57506001600160e01b03198116633348691d60e01b14915050919050565b600063012b8bc960e11b6127ea83613cb8565b612e4983612de9565b612e90576040805162461bcd60e51b815260206004820152601360248201527246554e4749424c455f41535345545f5459504560681b604482015290519081900360640190fd5b612e9983612e2d565b15612ef35780600114612ee9576040805162461bcd60e51b8152602060048201526013602482015272494c4c4547414c5f4e46545f42414c414e434560681b604482015290519081900360640190fd5b612ca58383614034565b8015610fc857610fc88383836140e7565b6000612f0f826111df565b90506001600160a01b038116610feb576040805162461bcd60e51b81526020600482015260116024820152701554d15497d553949151d254d511549151607a1b604482015290519081900360640190fd5b6001600160a01b038316612faf576040805162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015290519081900360640190fd5b6000612fbb8383612cf4565b9050612fc683613d6e565b156131c65781612fd65750610fc8565b6000612fe184613d81565b905060008190506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561303757600080fd5b505afa15801561304b573d6000803e3d6000fd5b505050506040513d602081101561306157600080fd5b5051604080516001600160a01b03808b16602483015260448083018990528351808403909101815260649092019092526020810180516001600160e01b031663a9059cbb60e01b1790529192506130ba90851682613d94565b6000836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561310957600080fd5b505afa15801561311d573d6000803e3d6000fd5b505050506040513d602081101561313357600080fd5b5051905082811115613178576040805162461bcd60e51b8152602060048201526009602482015268554e444552464c4f5760b81b604482015290519081900360640190fd5b85830381146131bc576040805162461bcd60e51b815260206004820152601c6024820152600080516020614ba6833981519152604482015290519081900360640190fd5b5050505050611ce0565b6131cf836127d7565b15612caa57816131df5750610fc8565b6131f26001600160a01b038516826143fd565b611ce0565b6000633348691d60e01b6127ea83613cb8565b61321383612de9565b61325a576040805162461bcd60e51b815260206004820152601360248201527246554e4749424c455f41535345545f5459504560681b604482015290519081900360640190fd5b61326383612e2d565b156132be57806001146132b3576040805162461bcd60e51b8152602060048201526013602482015272494c4c4547414c5f4e46545f42414c414e434560681b604482015290519081900360640190fd5b6131f28484846144a3565b8015611ce057611ce0848484846145a8565b6132d933612868565b61331c576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6000613326613ccb565b60018101549091506001600160a01b031615611cc9576001810180546001600160a01b03191690556040517f7a8dc7dd7fffb43c4807438fa62729225156941e641fd877938f4edade3429f590600090a150565b61338333611e16565b6133c8576040805162461bcd60e51b815260206004820152601160248201527027a7262cafaa27a5a2a729afa0a226a4a760791b604482015290519081900360640190fd5b6133d184610fd8565b1561341e576040805162461bcd60e51b81526020600482015260186024820152771054d4d15517d053149150511657d49151d254d51154915160421b604482015290519081900360640190fd5b600167080000000000001160c01b018410613475576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b600081116134bc576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f5155414e54554d60881b604482015290519081900360640190fd5b600160801b8110613506576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f5155414e54554d60881b604482015290519081900360640190fd5b60006001600160fa1b0384848460405160200180848480828437919091019283525050604080518083038152602092830190915280519101209290921692505050848114613590576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b6135cf84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061489592505050565b61360e84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250614a1192505050565b1561365e578160011461365e576040805162461bcd60e51b8152602060048201526013602482015272494e56414c49445f4e46545f5155414e54554d60681b604482015290519081900360640190fd5b6000858152601560209081526040808320805460ff191660011790556014909152902061368c908585614b12565b508160166000878152602001908152602001600020819055507f7a0efbc885500f3b4a895231945be4520e4c0ba5ef7274a225a0272c81ccbcb78585858560405180858152602001806020018381526020018281038252858582818152602001925080828437600083820152604051601f909101601f191690920182900397509095505050505050a15050505050565b61372533612868565b613768576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6000613772613ccb565b90506001600160a01b0382166137bd576040805162461bcd60e51b815260206004820152600b60248201526a4241445f4144445245535360a81b604482015290519081900360640190fd5b6137c682612868565b1561380b576040805162461bcd60e51b815260206004820152601060248201526f20a62922a0a22cafa3a7ab22a92727a960811b604482015290519081900360640190fd5b60018101546001600160a01b031615613865576040805162461bcd60e51b81526020600482015260176024820152764f544845525f43414e4449444154455f50454e44494e4760481b604482015290519081900360640190fd5b6001810180546001600160a01b0384166001600160a01b0319909116811790915560408051918252517f6166272c8d3f5f579082f2827532732f97195007983bb5b83ac12c56700b01a69181900360200190a15050565b6138c533612868565b613908576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b336001600160a01b038216141561395d576040805162461bcd60e51b8152602060048201526014602482015273474f5645524e4f525f53454c465f52454d4f564560601b604482015290519081900360640190fd5b6000613967613ccb565b905061397282612868565b6139b2576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa3a7ab22a92727a960a11b604482015290519081900360640190fd5b6001600160a01b03821660008181526020838152604091829020805460ff19169055815192835290517fd75f94825e770b8b512be8e74759e252ad00e102e38f50cce2f7c6f868a295999281900390910190a15050565b6000838152600760209081526040808320858452825280832084845290915281205480613a74576040805162461bcd60e51b815260206004820152601460248201527311115413d4d25517d393d517d0d05390d153115160621b604482015290519081900360640190fd5b6202a30081810190811015613a8557fe5b80421015613acb576040805162461bcd60e51b815260206004820152600e60248201526d11115413d4d25517d313d0d2d15160921b604482015290519081900360640190fd5b50505060008381526006602090815260408083208584528252808320848452825280832080549084905595835260078252808320948352938152838220928252919091529081205590565b6001600160a01b038316613b65576040805162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015290519081900360640190fd5b613b6e85612897565b613bb9576040805162461bcd60e51b81526020600482015260176024820152764e4f4e5f4d494e5441424c455f41535345545f5459504560481b604482015290519081900360640190fd5b60008411613c04576040805162461bcd60e51b81526020600482015260136024820152721253959053125117d352539517d05353d55395606a1b604482015290519081900360640190fd5b6000613c108686612cf4565b90506000613c1d87613d81565b9050613caf8583868660405160240180856001600160a01b0316815260200184815260200180602001828103825284848281815260200192508082843760008184015260408051601f19601f9093018316909401848103909201845252506020810180516319ee6e3f60e01b6001600160e01b039091161790526001600160a01b03891696509450613d949350505050565b50505050505050565b6000611771613cc68361266d565b614a55565b600080604051806060016040528060268152602001614c31602691396040518082805190602001908083835b60208310613d165780518252601f199092019160209182019101613cf7565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209392505050565b6000613d53826111df565b6001600160a01b0316336001600160a01b0316149050919050565b6000630f47261b60e41b6127ea83613cb8565b6000611771613d8f8361266d565b614a66565b613d9d82614a6d565b613de2576040805162461bcd60e51b81526020600482015260116024820152704241445f544f4b454e5f4144445245535360781b604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310613e205780518252601f199092019160209182019101613e01565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613e82576040519150601f19603f3d011682016040523d82523d6000602084013e613e87565b606091505b5091509150818190613f175760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613edc578181015183820152602001613ec4565b50505050905090810190601f168015613f095780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50805115611ce057808060200190516020811015613f3457600080fd5b5051611ce0576040805162461bcd60e51b81526020600482015260166024820152751513d2d15397d3d4115490551253d397d1905253115160521b604482015290519081900360640190fd5b613f8981612868565b15613fce576040805162461bcd60e51b815260206004820152601060248201526f20a62922a0a22cafa3a7ab22a92727a960811b604482015290519081900360640190fd5b6000613fd8613ccb565b6001600160a01b03831660008181526020838152604091829020805460ff19166001179055815192835290519293507fcfb473e6c03f9a29ddaf990e736fa3de5188a0bd85d684f5b6e164ebfbfff5d292918290030190a15050565b61403d82612e2d565b614081576040805162461bcd60e51b815260206004820152601060248201526f2727aa2fa2a9219b9918afaa27a5a2a760811b604482015290519081900360640190fd5b600061408c83613d81565b6040805133602482015230604482015260648082018690528251808303909101815260849091019091526020810180516001600160e01b0316632142170760e11b179052909150610fc8906001600160a01b03831690613d94565b6140f0836131f7565b614135576040805162461bcd60e51b81526020600482015260116024820152702727aa2fa2a92198989a9aafaa27a5a2a760791b604482015290519081900360640190fd5b8061413f57610fc8565b600061414b8483612cf4565b9050600061415885613d81565b60408051627eeac760e11b815230600482015260248101879052905191925082916000916001600160a01b0384169162fdd58e91604480820192602092909190829003018186803b1580156141ac57600080fd5b505afa1580156141c0573d6000803e3d6000fd5b505050506040513d60208110156141d657600080fd5b810190808051906020019092919050505090506142eb63f242432a60e01b333089886040518060200160405280600081525060405160240180866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561427257818101518382015260200161425a565b50505050905090810190601f16801561429f5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909a169990991790985250506001600160a01b038a1695945050613d9492505050565b6000826001600160a01b031662fdd58e30896040518363ffffffff1660e01b815260040180836001600160a01b031681526020018281526020019250505060206040518083038186803b15801561434157600080fd5b505afa158015614355573d6000803e3d6000fd5b505050506040513d602081101561436b57600080fd5b50519050818110156143af576040805162461bcd60e51b81526020600482015260086024820152674f564552464c4f5760c01b604482015290519081900360640190fd5b84820181146143f3576040805162461bcd60e51b815260206004820152601c6024820152600080516020614ba6833981519152604482015290519081900360640190fd5b5050505050505050565b8061440757612cf0565b6040516000906001600160a01b0384169083908381818185875af1925050503d8060008114614452576040519150601f19603f3d011682016040523d82523d6000602084013e614457565b606091505b5050905080610fc8576040805162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b6001600160a01b0383166144f2576040805162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015290519081900360640190fd5b6144fb82612e2d565b61453f576040805162461bcd60e51b815260206004820152601060248201526f2727aa2fa2a9219b9918afaa27a5a2a760811b604482015290519081900360640190fd5b600061454a83613d81565b604080513060248201526001600160a01b03808816604483015260648083018790528351808403909101815260849092019092526020810180516001600160e01b0316632142170760e11b179052919250611ce09190831690613d94565b6001600160a01b0384166145f7576040805162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015290519081900360640190fd5b614600836131f7565b614645576040805162461bcd60e51b81526020600482015260116024820152702727aa2fa2a92198989a9aafaa27a5a2a760791b604482015290519081900360640190fd5b8061464f57611ce0565b600061465b8483612cf4565b9050600061466885613d81565b60408051627eeac760e11b815230600482015260248101879052905191925082916000916001600160a01b0384169162fdd58e91604480820192602092909190829003018186803b1580156146bc57600080fd5b505afa1580156146d0573d6000803e3d6000fd5b505050506040513d60208110156146e657600080fd5b8101908080519060200190929190505050905061478163f242432a60e01b308a89886040518060200160405280600081525060405160240180866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360008381101561427257818101518382015260200161425a565b6000826001600160a01b031662fdd58e30896040518363ffffffff1660e01b815260040180836001600160a01b031681526020018281526020019250505060206040518083038186803b1580156147d757600080fd5b505afa1580156147eb573d6000803e3d6000fd5b505050506040513d602081101561480157600080fd5b5051905081811115614846576040805162461bcd60e51b8152602060048201526009602482015268554e444552464c4f5760b81b604482015290519081900360640190fd5b848203811461488a576040805162461bcd60e51b815260206004820152601c6024820152600080516020614ba6833981519152604482015290519081900360640190fd5b505050505050505050565b60006148a082614a55565b90506148ab81614a73565b6148f5576040805162461bcd60e51b8152602060048201526016602482015275554e535550504f525445445f544f4b454e5f5459504560501b604482015290519081900360640190fd5b6001600160e01b031981166341917ff960e11b141561496057815160041461495b576040805162461bcd60e51b8152602060048201526014602482015273494e56414c49445f41535345545f535452494e4760601b604482015290519081900360640190fd5b612cf0565b81516024146149ad576040805162461bcd60e51b8152602060048201526014602482015273494e56414c49445f41535345545f535452494e4760601b604482015290519081900360640190fd5b60006149b883614a66565b90506149cc816001600160a01b0316614a6d565b610fc8576040805162461bcd60e51b81526020600482015260116024820152704241445f544f4b454e5f4144445245535360781b604482015290519081900360640190fd5b600080614a1d83614a55565b90506001600160e01b0319811663012b8bc960e11b148061121d57506001600160e01b03198116635c5c333960e11b14915050919050565b602001516001600160e01b03191690565b6024015190565b3b151590565b60006001600160e01b031982166341917ff960e11b1480614aa457506001600160e01b03198216630f47261b60e41b145b80614abf57506001600160e01b0319821663012b8bc960e11b145b80614ada57506001600160e01b031982166368646e2d60e01b145b80614af557506001600160e01b03198216635c5c333960e11b145b806117715750506001600160e01b031916633348691d60e01b1490565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10614b535782800160ff19823516178555614b80565b82800160010185558215614b80579182015b82811115614b80578235825591602001919060010190614b65565b50614b8c929150614b90565b5090565b5b80821115614b8c5760008155600101614b9156fe494e434f52524543545f414d4f554e545f5452414e53464552524544000000004d49534d41544348494e475f535441524b5f4554485f4b455953000000000000537461726b576172655f50657270657475616c546f6b656e73416e6452616d70696e675f323032325f3241535345545f545950455f444f45535f4e4f545f54414b455f544f4b454e5f4944537461726b45782e4d61696e2e323031392e476f7665726e6f7273496e666f726d6174696f6ea2646970667358221220782f5efb1b7d337c080de156a618913a23577bc8195f9788bb072e369c453b2964736f6c634300060c0033
Deployed Bytecode
0x6080604052600436106102d35760003560e01c80638c4bce1c1161017b578063be2b1105116100d7578063e30a5cff11610085578063e30a5cff14610e5e578063e6de628214610e73578063ec3161b014610e88578063eeb7286614610eb8578063f2011f6614610ecd578063f637d95014610ef7578063fcb0582214610f21576102d3565b8063be2b110514610b96578063c1a8513014610bd2578063c23b60ef14610be7578063c8b1031a14610c71578063d88d8b3814610cf3578063d91443b714610dad578063dd7202d814610e34576102d3565b8063a6fa6e9011610134578063a6fa6e90146109d9578063abf98fe114610a0c578063adac3e1514610a42578063ae1cdde614610a57578063ae87381614610a93578063b12773fb14610ac9578063b766311214610b81576102d3565b80638c4bce1c146108bf578063993f3639146108f25780639ed1708414610907578063a1cc5e1314610943578063a1cc921e14610973578063a2bdde3d146109a6576102d3565b806333eeb1471161023557806364d84842116101e357806364d84842146107925780636ce5d957146102ff57806372eb3688146107c857806377e84e0d146107dd5780637cf12b90146107f25780637df7dc04146108075780637fbf9ba91461083d576102d3565b806333eeb147146106125780633cc660ad14610627578063439fab911461063c578063441a3e70146106b757806345f5cd97146106e757806349325bac1461071a5780634e8912da1461075c576102d3565b8063150b7a0211610292578063150b7a02146104365780631dbd1da7146104ee5780632505c3d91461053457806327b66a4d1461057057806328700a151461058557806329e411ac1461059a578063333ac20b146105dc576102d3565b8062717542146102d8578062aeef8a146102ff578063019b417a1461032a578063049f5ade146103605780630b3a2d211461039e5780630ebdac03146103d1575b600080fd5b3480156102e457600080fd5b506102ed610f5d565b60408051918252519081900360200190f35b6103286004803603606081101561031557600080fd5b5080359060208101359060400135610f64565b005b34801561033657600080fd5b506103286004803603606081101561034d57600080fd5b5080359060208101359060400135610fcd565b34801561036c57600080fd5b5061038a6004803603602081101561038357600080fd5b5035610fd8565b604080519115158252519081900360200190f35b3480156103aa57600080fd5b50610328600480360360208110156103c157600080fd5b50356001600160a01b0316610ff0565b3480156103dd57600080fd5b506103e6611097565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561042257818101518382015260200161040a565b505050509050019250505060405180910390f35b34801561044257600080fd5b506104d16004803603608081101561045957600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561049357600080fd5b8201836020820111156104a557600080fd5b803590602001918460018302840111600160201b831117156104c657600080fd5b5090925090506111b3565b604080516001600160e01b03199092168252519081900360200190f35b3480156104fa57600080fd5b506105186004803603602081101561051157600080fd5b50356111df565b604080516001600160a01b039092168252519081900360200190f35b34801561054057600080fd5b506103286004803603608081101561055757600080fd5b5080359060208101359060408101359060600135611224565b34801561057c57600080fd5b506102ed61139e565b34801561059157600080fd5b506103286113a7565b3480156105a657600080fd5b50610328600480360360a08110156105bd57600080fd5b50803590602081013590604081013590606081013590608001356113b1565b3480156105e857600080fd5b506102ed600480360360608110156105ff57600080fd5b50803590602081013590604001356115aa565b34801561061e57600080fd5b5061038a6115ce565b34801561063357600080fd5b506102ed6115de565b34801561064857600080fd5b506103286004803603602081101561065f57600080fd5b810190602081018135600160201b81111561067957600080fd5b82018360208201111561068b57600080fd5b803590602001918460018302840111600160201b831117156106ac57600080fd5b5090925090506115e3565b3480156106c357600080fd5b50610328600480360360408110156106da57600080fd5b5080359060200135611622565b3480156106f357600080fd5b5061038a6004803603602081101561070a57600080fd5b50356001600160a01b0316611766565b34801561072657600080fd5b50610328600480360360a081101561073d57600080fd5b5080359060208101359060408101359060608101359060800135611777565b34801561076857600080fd5b506102ed6004803603606081101561077f57600080fd5b5080359060208101359060400135611825565b34801561079e57600080fd5b50610328600480360360608110156107b557600080fd5b5080359060208101359060400135611849565b3480156107d457600080fd5b506103286119ba565b3480156107e957600080fd5b506102ed6119c2565b3480156107fe57600080fd5b506103286119c9565b34801561081357600080fd5b506103286004803603606081101561082a57600080fd5b5080359060208101359060400135611b08565b34801561084957600080fd5b506103286004803603604081101561086057600080fd5b81359190810190604081016020820135600160201b81111561088157600080fd5b82018360208201111561089357600080fd5b803590602001918460018302840111600160201b831117156108b457600080fd5b509092509050611bcd565b3480156108cb57600080fd5b50610328600480360360208110156108e257600080fd5b50356001600160a01b0316611cc0565b3480156108fe57600080fd5b506102ed611ccc565b34801561091357600080fd5b506103286004803603608081101561092a57600080fd5b5080359060208101359060408101359060600135611cd4565b34801561094f57600080fd5b506102ed6004803603604081101561096657600080fd5b5080359060200135611ce6565b34801561097f57600080fd5b506103286004803603602081101561099657600080fd5b50356001600160a01b0316611e0d565b3480156109b257600080fd5b5061038a600480360360208110156109c957600080fd5b50356001600160a01b0316611e16565b3480156109e557600080fd5b50610328600480360360208110156109fc57600080fd5b50356001600160a01b0316611e34565b348015610a1857600080fd5b506102ed60048036036060811015610a2f57600080fd5b5080359060208101359060400135611ed8565b348015610a4e57600080fd5b506102ed611f10565b348015610a6357600080fd5b5061032860048036036080811015610a7a57600080fd5b5080359060208101359060408101359060600135611f1e565b348015610a9f57600080fd5b5061032860048036036060811015610ab657600080fd5b5080359060208101359060400135611fc5565b348015610ad557600080fd5b506102ed60048036036040811015610aec57600080fd5b81359190810190604081016020820135600160201b811115610b0d57600080fd5b820183602082011115610b1f57600080fd5b803590602001918460018302840111600160201b83111715610b4057600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506120f3945050505050565b348015610b8d57600080fd5b506102ed6121b4565b348015610ba257600080fd5b5061032860048036036080811015610bb957600080fd5b50803590602081013590604081013590606001356121bb565b348015610bde57600080fd5b506102ed612365565b348015610bf357600080fd5b50610bfc612373565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610c36578181015183820152602001610c1e565b50505050905090810190601f168015610c635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610c7d57600080fd5b5061032860048036036040811015610c9457600080fd5b81359190810190604081016020820135600160201b811115610cb557600080fd5b820183602082011115610cc757600080fd5b803590602001918460018302840111600160201b83111715610ce857600080fd5b50909250905061238f565b348015610cff57600080fd5b5061032860048036036060811015610d1657600080fd5b81359190810190604081016020820135600160201b811115610d3757600080fd5b820183602082011115610d4957600080fd5b803590602001918460018302840111600160201b83111715610d6a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061238f915050565b348015610db957600080fd5b5061032860048036036060811015610dd057600080fd5b813591602081013591810190606081016040820135600160201b811115610df657600080fd5b820183602082011115610e0857600080fd5b803590602001918460018302840111600160201b83111715610e2957600080fd5b5090925090506123d3565b348015610e4057600080fd5b506102ed60048036036020811015610e5757600080fd5b50356125c9565b348015610e6a57600080fd5b506102ed6125fa565b348015610e7f57600080fd5b506102ed6125ff565b348015610e9457600080fd5b506102ed60048036036040811015610eab57600080fd5b5080359060200135612604565b348015610ec457600080fd5b50610bfc612633565b348015610ed957600080fd5b506102ed60048036036020811015610ef057600080fd5b5035612653565b348015610f0357600080fd5b50610bfc60048036036020811015610f1a57600080fd5b503561266d565b348015610f2d57600080fd5b5061032860048036036080811015610f4457600080fd5b508035906020810135906040810135906060013561276e565b62093a8081565b610f6d826127d7565b610fb3576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b610fc8838383610fc386346127fb565b611224565b505050565b610fc8838383611849565b60008181526015602052604090205460ff165b919050565b610ff933612868565b61103c576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6001600160a01b038116600081815260116020908152604091829020805460ff19166001179055815192835290517f9085a9044aeb6daeeb5b4bf84af42b1a1613d4056f503c4e992b6396c16bd52f9281900390910190a150565b60408051600380825260808201909252606091906000908260208201858036833750508151919450506001820191631f7df70160e21b9185919081106110d957fe5b6001600160e01b031990921660209283029190910190910152825160018201916357439c0b60e11b91859190811061110d57fe5b6001600160e01b03199092166020928302919091019091015282516001820191630441a3e760e41b91859190811061114157fe5b6001600160e01b0319909216602092830291909101909101528082146111ae576040805162461bcd60e51b815260206004820181905260248201527f494e434f52524543545f53454c4543544f52535f41525241595f4c454e475448604482015290519081900360640190fd5b505090565b60006001600160a01b03861630146111cc5760006111d5565b630a85bd0160e11b5b9695505050505050565b6000818152601860205260408120546001600160a01b03168015611204579050610feb565b6001600160a01b038316831461121b57600061121d565b825b9392505050565b61122c6115ce565b15611270576040805162461bcd60e51b815260206004820152600f60248201526e29aa20aa22afa4a9afa32927ad22a760891b604482015290519081900360640190fd5b61127983612897565b156112c1576040805162461bcd60e51b81526020600482015260136024820152724d494e5441424c455f41535345545f5459504560681b604482015290519081900360640190fd5b6112ca836128db565b611315576040805162461bcd60e51b81526020600482015260176024820152764e4f4e5f46554e4749424c455f41535345545f5459504560481b604482015290519081900360640190fd5b826113228582858561293a565b5061132d8483612a2f565b7f06724742ccc8c330a39a641ef02a0b419bd09248360680bb38159b0a8c2635d63386858761135c8988612cf4565b604080516001600160a01b0390961686526020860194909452848401929092526060840152608083015260a08201859052519081900360c00190a15050505050565b600160401b5490565b6113af612d65565b565b6113b96115ce565b156113fd576040805162461bcd60e51b815260206004820152600f60248201526e29aa20aa22afa4a9afa32927ad22a760891b604482015290519081900360640190fd5b61140684612de9565b61144c576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b60006114588585611ce6565b905060006114688783868661293a565b905061147386612e2d565b1561151c5760018111156114c6576040805162461bcd60e51b81526020600482015260156024820152741253131151d05317d15490cdcc8c57d05353d55395605a1b604482015290519081900360640190fd5b6040805133815260208101899052808201869052606081018890526080810187905260a0810184905290517f0fcf2162832b2d6033d4d34d2f45a28d9cfee523f1899945bbdd32529cfda67b9181900360c00190a15b611527868685612e40565b7fed94dc026fa9364c53bc0af51cde7f54f3109b3f31fceb26d01396d80e20453b3388868989876115588d8b612cf4565b604080516001600160a01b0390981688526020880196909652868601949094526060860192909252608085015260a084015260c083015260e0820186905251908190036101000190a150505050505050565b60009283526007602090815260408085209385529281528284209184525290205490565b600454600160a01b900460ff1690565b600090565b6040805162461bcd60e51b815260206004820152600f60248201526e1393d517d253541311535153951151608a1b604482015290519081900360640190fd5b600061162d83612f04565b905061163882612897565b15611680576040805162461bcd60e51b81526020600482015260136024820152724d494e5441424c455f41535345545f5459504560681b604482015290519081900360640190fd5b611689826128db565b6116d4576040805162461bcd60e51b81526020600482015260176024820152764e4f4e5f46554e4749424c455f41535345545f5459504560481b604482015290519081900360640190fd5b60008381526008602090815260408083208584529091528120805491905582906116ff838383612f60565b7fb7477a7b93b2addc5272bbd7ad0986ef1c0d0bd265f26c3dc4bbe42727c2ac0c858561172c8785612cf4565b60408051938452602084019290925282820152606082018490526001600160a01b0386166080830152519081900360a00190a15050505050565b600061177182612868565b92915050565b61177f6115ce565b156117c3576040805162461bcd60e51b815260206004820152600f60248201526e29aa20aa22afa4a9afa32927ad22a760891b604482015290519081900360640190fd5b6117cc846131f7565b611811576040805162461bcd60e51b81526020600482015260116024820152702727aa2fa2a92198989a9aafaa27a5a2a760791b604482015290519081900360640190fd5b61181e85858585856113b1565b5050505050565b60009283526006602090815260408085209385529281528284209184525290205490565b61185282612de9565b611898576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b60006118a48383611ce6565b905060006118b185612f04565b6000868152600860209081526040808320868452909152812080549190559091506118de8286868461320a565b6118e785612e2d565b15611943576040805187815260208101879052808201869052606081018590526001600160a01b038416608082015290517fa5cfa8e2199ec5b8ca319288bcab72734207d30569756ee594a74b4df7abbf419181900360a00190a15b7fc6ba68235f3229e53f3a95cda25543ad54c0f6df2493a06c05fb930bea7966fe868686866119728a87612cf4565b604080519586526020860194909452848401929092526060840152608083015260a082018490526001600160a01b03851660c0830152519081900360e00190a1505050505050565b6113af6132d0565b6202a30081565b6119d16115ce565b611a15576040805162461bcd60e51b815260206004820152601060248201526f29aa20aa22afa727aa2fa32927ad22a760811b604482015290519081900360640190fd5b611a1e33612868565b611a61576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b600554421015611ab3576040805162461bcd60e51b8152602060048201526018602482015277155391949151569157d393d517d0531313d5d15117d6515560421b604482015290519081900360640190fd5b6004805460ff60a01b19169055600d805460019081019091556025805482019055600f805490910190556040517f07017fe9180629cfffba412f65a9affcf9a121de02294179f5c058f881dcc9f890600090a1565b82611b1281612f04565b6001600160a01b0316336001600160a01b031614611b65576040805162461bcd60e51b815260206004820152601a6024820152600080516020614bc6833981519152604482015290519081900360640190fd5b60008481526007602090815260408083208684528252808320858452825291829020429055815186815290810184905280820185905290517f0bc1df35228095c37da66a6ffcc755ea79dfc437345685f618e05fafad6b445e9181900360600190a150505050565b611bd633611e16565b611c1b576040805162461bcd60e51b815260206004820152601160248201527027a7262cafaa27a5a2a729afa0a226a4a760791b604482015290519081900360640190fd5b600160401b5415611c73576040805162461bcd60e51b815260206004820152601d60248201527f53595354454d5f41535345545f545950455f414c52454144595f534554000000604482015290519081900360640190fd5b600160401b839055611c88838383600161337a565b6040805184815290517f51f48293a5ef1940e2b4eb2580372cf384aaa5bc739639e4624ce8d18c9644ab9181900360200190a1505050565b611cc98161371c565b50565b6301e1338081565b611ce084848484611224565b50505050565b6000611cf183612de9565b611d2c5760405162461bcd60e51b8152600401808060200182810382526021815260200180614c106021913960400191505060405180910390fd5b6060611d3784612e2d565b611d66576040518060400160405280600d81526020016c2727a72fa6a4a72a20a126229d60991b815250611d84565b6040518060400160405280600481526020016327232a1d60e11b8152505b90506001600160fa1b038185856040516020018084805190602001908083835b60208310611dc35780518252601f199092019160209182019101611da4565b51815160209384036101000a600019018019909216911617905292019485525083810192909252506040805180840383018152928101905281519101209190911695945050505050565b611cc9816138bc565b6001600160a01b031660009081526011602052604090205460ff1690565b611e3d33612868565b611e80576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6001600160a01b038116600081815260116020908152604091829020805460ff19169055815192835290517ffa49aecb996ea8d99950bb051552dfcc0b5460a0bb209867a1ed8067c32c21779281900390910190a150565b600083815260066020908152604080832085845282528083208484529091528120548390611f07908290612cf4565b95945050505050565b680100000000000000015481565b611f266115ce565b15611f6a576040805162461bcd60e51b815260206004820152600f60248201526e29aa20aa22afa4a9afa32927ad22a760891b604482015290519081900360640190fd5b611f7383612e2d565b611fb7576040805162461bcd60e51b815260206004820152601060248201526f2727aa2fa2a9219b9918afaa27a5a2a760811b604482015290519081900360640190fd5b611ce08484838560016113b1565b82611fcf81612f04565b6001600160a01b0316336001600160a01b031614612022576040805162461bcd60e51b815260206004820152601a6024820152600080516020614bc6833981519152604482015290519081900360640190fd5b61202b836128db565b612076576040805162461bcd60e51b81526020600482015260176024820152764e4f4e5f46554e4749424c455f41535345545f5459504560481b604482015290519081900360640190fd5b826000612084868386613a09565b9050612091338683612f60565b7fe3e46ecf1138180bf93cba62a0b7e661d976a8ab3d40243f7b082667d8f500af8685876120bf8986612cf4565b60408051948552602085019390935283830191909152606083015260808201849052519081900360a00190a1505050505050565b600080828051906020012060001c9050600160fa1b6001600160f01b036040518060400160405280600981526020016826a4a72a20a126229d60b91b81525086846040516020018084805190602001908083835b602083106121665780518252601f199092019160209182019101612147565b51815160209384036101000a60001901801990921691161790529201948552508381019290925250604080518084038301815292810190528151910120919091169190911795945050505050565b6224ea0081565b836121c581612f04565b6001600160a01b0316336001600160a01b031614612218576040805162461bcd60e51b815260206004820152601a6024820152600080516020614bc6833981519152604482015290519081900360640190fd5b61222184612de9565b612267576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b60006122738585611ce6565b90506000612282878386613a09565b90508015612296576122963387878461320a565b61229f86612e2d565b156122f3576040805188815260208101869052808201889052606081018790526080810184905290517ff00c0c1a754f6df7545d96a7e12aad552728b94ca6aa94f81e297bdbcf1dab9c9181900360a00190a15b7fcc00f2179d127845242252f3c3b6b238c5ed33c2e933179f09653cfb1cdee7ca87858888866123238c88612cf4565b604080519687526020870195909552858501939093526060850191909152608084015260a083015260c08201849052519081900360e00190a150505050505050565b680100000000000000045481565b604051806060016040528060268152602001614c316026913981565b6040805162461bcd60e51b81526020600482015260146024820152732aa729aaa82827a92a22a22fa32aa721aa24a7a760611b604482015290519081900360640190fd5b60006123de85612f04565b60008581526015602052604090205490915060ff16612439576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b61244284612897565b61248d576040805162461bcd60e51b81526020600482015260176024820152764e4f4e5f4d494e5441424c455f41535345545f5459504560481b604482015290519081900360640190fd5b60006124cf8585858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506120f392505050565b600087815260086020908152604080832084845290915290205490915061253d576040805162461bcd60e51b815260206004820152601d60248201527f4e4f5f50454e44494e475f5749544844524157414c5f42414c414e4345000000604482015290519081900360640190fd5b6000868152600860209081526040808320848452909152812080549190556125688682858888613b16565b7f7e6e15df814c1a309a57686de672b2bedd128eacde35c5370c36d6840d4e9a9287876125958985612cf4565b604080519384526020840192909252828201526060820184905260808201859052519081900360a00190a150505050505050565b60008181526015602052604081205460ff166125e757506001610feb565b5060009081526016602052604090205490565b600a81565b604081565b6000828152600860209081526040808320848452909152812054829061262b908290612cf4565b949350505050565b60606040518060600160405280602a8152602001614be6602a9139905090565b680100000000000000026020526000908152604090205481565b60008181526015602052604090205460609060ff166126cf576040805162461bcd60e51b81526020600482015260196024820152781054d4d15517d516541157d393d517d49151d254d511549151603a1b604482015290519081900360640190fd5b60008281526014602090815260409182902080548351601f6002600019610100600186161502019093169290920491820184900484028101840190945280845290918301828280156127625780601f1061273757610100808354040283529160200191612762565b820191906000526020600020905b81548152906001019060200180831161274557829003601f168201915b50505050509050919050565b8361277881612f04565b6001600160a01b0316336001600160a01b0316146127cb576040805162461bcd60e51b815260206004820152601a6024820152600080516020614bc6833981519152604482015290519081900360640190fd5b61181e858584866121bb565b60006341917ff960e11b6127ea83613cb8565b6001600160e01b0319161492915050565b600080612807846125c9565b905080838161281257fe5b0615612856576040805162461bcd60e51b815260206004820152600e60248201526d1253959053125117d05353d5539560921b604482015290519081900360640190fd5b80838161285f57fe5b04949350505050565b600080612873613ccb565b6001600160a01b039390931660009081526020939093525050604090205460ff1690565b6000806128a383613cb8565b90506001600160e01b031981166368646e2d60e01b148061121d57506001600160e01b03198116635c5c333960e11b14915050919050565b6000806128e783613cb8565b90506001600160e01b031981166341917ff960e11b148061291857506001600160e01b03198116630f47261b60e41b145b8061121d57506001600160e01b031981166368646e2d60e01b14915050919050565b600084815260066020908152604080832086845282528083208584529091528120548201828110156129a6576040805162461bcd60e51b815260206004820152601060248201526f4445504f5349545f4f564552464c4f5760801b604482015290519081900360640190fd5b6000868152600660209081526040808320888452825280832087845290915290208190556129d386613d48565b80156129ff57506000868152600760209081526040808320888452825280832087845290915290205415155b15611f07576000868152600760209081526040808320888452825280832087845290915281205595945050505050565b6000612a3b8383612cf4565b9050612a4683613d6e565b15612c485781612a565750612cf0565b6000612a6184613d81565b905060008190506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015612ab757600080fd5b505afa158015612acb573d6000803e3d6000fd5b505050506040513d6020811015612ae157600080fd5b50516040805133602482015230604482015260648082018890528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052909150612b3d6001600160a01b03851682613d94565b6000836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b158015612b8c57600080fd5b505afa158015612ba0573d6000803e3d6000fd5b505050506040513d6020811015612bb657600080fd5b5051905082811015612bfa576040805162461bcd60e51b81526020600482015260086024820152674f564552464c4f5760c01b604482015290519081900360640190fd5b8583018114612c3e576040805162461bcd60e51b815260206004820152601c6024820152600080516020614ba6833981519152604482015290519081900360640190fd5b5050505050610fc8565b612c51836127d7565b15612caa57803414612ca5576040805162461bcd60e51b8152602060048201526018602482015277125390d3d4949150d517d1115413d4d25517d05353d5539560421b604482015290519081900360640190fd5b610fc8565b6040805162461bcd60e51b8152602060048201526016602482015275554e535550504f525445445f544f4b454e5f5459504560501b604482015290519081900360640190fd5b5050565b600080612d00846125c9565b9050808302915082818381612d1157fe5b0414612d5e576040805162461bcd60e51b815260206004820152601760248201527644455155414e54495a4154494f4e5f4f564552464c4f5760481b604482015290519081900360640190fd5b5092915050565b6000612d6f613ccb565b60018101549091506001600160a01b03163314612dcd576040805162461bcd60e51b815260206004820152601760248201527627a7262cafa1a0a72224a220aa22afa3a7ab22a92727a960491b604482015290519081900360640190fd5b612dd633613f80565b60010180546001600160a01b0319169055565b600080612df583613cb8565b90506001600160e01b0319811663012b8bc960e11b148061121d57506001600160e01b03198116633348691d60e01b14915050919050565b600063012b8bc960e11b6127ea83613cb8565b612e4983612de9565b612e90576040805162461bcd60e51b815260206004820152601360248201527246554e4749424c455f41535345545f5459504560681b604482015290519081900360640190fd5b612e9983612e2d565b15612ef35780600114612ee9576040805162461bcd60e51b8152602060048201526013602482015272494c4c4547414c5f4e46545f42414c414e434560681b604482015290519081900360640190fd5b612ca58383614034565b8015610fc857610fc88383836140e7565b6000612f0f826111df565b90506001600160a01b038116610feb576040805162461bcd60e51b81526020600482015260116024820152701554d15497d553949151d254d511549151607a1b604482015290519081900360640190fd5b6001600160a01b038316612faf576040805162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015290519081900360640190fd5b6000612fbb8383612cf4565b9050612fc683613d6e565b156131c65781612fd65750610fc8565b6000612fe184613d81565b905060008190506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561303757600080fd5b505afa15801561304b573d6000803e3d6000fd5b505050506040513d602081101561306157600080fd5b5051604080516001600160a01b03808b16602483015260448083018990528351808403909101815260649092019092526020810180516001600160e01b031663a9059cbb60e01b1790529192506130ba90851682613d94565b6000836001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561310957600080fd5b505afa15801561311d573d6000803e3d6000fd5b505050506040513d602081101561313357600080fd5b5051905082811115613178576040805162461bcd60e51b8152602060048201526009602482015268554e444552464c4f5760b81b604482015290519081900360640190fd5b85830381146131bc576040805162461bcd60e51b815260206004820152601c6024820152600080516020614ba6833981519152604482015290519081900360640190fd5b5050505050611ce0565b6131cf836127d7565b15612caa57816131df5750610fc8565b6131f26001600160a01b038516826143fd565b611ce0565b6000633348691d60e01b6127ea83613cb8565b61321383612de9565b61325a576040805162461bcd60e51b815260206004820152601360248201527246554e4749424c455f41535345545f5459504560681b604482015290519081900360640190fd5b61326383612e2d565b156132be57806001146132b3576040805162461bcd60e51b8152602060048201526013602482015272494c4c4547414c5f4e46545f42414c414e434560681b604482015290519081900360640190fd5b6131f28484846144a3565b8015611ce057611ce0848484846145a8565b6132d933612868565b61331c576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6000613326613ccb565b60018101549091506001600160a01b031615611cc9576001810180546001600160a01b03191690556040517f7a8dc7dd7fffb43c4807438fa62729225156941e641fd877938f4edade3429f590600090a150565b61338333611e16565b6133c8576040805162461bcd60e51b815260206004820152601160248201527027a7262cafaa27a5a2a729afa0a226a4a760791b604482015290519081900360640190fd5b6133d184610fd8565b1561341e576040805162461bcd60e51b81526020600482015260186024820152771054d4d15517d053149150511657d49151d254d51154915160421b604482015290519081900360640190fd5b600167080000000000001160c01b018410613475576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b600081116134bc576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f5155414e54554d60881b604482015290519081900360640190fd5b600160801b8110613506576040805162461bcd60e51b815260206004820152600f60248201526e494e56414c49445f5155414e54554d60881b604482015290519081900360640190fd5b60006001600160fa1b0384848460405160200180848480828437919091019283525050604080518083038152602092830190915280519101209290921692505050848114613590576040805162461bcd60e51b8152602060048201526012602482015271494e56414c49445f41535345545f5459504560701b604482015290519081900360640190fd5b6135cf84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061489592505050565b61360e84848080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250614a1192505050565b1561365e578160011461365e576040805162461bcd60e51b8152602060048201526013602482015272494e56414c49445f4e46545f5155414e54554d60681b604482015290519081900360640190fd5b6000858152601560209081526040808320805460ff191660011790556014909152902061368c908585614b12565b508160166000878152602001908152602001600020819055507f7a0efbc885500f3b4a895231945be4520e4c0ba5ef7274a225a0272c81ccbcb78585858560405180858152602001806020018381526020018281038252858582818152602001925080828437600083820152604051601f909101601f191690920182900397509095505050505050a15050505050565b61372533612868565b613768576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6000613772613ccb565b90506001600160a01b0382166137bd576040805162461bcd60e51b815260206004820152600b60248201526a4241445f4144445245535360a81b604482015290519081900360640190fd5b6137c682612868565b1561380b576040805162461bcd60e51b815260206004820152601060248201526f20a62922a0a22cafa3a7ab22a92727a960811b604482015290519081900360640190fd5b60018101546001600160a01b031615613865576040805162461bcd60e51b81526020600482015260176024820152764f544845525f43414e4449444154455f50454e44494e4760481b604482015290519081900360640190fd5b6001810180546001600160a01b0384166001600160a01b0319909116811790915560408051918252517f6166272c8d3f5f579082f2827532732f97195007983bb5b83ac12c56700b01a69181900360200190a15050565b6138c533612868565b613908576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b336001600160a01b038216141561395d576040805162461bcd60e51b8152602060048201526014602482015273474f5645524e4f525f53454c465f52454d4f564560601b604482015290519081900360640190fd5b6000613967613ccb565b905061397282612868565b6139b2576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa3a7ab22a92727a960a11b604482015290519081900360640190fd5b6001600160a01b03821660008181526020838152604091829020805460ff19169055815192835290517fd75f94825e770b8b512be8e74759e252ad00e102e38f50cce2f7c6f868a295999281900390910190a15050565b6000838152600760209081526040808320858452825280832084845290915281205480613a74576040805162461bcd60e51b815260206004820152601460248201527311115413d4d25517d393d517d0d05390d153115160621b604482015290519081900360640190fd5b6202a30081810190811015613a8557fe5b80421015613acb576040805162461bcd60e51b815260206004820152600e60248201526d11115413d4d25517d313d0d2d15160921b604482015290519081900360640190fd5b50505060008381526006602090815260408083208584528252808320848452825280832080549084905595835260078252808320948352938152838220928252919091529081205590565b6001600160a01b038316613b65576040805162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015290519081900360640190fd5b613b6e85612897565b613bb9576040805162461bcd60e51b81526020600482015260176024820152764e4f4e5f4d494e5441424c455f41535345545f5459504560481b604482015290519081900360640190fd5b60008411613c04576040805162461bcd60e51b81526020600482015260136024820152721253959053125117d352539517d05353d55395606a1b604482015290519081900360640190fd5b6000613c108686612cf4565b90506000613c1d87613d81565b9050613caf8583868660405160240180856001600160a01b0316815260200184815260200180602001828103825284848281815260200192508082843760008184015260408051601f19601f9093018316909401848103909201845252506020810180516319ee6e3f60e01b6001600160e01b039091161790526001600160a01b03891696509450613d949350505050565b50505050505050565b6000611771613cc68361266d565b614a55565b600080604051806060016040528060268152602001614c31602691396040518082805190602001908083835b60208310613d165780518252601f199092019160209182019101613cf7565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209392505050565b6000613d53826111df565b6001600160a01b0316336001600160a01b0316149050919050565b6000630f47261b60e41b6127ea83613cb8565b6000611771613d8f8361266d565b614a66565b613d9d82614a6d565b613de2576040805162461bcd60e51b81526020600482015260116024820152704241445f544f4b454e5f4144445245535360781b604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b60208310613e205780518252601f199092019160209182019101613e01565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613e82576040519150601f19603f3d011682016040523d82523d6000602084013e613e87565b606091505b5091509150818190613f175760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613edc578181015183820152602001613ec4565b50505050905090810190601f168015613f095780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50805115611ce057808060200190516020811015613f3457600080fd5b5051611ce0576040805162461bcd60e51b81526020600482015260166024820152751513d2d15397d3d4115490551253d397d1905253115160521b604482015290519081900360640190fd5b613f8981612868565b15613fce576040805162461bcd60e51b815260206004820152601060248201526f20a62922a0a22cafa3a7ab22a92727a960811b604482015290519081900360640190fd5b6000613fd8613ccb565b6001600160a01b03831660008181526020838152604091829020805460ff19166001179055815192835290519293507fcfb473e6c03f9a29ddaf990e736fa3de5188a0bd85d684f5b6e164ebfbfff5d292918290030190a15050565b61403d82612e2d565b614081576040805162461bcd60e51b815260206004820152601060248201526f2727aa2fa2a9219b9918afaa27a5a2a760811b604482015290519081900360640190fd5b600061408c83613d81565b6040805133602482015230604482015260648082018690528251808303909101815260849091019091526020810180516001600160e01b0316632142170760e11b179052909150610fc8906001600160a01b03831690613d94565b6140f0836131f7565b614135576040805162461bcd60e51b81526020600482015260116024820152702727aa2fa2a92198989a9aafaa27a5a2a760791b604482015290519081900360640190fd5b8061413f57610fc8565b600061414b8483612cf4565b9050600061415885613d81565b60408051627eeac760e11b815230600482015260248101879052905191925082916000916001600160a01b0384169162fdd58e91604480820192602092909190829003018186803b1580156141ac57600080fd5b505afa1580156141c0573d6000803e3d6000fd5b505050506040513d60208110156141d657600080fd5b810190808051906020019092919050505090506142eb63f242432a60e01b333089886040518060200160405280600081525060405160240180866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561427257818101518382015260200161425a565b50505050905090810190601f16801561429f5780820380516001836020036101000a031916815260200191505b5060408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909a169990991790985250506001600160a01b038a1695945050613d9492505050565b6000826001600160a01b031662fdd58e30896040518363ffffffff1660e01b815260040180836001600160a01b031681526020018281526020019250505060206040518083038186803b15801561434157600080fd5b505afa158015614355573d6000803e3d6000fd5b505050506040513d602081101561436b57600080fd5b50519050818110156143af576040805162461bcd60e51b81526020600482015260086024820152674f564552464c4f5760c01b604482015290519081900360640190fd5b84820181146143f3576040805162461bcd60e51b815260206004820152601c6024820152600080516020614ba6833981519152604482015290519081900360640190fd5b5050505050505050565b8061440757612cf0565b6040516000906001600160a01b0384169083908381818185875af1925050503d8060008114614452576040519150601f19603f3d011682016040523d82523d6000602084013e614457565b606091505b5050905080610fc8576040805162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b6001600160a01b0383166144f2576040805162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015290519081900360640190fd5b6144fb82612e2d565b61453f576040805162461bcd60e51b815260206004820152601060248201526f2727aa2fa2a9219b9918afaa27a5a2a760811b604482015290519081900360640190fd5b600061454a83613d81565b604080513060248201526001600160a01b03808816604483015260648083018790528351808403909101815260849092019092526020810180516001600160e01b0316632142170760e11b179052919250611ce09190831690613d94565b6001600160a01b0384166145f7576040805162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015290519081900360640190fd5b614600836131f7565b614645576040805162461bcd60e51b81526020600482015260116024820152702727aa2fa2a92198989a9aafaa27a5a2a760791b604482015290519081900360640190fd5b8061464f57611ce0565b600061465b8483612cf4565b9050600061466885613d81565b60408051627eeac760e11b815230600482015260248101879052905191925082916000916001600160a01b0384169162fdd58e91604480820192602092909190829003018186803b1580156146bc57600080fd5b505afa1580156146d0573d6000803e3d6000fd5b505050506040513d60208110156146e657600080fd5b8101908080519060200190929190505050905061478163f242432a60e01b308a89886040518060200160405280600081525060405160240180866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200180602001828103825283818151815260200191508051906020019080838360008381101561427257818101518382015260200161425a565b6000826001600160a01b031662fdd58e30896040518363ffffffff1660e01b815260040180836001600160a01b031681526020018281526020019250505060206040518083038186803b1580156147d757600080fd5b505afa1580156147eb573d6000803e3d6000fd5b505050506040513d602081101561480157600080fd5b5051905081811115614846576040805162461bcd60e51b8152602060048201526009602482015268554e444552464c4f5760b81b604482015290519081900360640190fd5b848203811461488a576040805162461bcd60e51b815260206004820152601c6024820152600080516020614ba6833981519152604482015290519081900360640190fd5b505050505050505050565b60006148a082614a55565b90506148ab81614a73565b6148f5576040805162461bcd60e51b8152602060048201526016602482015275554e535550504f525445445f544f4b454e5f5459504560501b604482015290519081900360640190fd5b6001600160e01b031981166341917ff960e11b141561496057815160041461495b576040805162461bcd60e51b8152602060048201526014602482015273494e56414c49445f41535345545f535452494e4760601b604482015290519081900360640190fd5b612cf0565b81516024146149ad576040805162461bcd60e51b8152602060048201526014602482015273494e56414c49445f41535345545f535452494e4760601b604482015290519081900360640190fd5b60006149b883614a66565b90506149cc816001600160a01b0316614a6d565b610fc8576040805162461bcd60e51b81526020600482015260116024820152704241445f544f4b454e5f4144445245535360781b604482015290519081900360640190fd5b600080614a1d83614a55565b90506001600160e01b0319811663012b8bc960e11b148061121d57506001600160e01b03198116635c5c333960e11b14915050919050565b602001516001600160e01b03191690565b6024015190565b3b151590565b60006001600160e01b031982166341917ff960e11b1480614aa457506001600160e01b03198216630f47261b60e41b145b80614abf57506001600160e01b0319821663012b8bc960e11b145b80614ada57506001600160e01b031982166368646e2d60e01b145b80614af557506001600160e01b03198216635c5c333960e11b145b806117715750506001600160e01b031916633348691d60e01b1490565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10614b535782800160ff19823516178555614b80565b82800160010185558215614b80579182015b82811115614b80578235825591602001919060010190614b65565b50614b8c929150614b90565b5090565b5b80821115614b8c5760008155600101614b9156fe494e434f52524543545f414d4f554e545f5452414e53464552524544000000004d49534d41544348494e475f535441524b5f4554485f4b455953000000000000537461726b576172655f50657270657475616c546f6b656e73416e6452616d70696e675f323032325f3241535345545f545950455f444f45535f4e4f545f54414b455f544f4b454e5f4944537461726b45782e4d61696e2e323031392e476f7665726e6f7273496e666f726d6174696f6ea2646970667358221220782f5efb1b7d337c080de156a618913a23577bc8195f9788bb072e369c453b2964736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.