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
|
|||||
---|---|---|---|---|---|---|---|---|---|
Deposit | 18270154 | 446 days ago | IN | 0.00324985 ETH | 0.00035548 |
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
StarknetEthBridge
Compiler Version
v0.6.12+commit.27d51765
Contract Source Code (Solidity Standard Json-Input format)
/* Copyright 2019-2023 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 "StarknetTokenBridge.sol"; contract StarknetEthBridge is StarknetTokenBridge { using Addresses for address; function isTokenContractRequired() internal pure override returns (bool) { return false; } function deposit(uint256 amount, uint256 l2Recipient) public payable override { // Make sure msg.value is enough to cover amount. The remaining value is fee. require(msg.value >= amount, "INSUFFICIENT_VALUE"); uint256 fee = msg.value - amount; // The msg.value was already credited to this contract. Fee will be passed to StarkNet. require(address(this).balance - fee <= maxTotalBalance(), "MAX_BALANCE_EXCEEDED"); sendMessage(amount, l2Recipient, fee); } // A backwards compatible deposit function with zero fee. function deposit(uint256 l2Recipient) external payable { deposit(msg.value, l2Recipient); } function transferOutFunds(uint256 amount, address recipient) internal override { recipient.performEthTransfer(amount); } /** Returns a string that identifies the contract. */ function identify() external pure override returns (string memory) { return "StarkWare_StarknetEthBridge_2023_1"; } }
/* Copyright 2019-2023 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-2023 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; /* This contract provides means to block direct call of an external function. A derived contract (e.g. MainDispatcherBase) should decorate sensitive functions with the notCalledDirectly modifier, thereby preventing it from being called directly, and allowing only calling using delegate_call. */ abstract contract BlockDirectCall { address immutable this_; constructor() internal { this_ = address(this); } modifier notCalledDirectly() { require(this_ != address(this), "DIRECT_CALL_DISALLOWED"); _; } }
/* Copyright 2019-2023 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; library CairoConstants { uint256 public constant FIELD_PRIME = 0x800000000000011000000000000000000000000000000000000000000000001; }
/* Copyright 2019-2023 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 for contract initialization. The functions it exposes are the app specific parts of the contract initialization, and are called by the ProxySupport contract that implement the generic part of behind-proxy initialization. */ abstract contract ContractInitializer { /* The number of sub-contracts that the proxied contract consists of. */ function numOfSubContracts() internal pure virtual returns (uint256); /* Indicates if the proxied contract has already been initialized. Used to prevent re-init. */ function isInitialized() internal view virtual returns (bool); /* Validates the init data that is passed into the proxied contract. */ function validateInitData(bytes calldata data) internal view virtual; /* For a proxied contract that consists of sub-contracts, this function processes the sub-contract addresses, e.g. validates them, stores them etc. */ function processSubContractAddresses(bytes calldata subContractAddresses) internal virtual; /* This function applies the logic of initializing the proxied contract state, e.g. setting root values etc. */ function initializeContractState(bytes calldata data) internal virtual; }
/* Copyright 2019-2023 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"; contract GenericGovernance is Governance { bytes32 immutable GOVERNANCE_INFO_TAG_HASH; constructor(string memory governanceContext) public { GOVERNANCE_INFO_TAG_HASH = keccak256(abi.encodePacked(governanceContext)); } /* Returns the GovernanceInfoStruct associated with the governance tag. */ function getGovernanceInfo() internal view override returns (GovernanceInfoStruct storage gub) { bytes32 location = GOVERNANCE_INFO_TAG_HASH; assembly { gub_slot := location } } function isGovernor(address user) external view returns (bool) { return _isGovernor(user); } function nominateNewGovernor(address newGovernor) external { _nominateNewGovernor(newGovernor); } function removeGovernor(address governorForRemoval) external { _removeGovernor(governorForRemoval); } function acceptGovernance() external { _acceptGovernance(); } function cancelNomination() external { _cancelNomination(); } }
/* Copyright 2019-2023 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-2023 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 "IStarknetMessagingEvents.sol"; interface IStarknetMessaging is IStarknetMessagingEvents { /** Returns the max fee (in Wei) that StarkNet will accept per single message. */ function getMaxL1MsgFee() external pure returns (uint256); /** Sends a message to an L2 contract. This function is payable, the payed amount is the message fee. Returns the hash of the message and the nonce of the message. */ function sendMessageToL2( uint256 toAddress, uint256 selector, uint256[] calldata payload ) external payable returns (bytes32, uint256); /** Consumes a message that was sent from an L2 contract. Returns the hash of the message. */ function consumeMessageFromL2(uint256 fromAddress, uint256[] calldata payload) external returns (bytes32); /** Starts the cancellation of an L1 to L2 message. A message can be canceled messageCancellationDelay() seconds after this function is called. Note: This function may only be called for a message that is currently pending and the caller must be the sender of the that message. */ function startL1ToL2MessageCancellation( uint256 toAddress, uint256 selector, uint256[] calldata payload, uint256 nonce ) external returns (bytes32); /** Cancels an L1 to L2 message, this function should be called at least messageCancellationDelay() seconds after the call to startL1ToL2MessageCancellation(). A message may only be cancelled by its sender. If the message is missing, the call will revert. Note that the message fee is not refunded. */ function cancelL1ToL2Message( uint256 toAddress, uint256 selector, uint256[] calldata payload, uint256 nonce ) external returns (bytes32); }
/* Copyright 2019-2023 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 IStarknetMessagingEvents { // This event needs to be compatible with the one defined in Output.sol. event LogMessageToL1(uint256 indexed fromAddress, address indexed toAddress, uint256[] payload); // An event that is raised when a message is sent from L1 to L2. event LogMessageToL2( address indexed fromAddress, uint256 indexed toAddress, uint256 indexed selector, uint256[] payload, uint256 nonce, uint256 fee ); // An event that is raised when a message from L2 to L1 is consumed. event ConsumedMessageToL1( uint256 indexed fromAddress, address indexed toAddress, uint256[] payload ); // An event that is raised when a message from L1 to L2 is consumed. event ConsumedMessageToL2( address indexed fromAddress, uint256 indexed toAddress, uint256 indexed selector, uint256[] payload, uint256 nonce ); // An event that is raised when a message from L1 to L2 Cancellation is started. event MessageToL2CancellationStarted( address indexed fromAddress, uint256 indexed toAddress, uint256 indexed selector, uint256[] payload, uint256 nonce ); // An event that is raised when a message from L1 to L2 is canceled. event MessageToL2Canceled( address indexed fromAddress, uint256 indexed toAddress, uint256 indexed selector, uint256[] payload, uint256 nonce ); }
/* Copyright 2019-2023 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-2023 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-2023 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; /* Library to provide basic storage, in storage location out of the low linear address space. New types of storage variables should be added here upon need. */ library NamedStorage { function bytes32ToUint256Mapping(string memory tag_) internal pure returns (mapping(bytes32 => uint256) storage randomVariable) { bytes32 location = keccak256(abi.encodePacked(tag_)); assembly { randomVariable_slot := location } } function bytes32ToAddressMapping(string memory tag_) internal pure returns (mapping(bytes32 => address) storage randomVariable) { bytes32 location = keccak256(abi.encodePacked(tag_)); assembly { randomVariable_slot := location } } function uintToAddressMapping(string memory tag_) internal pure returns (mapping(uint256 => address) storage randomVariable) { bytes32 location = keccak256(abi.encodePacked(tag_)); assembly { randomVariable_slot := location } } function addressToBoolMapping(string memory tag_) internal pure returns (mapping(address => bool) storage randomVariable) { bytes32 location = keccak256(abi.encodePacked(tag_)); assembly { randomVariable_slot := location } } function getUintValue(string memory tag_) internal view returns (uint256 retVal) { bytes32 slot = keccak256(abi.encodePacked(tag_)); assembly { retVal := sload(slot) } } function setUintValue(string memory tag_, uint256 value) internal { bytes32 slot = keccak256(abi.encodePacked(tag_)); assembly { sstore(slot, value) } } function setUintValueOnce(string memory tag_, uint256 value) internal { require(getUintValue(tag_) == 0, "ALREADY_SET"); setUintValue(tag_, value); } function getAddressValue(string memory tag_) internal view returns (address retVal) { bytes32 slot = keccak256(abi.encodePacked(tag_)); assembly { retVal := sload(slot) } } function setAddressValue(string memory tag_, address value) internal { bytes32 slot = keccak256(abi.encodePacked(tag_)); assembly { sstore(slot, value) } } function setAddressValueOnce(string memory tag_, address value) internal { require(getAddressValue(tag_) == address(0x0), "ALREADY_SET"); setAddressValue(tag_, value); } function getBoolValue(string memory tag_) internal view returns (bool retVal) { bytes32 slot = keccak256(abi.encodePacked(tag_)); assembly { retVal := sload(slot) } } function setBoolValue(string memory tag_, bool value) internal { bytes32 slot = keccak256(abi.encodePacked(tag_)); assembly { sstore(slot, value) } } }
/* Copyright 2019-2023 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 "Addresses.sol"; import "BlockDirectCall.sol"; import "ContractInitializer.sol"; /** This contract contains the code commonly needed for a contract to be deployed behind an upgradability proxy. It perform the required semantics of the proxy pattern, but in a generic manner. Instantiation of the Governance and of the ContractInitializer, that are the app specific part of initialization, has to be done by the using contract. */ abstract contract ProxySupport is Governance, BlockDirectCall, ContractInitializer { using Addresses for address; // The two function below (isFrozen & initialize) needed to bind to the Proxy. function isFrozen() external view virtual returns (bool) { return false; } /* The initialize() function serves as an alternative constructor for a proxied deployment. Flow and notes: 1. This function cannot be called directly on the deployed contract, but only via delegate call. 2. If an EIC is provided - init is passed onto EIC and the standard init flow is skipped. This true for both first intialization or a later one. 3. The data passed to this function is as follows: [sub_contracts addresses, eic address, initData]. When calling on an initialized contract (no EIC scenario), initData.length must be 0. */ function initialize(bytes calldata data) external notCalledDirectly { uint256 eicOffset = 32 * numOfSubContracts(); uint256 expectedBaseSize = eicOffset + 32; require(data.length >= expectedBaseSize, "INIT_DATA_TOO_SMALL"); address eicAddress = abi.decode(data[eicOffset:expectedBaseSize], (address)); bytes calldata subContractAddresses = data[:eicOffset]; processSubContractAddresses(subContractAddresses); bytes calldata initData = data[expectedBaseSize:]; // EIC Provided - Pass initData to EIC and the skip standard init flow. if (eicAddress != address(0x0)) { callExternalInitializer(eicAddress, initData); return; } if (isInitialized()) { require(initData.length == 0, "UNEXPECTED_INIT_DATA"); } else { // Contract was not initialized yet. validateInitData(initData); initializeContractState(initData); initGovernance(); } } function callExternalInitializer(address externalInitializerAddr, bytes calldata eicData) private { require(externalInitializerAddr.isContract(), "EIC_NOT_A_CONTRACT"); // NOLINTNEXTLINE: low-level-calls, controlled-delegatecall. (bool success, bytes memory returndata) = externalInitializerAddr.delegatecall( abi.encodeWithSelector(this.initialize.selector, eicData) ); require(success, string(returndata)); require(returndata.length == 0, string(returndata)); } }
/* Copyright 2019-2023 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 StarknetBridgeConstants { // The selector of the deposit handler in L2. uint256 constant DEPOSIT_SELECTOR = 1285101517810983806491589552491143496277809242732141897358598292095611420389; uint256 constant TRANSFER_FROM_STARKNET = 0; uint256 constant UINT256_PART_SIZE_BITS = 128; uint256 constant UINT256_PART_SIZE = 2**UINT256_PART_SIZE_BITS; string constant GOVERNANCE_TAG = "STARKWARE_DEFAULT_GOVERNANCE_INFO"; }
/* Copyright 2019-2023 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 "GenericGovernance.sol"; import "Identity.sol"; import "ProxySupport.sol"; import "Addresses.sol"; import "CairoConstants.sol"; import "StarknetBridgeConstants.sol"; import "StarknetTokenStorage.sol"; import "IStarknetMessaging.sol"; abstract contract StarknetTokenBridge is Identity, StarknetTokenStorage, StarknetBridgeConstants, GenericGovernance, ProxySupport { event LogDeposit( address indexed sender, uint256 amount, uint256 indexed l2Recipient, uint256 nonce, uint256 fee ); event LogDepositCancelRequest( address indexed sender, uint256 amount, uint256 indexed l2Recipient, uint256 nonce ); event LogDepositReclaimed( address indexed sender, uint256 amount, uint256 indexed l2Recipient, uint256 nonce ); event LogWithdrawal(address indexed recipient, uint256 amount); event LogSetL2TokenBridge(uint256 value); event LogSetMaxTotalBalance(uint256 value); event LogSetMaxDeposit(uint256 value); event LogBridgeActivated(); function deposit(uint256 amount, uint256 l2Recipient) external payable virtual; function transferOutFunds(uint256 amount, address recipient) internal virtual; /* The constructor is in use here only to set the immutable tag in GenericGovernance. */ constructor() internal GenericGovernance(GOVERNANCE_TAG) {} function isTokenContractRequired() internal pure virtual returns (bool) { return true; } function isInitialized() internal view override returns (bool) { if (!isTokenContractRequired()) { return (messagingContract() != IStarknetMessaging(0)); } return (messagingContract() != IStarknetMessaging(0)) && (bridgedToken() != address(0)); } function numOfSubContracts() internal pure override returns (uint256) { return 0; } function validateInitData(bytes calldata data) internal view virtual override { require(data.length == 64, "ILLEGAL_DATA_SIZE"); (address bridgedToken_, address messagingContract_) = abi.decode(data, (address, address)); if (isTokenContractRequired()) { require(bridgedToken_.isContract(), "INVALID_BRIDGE_TOKEN_ADDRESS"); } else { require(bridgedToken_ == address(0), "NON_ZERO_TOKEN_ADDRESS_PROVIDED"); } require(messagingContract_.isContract(), "INVALID_MESSAGING_CONTRACT_ADDRESS"); } /* No processing needed, as there are no sub-contracts to this contract. */ function processSubContractAddresses(bytes calldata subContractAddresses) internal override {} /* Gets the addresses of bridgedToken & messagingContract from the ProxySupport initialize(), and sets the storage slot accordingly. */ function initializeContractState(bytes calldata data) internal override { (address bridgedToken_, address messagingContract_) = abi.decode(data, (address, address)); bridgedToken(bridgedToken_); messagingContract(messagingContract_); } function isValidL2Address(uint256 l2Address) internal pure returns (bool) { return (l2Address > 0 && l2Address < CairoConstants.FIELD_PRIME); } modifier onlyActive() { require(isActive(), "NOT_ACTIVE_YET"); _; } modifier onlyDepositor(uint256 nonce) { address depositor_ = depositors()[nonce]; require(depositor_ != address(0x0), "NO_DEPOSIT_TO_CANCEL"); require(depositor_ == msg.sender, "ONLY_DEPOSITOR"); _; } function setL2TokenBridge(uint256 l2TokenBridge_) external onlyGovernance { require(isInitialized(), "CONTRACT_NOT_INITIALIZED"); require(isValidL2Address(l2TokenBridge_), "L2_ADDRESS_OUT_OF_RANGE"); l2TokenBridge(l2TokenBridge_); setActive(); emit LogSetL2TokenBridge(l2TokenBridge_); emit LogBridgeActivated(); } /* Sets the maximum allowed balance of the bridge. Note: It is possible to set a lower value than the current total balance. In this case, deposits will not be possible, until enough withdrawls are done, such that the total balance gets below the limit. */ function setMaxTotalBalance(uint256 maxTotalBalance_) external onlyGovernance { emit LogSetMaxTotalBalance(maxTotalBalance_); maxTotalBalance(maxTotalBalance_); } function setMaxDeposit(uint256 maxDeposit_) external onlyGovernance { emit LogSetMaxDeposit(maxDeposit_); maxDeposit(maxDeposit_); } function depositMessagePayload(uint256 amount, uint256 l2Recipient) private pure returns (uint256[] memory) { uint256[] memory payload = new uint256[](3); payload[0] = l2Recipient; payload[1] = amount & (UINT256_PART_SIZE - 1); payload[2] = amount >> UINT256_PART_SIZE_BITS; return payload; } function sendMessage( uint256 amount, uint256 l2Recipient, uint256 fee ) internal onlyActive { require(amount > 0, "ZERO_DEPOSIT"); require(msg.value >= fee, "INSUFFICIENT_MSG_VALUE"); require(isValidL2Address(l2Recipient), "L2_ADDRESS_OUT_OF_RANGE"); require(amount <= maxDeposit(), "TRANSFER_TO_STARKNET_AMOUNT_EXCEEDED"); (, uint256 nonce) = messagingContract().sendMessageToL2{value: fee}( l2TokenBridge(), DEPOSIT_SELECTOR, depositMessagePayload(amount, l2Recipient) ); require(depositors()[nonce] == address(0x0), "DEPOSIT_ALREADY_REGISTERED"); depositors()[nonce] = msg.sender; emit LogDeposit(msg.sender, amount, l2Recipient, nonce, fee); } function consumeMessage(uint256 amount, address recipient) internal onlyActive { uint256[] memory payload = new uint256[](4); payload[0] = TRANSFER_FROM_STARKNET; payload[1] = uint256(recipient); payload[2] = amount & (UINT256_PART_SIZE - 1); payload[3] = amount >> UINT256_PART_SIZE_BITS; messagingContract().consumeMessageFromL2(l2TokenBridge(), payload); } function withdraw(uint256 amount, address recipient) public { // Make sure we don't accidentally burn funds. require(recipient != address(0x0), "INVALID_RECIPIENT"); // The call to consumeMessage will succeed only if a matching L2->L1 message // exists and is ready for consumption. consumeMessage(amount, recipient); transferOutFunds(amount, recipient); emit LogWithdrawal(recipient, amount); } function withdraw(uint256 amount) external { withdraw(amount, msg.sender); } /* A deposit cancellation requires two steps: 1. The depositor should send a depositCancelRequest request with deposit details & nonce. 2. Only the depositor is allowed to cancel a deposit. 3. After a certain threshold time, (cancellation delay), they can claim back the funds by calling depositReclaim (using the same arguments). The nonce should be extracted from the LogMessageToL2 event that was emitted by the StarknetMessaging contract upon deposit. Note: As long as the depositReclaim was not performed, the deposit may be processed, even if the cancellation delay time as already passed. */ function depositCancelRequest( uint256 amount, uint256 l2Recipient, uint256 nonce ) external onlyActive onlyDepositor(nonce) { messagingContract().startL1ToL2MessageCancellation( l2TokenBridge(), DEPOSIT_SELECTOR, depositMessagePayload(amount, l2Recipient), nonce ); // Only the depositor is allowed to cancel a deposit. emit LogDepositCancelRequest(msg.sender, amount, l2Recipient, nonce); } function depositReclaim( uint256 amount, uint256 l2Recipient, uint256 nonce ) external onlyActive onlyDepositor(nonce) { messagingContract().cancelL1ToL2Message( l2TokenBridge(), DEPOSIT_SELECTOR, depositMessagePayload(amount, l2Recipient), nonce ); transferOutFunds(amount, msg.sender); emit LogDepositReclaimed(msg.sender, amount, l2Recipient, nonce); } }
/* Copyright 2019-2023 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 "NamedStorage.sol"; import "IStarknetMessaging.sol"; abstract contract StarknetTokenStorage { // Random storage slot tags. string internal constant BRIDGED_TOKEN_TAG = "STARKNET_ERC20_TOKEN_BRIDGE_TOKEN_ADDRESS"; string internal constant L2_TOKEN_TAG = "STARKNET_TOKEN_BRIDGE_L2_TOKEN_CONTRACT"; string internal constant MAX_DEPOSIT_TAG = "STARKNET_TOKEN_BRIDGE_MAX_DEPOSIT"; string internal constant MAX_TOTAL_BALANCE_TAG = "STARKNET_TOKEN_BRIDGE_MAX_TOTAL_BALANCE"; string internal constant MESSAGING_CONTRACT_TAG = "STARKNET_TOKEN_BRIDGE_MESSAGING_CONTRACT"; string internal constant DEPOSITOR_ADDRESSES_TAG = "STARKNET_TOKEN_BRIDGE_DEPOSITOR_ADDRESSES"; string internal constant BRIDGE_IS_ACTIVE_TAG = "STARKNET_TOKEN_BRIDGE_IS_ACTIVE"; // Storage Getters. function bridgedToken() internal view returns (address) { return NamedStorage.getAddressValue(BRIDGED_TOKEN_TAG); } function l2TokenBridge() internal view returns (uint256) { return NamedStorage.getUintValue(L2_TOKEN_TAG); } function maxDeposit() public view returns (uint256) { return NamedStorage.getUintValue(MAX_DEPOSIT_TAG); } function maxTotalBalance() public view returns (uint256) { return NamedStorage.getUintValue(MAX_TOTAL_BALANCE_TAG); } function messagingContract() internal view returns (IStarknetMessaging) { return IStarknetMessaging(NamedStorage.getAddressValue(MESSAGING_CONTRACT_TAG)); } function isActive() public view returns (bool) { return NamedStorage.getBoolValue(BRIDGE_IS_ACTIVE_TAG); } function depositors() internal pure returns (mapping(uint256 => address) storage) { return NamedStorage.uintToAddressMapping(DEPOSITOR_ADDRESSES_TAG); } // Storage Setters. function bridgedToken(address contract_) internal { NamedStorage.setAddressValueOnce(BRIDGED_TOKEN_TAG, contract_); } function l2TokenBridge(uint256 value) internal { NamedStorage.setUintValueOnce(L2_TOKEN_TAG, value); } function maxDeposit(uint256 value) internal { NamedStorage.setUintValue(MAX_DEPOSIT_TAG, value); } function maxTotalBalance(uint256 value) internal { NamedStorage.setUintValue(MAX_TOTAL_BALANCE_TAG, value); } function messagingContract(address contract_) internal { NamedStorage.setAddressValueOnce(MESSAGING_CONTRACT_TAG, contract_); } function setActive() internal { return NamedStorage.setBoolValue(BRIDGE_IS_ACTIVE_TAG, true); } }
{ "metadata": { "useLiteralContent": true }, "libraries": {}, "remappings": [], "optimizer": { "enabled": true, "runs": 200 }, "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":[],"name":"LogBridgeActivated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"l2Recipient","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"LogDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"l2Recipient","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"LogDepositCancelRequest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"l2Recipient","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"LogDepositReclaimed","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":"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":"value","type":"uint256"}],"name":"LogSetL2TokenBridge","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"LogSetMaxDeposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"LogSetMaxTotalBalance","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"LogWithdrawal","type":"event"},{"inputs":[],"name":"acceptGovernance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelNomination","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"l2Recipient","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"l2Recipient","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"l2Recipient","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"depositCancelRequest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"l2Recipient","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"depositReclaim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"identify","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes","name":"data","type":"bytes"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isActive","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":"user","type":"address"}],"name":"isGovernor","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxTotalBalance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newGovernor","type":"address"}],"name":"nominateNewGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"governorForRemoval","type":"address"}],"name":"removeGovernor","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"l2TokenBridge_","type":"uint256"}],"name":"setL2TokenBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxDeposit_","type":"uint256"}],"name":"setMaxDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxTotalBalance_","type":"uint256"}],"name":"setMaxTotalBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c060405234801561001057600080fd5b5060405180606001604052806021815260200161270860219139806040516020018082805190602001908083835b6020831061005d5780518252601f19909201916020918201910161003e565b51815160209384036101000a60001901801990921691161790526040805192909401828103601f190183529093528051920191909120608081905230606081901b60a052909450925061264191506100c790506000398061062b5250806121b652506126416000f3fe60806040526004361061011e5760003560e01c80637fc2ab3e116100a0578063bb371fdd11610064578063bb371fdd146103b9578063e2bbb158146103e3578063e43581b814610406578063eeb7286614610439578063eecdac88146104c35761011e565b80637fc2ab3e146102df57806387ebeb1814610309578063894ecf041461033c578063ae87381614610366578063b6b55f251461039c5761011e565b80632e1a7d4d116100e75780632e1a7d4d146101d857806333eeb14714610202578063439fab91146102175780634c567662146102945780636083e59a146102ca5761011e565b8062f714ce1461012357806310f2ec451461015e578063195340751461017357806322f3e2d41461019a578063238efcbc146101c3575b600080fd5b34801561012f57600080fd5b5061015c6004803603604081101561014657600080fd5b50803590602001356001600160a01b03166104f6565b005b34801561016a57600080fd5b5061015c61059c565b34801561017f57600080fd5b506101886105a6565b60408051918252519081900360200190f35b3480156101a657600080fd5b506101af6105cf565b604080519115158252519081900360200190f35b3480156101cf57600080fd5b5061015c61060f565b3480156101e457600080fd5b5061015c600480360360208110156101fb57600080fd5b5035610617565b34801561020e57600080fd5b506101af610624565b34801561022357600080fd5b5061015c6004803603602081101561023a57600080fd5b81019060208101813564010000000081111561025557600080fd5b82018360208201111561026757600080fd5b8035906020019184600183028401116401000000008311171561028957600080fd5b509092509050610629565b3480156102a057600080fd5b5061015c600480360360608110156102b757600080fd5b5080359060208101359060400135610802565b3480156102d657600080fd5b50610188610a4e565b3480156102eb57600080fd5b5061015c6004803603602081101561030257600080fd5b5035610a71565b34801561031557600080fd5b5061015c6004803603602081101561032c57600080fd5b50356001600160a01b0316610bda565b34801561034857600080fd5b5061015c6004803603602081101561035f57600080fd5b5035610be3565b34801561037257600080fd5b5061015c6004803603606081101561038957600080fd5b5080359060208101359060400135610c6b565b61015c600480360360208110156103b257600080fd5b5035610ec2565b3480156103c557600080fd5b5061015c600480360360208110156103dc57600080fd5b5035610ecc565b61015c600480360360408110156103f957600080fd5b5080359060200135610f54565b34801561041257600080fd5b506101af6004803603602081101561042957600080fd5b50356001600160a01b0316611007565b34801561044557600080fd5b5061044e611018565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610488578181015183820152602001610470565b50505050905090810190601f1680156104b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cf57600080fd5b5061015c600480360360208110156104e657600080fd5b50356001600160a01b0316611038565b6001600160a01b038116610545576040805162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015290519081900360640190fd5b61054f8282611041565b61055982826111fa565b6040805183815290516001600160a01b038316917fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e91919081900360200190a25050565b6105a461120d565b565b60006105c960405180606001604052806027815260200161252e602791396112b7565b90505b90565b60006105c96040518060400160405280601f81526020017f535441524b4e45545f544f4b454e5f4252494447455f49535f414354495645008152506112b7565b6105a4611334565b61062181336104f6565b50565b600090565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03163014156106a0576040805162461bcd60e51b81526020600482015260166024820152751112549150d517d0d0531317d11254d0531313d5d15160521b604482015290519081900360640190fd5b60006106aa610624565b602090810291508101808310156106fe576040805162461bcd60e51b81526020600482015260136024820152721253925517d110551057d513d3d7d4d3505313606a1b604482015290519081900360640190fd5b600061070c82848688612492565b602081101561071a57600080fd5b50356001600160a01b031690503660006107368582888a612492565b9150915061074482826107fe565b3660006107538887818c612492565b90925090506001600160a01b0385161561077e576107728583836113be565b505050505050506107fe565b610786611615565b156107da5780156107d5576040805162461bcd60e51b8152602060048201526014602482015273554e45585045435445445f494e49545f4441544160601b604482015290519081900360640190fd5b6107f6565b6107e48282611675565b6107ee828261180d565b6107f661184a565b505050505050505b5050565b61080a6105cf565b61084c576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d050d512559157d6515560921b604482015290519081900360640190fd5b8060006108576118cc565b600083815260209190915260409020546001600160a01b03169050806108bb576040805162461bcd60e51b81526020600482015260146024820152731393d7d1115413d4d25517d513d7d0d05390d15360621b604482015290519081900360640190fd5b6001600160a01b0381163314610909576040805162461bcd60e51b815260206004820152600e60248201526d27a7262cafa222a827a9a4aa27a960911b604482015290519081900360640190fd5b6109116118ef565b6001600160a01b0316637a98660b610927611912565b7f02d757788a8d8d6f21d1cd40bce38a8222d70654214e96ff95d8086e684fbee56109528989611935565b876040518563ffffffff1660e01b81526004018085815260200184815260200180602001838152602001828103825284818151815260200191508051906020019060200280838360005b838110156109b457818101518382015260200161099c565b5050505090500195505050505050602060405180830381600087803b1580156109dc57600080fd5b505af11580156109f0573d6000803e3d6000fd5b505050506040513d6020811015610a0657600080fd5b505060408051868152602081018590528151869233927fea57f52faafe318751f75acb6756cff3f66afc10201ef8f2d504e788985db3f5929081900390910190a35050505050565b60006105c96040518060600160405280602181526020016125a0602191396112b7565b610a7a336119bd565b610abd576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b610ac5611615565b610b16576040805162461bcd60e51b815260206004820152601860248201527f434f4e54524143545f4e4f545f494e495449414c495a45440000000000000000604482015290519081900360640190fd5b610b1f816119ec565b610b6a576040805162461bcd60e51b81526020600482015260176024820152764c325f414444524553535f4f55545f4f465f52414e474560481b604482015290519081900360640190fd5b610b7381611a0c565b610b7b611a2e565b6040805182815290517f7c4f4649950225877ed9efe9dd52350ec7c8be63c1ba43ead5dc74d9fc88deb89181900360200190a16040517f4ef0aca3da44a9503e18003dde42e77ce3415f7af25714333c7c09e255072fdf90600090a150565b61062181611a6e565b610bec336119bd565b610c2f576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6040805182815290517fa9aec19ec61c04ae0a4a1498ab6ce04cbd68b3d54c47888a45eb2bd37caf06bc9181900360200190a161062181611c14565b610c736105cf565b610cb5576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d050d512559157d6515560921b604482015290519081900360640190fd5b806000610cc06118cc565b600083815260209190915260409020546001600160a01b0316905080610d24576040805162461bcd60e51b81526020600482015260146024820152731393d7d1115413d4d25517d513d7d0d05390d15360621b604482015290519081900360640190fd5b6001600160a01b0381163314610d72576040805162461bcd60e51b815260206004820152600e60248201526d27a7262cafa222a827a9a4aa27a960911b604482015290519081900360640190fd5b610d7a6118ef565b6001600160a01b0316636170ff1b610d90611912565b7f02d757788a8d8d6f21d1cd40bce38a8222d70654214e96ff95d8086e684fbee5610dbb8989611935565b876040518563ffffffff1660e01b81526004018085815260200184815260200180602001838152602001828103825284818151815260200191508051906020019060200280838360005b83811015610e1d578181015183820152602001610e05565b5050505090500195505050505050602060405180830381600087803b158015610e4557600080fd5b505af1158015610e59573d6000803e3d6000fd5b505050506040513d6020811015610e6f57600080fd5b50610e7c905085336111fa565b60408051868152602081018590528151869233927fb0b548d5e12b6a60adac4d6dd7610f55134cea4fd145535edc303a48063e0cb4929081900390910190a35050505050565b6106213482610f54565b610ed5336119bd565b610f18576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6040805182815290517faf474b5afcf11bd99dc9fc7f499e6ab368d650bf7ef23993f0d61bd9ad7626519181900360200190a161062181611c36565b81341015610f9e576040805162461bcd60e51b8152602060048201526012602482015271494e53554646494349454e545f56414c554560701b604482015290519081900360640190fd5b34829003610faa6105a6565b8147031115610ff7576040805162461bcd60e51b815260206004820152601460248201527313505617d09053105390d157d15610d15151115160621b604482015290519081900360640190fd5b611002838383611c58565b505050565b6000611012826119bd565b92915050565b606060405180606001604052806022815260200161255560229139905090565b61062181611fc1565b6110496105cf565b61108b576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d050d512559157d6515560921b604482015290519081900360640190fd5b60408051600480825260a08201909252606091602082016080803683370190505090506000816000815181106110bd57fe5b602002602001018181525050816001600160a01b0316816001815181106110e057fe5b602090810291909101015280516001600160801b038416908290600290811061110557fe5b602002602001018181525050608083901c8160038151811061112357fe5b6020026020010181815250506111376118ef565b6001600160a01b0316632c9dd5c061114d611912565b836040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019060200280838360005b838110156111a357818101518382015260200161118b565b505050509050019350505050602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b5050505050565b6107fe6001600160a01b0382168361210e565b611216336119bd565b611259576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b60006112636121b4565b60018101549091506001600160a01b031615610621576001810180546001600160a01b03191690556040517f7a8dc7dd7fffb43c4807438fa62729225156941e641fd877938f4edade3429f590600090a150565b600080826040516020018082805190602001908083835b602083106112ed5780518252601f1990920191602091820191016112ce565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040528051906020012090508054915050919050565b600061133e6121b4565b60018101549091506001600160a01b031633146113a2576040805162461bcd60e51b815260206004820152601760248201527f4f4e4c595f43414e4449444154455f474f5645524e4f52000000000000000000604482015290519081900360640190fd5b6113ab336121d8565b60010180546001600160a01b0319169055565b6113d0836001600160a01b031661228c565b611416576040805162461bcd60e51b8152602060048201526012602482015271115250d7d393d517d057d0d3d395149050d560721b604482015290519081900360640190fd5b60006060846001600160a01b031663439fab9160e01b85856040516024018080602001828103825284848281815260200192508082843760008382015260408051601f909201601f1990811690940182810390940182529283526020810180516001600160e01b03166001600160e01b0319909916989098178852915182519297909650869550935090915081905083835b602083106114c75780518252601f1990920191602091820191016114a8565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114611527576040519150601f19603f3d011682016040523d82523d6000602084013e61152c565b606091505b50915091508181906115bc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611581578181015183820152602001611569565b50505050905090810190601f1680156115ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50805181901561160d5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611581578181015183820152602001611569565b505050505050565b600061161f610624565b61163f57600061162d6118ef565b6001600160a01b0316141590506105cc565b60006116496118ef565b6001600160a01b0316141580156105c957506000611665612292565b6001600160a01b03161415905090565b604081146116be576040805162461bcd60e51b8152602060048201526011602482015270494c4c4547414c5f444154415f53495a4560781b604482015290519081900360640190fd5b600080838360408110156116d157600080fd5b506001600160a01b038135811693506020909101351690506116f1610624565b1561175e57611708826001600160a01b031661228c565b611759576040805162461bcd60e51b815260206004820152601c60248201527f494e56414c49445f4252494447455f544f4b454e5f4144445245535300000000604482015290519081900360640190fd5b6117ba565b6001600160a01b038216156117ba576040805162461bcd60e51b815260206004820152601f60248201527f4e4f4e5f5a45524f5f544f4b454e5f414444524553535f50524f564944454400604482015290519081900360640190fd5b6117cc816001600160a01b031661228c565b6118075760405162461bcd60e51b81526004018080602001828103825260228152602001806125c16022913960400191505060405180910390fd5b50505050565b6000808383604081101561182057600080fd5b506001600160a01b03813581169350602090910135169050611841826122b5565b611807816122d7565b60006118546121b4565b6001810154909150600160a01b900460ff16156118ae576040805162461bcd60e51b81526020600482015260136024820152721053149150511657d253925512505312569151606a1b604482015290519081900360640190fd5b60018101805460ff60a01b1916600160a01b179055610621336121d8565b60006105c9604051806060016040528060298152602001612577602991396122f9565b60006105c96040518060600160405280602881526020016124bb602891396112b7565b60006105c9604051806060016040528060278152602001612507602791396112b7565b60408051600380825260808201909252606091829190602082018380368337019050509050828160008151811061196857fe5b602090810291909101015280516001600160801b038516908290600190811061198d57fe5b602002602001018181525050608084901c816002815181106119ab57fe5b60209081029190910101529392505050565b6000806119c86121b4565b6001600160a01b039390931660009081526020939093525050604090205460ff1690565b60008082118015611012575050600167080000000000001160c01b011190565b6106216040518060600160405280602781526020016125076027913982612375565b6105a46040518060400160405280601f81526020017f535441524b4e45545f544f4b454e5f4252494447455f49535f4143544956450081525060016123c4565b611a77336119bd565b611aba576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6000611ac46121b4565b90506001600160a01b038216611b0f576040805162461bcd60e51b815260206004820152600b60248201526a4241445f4144445245535360a81b604482015290519081900360640190fd5b611b18826119bd565b15611b5d576040805162461bcd60e51b815260206004820152601060248201526f20a62922a0a22cafa3a7ab22a92727a960811b604482015290519081900360640190fd5b60018101546001600160a01b031615611bbd576040805162461bcd60e51b815260206004820152601760248201527f4f544845525f43414e4449444154455f50454e44494e47000000000000000000604482015290519081900360640190fd5b6001810180546001600160a01b0384166001600160a01b0319909116811790915560408051918252517f6166272c8d3f5f579082f2827532732f97195007983bb5b83ac12c56700b01a69181900360200190a15050565b61062160405180606001604052806027815260200161252e60279139826123c4565b6106216040518060600160405280602181526020016125a060219139826123c4565b611c606105cf565b611ca2576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d050d512559157d6515560921b604482015290519081900360640190fd5b60008311611ce6576040805162461bcd60e51b815260206004820152600c60248201526b16915493d7d1115413d4d25560a21b604482015290519081900360640190fd5b80341015611d34576040805162461bcd60e51b8152602060048201526016602482015275494e53554646494349454e545f4d53475f56414c554560501b604482015290519081900360640190fd5b611d3d826119ec565b611d88576040805162461bcd60e51b81526020600482015260176024820152764c325f414444524553535f4f55545f4f465f52414e474560481b604482015290519081900360640190fd5b611d90610a4e565b831115611dce5760405162461bcd60e51b81526004018080602001828103825260248152602001806124e36024913960400191505060405180910390fd5b6000611dd86118ef565b6001600160a01b0316633e3aa6c583611def611912565b7f02d757788a8d8d6f21d1cd40bce38a8222d70654214e96ff95d8086e684fbee5611e1a8989611935565b6040518563ffffffff1660e01b81526004018084815260200183815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015611e75578181015183820152602001611e5d565b5050505090500194505050505060408051808303818588803b158015611e9a57600080fd5b505af1158015611eae573d6000803e3d6000fd5b50505050506040513d6040811015611ec557600080fd5b506020015190506000611ed66118cc565b600083815260209190915260409020546001600160a01b031614611f41576040805162461bcd60e51b815260206004820152601a60248201527f4445504f5349545f414c52454144595f52454749535445524544000000000000604482015290519081900360640190fd5b33611f4a6118cc565b6000838152602091825260409081902080546001600160a01b0319166001600160a01b03949094169390931790925581518681529081018390528082018490529051849133917f5b5dbc6c64043a15d3fe6943a6e443a826b78755edc257b2ec890c022225dbcf916060908290030190a350505050565b611fca336119bd565b61200d576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b336001600160a01b0382161415612062576040805162461bcd60e51b8152602060048201526014602482015273474f5645524e4f525f53454c465f52454d4f564560601b604482015290519081900360640190fd5b600061206c6121b4565b9050612077826119bd565b6120b7576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa3a7ab22a92727a960a11b604482015290519081900360640190fd5b6001600160a01b03821660008181526020838152604091829020805460ff19169055815192835290517fd75f94825e770b8b512be8e74759e252ad00e102e38f50cce2f7c6f868a295999281900390910190a15050565b80612118576107fe565b6040516000906001600160a01b0384169083908381818185875af1925050503d8060008114612163576040519150601f19603f3d011682016040523d82523d6000602084013e612168565b606091505b5050905080611002576040805162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b7f000000000000000000000000000000000000000000000000000000000000000090565b6121e1816119bd565b15612226576040805162461bcd60e51b815260206004820152601060248201526f20a62922a0a22cafa3a7ab22a92727a960811b604482015290519081900360640190fd5b60006122306121b4565b6001600160a01b03831660008181526020838152604091829020805460ff19166001179055815192835290519293507fcfb473e6c03f9a29ddaf990e736fa3de5188a0bd85d684f5b6e164ebfbfff5d292918290030190a15050565b3b151590565b60006105c96040518060600160405280602981526020016125e3602991396112b7565b6106216040518060600160405280602981526020016125e3602991398261243e565b6106216040518060600160405280602881526020016124bb602891398261243e565b600080826040516020018082805190602001908083835b6020831061232f5780518252601f199092019160209182019101612310565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120905080915050919050565b61237e826112b7565b156123be576040805162461bcd60e51b815260206004820152600b60248201526a1053149150511657d4d15560aa1b604482015290519081900360640190fd5b6107fe82825b6000826040516020018082805190602001908083835b602083106123f95780518252601f1990920191602091820191016123da565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052805190602001209050818155505050565b6000612449836112b7565b6001600160a01b0316146123be576040805162461bcd60e51b815260206004820152600b60248201526a1053149150511657d4d15560aa1b604482015290519081900360640190fd5b600080858511156124a1578182fd5b838611156124ad578182fd5b505082019391909203915056fe535441524b4e45545f544f4b454e5f4252494447455f4d4553534147494e475f434f4e54524143545452414e534645525f544f5f535441524b4e45545f414d4f554e545f4558434545444544535441524b4e45545f544f4b454e5f4252494447455f4c325f544f4b454e5f434f4e5452414354535441524b4e45545f544f4b454e5f4252494447455f4d41585f544f54414c5f42414c414e4345537461726b576172655f537461726b6e65744574684272696467655f323032335f31535441524b4e45545f544f4b454e5f4252494447455f4445504f5349544f525f414444524553534553535441524b4e45545f544f4b454e5f4252494447455f4d41585f4445504f534954494e56414c49445f4d4553534147494e475f434f4e54524143545f41444452455353535441524b4e45545f45524332305f544f4b454e5f4252494447455f544f4b454e5f41444452455353a264697066735822122042b34d36c5299eab1c67d4888a1bb65f94786447af356faa13519bfb3a9b625964736f6c634300060c0033535441524b574152455f44454641554c545f474f5645524e414e43455f494e464f
Deployed Bytecode
0x60806040526004361061011e5760003560e01c80637fc2ab3e116100a0578063bb371fdd11610064578063bb371fdd146103b9578063e2bbb158146103e3578063e43581b814610406578063eeb7286614610439578063eecdac88146104c35761011e565b80637fc2ab3e146102df57806387ebeb1814610309578063894ecf041461033c578063ae87381614610366578063b6b55f251461039c5761011e565b80632e1a7d4d116100e75780632e1a7d4d146101d857806333eeb14714610202578063439fab91146102175780634c567662146102945780636083e59a146102ca5761011e565b8062f714ce1461012357806310f2ec451461015e578063195340751461017357806322f3e2d41461019a578063238efcbc146101c3575b600080fd5b34801561012f57600080fd5b5061015c6004803603604081101561014657600080fd5b50803590602001356001600160a01b03166104f6565b005b34801561016a57600080fd5b5061015c61059c565b34801561017f57600080fd5b506101886105a6565b60408051918252519081900360200190f35b3480156101a657600080fd5b506101af6105cf565b604080519115158252519081900360200190f35b3480156101cf57600080fd5b5061015c61060f565b3480156101e457600080fd5b5061015c600480360360208110156101fb57600080fd5b5035610617565b34801561020e57600080fd5b506101af610624565b34801561022357600080fd5b5061015c6004803603602081101561023a57600080fd5b81019060208101813564010000000081111561025557600080fd5b82018360208201111561026757600080fd5b8035906020019184600183028401116401000000008311171561028957600080fd5b509092509050610629565b3480156102a057600080fd5b5061015c600480360360608110156102b757600080fd5b5080359060208101359060400135610802565b3480156102d657600080fd5b50610188610a4e565b3480156102eb57600080fd5b5061015c6004803603602081101561030257600080fd5b5035610a71565b34801561031557600080fd5b5061015c6004803603602081101561032c57600080fd5b50356001600160a01b0316610bda565b34801561034857600080fd5b5061015c6004803603602081101561035f57600080fd5b5035610be3565b34801561037257600080fd5b5061015c6004803603606081101561038957600080fd5b5080359060208101359060400135610c6b565b61015c600480360360208110156103b257600080fd5b5035610ec2565b3480156103c557600080fd5b5061015c600480360360208110156103dc57600080fd5b5035610ecc565b61015c600480360360408110156103f957600080fd5b5080359060200135610f54565b34801561041257600080fd5b506101af6004803603602081101561042957600080fd5b50356001600160a01b0316611007565b34801561044557600080fd5b5061044e611018565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610488578181015183820152602001610470565b50505050905090810190601f1680156104b55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cf57600080fd5b5061015c600480360360208110156104e657600080fd5b50356001600160a01b0316611038565b6001600160a01b038116610545576040805162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b604482015290519081900360640190fd5b61054f8282611041565b61055982826111fa565b6040805183815290516001600160a01b038316917fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e91919081900360200190a25050565b6105a461120d565b565b60006105c960405180606001604052806027815260200161252e602791396112b7565b90505b90565b60006105c96040518060400160405280601f81526020017f535441524b4e45545f544f4b454e5f4252494447455f49535f414354495645008152506112b7565b6105a4611334565b61062181336104f6565b50565b600090565b7f000000000000000000000000455603ad9ae671f6c1f0f746f24d7904ca6035816001600160a01b03163014156106a0576040805162461bcd60e51b81526020600482015260166024820152751112549150d517d0d0531317d11254d0531313d5d15160521b604482015290519081900360640190fd5b60006106aa610624565b602090810291508101808310156106fe576040805162461bcd60e51b81526020600482015260136024820152721253925517d110551057d513d3d7d4d3505313606a1b604482015290519081900360640190fd5b600061070c82848688612492565b602081101561071a57600080fd5b50356001600160a01b031690503660006107368582888a612492565b9150915061074482826107fe565b3660006107538887818c612492565b90925090506001600160a01b0385161561077e576107728583836113be565b505050505050506107fe565b610786611615565b156107da5780156107d5576040805162461bcd60e51b8152602060048201526014602482015273554e45585045435445445f494e49545f4441544160601b604482015290519081900360640190fd5b6107f6565b6107e48282611675565b6107ee828261180d565b6107f661184a565b505050505050505b5050565b61080a6105cf565b61084c576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d050d512559157d6515560921b604482015290519081900360640190fd5b8060006108576118cc565b600083815260209190915260409020546001600160a01b03169050806108bb576040805162461bcd60e51b81526020600482015260146024820152731393d7d1115413d4d25517d513d7d0d05390d15360621b604482015290519081900360640190fd5b6001600160a01b0381163314610909576040805162461bcd60e51b815260206004820152600e60248201526d27a7262cafa222a827a9a4aa27a960911b604482015290519081900360640190fd5b6109116118ef565b6001600160a01b0316637a98660b610927611912565b7f02d757788a8d8d6f21d1cd40bce38a8222d70654214e96ff95d8086e684fbee56109528989611935565b876040518563ffffffff1660e01b81526004018085815260200184815260200180602001838152602001828103825284818151815260200191508051906020019060200280838360005b838110156109b457818101518382015260200161099c565b5050505090500195505050505050602060405180830381600087803b1580156109dc57600080fd5b505af11580156109f0573d6000803e3d6000fd5b505050506040513d6020811015610a0657600080fd5b505060408051868152602081018590528151869233927fea57f52faafe318751f75acb6756cff3f66afc10201ef8f2d504e788985db3f5929081900390910190a35050505050565b60006105c96040518060600160405280602181526020016125a0602191396112b7565b610a7a336119bd565b610abd576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b610ac5611615565b610b16576040805162461bcd60e51b815260206004820152601860248201527f434f4e54524143545f4e4f545f494e495449414c495a45440000000000000000604482015290519081900360640190fd5b610b1f816119ec565b610b6a576040805162461bcd60e51b81526020600482015260176024820152764c325f414444524553535f4f55545f4f465f52414e474560481b604482015290519081900360640190fd5b610b7381611a0c565b610b7b611a2e565b6040805182815290517f7c4f4649950225877ed9efe9dd52350ec7c8be63c1ba43ead5dc74d9fc88deb89181900360200190a16040517f4ef0aca3da44a9503e18003dde42e77ce3415f7af25714333c7c09e255072fdf90600090a150565b61062181611a6e565b610bec336119bd565b610c2f576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6040805182815290517fa9aec19ec61c04ae0a4a1498ab6ce04cbd68b3d54c47888a45eb2bd37caf06bc9181900360200190a161062181611c14565b610c736105cf565b610cb5576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d050d512559157d6515560921b604482015290519081900360640190fd5b806000610cc06118cc565b600083815260209190915260409020546001600160a01b0316905080610d24576040805162461bcd60e51b81526020600482015260146024820152731393d7d1115413d4d25517d513d7d0d05390d15360621b604482015290519081900360640190fd5b6001600160a01b0381163314610d72576040805162461bcd60e51b815260206004820152600e60248201526d27a7262cafa222a827a9a4aa27a960911b604482015290519081900360640190fd5b610d7a6118ef565b6001600160a01b0316636170ff1b610d90611912565b7f02d757788a8d8d6f21d1cd40bce38a8222d70654214e96ff95d8086e684fbee5610dbb8989611935565b876040518563ffffffff1660e01b81526004018085815260200184815260200180602001838152602001828103825284818151815260200191508051906020019060200280838360005b83811015610e1d578181015183820152602001610e05565b5050505090500195505050505050602060405180830381600087803b158015610e4557600080fd5b505af1158015610e59573d6000803e3d6000fd5b505050506040513d6020811015610e6f57600080fd5b50610e7c905085336111fa565b60408051868152602081018590528151869233927fb0b548d5e12b6a60adac4d6dd7610f55134cea4fd145535edc303a48063e0cb4929081900390910190a35050505050565b6106213482610f54565b610ed5336119bd565b610f18576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6040805182815290517faf474b5afcf11bd99dc9fc7f499e6ab368d650bf7ef23993f0d61bd9ad7626519181900360200190a161062181611c36565b81341015610f9e576040805162461bcd60e51b8152602060048201526012602482015271494e53554646494349454e545f56414c554560701b604482015290519081900360640190fd5b34829003610faa6105a6565b8147031115610ff7576040805162461bcd60e51b815260206004820152601460248201527313505617d09053105390d157d15610d15151115160621b604482015290519081900360640190fd5b611002838383611c58565b505050565b6000611012826119bd565b92915050565b606060405180606001604052806022815260200161255560229139905090565b61062181611fc1565b6110496105cf565b61108b576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d050d512559157d6515560921b604482015290519081900360640190fd5b60408051600480825260a08201909252606091602082016080803683370190505090506000816000815181106110bd57fe5b602002602001018181525050816001600160a01b0316816001815181106110e057fe5b602090810291909101015280516001600160801b038416908290600290811061110557fe5b602002602001018181525050608083901c8160038151811061112357fe5b6020026020010181815250506111376118ef565b6001600160a01b0316632c9dd5c061114d611912565b836040518363ffffffff1660e01b81526004018083815260200180602001828103825283818151815260200191508051906020019060200280838360005b838110156111a357818101518382015260200161118b565b505050509050019350505050602060405180830381600087803b1580156111c957600080fd5b505af11580156111dd573d6000803e3d6000fd5b505050506040513d60208110156111f357600080fd5b5050505050565b6107fe6001600160a01b0382168361210e565b611216336119bd565b611259576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b60006112636121b4565b60018101549091506001600160a01b031615610621576001810180546001600160a01b03191690556040517f7a8dc7dd7fffb43c4807438fa62729225156941e641fd877938f4edade3429f590600090a150565b600080826040516020018082805190602001908083835b602083106112ed5780518252601f1990920191602091820191016112ce565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040528051906020012090508054915050919050565b600061133e6121b4565b60018101549091506001600160a01b031633146113a2576040805162461bcd60e51b815260206004820152601760248201527f4f4e4c595f43414e4449444154455f474f5645524e4f52000000000000000000604482015290519081900360640190fd5b6113ab336121d8565b60010180546001600160a01b0319169055565b6113d0836001600160a01b031661228c565b611416576040805162461bcd60e51b8152602060048201526012602482015271115250d7d393d517d057d0d3d395149050d560721b604482015290519081900360640190fd5b60006060846001600160a01b031663439fab9160e01b85856040516024018080602001828103825284848281815260200192508082843760008382015260408051601f909201601f1990811690940182810390940182529283526020810180516001600160e01b03166001600160e01b0319909916989098178852915182519297909650869550935090915081905083835b602083106114c75780518252601f1990920191602091820191016114a8565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d8060008114611527576040519150601f19603f3d011682016040523d82523d6000602084013e61152c565b606091505b50915091508181906115bc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611581578181015183820152602001611569565b50505050905090810190601f1680156115ae5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50805181901561160d5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611581578181015183820152602001611569565b505050505050565b600061161f610624565b61163f57600061162d6118ef565b6001600160a01b0316141590506105cc565b60006116496118ef565b6001600160a01b0316141580156105c957506000611665612292565b6001600160a01b03161415905090565b604081146116be576040805162461bcd60e51b8152602060048201526011602482015270494c4c4547414c5f444154415f53495a4560781b604482015290519081900360640190fd5b600080838360408110156116d157600080fd5b506001600160a01b038135811693506020909101351690506116f1610624565b1561175e57611708826001600160a01b031661228c565b611759576040805162461bcd60e51b815260206004820152601c60248201527f494e56414c49445f4252494447455f544f4b454e5f4144445245535300000000604482015290519081900360640190fd5b6117ba565b6001600160a01b038216156117ba576040805162461bcd60e51b815260206004820152601f60248201527f4e4f4e5f5a45524f5f544f4b454e5f414444524553535f50524f564944454400604482015290519081900360640190fd5b6117cc816001600160a01b031661228c565b6118075760405162461bcd60e51b81526004018080602001828103825260228152602001806125c16022913960400191505060405180910390fd5b50505050565b6000808383604081101561182057600080fd5b506001600160a01b03813581169350602090910135169050611841826122b5565b611807816122d7565b60006118546121b4565b6001810154909150600160a01b900460ff16156118ae576040805162461bcd60e51b81526020600482015260136024820152721053149150511657d253925512505312569151606a1b604482015290519081900360640190fd5b60018101805460ff60a01b1916600160a01b179055610621336121d8565b60006105c9604051806060016040528060298152602001612577602991396122f9565b60006105c96040518060600160405280602881526020016124bb602891396112b7565b60006105c9604051806060016040528060278152602001612507602791396112b7565b60408051600380825260808201909252606091829190602082018380368337019050509050828160008151811061196857fe5b602090810291909101015280516001600160801b038516908290600190811061198d57fe5b602002602001018181525050608084901c816002815181106119ab57fe5b60209081029190910101529392505050565b6000806119c86121b4565b6001600160a01b039390931660009081526020939093525050604090205460ff1690565b60008082118015611012575050600167080000000000001160c01b011190565b6106216040518060600160405280602781526020016125076027913982612375565b6105a46040518060400160405280601f81526020017f535441524b4e45545f544f4b454e5f4252494447455f49535f4143544956450081525060016123c4565b611a77336119bd565b611aba576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b6000611ac46121b4565b90506001600160a01b038216611b0f576040805162461bcd60e51b815260206004820152600b60248201526a4241445f4144445245535360a81b604482015290519081900360640190fd5b611b18826119bd565b15611b5d576040805162461bcd60e51b815260206004820152601060248201526f20a62922a0a22cafa3a7ab22a92727a960811b604482015290519081900360640190fd5b60018101546001600160a01b031615611bbd576040805162461bcd60e51b815260206004820152601760248201527f4f544845525f43414e4449444154455f50454e44494e47000000000000000000604482015290519081900360640190fd5b6001810180546001600160a01b0384166001600160a01b0319909116811790915560408051918252517f6166272c8d3f5f579082f2827532732f97195007983bb5b83ac12c56700b01a69181900360200190a15050565b61062160405180606001604052806027815260200161252e60279139826123c4565b6106216040518060600160405280602181526020016125a060219139826123c4565b611c606105cf565b611ca2576040805162461bcd60e51b815260206004820152600e60248201526d1393d517d050d512559157d6515560921b604482015290519081900360640190fd5b60008311611ce6576040805162461bcd60e51b815260206004820152600c60248201526b16915493d7d1115413d4d25560a21b604482015290519081900360640190fd5b80341015611d34576040805162461bcd60e51b8152602060048201526016602482015275494e53554646494349454e545f4d53475f56414c554560501b604482015290519081900360640190fd5b611d3d826119ec565b611d88576040805162461bcd60e51b81526020600482015260176024820152764c325f414444524553535f4f55545f4f465f52414e474560481b604482015290519081900360640190fd5b611d90610a4e565b831115611dce5760405162461bcd60e51b81526004018080602001828103825260248152602001806124e36024913960400191505060405180910390fd5b6000611dd86118ef565b6001600160a01b0316633e3aa6c583611def611912565b7f02d757788a8d8d6f21d1cd40bce38a8222d70654214e96ff95d8086e684fbee5611e1a8989611935565b6040518563ffffffff1660e01b81526004018084815260200183815260200180602001828103825283818151815260200191508051906020019060200280838360005b83811015611e75578181015183820152602001611e5d565b5050505090500194505050505060408051808303818588803b158015611e9a57600080fd5b505af1158015611eae573d6000803e3d6000fd5b50505050506040513d6040811015611ec557600080fd5b506020015190506000611ed66118cc565b600083815260209190915260409020546001600160a01b031614611f41576040805162461bcd60e51b815260206004820152601a60248201527f4445504f5349545f414c52454144595f52454749535445524544000000000000604482015290519081900360640190fd5b33611f4a6118cc565b6000838152602091825260409081902080546001600160a01b0319166001600160a01b03949094169390931790925581518681529081018390528082018490529051849133917f5b5dbc6c64043a15d3fe6943a6e443a826b78755edc257b2ec890c022225dbcf916060908290030190a350505050565b611fca336119bd565b61200d576040805162461bcd60e51b815260206004820152600f60248201526e4f4e4c595f474f5645524e414e434560881b604482015290519081900360640190fd5b336001600160a01b0382161415612062576040805162461bcd60e51b8152602060048201526014602482015273474f5645524e4f525f53454c465f52454d4f564560601b604482015290519081900360640190fd5b600061206c6121b4565b9050612077826119bd565b6120b7576040805162461bcd60e51b815260206004820152600c60248201526b2727aa2fa3a7ab22a92727a960a11b604482015290519081900360640190fd5b6001600160a01b03821660008181526020838152604091829020805460ff19169055815192835290517fd75f94825e770b8b512be8e74759e252ad00e102e38f50cce2f7c6f868a295999281900390910190a15050565b80612118576107fe565b6040516000906001600160a01b0384169083908381818185875af1925050503d8060008114612163576040519150601f19603f3d011682016040523d82523d6000602084013e612168565b606091505b5050905080611002576040805162461bcd60e51b815260206004820152601360248201527211551217d514905394d1915497d19052531151606a1b604482015290519081900360640190fd5b7f77765b223557306749dec3d8a1282364a5c0a4115f52f11527df3de374dc71f790565b6121e1816119bd565b15612226576040805162461bcd60e51b815260206004820152601060248201526f20a62922a0a22cafa3a7ab22a92727a960811b604482015290519081900360640190fd5b60006122306121b4565b6001600160a01b03831660008181526020838152604091829020805460ff19166001179055815192835290519293507fcfb473e6c03f9a29ddaf990e736fa3de5188a0bd85d684f5b6e164ebfbfff5d292918290030190a15050565b3b151590565b60006105c96040518060600160405280602981526020016125e3602991396112b7565b6106216040518060600160405280602981526020016125e3602991398261243e565b6106216040518060600160405280602881526020016124bb602891398261243e565b600080826040516020018082805190602001908083835b6020831061232f5780518252601f199092019160209182019101612310565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405160208183030381529060405280519060200120905080915050919050565b61237e826112b7565b156123be576040805162461bcd60e51b815260206004820152600b60248201526a1053149150511657d4d15560aa1b604482015290519081900360640190fd5b6107fe82825b6000826040516020018082805190602001908083835b602083106123f95780518252601f1990920191602091820191016123da565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051602081830303815290604052805190602001209050818155505050565b6000612449836112b7565b6001600160a01b0316146123be576040805162461bcd60e51b815260206004820152600b60248201526a1053149150511657d4d15560aa1b604482015290519081900360640190fd5b600080858511156124a1578182fd5b838611156124ad578182fd5b505082019391909203915056fe535441524b4e45545f544f4b454e5f4252494447455f4d4553534147494e475f434f4e54524143545452414e534645525f544f5f535441524b4e45545f414d4f554e545f4558434545444544535441524b4e45545f544f4b454e5f4252494447455f4c325f544f4b454e5f434f4e5452414354535441524b4e45545f544f4b454e5f4252494447455f4d41585f544f54414c5f42414c414e4345537461726b576172655f537461726b6e65744574684272696467655f323032335f31535441524b4e45545f544f4b454e5f4252494447455f4445504f5349544f525f414444524553534553535441524b4e45545f544f4b454e5f4252494447455f4d41585f4445504f534954494e56414c49445f4d4553534147494e475f434f4e54524143545f41444452455353535441524b4e45545f45524332305f544f4b454e5f4252494447455f544f4b454e5f41444452455353a264697066735822122042b34d36c5299eab1c67d4888a1bb65f94786447af356faa13519bfb3a9b625964736f6c634300060c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 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.