Source Code
Overview
GLMR Balance
GLMR Value
$0.00View more zero value Internal Transactions in Advanced View mode
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 {
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 % 200 == 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 % 200 <= (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) {
return _blockNumber / 200;
}
//----------------------------------------------------------------------------------
// 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
608060405234801561001057600080fd5b50611b06806100206000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806382a705ba116100b8578063a9ef31de1161007c578063a9ef31de14610293578063bd043d881461029c578063c4d98bce146102bc578063cc373045146102e5578063dc3588ea146102f8578063f2fde38b1461031b57600080fd5b806382a705ba1461022c5780638da5cb5b1461023f5780639c6a3f56146102645780639d0167e71461026d578063a4f2b42f1461028057600080fd5b8063412ec79d116100ff578063412ec79d146101df57806370e1e09b146101f2578063715018a6146101fb5780637667180814610203578063769b047d1461020c57600080fd5b806302952ab61461013c5780631957ba4e1461017a5780631bf4864e1461018f578063254252af146101a257806336fbafad146101cc575b600080fd5b61016761014a366004611531565b606d60209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b61018d61018836600461156f565b61032e565b005b61018d61019d36600461159b565b610364565b6101b56101b0366004611531565b61038e565b604080519215158352602083019190915201610171565b61018d6101da3660046115bd565b6103a7565b61018d6101ed36600461162f565b610681565b61016760685481565b61018d61068e565b61016760655481565b61016761021a36600461162f565b606e6020526000908152604090205481565b61018d61023a366004611648565b6106a2565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610171565b61016760675481565b61018d61027b36600461162f565b61088c565b60695461024c906001600160a01b031681565b61016760665481565b6101676102aa36600461162f565b606b6020526000908152604090205481565b61024c6102ca36600461162f565b606a602052600090815260409020546001600160a01b031681565b6101676102f336600461162f565b6108d5565b61030b610306366004611531565b610904565b6040519015158152602001610171565b61018d61032936600461159b565b61091c565b610336610995565b6000918252606a602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b61036c610995565b606980546001600160a01b0319166001600160a01b0392909216919091179055565b60008061039b84846109ef565b915091505b9250929050565b6103af61148e565b6103bb828401846117e4565b606085018190526040850191909152602084019190915290825260685490516000916103e6916118ca565b9050816060015151606854826103fc91906118de565b1461044e5760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964207075626c696320696e7075742073697a650000000000000060448201526064015b60405180910390fd5b6000818152606a60205260409020546001600160a01b0316806104a65760405162461bcd60e51b815260206004820152601060248201526f3737ba1039b2ba103b32b934b334b2b960811b6044820152606401610445565b6104ae6114c8565b6104bb8460600151610ab7565b81528351602085015160408087015190516343753b4d60e01b81526001600160a01b038616936343753b4d936104fa9391929091908790600401611934565b602060405180830381865afa158015610517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053b91906119eb565b6105775760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610445565b6000610587856060015185610b1f565b905060005b84811015610677576000811180156105e75750816105ab600183611a06565b815181106105bb576105bb6118f5565b6020026020010151608001518282815181106105d9576105d96118f5565b602002602001015160800151145b6106775760c88282815181106105ff576105ff6118f5565b6020026020010151600001516106159190611a19565b6000036106435761063e828281518110610631576106316118f5565b6020026020010151610ec1565b610665565b610665828281518110610658576106586118f5565b60200260200101516110f1565b8061066f81611a2d565b91505061058c565b5050505050505050565b610689610995565b606855565b610696610995565b6106a060006113b1565b565b600054610100900460ff16158080156106c25750600054600160ff909116105b806106dc5750303b1580156106dc575060005460ff166001145b61073f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610445565b6000805460ff191660011790558015610762576000805461ff0019166101001790555b61076a611403565b8b60658190555088606b60008e81526020019081526020016000208190555087606b600060018f61079b9190611a06565b81526020019081526020016000208190555082606e600060018f6107bf9190611a06565b815260208082019290925260409081016000908120939093558e8352606e8252808320859055606c90915290208b90556107f98c8c611432565b61080d61080760018e611a06565b8b611432565b6000878152606d60209081526040808320898452909152902085905560668590556067849055600c606855801561087e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b610894610995565b60665460408051918252602082018390527f5ab2642364d92dafb2be757706f004ccf8325cca566bc2d0742133d316a5eaed910160405180910390a1606655565b6000818152606c6020526040812054156108fc57506000908152606c602052604090205490565b505060675490565b60008061091184846109ef565b509150505b92915050565b610924610995565b6001600160a01b0381166109895760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610445565b610992816113b1565b50565b6033546001600160a01b031633146106a05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610445565b6000828152606d6020908152604080832084845290915281205481908015610a1c576001925090506103a0565b6069546001600160a01b031615610aaa5760695460405163254252af60e01b815260048101879052602481018690526001600160a01b039091169063254252af906044016040805180830381865afa158015610a7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa09190611a46565b92509250506103a0565b5060009485945092505050565b805160009081610ac88260206118de565b6040805160208382018101909252828152919250810160005b84811015610b0057600101602081810288015183529190910190610ae1565b505080516020820120610b15610100826118ca565b9695505050505050565b60606000808367ffffffffffffffff811115610b3d57610b3d6116ba565b604051908082528060200260200182016040528015610bac57816020015b604080516101008101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e08201528252600019909201910181610b5b5790505b50905060005b8481101561091157858381518110610bcc57610bcc6118f5565b6020026020010151828281518110610be657610be66118f5565b60209081029190910101515282610bfc81611a2d565b935050858381518110610c1157610c116118f5565b6020026020010151608087856001610c299190611a72565b81518110610c3957610c396118f5565b6020026020010151901b1760001b828281518110610c5957610c596118f5565b602090810291909101015160800152610c73600284611a72565b9250858381518110610c8757610c876118f5565b6020026020010151608087856001610c9f9190611a72565b81518110610caf57610caf6118f5565b6020026020010151901b1760001b828281518110610ccf57610ccf6118f5565b602090810291909101015160a00152610ce9600284611a72565b9250858381518110610cfd57610cfd6118f5565b6020026020010151608087856001610d159190611a72565b81518110610d2557610d256118f5565b6020026020010151901b1760001b828281518110610d4557610d456118f5565b602090810291909101015160c00152610d5f600284611a72565b9250858381518110610d7357610d736118f5565b6020026020010151608087856001610d8b9190611a72565b81518110610d9b57610d9b6118f5565b6020026020010151901b1760001b828281518110610dbb57610dbb6118f5565b602090810291909101015160e00152610dd5600284611a72565b9250858381518110610de957610de96118f5565b6020026020010151828281518110610e0357610e036118f5565b602090810291909101810151015282610e1b81611a2d565b935050858381518110610e3057610e306118f5565b6020026020010151828281518110610e4a57610e4a6118f5565b60209081029190910101516040015282610e6381611a2d565b935050858381518110610e7857610e786118f5565b6020026020010151828281518110610e9257610e926118f5565b60209081029190910101516060015282610eab81611a2d565b9350508080610eb990611a2d565b915050610bb2565b6000610ed08260000151611451565b90506000610edf600183611a06565b60e0840151909150610f335760405162461bcd60e51b815260206004820152601d60248201527f696e76616c69642065706f636856616c696461746f72536574486173680000006044820152606401610445565b60c0830151610f845760405162461bcd60e51b815260206004820152601f60248201527f696e76616c6964207369676e696e6756616c696461746f7253657448617368006044820152606401610445565b60665483604001511015610fda5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820626c6f636b20636f6e6669726d6174696f6e7300006044820152606401610445565b6000818152606b602052604090205460c08401511461103b5760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726545706f636856616c696461746f72536574486173686044820152606401610445565b8260e00151606b600084815260200190815260200160002081905550611065828460200151611432565b60608301516000838152606e602052604090205560658290556040838101516080850180516000908152606d602090815284822060a089018051845290825291859020939093558651915190518451918252928101929092529184917fb20f83d7fca2253dd4a37d0ee1922398cbbecf5a89899514947161ae70c0037f910160405180910390a3505050565b606654816040015110156111475760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820626c6f636b20636f6e6669726d6174696f6e7300006044820152606401610445565b60008061115c83608001518460a001516109ef565b91509150818015611171575080836040015111155b156111ae5760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e48195e1a5cdd609a1b6044820152606401610445565b60006111bd8460000151611451565b905060006111cc600183611a06565b6000838152606b602052604090205490915061121c5760405162461bcd60e51b815260206004820152600f60248201526e195c1bd8da081b9bc81d5c1b1bd859608a1b6044820152606401610445565b6000818152606e60205260409020546001906002611239846108d5565b61124391906118ca565b61124e906001611a72565b61125891906118de565b6112629190611a06565b85516112709060c890611a19565b116112db576000818152606b602052604090205460c0860151146112d65760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726545706f636856616c696461746f72536574486173686044820152606401610445565b61133c565b6000828152606b602052604090205460c08601511461133c5760405162461bcd60e51b815260206004820152601d60248201527f696e76616c69642065706f636856616c696461746f72536574486173680000006044820152606401610445565b6040858101516080870180516000908152606d602090815284822060a08b01805184529082529185902093909355885191519051845192835292820152918201527fa3fa2e60f4d1c7f6bd60da77a4be0625773dfb6b22c54fe77e725d03e49cdf2e9060600160405180910390a15050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661142a5760405162461bcd60e51b815260040161044590611a85565b6106a061145e565b606754811461144d576000828152606c602052604090208190555b5050565b600061091660c8836118ca565b600054610100900460ff166114855760405162461bcd60e51b815260040161044590611a85565b6106a0336113b1565b60405180608001604052806114a16114e6565b81526020016114ae611504565b81526020016114bb6114e6565b8152602001606081525090565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b60405180604001604052806002905b61151b6114e6565b8152602001906001900390816115135790505090565b6000806040838503121561154457600080fd5b50508035926020909101359150565b80356001600160a01b038116811461156a57600080fd5b919050565b6000806040838503121561158257600080fd5b8235915061159260208401611553565b90509250929050565b6000602082840312156115ad57600080fd5b6115b682611553565b9392505050565b600080602083850312156115d057600080fd5b823567ffffffffffffffff808211156115e857600080fd5b818501915085601f8301126115fc57600080fd5b81358181111561160b57600080fd5b86602082850101111561161d57600080fd5b60209290920196919550909350505050565b60006020828403121561164157600080fd5b5035919050565b60008060008060008060008060008060006101608c8e03121561166a57600080fd5b505089359b60208b01359b5060408b01359a60608101359a506080810135995060a0810135985060c0810135975060e0810135965061010081013595506101208101359450610140013592509050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156116f3576116f36116ba565b60405290565b600082601f83011261170a57600080fd5b6117126116d0565b80604084018581111561172457600080fd5b845b8181101561173e578035845260209384019301611726565b509095945050505050565b600082601f83011261175a57600080fd5b8135602067ffffffffffffffff80831115611777576117776116ba565b8260051b604051601f19603f8301168101818110848211171561179c5761179c6116ba565b6040529384528581018301938381019250878511156117ba57600080fd5b83870191505b848210156117d9578135835291830191908301906117c0565b979650505050505050565b60008060008061012085870312156117fb57600080fd5b61180586866116f9565b9350604086605f87011261181857600080fd5b6118206116d0565b8060c088018981111561183257600080fd5b8389015b81811015611857576118488b826116f9565b84526020909301928401611836565b508196506118658a826116f9565b95505050505061010085013567ffffffffffffffff81111561188657600080fd5b61189287828801611749565b91505092959194509250565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000826118d9576118d961189e565b500490565b8082028115828204841417610916576109166118b4565b634e487b7160e01b600052603260045260246000fd5b8060005b600281101561192e57815184526020938401939091019060010161190f565b50505050565b6101208101611943828761190b565b60408083018660005b600280821061195b5750611996565b82518460005b8381101561197f578251825260209283019290910190600101611961565b50505092840192506020919091019060010161194c565b505050506119a760c083018561190b565b61010082018360005b60018110156119cf5781518352602092830192909101906001016119b0565b50505095945050505050565b8051801515811461156a57600080fd5b6000602082840312156119fd57600080fd5b6115b6826119db565b81810381811115610916576109166118b4565b600082611a2857611a2861189e565b500690565b600060018201611a3f57611a3f6118b4565b5060010190565b60008060408385031215611a5957600080fd5b611a62836119db565b9150602083015190509250929050565b80820180821115610916576109166118b4565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220e65f9d0d4e5e54750178b792286d0f61176521e7c139ebc1684da0decbfdeeb464736f6c63430008120033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101375760003560e01c806382a705ba116100b8578063a9ef31de1161007c578063a9ef31de14610293578063bd043d881461029c578063c4d98bce146102bc578063cc373045146102e5578063dc3588ea146102f8578063f2fde38b1461031b57600080fd5b806382a705ba1461022c5780638da5cb5b1461023f5780639c6a3f56146102645780639d0167e71461026d578063a4f2b42f1461028057600080fd5b8063412ec79d116100ff578063412ec79d146101df57806370e1e09b146101f2578063715018a6146101fb5780637667180814610203578063769b047d1461020c57600080fd5b806302952ab61461013c5780631957ba4e1461017a5780631bf4864e1461018f578063254252af146101a257806336fbafad146101cc575b600080fd5b61016761014a366004611531565b606d60209081526000928352604080842090915290825290205481565b6040519081526020015b60405180910390f35b61018d61018836600461156f565b61032e565b005b61018d61019d36600461159b565b610364565b6101b56101b0366004611531565b61038e565b604080519215158352602083019190915201610171565b61018d6101da3660046115bd565b6103a7565b61018d6101ed36600461162f565b610681565b61016760685481565b61018d61068e565b61016760655481565b61016761021a36600461162f565b606e6020526000908152604090205481565b61018d61023a366004611648565b6106a2565b6033546001600160a01b03165b6040516001600160a01b039091168152602001610171565b61016760675481565b61018d61027b36600461162f565b61088c565b60695461024c906001600160a01b031681565b61016760665481565b6101676102aa36600461162f565b606b6020526000908152604090205481565b61024c6102ca36600461162f565b606a602052600090815260409020546001600160a01b031681565b6101676102f336600461162f565b6108d5565b61030b610306366004611531565b610904565b6040519015158152602001610171565b61018d61032936600461159b565b61091c565b610336610995565b6000918252606a602052604090912080546001600160a01b0319166001600160a01b03909216919091179055565b61036c610995565b606980546001600160a01b0319166001600160a01b0392909216919091179055565b60008061039b84846109ef565b915091505b9250929050565b6103af61148e565b6103bb828401846117e4565b606085018190526040850191909152602084019190915290825260685490516000916103e6916118ca565b9050816060015151606854826103fc91906118de565b1461044e5760405162461bcd60e51b815260206004820152601960248201527f696e76616c6964207075626c696320696e7075742073697a650000000000000060448201526064015b60405180910390fd5b6000818152606a60205260409020546001600160a01b0316806104a65760405162461bcd60e51b815260206004820152601060248201526f3737ba1039b2ba103b32b934b334b2b960811b6044820152606401610445565b6104ae6114c8565b6104bb8460600151610ab7565b81528351602085015160408087015190516343753b4d60e01b81526001600160a01b038616936343753b4d936104fa9391929091908790600401611934565b602060405180830381865afa158015610517573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053b91906119eb565b6105775760405162461bcd60e51b815260206004820152600d60248201526c34b73b30b634b210383937b7b360991b6044820152606401610445565b6000610587856060015185610b1f565b905060005b84811015610677576000811180156105e75750816105ab600183611a06565b815181106105bb576105bb6118f5565b6020026020010151608001518282815181106105d9576105d96118f5565b602002602001015160800151145b6106775760c88282815181106105ff576105ff6118f5565b6020026020010151600001516106159190611a19565b6000036106435761063e828281518110610631576106316118f5565b6020026020010151610ec1565b610665565b610665828281518110610658576106586118f5565b60200260200101516110f1565b8061066f81611a2d565b91505061058c565b5050505050505050565b610689610995565b606855565b610696610995565b6106a060006113b1565b565b600054610100900460ff16158080156106c25750600054600160ff909116105b806106dc5750303b1580156106dc575060005460ff166001145b61073f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610445565b6000805460ff191660011790558015610762576000805461ff0019166101001790555b61076a611403565b8b60658190555088606b60008e81526020019081526020016000208190555087606b600060018f61079b9190611a06565b81526020019081526020016000208190555082606e600060018f6107bf9190611a06565b815260208082019290925260409081016000908120939093558e8352606e8252808320859055606c90915290208b90556107f98c8c611432565b61080d61080760018e611a06565b8b611432565b6000878152606d60209081526040808320898452909152902085905560668590556067849055600c606855801561087e576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b505050505050505050505050565b610894610995565b60665460408051918252602082018390527f5ab2642364d92dafb2be757706f004ccf8325cca566bc2d0742133d316a5eaed910160405180910390a1606655565b6000818152606c6020526040812054156108fc57506000908152606c602052604090205490565b505060675490565b60008061091184846109ef565b509150505b92915050565b610924610995565b6001600160a01b0381166109895760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610445565b610992816113b1565b50565b6033546001600160a01b031633146106a05760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610445565b6000828152606d6020908152604080832084845290915281205481908015610a1c576001925090506103a0565b6069546001600160a01b031615610aaa5760695460405163254252af60e01b815260048101879052602481018690526001600160a01b039091169063254252af906044016040805180830381865afa158015610a7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa09190611a46565b92509250506103a0565b5060009485945092505050565b805160009081610ac88260206118de565b6040805160208382018101909252828152919250810160005b84811015610b0057600101602081810288015183529190910190610ae1565b505080516020820120610b15610100826118ca565b9695505050505050565b60606000808367ffffffffffffffff811115610b3d57610b3d6116ba565b604051908082528060200260200182016040528015610bac57816020015b604080516101008101825260008082526020808301829052928201819052606082018190526080820181905260a0820181905260c0820181905260e08201528252600019909201910181610b5b5790505b50905060005b8481101561091157858381518110610bcc57610bcc6118f5565b6020026020010151828281518110610be657610be66118f5565b60209081029190910101515282610bfc81611a2d565b935050858381518110610c1157610c116118f5565b6020026020010151608087856001610c299190611a72565b81518110610c3957610c396118f5565b6020026020010151901b1760001b828281518110610c5957610c596118f5565b602090810291909101015160800152610c73600284611a72565b9250858381518110610c8757610c876118f5565b6020026020010151608087856001610c9f9190611a72565b81518110610caf57610caf6118f5565b6020026020010151901b1760001b828281518110610ccf57610ccf6118f5565b602090810291909101015160a00152610ce9600284611a72565b9250858381518110610cfd57610cfd6118f5565b6020026020010151608087856001610d159190611a72565b81518110610d2557610d256118f5565b6020026020010151901b1760001b828281518110610d4557610d456118f5565b602090810291909101015160c00152610d5f600284611a72565b9250858381518110610d7357610d736118f5565b6020026020010151608087856001610d8b9190611a72565b81518110610d9b57610d9b6118f5565b6020026020010151901b1760001b828281518110610dbb57610dbb6118f5565b602090810291909101015160e00152610dd5600284611a72565b9250858381518110610de957610de96118f5565b6020026020010151828281518110610e0357610e036118f5565b602090810291909101810151015282610e1b81611a2d565b935050858381518110610e3057610e306118f5565b6020026020010151828281518110610e4a57610e4a6118f5565b60209081029190910101516040015282610e6381611a2d565b935050858381518110610e7857610e786118f5565b6020026020010151828281518110610e9257610e926118f5565b60209081029190910101516060015282610eab81611a2d565b9350508080610eb990611a2d565b915050610bb2565b6000610ed08260000151611451565b90506000610edf600183611a06565b60e0840151909150610f335760405162461bcd60e51b815260206004820152601d60248201527f696e76616c69642065706f636856616c696461746f72536574486173680000006044820152606401610445565b60c0830151610f845760405162461bcd60e51b815260206004820152601f60248201527f696e76616c6964207369676e696e6756616c696461746f7253657448617368006044820152606401610445565b60665483604001511015610fda5760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820626c6f636b20636f6e6669726d6174696f6e7300006044820152606401610445565b6000818152606b602052604090205460c08401511461103b5760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726545706f636856616c696461746f72536574486173686044820152606401610445565b8260e00151606b600084815260200190815260200160002081905550611065828460200151611432565b60608301516000838152606e602052604090205560658290556040838101516080850180516000908152606d602090815284822060a089018051845290825291859020939093558651915190518451918252928101929092529184917fb20f83d7fca2253dd4a37d0ee1922398cbbecf5a89899514947161ae70c0037f910160405180910390a3505050565b606654816040015110156111475760405162461bcd60e51b815260206004820152601e60248201527f4e6f7420656e6f75676820626c6f636b20636f6e6669726d6174696f6e7300006044820152606401610445565b60008061115c83608001518460a001516109ef565b91509150818015611171575080836040015111155b156111ae5760405162461bcd60e51b815260206004820152600d60248201526c185b1c9958591e48195e1a5cdd609a1b6044820152606401610445565b60006111bd8460000151611451565b905060006111cc600183611a06565b6000838152606b602052604090205490915061121c5760405162461bcd60e51b815260206004820152600f60248201526e195c1bd8da081b9bc81d5c1b1bd859608a1b6044820152606401610445565b6000818152606e60205260409020546001906002611239846108d5565b61124391906118ca565b61124e906001611a72565b61125891906118de565b6112629190611a06565b85516112709060c890611a19565b116112db576000818152606b602052604090205460c0860151146112d65760405162461bcd60e51b815260206004820181905260248201527f696e76616c69642070726545706f636856616c696461746f72536574486173686044820152606401610445565b61133c565b6000828152606b602052604090205460c08601511461133c5760405162461bcd60e51b815260206004820152601d60248201527f696e76616c69642065706f636856616c696461746f72536574486173680000006044820152606401610445565b6040858101516080870180516000908152606d602090815284822060a08b01805184529082529185902093909355885191519051845192835292820152918201527fa3fa2e60f4d1c7f6bd60da77a4be0625773dfb6b22c54fe77e725d03e49cdf2e9060600160405180910390a15050505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff1661142a5760405162461bcd60e51b815260040161044590611a85565b6106a061145e565b606754811461144d576000828152606c602052604090208190555b5050565b600061091660c8836118ca565b600054610100900460ff166114855760405162461bcd60e51b815260040161044590611a85565b6106a0336113b1565b60405180608001604052806114a16114e6565b81526020016114ae611504565b81526020016114bb6114e6565b8152602001606081525090565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b60405180604001604052806002905b61151b6114e6565b8152602001906001900390816115135790505090565b6000806040838503121561154457600080fd5b50508035926020909101359150565b80356001600160a01b038116811461156a57600080fd5b919050565b6000806040838503121561158257600080fd5b8235915061159260208401611553565b90509250929050565b6000602082840312156115ad57600080fd5b6115b682611553565b9392505050565b600080602083850312156115d057600080fd5b823567ffffffffffffffff808211156115e857600080fd5b818501915085601f8301126115fc57600080fd5b81358181111561160b57600080fd5b86602082850101111561161d57600080fd5b60209290920196919550909350505050565b60006020828403121561164157600080fd5b5035919050565b60008060008060008060008060008060006101608c8e03121561166a57600080fd5b505089359b60208b01359b5060408b01359a60608101359a506080810135995060a0810135985060c0810135975060e0810135965061010081013595506101208101359450610140013592509050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156116f3576116f36116ba565b60405290565b600082601f83011261170a57600080fd5b6117126116d0565b80604084018581111561172457600080fd5b845b8181101561173e578035845260209384019301611726565b509095945050505050565b600082601f83011261175a57600080fd5b8135602067ffffffffffffffff80831115611777576117776116ba565b8260051b604051601f19603f8301168101818110848211171561179c5761179c6116ba565b6040529384528581018301938381019250878511156117ba57600080fd5b83870191505b848210156117d9578135835291830191908301906117c0565b979650505050505050565b60008060008061012085870312156117fb57600080fd5b61180586866116f9565b9350604086605f87011261181857600080fd5b6118206116d0565b8060c088018981111561183257600080fd5b8389015b81811015611857576118488b826116f9565b84526020909301928401611836565b508196506118658a826116f9565b95505050505061010085013567ffffffffffffffff81111561188657600080fd5b61189287828801611749565b91505092959194509250565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000826118d9576118d961189e565b500490565b8082028115828204841417610916576109166118b4565b634e487b7160e01b600052603260045260246000fd5b8060005b600281101561192e57815184526020938401939091019060010161190f565b50505050565b6101208101611943828761190b565b60408083018660005b600280821061195b5750611996565b82518460005b8381101561197f578251825260209283019290910190600101611961565b50505092840192506020919091019060010161194c565b505050506119a760c083018561190b565b61010082018360005b60018110156119cf5781518352602092830192909101906001016119b0565b50505095945050505050565b8051801515811461156a57600080fd5b6000602082840312156119fd57600080fd5b6115b6826119db565b81810381811115610916576109166118b4565b600082611a2857611a2861189e565b500690565b600060018201611a3f57611a3f6118b4565b5060010190565b60008060408385031215611a5957600080fd5b611a62836119db565b9150602083015190509250929050565b80820180821115610916576109166118b4565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b60608201526080019056fea2646970667358221220e65f9d0d4e5e54750178b792286d0f61176521e7c139ebc1684da0decbfdeeb464736f6c63430008120033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in GLMR
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.