Source Code
Overview
ETH Balance
ETH Value
$0.00| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 27520118 | 19 days ago | 0 ETH | ||||
| 27517246 | 19 days ago | 0 ETH | ||||
| 27514331 | 19 days ago | 0 ETH | ||||
| 27511514 | 19 days ago | 0 ETH | ||||
| 27508570 | 19 days ago | 0 ETH | ||||
| 27505649 | 19 days ago | 0 ETH | ||||
| 27502733 | 20 days ago | 0 ETH | ||||
| 27499815 | 20 days ago | 0 ETH | ||||
| 27496825 | 20 days ago | 0 ETH | ||||
| 27493877 | 20 days ago | 0 ETH | ||||
| 27490911 | 20 days ago | 0 ETH | ||||
| 27487932 | 20 days ago | 0 ETH | ||||
| 27485015 | 20 days ago | 0 ETH | ||||
| 27482091 | 20 days ago | 0 ETH | ||||
| 27479288 | 20 days ago | 0 ETH | ||||
| 27476398 | 20 days ago | 0 ETH | ||||
| 27473570 | 20 days ago | 0 ETH | ||||
| 27470907 | 20 days ago | 0 ETH | ||||
| 27468111 | 20 days ago | 0 ETH | ||||
| 27465324 | 20 days ago | 0 ETH | ||||
| 27462553 | 20 days ago | 0 ETH | ||||
| 27459765 | 21 days ago | 0 ETH | ||||
| 27456867 | 21 days ago | 0 ETH | ||||
| 27453945 | 21 days ago | 0 ETH | ||||
| 27451035 | 21 days ago | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
BscBlockUpdater
Compiler Version
v0.8.18+commit.87f61d96
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.14;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import "contracts/interface/IBlockUpdater.sol";
import "contracts/interface/ICircuitVerifier.sol";
contract BscBlockUpdater is IBlockUpdater, Initializable, OwnableUpgradeable {
uint256 private constant FIRST_LORENTZ_FORK_HEIGHT = 48773577;
uint256 private constant FIRST_MAXWELL_FORK_HEIGHT = 52337741;
uint256 private constant LEGACY_EPOCH = 200;
uint256 private constant LORENTZ_EPOCH = 500;
uint256 private constant MAXWELL_EPOCH = 1000;
uint256 private constant FIRST_LORENTZ_EPOCH_HEIGHT = FIRST_LORENTZ_FORK_HEIGHT / LORENTZ_EPOCH * LORENTZ_EPOCH + LORENTZ_EPOCH;
uint256 private constant FIRST_MAXWELL_EPOCH_HEIGHT = FIRST_MAXWELL_FORK_HEIGHT / MAXWELL_EPOCH * MAXWELL_EPOCH + MAXWELL_EPOCH;
uint256 private constant FIRST_LORENTZ_EPOCH_NUM = (FIRST_LORENTZ_EPOCH_HEIGHT - 1) / LEGACY_EPOCH + 1;
uint256 private constant FIRST_MAXWELL_EPOCH_NUM = FIRST_LORENTZ_EPOCH_NUM + (FIRST_MAXWELL_FORK_HEIGHT - FIRST_LORENTZ_EPOCH_HEIGHT) / LORENTZ_EPOCH + 1;
event ImportValidator(uint256 indexed epoch, uint256 indexed blockNumber, bytes32 blockHash, bytes32 receiptHash);
event ModBlockConfirmation(uint256 oldBlockConfirmation, uint256 newBlockConfirmation);
struct ParsedInput {
uint256 blockNumber;
uint256 epochValidatorCount;
uint256 blockConfirmation;
uint256 epochValidatorN;
bytes32 blockHash;
bytes32 receiptHash;
bytes32 signingValidatorSetHash;
bytes32 epochValidatorSetHash;
}
struct ZkProof {
uint256[2] a;
uint256[2][2] b;
uint256[2] c;
uint256[] inputs;
}
uint256 public currentEpoch;
uint256 public minBlockConfirmation;
uint256 public regularValidatorCount;
uint256 public publicInputSize;
IBlockUpdater public oldBlockUpdater;
mapping(uint256 => ICircuitVerifier) public blockVerifier;
// epoch=>validatorHash
mapping(uint256 => bytes32) public validatorHashes;
// epoch=>validatorCount
mapping(uint256 => uint256) private validatorCounts;
// blockHash=>receiptsRoot =>BlockConfirmation
mapping(bytes32 => mapping(bytes32 => uint256)) public blockInfos;
// epoch=>validatorN
mapping(uint256 => uint256) public validatorN;
function initialize(
uint256 _epoch,
uint256 _validatorCount,
uint256 _preValidatorCount,
bytes32 _epochValidatorSetHash,
bytes32 _preEpochValidatorSetHash,
bytes32 _blockHash,
bytes32 _receiptHash,
uint256 _minBlockConfirmation,
uint256 _regularValidatorCount,
uint256 _preEpochValidatorN,
uint256 _epochValidatorN
) public initializer {
__Ownable_init();
currentEpoch = _epoch;
validatorHashes[_epoch] = _epochValidatorSetHash;
validatorHashes[_epoch - 1] = _preEpochValidatorSetHash;
validatorN[_epoch - 1] = _preEpochValidatorN;
validatorN[_epoch] = _epochValidatorN;
validatorCounts[_epoch] = _validatorCount;
_setValidatorCount(_epoch, _validatorCount);
_setValidatorCount(_epoch - 1, _preValidatorCount);
blockInfos[_blockHash][_receiptHash] = _minBlockConfirmation;
minBlockConfirmation = _minBlockConfirmation;
regularValidatorCount = _regularValidatorCount;
publicInputSize = 12;
}
function importBlock(bytes calldata _proof) external {
ZkProof memory proofData;
(proofData.a, proofData.b, proofData.c, proofData.inputs) = abi.decode(
_proof,
(uint256[2], uint256[2][2], uint256[2], uint256[])
);
uint256 blockSize = proofData.inputs.length / publicInputSize;
require(blockSize * publicInputSize == proofData.inputs.length, "invalid public input size");
ICircuitVerifier circuitVerifier = blockVerifier[blockSize];
require(address(circuitVerifier) != address(0), "not set verifier");
uint256[1] memory compressInput;
compressInput[0] = _hashInput(proofData.inputs);
require(circuitVerifier.verifyProof(proofData.a, proofData.b, proofData.c, compressInput), "invalid proof");
ParsedInput[] memory parsedInputs = _parseInput(proofData.inputs, blockSize);
for (uint256 i = 0; i < blockSize; i++) {
if (i > 0 && parsedInputs[i].blockHash == parsedInputs[i - 1].blockHash) {
break;
}
if (parsedInputs[i].blockNumber % 1000 == 0) {
_importValidator(parsedInputs[i]);
} else {
_importBlock(parsedInputs[i]);
}
}
}
function checkBlock(bytes32 _blockHash, bytes32 _receiptHash) external view returns (bool) {
(bool exist, ) = _checkBlock(_blockHash, _receiptHash);
return exist;
}
function checkBlockConfirmation(bytes32 _blockHash, bytes32 _receiptHash) external view returns (bool, uint256) {
return _checkBlock(_blockHash, _receiptHash);
}
function _checkBlock(bytes32 _blockHash, bytes32 _receiptHash) internal view returns (bool, uint256) {
uint256 blockConfirmation = blockInfos[_blockHash][_receiptHash];
if (blockConfirmation > 0) {
return (true, blockConfirmation);
}
if (address(oldBlockUpdater) != address(0)) {
return oldBlockUpdater.checkBlockConfirmation(_blockHash, _receiptHash);
}
return (false, 0);
}
function _importBlock(ParsedInput memory parsedInput) internal {
require(parsedInput.blockConfirmation >= minBlockConfirmation, "Not enough block confirmations");
(bool exist, uint256 blockConfirmation) = _checkBlock(parsedInput.blockHash, parsedInput.receiptHash);
if (exist && parsedInput.blockConfirmation <= blockConfirmation) {
revert("already exist");
}
uint256 epoch = _computeEpoch(parsedInput.blockNumber);
uint256 preEpoch = epoch - 1;
require(validatorHashes[epoch] != bytes32(0), "epoch no upload");
if (parsedInput.blockNumber % 1000 <= (getValidatorCount(preEpoch) / 2 + 1) * validatorN[preEpoch] - 1) {
require(
parsedInput.signingValidatorSetHash == validatorHashes[preEpoch],
"invalid preEpochValidatorSetHash"
);
} else {
require(parsedInput.signingValidatorSetHash == validatorHashes[epoch], "invalid epochValidatorSetHash");
}
blockInfos[parsedInput.blockHash][parsedInput.receiptHash] = parsedInput.blockConfirmation;
emit ImportBlock(parsedInput.blockNumber, parsedInput.blockHash, parsedInput.receiptHash);
}
function _importValidator(ParsedInput memory parsedInput) internal {
uint256 epoch = _computeEpoch(parsedInput.blockNumber);
uint256 preEpoch = epoch - 1;
require(parsedInput.epochValidatorSetHash != bytes32(0), "invalid epochValidatorSetHash");
require(parsedInput.signingValidatorSetHash != bytes32(0), "invalid signingValidatorSetHash");
require(parsedInput.blockConfirmation >= minBlockConfirmation, "Not enough block confirmations");
require(parsedInput.signingValidatorSetHash == validatorHashes[preEpoch], "invalid preEpochValidatorSetHash");
validatorHashes[epoch] = parsedInput.epochValidatorSetHash;
_setValidatorCount(epoch, parsedInput.epochValidatorCount);
_setValidatorN(epoch, parsedInput.epochValidatorN);
currentEpoch = epoch;
blockInfos[parsedInput.blockHash][parsedInput.receiptHash] = parsedInput.blockConfirmation;
emit ImportValidator(epoch, parsedInput.blockNumber, parsedInput.blockHash, parsedInput.receiptHash);
}
function _setValidatorN(uint256 _epoch, uint256 _validatorN) internal {
validatorN[_epoch] = _validatorN;
}
function _setValidatorCount(uint256 _epoch, uint256 _validatorCount) internal {
if (_validatorCount != regularValidatorCount) {
validatorCounts[_epoch] = _validatorCount;
}
}
function getValidatorCount(uint256 _epoch) public view returns (uint256) {
if (validatorCounts[_epoch] != 0) {
return validatorCounts[_epoch];
}
return regularValidatorCount;
}
function _parseInput(uint256[] memory _inputs, uint256 _blockSize) internal pure returns (ParsedInput[] memory) {
uint256 index = 0;
ParsedInput[] memory result = new ParsedInput[](_blockSize);
for (uint256 i = 0; i < _blockSize; i++) {
result[i].blockNumber = _inputs[index];
index++;
result[i].blockHash = bytes32((_inputs[index + 1] << 128) | _inputs[index]);
index += 2;
result[i].receiptHash = bytes32((_inputs[index + 1] << 128) | _inputs[index]);
index += 2;
result[i].signingValidatorSetHash = bytes32((_inputs[index + 1] << 128) | _inputs[index]);
index += 2;
result[i].epochValidatorSetHash = bytes32((_inputs[index + 1] << 128) | _inputs[index]);
index += 2;
result[i].epochValidatorCount = _inputs[index];
index++;
result[i].blockConfirmation = _inputs[index];
index++;
result[i].epochValidatorN = _inputs[index];
index++;
}
return result;
}
function _hashInput(uint256[] memory _inputs) internal pure returns (uint256) {
uint256 n = _inputs.length;
uint256 inputLength = n * 32;
bytes memory packedInputs;
assembly {
packedInputs := mload(0x40) // Get the free memory pointer
mstore(0x40, add(packedInputs, add(inputLength, 0x20))) // Update the free memory pointer
let inputOffset := packedInputs
mstore(inputOffset, inputLength) // Store the length of the concatenated inputs
inputOffset := add(inputOffset, 0x20) // Move the pointer to the start of the concatenated inputs
for {
let i := 0
} lt(i, n) {
i := add(i, 1)
} {
let inputValue := mload(add(_inputs, mul(add(i, 1), 0x20))) // Load the input value
mstore(inputOffset, inputValue) // Store the input value at the current offset
inputOffset := add(inputOffset, 0x20) // Move the pointer to the next position
}
}
uint256 computedHash = uint256(keccak256(packedInputs));
return computedHash / 256;
}
function _computeEpoch(uint256 _blockNumber) internal pure returns (uint256) {
if (_blockNumber < FIRST_LORENTZ_EPOCH_HEIGHT) {
return _blockNumber / LEGACY_EPOCH;
} else if (_blockNumber < FIRST_MAXWELL_EPOCH_HEIGHT) {
return FIRST_LORENTZ_EPOCH_NUM + (_blockNumber - FIRST_LORENTZ_EPOCH_HEIGHT) / LORENTZ_EPOCH;
} else {
return FIRST_MAXWELL_EPOCH_NUM + (_blockNumber - FIRST_MAXWELL_EPOCH_HEIGHT) / MAXWELL_EPOCH;
}
}
//----------------------------------------------------------------------------------
// onlyOwner
function setBlockConfirmation(uint256 _minBlockConfirmation) external onlyOwner {
emit ModBlockConfirmation(minBlockConfirmation, _minBlockConfirmation);
minBlockConfirmation = _minBlockConfirmation;
}
function setOldBlockUpdater(address _oldBlockUpdater) external onlyOwner {
oldBlockUpdater = IBlockUpdater(_oldBlockUpdater);
}
function setPublicInputSize(uint256 _publicInputSize) external onlyOwner {
publicInputSize = _publicInputSize;
}
function setVerifier(uint256 _blockSize, address _blockVerifier) external onlyOwner {
blockVerifier[_blockSize] = ICircuitVerifier(_blockVerifier);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../utils/ContextUpgradeable.sol";
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal onlyInitializing {
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal onlyInitializing {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a
* constructor.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: setting the version to 255 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized != type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint8) {
return _initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _initializing;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
*
* Furthermore, `isContract` will also return true if the target contract within
* the same transaction is already scheduled for destruction by `SELFDESTRUCT`,
* which only has an effect at the end of a transaction.
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.0/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata, errorMessage);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling
* the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.
*
* _Available since v4.8._
*/
function verifyCallResultFromTarget(
address target,
bool success,
bytes memory returndata,
string memory errorMessage
) internal view returns (bytes memory) {
if (success) {
if (returndata.length == 0) {
// only check isContract if the call was successful and the return data is empty
// otherwise we already know that it was a contract
require(isContract(target), "Address: call to non-contract");
}
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
/**
* @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason or using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
_revert(returndata, errorMessage);
}
}
function _revert(bytes memory returndata, string memory errorMessage) private pure {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
import {Initializable} from "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface IBlockUpdater {
event ImportBlock(uint256 identifier, bytes32 blockHash, bytes32 receiptHash);
function importBlock(bytes calldata _proof) external;
function checkBlock(bytes32 _blockHash, bytes32 _receiptsRoot) external view returns (bool);
function checkBlockConfirmation(bytes32 _blockHash, bytes32 _receiptsRoot) external view returns (bool, uint256);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface ICircuitVerifier {
function verifyProof(
uint256[2] memory a,
uint256[2][2] memory b,
uint256[2] memory c,
uint256[1] memory input
) external view returns (bool);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"identifier","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"blockHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"receiptHash","type":"bytes32"}],"name":"ImportBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"epoch","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"blockNumber","type":"uint256"},{"indexed":false,"internalType":"bytes32","name":"blockHash","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"receiptHash","type":"bytes32"}],"name":"ImportValidator","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldBlockConfirmation","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newBlockConfirmation","type":"uint256"}],"name":"ModBlockConfirmation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"blockInfos","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"blockVerifier","outputs":[{"internalType":"contract ICircuitVerifier","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_blockHash","type":"bytes32"},{"internalType":"bytes32","name":"_receiptHash","type":"bytes32"}],"name":"checkBlock","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_blockHash","type":"bytes32"},{"internalType":"bytes32","name":"_receiptHash","type":"bytes32"}],"name":"checkBlockConfirmation","outputs":[{"internalType":"bool","name":"","type":"bool"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentEpoch","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"}],"name":"getValidatorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"_proof","type":"bytes"}],"name":"importBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_epoch","type":"uint256"},{"internalType":"uint256","name":"_validatorCount","type":"uint256"},{"internalType":"uint256","name":"_preValidatorCount","type":"uint256"},{"internalType":"bytes32","name":"_epochValidatorSetHash","type":"bytes32"},{"internalType":"bytes32","name":"_preEpochValidatorSetHash","type":"bytes32"},{"internalType":"bytes32","name":"_blockHash","type":"bytes32"},{"internalType":"bytes32","name":"_receiptHash","type":"bytes32"},{"internalType":"uint256","name":"_minBlockConfirmation","type":"uint256"},{"internalType":"uint256","name":"_regularValidatorCount","type":"uint256"},{"internalType":"uint256","name":"_preEpochValidatorN","type":"uint256"},{"internalType":"uint256","name":"_epochValidatorN","type":"uint256"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"minBlockConfirmation","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oldBlockUpdater","outputs":[{"internalType":"contract IBlockUpdater","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"publicInputSize","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"regularValidatorCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minBlockConfirmation","type":"uint256"}],"name":"setBlockConfirmation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_oldBlockUpdater","type":"address"}],"name":"setOldBlockUpdater","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_publicInputSize","type":"uint256"}],"name":"setPublicInputSize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_blockSize","type":"uint256"},{"internalType":"address","name":"_blockVerifier","type":"address"}],"name":"setVerifier","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"validatorHashes","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"validatorN","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
608060405234801561001057600080fd5b50611cbd806100206000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806382a705ba116100b8578063a9ef31de1161007c578063a9ef31de14610293578063bd043d881461029c578063c4d98bce146102bc578063cc373045146102e5578063dc3588ea146102f8578063f2fde38b1461031b57600080fd5b806382a705ba1461022c5780638da5cb5b1461023f5780639c6a3f56146102645780639d0167e71461026d578063a4f2b42f1461028057600080fd5b8063412ec79d116100ff578063412ec79d146101df57806370e1e09b146101f2578063715018a6146101fb5780637667180814610203578063769b047d1461020c57600080fd5b806302952ab61461013c5780631957ba4e1461017a5780631bf4864e1461018f578063254252af146101a257806336fbafad146101cc575b600080fd5b61016761014a3660046116ed565b606d60209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b61018d610188366004611726565b61032e565b005b61018d61019d366004611752565b610364565b6101b56101b03660046116ed565b61038e565b604080519215158352602083019190915201610171565b61018d6101da366004611774565b6103a7565b61018d6101ed3660046117e6565b610682565b61016760685481565b61018d61068f565b61016760655481565b61016761021a3660046117e6565b606e6020526000908152604090205481565b61018d61023a3660046117ff565b6106a3565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610171565b61016760675481565b61018d61027b3660046117e6565b61088d565b60695461024c906001600160a01b031681565b61016760665481565b6101676102aa3660046117e6565b606b6020526000908152604090205481565b61024c6102ca3660046117e6565b606a602052600090815260409020546001600160a01b031681565b6101676102f33660046117e6565b6108d6565b61030b6103063660046116ed565b610905565b6040519015158152602001610171565b61018d610329366004611752565b61091d565b610336610996565b6000918252606a602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b61036c610996565b606980546001600160a01b0319166001600160a01b0392909216919091179055565b60008061039b84846109f0565b915091505b9250929050565b6103af61164a565b6103bb8284018461199b565b606085018190526040850191909152602084019190915290825260685490516000916103e691611a81565b9050816060015151606854826103fc9190611a95565b1461044e5760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964207075626c696320696e7075742073697a650000000000000060448201526064015b60405180910390fd5b6000818152606a60205260409020546001600160a01b0316806104a65760405162461bcd60e51b815260206004820152601060248201526f3737ba1039b2ba103b32b934b334b2b960811b6044820152606401610445565b6104ae611684565b6104bb8460600151610ab8565b81528351602085015160408087015190516343753b4d60e01b81526001600160a01b038616936343753b4d936104fa9391929091908790600401611aeb565b602060405180830381865afa158015610517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053b9190611ba2565b6105775760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610445565b6000610587856060015185610b20565b905060005b84811015610678576000811180156105e75750816105ab600183611bbd565b815181106105bb576105bb611aac565b6020026020010151608001518282815181106105d9576105d9611aac565b602002602001015160800151145b610678576103e882828151811061060057610600611aac565b6020026020010151600001516106169190611bd0565b6000036106445761063f82828151811061063257610632611aac565b6020026020010151610ec2565b610666565b61066682828151811061065957610659611aac565b60200260200101516110f2565b8061067081611be4565b91505061058c565b5050505050505050565b61068a610996565b606855565b610697610996565b6106a160006113b3565b565b600054610100900460ff16158080156106c35750600054600160ff909116105b806106dd5750303b1580156106dd575060005460ff166001145b6107405760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610445565b6000805460ff191660011790558015610763576000805461ff0019166101001790555b61076b611405565b8b60658190555088606b60008e81526020019081526020016000208190555087606b600060018f61079c9190611bbd565b81526020019081526020016000208190555082606e600060018f6107c09190611bbd565b815260208082019290925260409081016000908120939093558e8352606e8252808320859055606c90915290208b90556107fa8c8c611434565b61080e61080860018e611bbd565b8b611434565b6000878152606d60209081526040808320898452909152902085905560668590556067849055600c606855801561087f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b610895610996565b60665460408051918252602082018390527f5ab2642364d92dafb2be757706f004ccf8325cca566bc2d0742133d316a5eaed910160405180910390a1606655565b6000818152606c6020526040812054156108fd57506000908152606c602052604090205490565b505060675490565b60008061091284846109f0565b509150505b92915050565b610925610996565b6001600160a01b03811661098a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610445565b610993816113b3565b50565b6033546001600160a01b031633146106a15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610445565b6000828152606d6020908152604080832084845290915281205481908015610a1d576001925090506103a0565b6069546001600160a01b031615610aab5760695460405163254252af60e01b815260048101879052602481018690526001600160a01b039091169063254252af906044016040805180830381865afa158015610a7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa19190611bfd565b92509250506103a0565b5060009485945092505050565b805160009081610ac9826020611a95565b6040805160208382018101909252828152919250810160005b84811015610b0157600101602081810288015183529190910190610ae2565b505080516020820120610b1661010082611a81565b9695505050505050565b60606000808367ffffffffffffffff811115610b3e57610b3e611871565b604051908082528060200260200182016040528015610bad57816020015b604080516101008101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e08201528252600019909201910181610b5c5790505b50905060005b8481101561091257858381518110610bcd57610bcd611aac565b6020026020010151828281518110610be757610be7611aac565b60209081029190910101515282610bfd81611be4565b935050858381518110610c1257610c12611aac565b6020026020010151608087856001610c2a9190611c29565b81518110610c3a57610c3a611aac565b6020026020010151901b1760001b828281518110610c5a57610c5a611aac565b602090810291909101015160800152610c74600284611c29565b9250858381518110610c8857610c88611aac565b6020026020010151608087856001610ca09190611c29565b81518110610cb057610cb0611aac565b6020026020010151901b1760001b828281518110610cd057610cd0611aac565b602090810291909101015160a00152610cea600284611c29565b9250858381518110610cfe57610cfe611aac565b6020026020010151608087856001610d169190611c29565b81518110610d2657610d26611aac565b6020026020010151901b1760001b828281518110610d4657610d46611aac565b602090810291909101015160c00152610d60600284611c29565b9250858381518110610d7457610d74611aac565b6020026020010151608087856001610d8c9190611c29565b81518110610d9c57610d9c611aac565b6020026020010151901b1760001b828281518110610dbc57610dbc611aac565b602090810291909101015160e00152610dd6600284611c29565b9250858381518110610dea57610dea611aac565b6020026020010151828281518110610e0457610e04611aac565b602090810291909101810151015282610e1c81611be4565b935050858381518110610e3157610e31611aac565b6020026020010151828281518110610e4b57610e4b611aac565b60209081029190910101516040015282610e6481611be4565b935050858381518110610e7957610e79611aac565b6020026020010151828281518110610e9357610e93611aac565b60209081029190910101516060015282610eac81611be4565b9350508080610eba90611be4565b915050610bb3565b6000610ed18260000151611453565b90506000610ee0600183611bbd565b60e0840151909150610f345760405162461bcd60e51b815260206004820152601d60248201527f696e76616c69642065706f636856616c696461746f72536574486173680000006044820152606401610445565b60c0830151610f855760405162461bcd60e51b815260206004820152601f60248201527f696e76616c6964207369676e696e6756616c696461746f7253657448617368006044820152606401610445565b60665483604001511015610fdb5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820626c6f636b20636f6e6669726d6174696f6e7300006044820152606401610445565b6000818152606b602052604090205460c08401511461103c5760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726545706f636856616c696461746f72536574486173686044820152606401610445565b8260e00151606b600084815260200190815260200160002081905550611066828460200151611434565b60608301516000838152606e602052604090205560658290556040838101516080850180516000908152606d602090815284822060a089018051845290825291859020939093558651915190518451918252928101929092529184917fb20f83d7fca2253dd4a37d0ee1922398cbbecf5a89899514947161ae70c0037f910160405180910390a3505050565b606654816040015110156111485760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820626c6f636b20636f6e6669726d6174696f6e7300006044820152606401610445565b60008061115d83608001518460a001516109f0565b91509150818015611172575080836040015111155b156111af5760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e48195e1a5cdd609a1b6044820152606401610445565b60006111be8460000151611453565b905060006111cd600183611bbd565b6000838152606b602052604090205490915061121d5760405162461bcd60e51b815260206004820152600f60248201526e195c1bd8da081b9bc81d5c1b1bd859608a1b6044820152606401610445565b6000818152606e6020526040902054600190600261123a846108d6565b6112449190611a81565b61124f906001611c29565b6112599190611a95565b6112639190611bbd565b8551611272906103e890611bd0565b116112dd576000818152606b602052604090205460c0860151146112d85760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726545706f636856616c696461746f72536574486173686044820152606401610445565b61133e565b6000828152606b602052604090205460c08601511461133e5760405162461bcd60e51b815260206004820152601d60248201527f696e76616c69642065706f636856616c696461746f72536574486173680000006044820152606401610445565b6040858101516080870180516000908152606d602090815284822060a08b01805184529082529185902093909355885191519051845192835292820152918201527fa3fa2e60f4d1c7f6bd60da77a4be0625773dfb6b22c54fe77e725d03e49cdf2e9060600160405180910390a15050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661142c5760405162461bcd60e51b815260040161044590611c3c565b6106a161161a565b606754811461144f576000828152606c602052604090208190555b5050565b60006101f480611467816302e839c9611a81565b6114719190611a95565b61147b9190611c29565b82101561148d5761091760c883611a81565b6103e88061149f8163031e9c4d611a81565b6114a99190611a95565b6114b39190611c29565b821015611548576101f480806114cd816302e839c9611a81565b6114d79190611a95565b6114e19190611c29565b6114eb9084611bbd565b6114f59190611a81565b60c860016101f48061150b816302e839c9611a81565b6115159190611a95565b61151f9190611c29565b6115299190611bbd565b6115339190611a81565b61153e906001611c29565b6109179190611c29565b6103e8808061155b8163031e9c4d611a81565b6115659190611a95565b61156f9190611c29565b6115799084611bbd565b6115839190611a81565b6101f48080611596816302e839c9611a81565b6115a09190611a95565b6115aa9190611c29565b6115b89063031e9c4d611bbd565b6115c29190611a81565b60c860016101f4806115d8816302e839c9611a81565b6115e29190611a95565b6115ec9190611c29565b6115f69190611bbd565b6116009190611a81565b61160b906001611c29565b6115339190611c29565b919050565b600054610100900460ff166116415760405162461bcd60e51b815260040161044590611c3c565b6106a1336113b3565b604051806080016040528061165d6116a2565b815260200161166a6116c0565b81526020016116776116a2565b8152602001606081525090565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b60405180604001604052806002905b6116d76116a2565b8152602001906001900390816116cf5790505090565b6000806040838503121561170057600080fd5b50508035926020909101359150565b80356001600160a01b038116811461161557600080fd5b6000806040838503121561173957600080fd5b823591506117496020840161170f565b90509250929050565b60006020828403121561176457600080fd5b61176d8261170f565b9392505050565b6000806020838503121561178757600080fd5b823567ffffffffffffffff8082111561179f57600080fd5b818501915085601f8301126117b357600080fd5b8135818111156117c257600080fd5b8660208285010111156117d457600080fd5b60209290920196919550909350505050565b6000602082840312156117f857600080fd5b5035919050565b60008060008060008060008060008060006101608c8e03121561182157600080fd5b505089359b60208b01359b5060408b01359a60608101359a506080810135995060a0810135985060c0810135975060e0810135965061010081013595506101208101359450610140013592509050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156118aa576118aa611871565b60405290565b600082601f8301126118c157600080fd5b6118c9611887565b8060408401858111156118db57600080fd5b845b818110156118f55780358452602093840193016118dd565b509095945050505050565b600082601f83011261191157600080fd5b8135602067ffffffffffffffff8083111561192e5761192e611871565b8260051b604051601f19603f8301168101818110848211171561195357611953611871565b60405293845285810183019383810192508785111561197157600080fd5b83870191505b8482101561199057813583529183019190830190611977565b979650505050505050565b60008060008061012085870312156119b257600080fd5b6119bc86866118b0565b9350604086605f8701126119cf57600080fd5b6119d7611887565b8060c08801898111156119e957600080fd5b8389015b81811015611a0e576119ff8b826118b0565b845260209093019284016119ed565b50819650611a1c8a826118b0565b95505050505061010085013567ffffffffffffffff811115611a3d57600080fd5b611a4987828801611900565b91505092959194509250565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082611a9057611a90611a55565b500490565b808202811582820484141761091757610917611a6b565b634e487b7160e01b600052603260045260246000fd5b8060005b6002811015611ae5578151845260209384019390910190600101611ac6565b50505050565b6101208101611afa8287611ac2565b60408083018660005b6002808210611b125750611b4d565b82518460005b83811015611b36578251825260209283019290910190600101611b18565b505050928401925060209190910190600101611b03565b50505050611b5e60c0830185611ac2565b61010082018360005b6001811015611b86578151835260209283019290910190600101611b67565b50505095945050505050565b8051801515811461161557600080fd5b600060208284031215611bb457600080fd5b61176d82611b92565b8181038181111561091757610917611a6b565b600082611bdf57611bdf611a55565b500690565b600060018201611bf657611bf6611a6b565b5060010190565b60008060408385031215611c1057600080fd5b611c1983611b92565b9150602083015190509250929050565b8082018082111561091757610917611a6b565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220dd9291237f9d7f1b8dacac13c9cfeb134b1c707868706a02e01eccc38413541664736f6c63430008120033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806382a705ba116100b8578063a9ef31de1161007c578063a9ef31de14610293578063bd043d881461029c578063c4d98bce146102bc578063cc373045146102e5578063dc3588ea146102f8578063f2fde38b1461031b57600080fd5b806382a705ba1461022c5780638da5cb5b1461023f5780639c6a3f56146102645780639d0167e71461026d578063a4f2b42f1461028057600080fd5b8063412ec79d116100ff578063412ec79d146101df57806370e1e09b146101f2578063715018a6146101fb5780637667180814610203578063769b047d1461020c57600080fd5b806302952ab61461013c5780631957ba4e1461017a5780631bf4864e1461018f578063254252af146101a257806336fbafad146101cc575b600080fd5b61016761014a3660046116ed565b606d60209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b61018d610188366004611726565b61032e565b005b61018d61019d366004611752565b610364565b6101b56101b03660046116ed565b61038e565b604080519215158352602083019190915201610171565b61018d6101da366004611774565b6103a7565b61018d6101ed3660046117e6565b610682565b61016760685481565b61018d61068f565b61016760655481565b61016761021a3660046117e6565b606e6020526000908152604090205481565b61018d61023a3660046117ff565b6106a3565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610171565b61016760675481565b61018d61027b3660046117e6565b61088d565b60695461024c906001600160a01b031681565b61016760665481565b6101676102aa3660046117e6565b606b6020526000908152604090205481565b61024c6102ca3660046117e6565b606a602052600090815260409020546001600160a01b031681565b6101676102f33660046117e6565b6108d6565b61030b6103063660046116ed565b610905565b6040519015158152602001610171565b61018d610329366004611752565b61091d565b610336610996565b6000918252606a602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b61036c610996565b606980546001600160a01b0319166001600160a01b0392909216919091179055565b60008061039b84846109f0565b915091505b9250929050565b6103af61164a565b6103bb8284018461199b565b606085018190526040850191909152602084019190915290825260685490516000916103e691611a81565b9050816060015151606854826103fc9190611a95565b1461044e5760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964207075626c696320696e7075742073697a650000000000000060448201526064015b60405180910390fd5b6000818152606a60205260409020546001600160a01b0316806104a65760405162461bcd60e51b815260206004820152601060248201526f3737ba1039b2ba103b32b934b334b2b960811b6044820152606401610445565b6104ae611684565b6104bb8460600151610ab8565b81528351602085015160408087015190516343753b4d60e01b81526001600160a01b038616936343753b4d936104fa9391929091908790600401611aeb565b602060405180830381865afa158015610517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053b9190611ba2565b6105775760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610445565b6000610587856060015185610b20565b905060005b84811015610678576000811180156105e75750816105ab600183611bbd565b815181106105bb576105bb611aac565b6020026020010151608001518282815181106105d9576105d9611aac565b602002602001015160800151145b610678576103e882828151811061060057610600611aac565b6020026020010151600001516106169190611bd0565b6000036106445761063f82828151811061063257610632611aac565b6020026020010151610ec2565b610666565b61066682828151811061065957610659611aac565b60200260200101516110f2565b8061067081611be4565b91505061058c565b5050505050505050565b61068a610996565b606855565b610697610996565b6106a160006113b3565b565b600054610100900460ff16158080156106c35750600054600160ff909116105b806106dd5750303b1580156106dd575060005460ff166001145b6107405760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610445565b6000805460ff191660011790558015610763576000805461ff0019166101001790555b61076b611405565b8b60658190555088606b60008e81526020019081526020016000208190555087606b600060018f61079c9190611bbd565b81526020019081526020016000208190555082606e600060018f6107c09190611bbd565b815260208082019290925260409081016000908120939093558e8352606e8252808320859055606c90915290208b90556107fa8c8c611434565b61080e61080860018e611bbd565b8b611434565b6000878152606d60209081526040808320898452909152902085905560668590556067849055600c606855801561087f576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b610895610996565b60665460408051918252602082018390527f5ab2642364d92dafb2be757706f004ccf8325cca566bc2d0742133d316a5eaed910160405180910390a1606655565b6000818152606c6020526040812054156108fd57506000908152606c602052604090205490565b505060675490565b60008061091284846109f0565b509150505b92915050565b610925610996565b6001600160a01b03811661098a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610445565b610993816113b3565b50565b6033546001600160a01b031633146106a15760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610445565b6000828152606d6020908152604080832084845290915281205481908015610a1d576001925090506103a0565b6069546001600160a01b031615610aab5760695460405163254252af60e01b815260048101879052602481018690526001600160a01b039091169063254252af906044016040805180830381865afa158015610a7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa19190611bfd565b92509250506103a0565b5060009485945092505050565b805160009081610ac9826020611a95565b6040805160208382018101909252828152919250810160005b84811015610b0157600101602081810288015183529190910190610ae2565b505080516020820120610b1661010082611a81565b9695505050505050565b60606000808367ffffffffffffffff811115610b3e57610b3e611871565b604051908082528060200260200182016040528015610bad57816020015b604080516101008101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e08201528252600019909201910181610b5c5790505b50905060005b8481101561091257858381518110610bcd57610bcd611aac565b6020026020010151828281518110610be757610be7611aac565b60209081029190910101515282610bfd81611be4565b935050858381518110610c1257610c12611aac565b6020026020010151608087856001610c2a9190611c29565b81518110610c3a57610c3a611aac565b6020026020010151901b1760001b828281518110610c5a57610c5a611aac565b602090810291909101015160800152610c74600284611c29565b9250858381518110610c8857610c88611aac565b6020026020010151608087856001610ca09190611c29565b81518110610cb057610cb0611aac565b6020026020010151901b1760001b828281518110610cd057610cd0611aac565b602090810291909101015160a00152610cea600284611c29565b9250858381518110610cfe57610cfe611aac565b6020026020010151608087856001610d169190611c29565b81518110610d2657610d26611aac565b6020026020010151901b1760001b828281518110610d4657610d46611aac565b602090810291909101015160c00152610d60600284611c29565b9250858381518110610d7457610d74611aac565b6020026020010151608087856001610d8c9190611c29565b81518110610d9c57610d9c611aac565b6020026020010151901b1760001b828281518110610dbc57610dbc611aac565b602090810291909101015160e00152610dd6600284611c29565b9250858381518110610dea57610dea611aac565b6020026020010151828281518110610e0457610e04611aac565b602090810291909101810151015282610e1c81611be4565b935050858381518110610e3157610e31611aac565b6020026020010151828281518110610e4b57610e4b611aac565b60209081029190910101516040015282610e6481611be4565b935050858381518110610e7957610e79611aac565b6020026020010151828281518110610e9357610e93611aac565b60209081029190910101516060015282610eac81611be4565b9350508080610eba90611be4565b915050610bb3565b6000610ed18260000151611453565b90506000610ee0600183611bbd565b60e0840151909150610f345760405162461bcd60e51b815260206004820152601d60248201527f696e76616c69642065706f636856616c696461746f72536574486173680000006044820152606401610445565b60c0830151610f855760405162461bcd60e51b815260206004820152601f60248201527f696e76616c6964207369676e696e6756616c696461746f7253657448617368006044820152606401610445565b60665483604001511015610fdb5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820626c6f636b20636f6e6669726d6174696f6e7300006044820152606401610445565b6000818152606b602052604090205460c08401511461103c5760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726545706f636856616c696461746f72536574486173686044820152606401610445565b8260e00151606b600084815260200190815260200160002081905550611066828460200151611434565b60608301516000838152606e602052604090205560658290556040838101516080850180516000908152606d602090815284822060a089018051845290825291859020939093558651915190518451918252928101929092529184917fb20f83d7fca2253dd4a37d0ee1922398cbbecf5a89899514947161ae70c0037f910160405180910390a3505050565b606654816040015110156111485760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820626c6f636b20636f6e6669726d6174696f6e7300006044820152606401610445565b60008061115d83608001518460a001516109f0565b91509150818015611172575080836040015111155b156111af5760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e48195e1a5cdd609a1b6044820152606401610445565b60006111be8460000151611453565b905060006111cd600183611bbd565b6000838152606b602052604090205490915061121d5760405162461bcd60e51b815260206004820152600f60248201526e195c1bd8da081b9bc81d5c1b1bd859608a1b6044820152606401610445565b6000818152606e6020526040902054600190600261123a846108d6565b6112449190611a81565b61124f906001611c29565b6112599190611a95565b6112639190611bbd565b8551611272906103e890611bd0565b116112dd576000818152606b602052604090205460c0860151146112d85760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726545706f636856616c696461746f72536574486173686044820152606401610445565b61133e565b6000828152606b602052604090205460c08601511461133e5760405162461bcd60e51b815260206004820152601d60248201527f696e76616c69642065706f636856616c696461746f72536574486173680000006044820152606401610445565b6040858101516080870180516000908152606d602090815284822060a08b01805184529082529185902093909355885191519051845192835292820152918201527fa3fa2e60f4d1c7f6bd60da77a4be0625773dfb6b22c54fe77e725d03e49cdf2e9060600160405180910390a15050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661142c5760405162461bcd60e51b815260040161044590611c3c565b6106a161161a565b606754811461144f576000828152606c602052604090208190555b5050565b60006101f480611467816302e839c9611a81565b6114719190611a95565b61147b9190611c29565b82101561148d5761091760c883611a81565b6103e88061149f8163031e9c4d611a81565b6114a99190611a95565b6114b39190611c29565b821015611548576101f480806114cd816302e839c9611a81565b6114d79190611a95565b6114e19190611c29565b6114eb9084611bbd565b6114f59190611a81565b60c860016101f48061150b816302e839c9611a81565b6115159190611a95565b61151f9190611c29565b6115299190611bbd565b6115339190611a81565b61153e906001611c29565b6109179190611c29565b6103e8808061155b8163031e9c4d611a81565b6115659190611a95565b61156f9190611c29565b6115799084611bbd565b6115839190611a81565b6101f48080611596816302e839c9611a81565b6115a09190611a95565b6115aa9190611c29565b6115b89063031e9c4d611bbd565b6115c29190611a81565b60c860016101f4806115d8816302e839c9611a81565b6115e29190611a95565b6115ec9190611c29565b6115f69190611bbd565b6116009190611a81565b61160b906001611c29565b6115339190611c29565b919050565b600054610100900460ff166116415760405162461bcd60e51b815260040161044590611c3c565b6106a1336113b3565b604051806080016040528061165d6116a2565b815260200161166a6116c0565b81526020016116776116a2565b8152602001606081525090565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b60405180604001604052806002905b6116d76116a2565b8152602001906001900390816116cf5790505090565b6000806040838503121561170057600080fd5b50508035926020909101359150565b80356001600160a01b038116811461161557600080fd5b6000806040838503121561173957600080fd5b823591506117496020840161170f565b90509250929050565b60006020828403121561176457600080fd5b61176d8261170f565b9392505050565b6000806020838503121561178757600080fd5b823567ffffffffffffffff8082111561179f57600080fd5b818501915085601f8301126117b357600080fd5b8135818111156117c257600080fd5b8660208285010111156117d457600080fd5b60209290920196919550909350505050565b6000602082840312156117f857600080fd5b5035919050565b60008060008060008060008060008060006101608c8e03121561182157600080fd5b505089359b60208b01359b5060408b01359a60608101359a506080810135995060a0810135985060c0810135975060e0810135965061010081013595506101208101359450610140013592509050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156118aa576118aa611871565b60405290565b600082601f8301126118c157600080fd5b6118c9611887565b8060408401858111156118db57600080fd5b845b818110156118f55780358452602093840193016118dd565b509095945050505050565b600082601f83011261191157600080fd5b8135602067ffffffffffffffff8083111561192e5761192e611871565b8260051b604051601f19603f8301168101818110848211171561195357611953611871565b60405293845285810183019383810192508785111561197157600080fd5b83870191505b8482101561199057813583529183019190830190611977565b979650505050505050565b60008060008061012085870312156119b257600080fd5b6119bc86866118b0565b9350604086605f8701126119cf57600080fd5b6119d7611887565b8060c08801898111156119e957600080fd5b8389015b81811015611a0e576119ff8b826118b0565b845260209093019284016119ed565b50819650611a1c8a826118b0565b95505050505061010085013567ffffffffffffffff811115611a3d57600080fd5b611a4987828801611900565b91505092959194509250565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082611a9057611a90611a55565b500490565b808202811582820484141761091757610917611a6b565b634e487b7160e01b600052603260045260246000fd5b8060005b6002811015611ae5578151845260209384019390910190600101611ac6565b50505050565b6101208101611afa8287611ac2565b60408083018660005b6002808210611b125750611b4d565b82518460005b83811015611b36578251825260209283019290910190600101611b18565b505050928401925060209190910190600101611b03565b50505050611b5e60c0830185611ac2565b61010082018360005b6001811015611b86578151835260209283019290910190600101611b67565b50505095945050505050565b8051801515811461161557600080fd5b600060208284031215611bb457600080fd5b61176d82611b92565b8181038181111561091757610917611a6b565b600082611bdf57611bdf611a55565b500690565b600060018201611bf657611bf6611a6b565b5060010190565b60008060408385031215611c1057600080fd5b611c1983611b92565b9150602083015190509250929050565b8082018082111561091757610917611a6b565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220dd9291237f9d7f1b8dacac13c9cfeb134b1c707868706a02e01eccc38413541664736f6c63430008120033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
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.