Source Code
Overview
ETH Balance
ETH Value
$0.00Latest 25 from a total of 1,992 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Attest | 13806462 | 396 days ago | IN | 0 ETH | 0.00032318 | ||||
| Attest | 13768317 | 397 days ago | IN | 0 ETH | 0.00010578 | ||||
| Attest | 13754896 | 397 days ago | IN | 0 ETH | 0.00006812 | ||||
| Attest | 13754871 | 397 days ago | IN | 0 ETH | 0.00006808 | ||||
| Attest | 13753958 | 397 days ago | IN | 0 ETH | 0.00006798 | ||||
| Attest | 13752696 | 397 days ago | IN | 0 ETH | 0.00006649 | ||||
| Attest | 13752672 | 397 days ago | IN | 0 ETH | 0.0000664 | ||||
| Attest | 13747032 | 397 days ago | IN | 0 ETH | 0.0000609 | ||||
| Attest | 13747003 | 397 days ago | IN | 0 ETH | 0.0000609 | ||||
| Attest | 13746956 | 397 days ago | IN | 0 ETH | 0.0000609 | ||||
| Attest | 13746893 | 397 days ago | IN | 0 ETH | 0.0000609 | ||||
| Attest | 13352127 | 407 days ago | IN | 0 ETH | 0.00020184 | ||||
| Attest | 13336603 | 407 days ago | IN | 0 ETH | 0.00008953 | ||||
| Attest | 13102793 | 413 days ago | IN | 0 ETH | 0.00026367 | ||||
| Attest | 13002625 | 415 days ago | IN | 0 ETH | 0.00017862 | ||||
| Attest | 12933958 | 417 days ago | IN | 0 ETH | 0.00028413 | ||||
| Attest | 12775519 | 421 days ago | IN | 0 ETH | 0.00028016 | ||||
| Attest | 12775145 | 421 days ago | IN | 0 ETH | 0.00027721 | ||||
| Attest | 12775099 | 421 days ago | IN | 0 ETH | 0.00027702 | ||||
| Attest | 12775080 | 421 days ago | IN | 0 ETH | 0.00027697 | ||||
| Attest | 12199004 | 435 days ago | IN | 0 ETH | 0.00013028 | ||||
| Attest | 11851907 | 443 days ago | IN | 0 ETH | 0.00015353 | ||||
| Attest | 10500688 | 475 days ago | IN | 0 ETH | 0.00013605 | ||||
| Attest | 10439140 | 476 days ago | IN | 0 ETH | 0.00013605 | ||||
| Attest | 10438793 | 476 days ago | IN | 0 ETH | 0.00013605 |
Latest 25 internal transactions (View All)
Advanced mode:
| Parent Transaction Hash | Block | From | To | |||
|---|---|---|---|---|---|---|
| 13806462 | 396 days ago | 0 ETH | ||||
| 13806462 | 396 days ago | 0 ETH | ||||
| 13768317 | 397 days ago | 0 ETH | ||||
| 13768317 | 397 days ago | 0 ETH | ||||
| 13754896 | 397 days ago | 0 ETH | ||||
| 13754896 | 397 days ago | 0 ETH | ||||
| 13754871 | 397 days ago | 0 ETH | ||||
| 13754871 | 397 days ago | 0 ETH | ||||
| 13753958 | 397 days ago | 0 ETH | ||||
| 13753958 | 397 days ago | 0 ETH | ||||
| 13752696 | 397 days ago | 0 ETH | ||||
| 13752696 | 397 days ago | 0 ETH | ||||
| 13752672 | 397 days ago | 0 ETH | ||||
| 13752672 | 397 days ago | 0 ETH | ||||
| 13747032 | 397 days ago | 0 ETH | ||||
| 13747032 | 397 days ago | 0 ETH | ||||
| 13747003 | 397 days ago | 0 ETH | ||||
| 13747003 | 397 days ago | 0 ETH | ||||
| 13746956 | 397 days ago | 0 ETH | ||||
| 13746956 | 397 days ago | 0 ETH | ||||
| 13746893 | 397 days ago | 0 ETH | ||||
| 13746893 | 397 days ago | 0 ETH | ||||
| 13352127 | 407 days ago | 0 ETH | ||||
| 13352127 | 407 days ago | 0 ETH | ||||
| 13336603 | 407 days ago | 0 ETH |
Cross-Chain Transactions
Loading...
Loading
Contract Name:
ZeronymV3Portal
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
No with 200 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import {AttestationPayload} from "@verax-attestation-registry/verax-contracts/contracts/types/Structs.sol";
import {AbstractPortal} from "@verax-attestation-registry/verax-contracts/contracts/abstracts/AbstractPortal.sol";
/**
* @title Zeronym V3 Portal
* @author Holonym Foundation
*/
contract ZeronymV3Portal is AbstractPortal {
constructor(address[] memory modules, address router) AbstractPortal(modules, router) {}
/// @inheritdoc AbstractPortal
function withdraw(address payable to, uint256 amount) external override {}
/// @inheritdoc AbstractPortal
function _onReplace(
bytes32 attestationId,
AttestationPayload memory attestationPayload,
address attester,
uint256 value
) internal virtual override {
if (msg.sender != portalRegistry.getPortalByAddress(address(this)).ownerAddress) revert OnlyPortalOwner();
}
/// @inheritdoc AbstractPortal
function _onBulkReplace(
bytes32[] memory attestationIds,
AttestationPayload[] memory attestationsPayloads,
bytes[][] memory validationPayloads
) internal virtual override {
if (msg.sender != portalRegistry.getPortalByAddress(address(this)).ownerAddress) revert OnlyPortalOwner();
}
}// 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
// OpenZeppelin Contracts (last updated v4.9.0) (utils/introspection/ERC165Checker.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
/**
* @dev Library used to query support of an interface declared via {IERC165}.
*
* Note that these functions return the actual result of the query: they do not
* `revert` if an interface is not supported. It is up to the caller to decide
* what to do in these cases.
*/
library ERC165CheckerUpgradeable {
// As per the EIP-165 spec, no interface should ever match 0xffffffff
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
/**
* @dev Returns true if `account` supports the {IERC165} interface.
*/
function supportsERC165(address account) internal view returns (bool) {
// Any contract that implements ERC165 must explicitly indicate support of
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
return
supportsERC165InterfaceUnchecked(account, type(IERC165Upgradeable).interfaceId) &&
!supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID);
}
/**
* @dev Returns true if `account` supports the interface defined by
* `interfaceId`. Support for {IERC165} itself is queried automatically.
*
* See {IERC165-supportsInterface}.
*/
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
// query support of both ERC165 as per the spec and support of _interfaceId
return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId);
}
/**
* @dev Returns a boolean array where each value corresponds to the
* interfaces passed in and whether they're supported or not. This allows
* you to batch check interfaces for a contract where your expectation
* is that some interfaces may not be supported.
*
* See {IERC165-supportsInterface}.
*
* _Available since v3.4._
*/
function getSupportedInterfaces(
address account,
bytes4[] memory interfaceIds
) internal view returns (bool[] memory) {
// an array of booleans corresponding to interfaceIds and whether they're supported or not
bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);
// query support of ERC165 itself
if (supportsERC165(account)) {
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]);
}
}
return interfaceIdsSupported;
}
/**
* @dev Returns true if `account` supports all the interfaces defined in
* `interfaceIds`. Support for {IERC165} itself is queried automatically.
*
* Batch-querying can lead to gas savings by skipping repeated checks for
* {IERC165} support.
*
* See {IERC165-supportsInterface}.
*/
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself
if (!supportsERC165(account)) {
return false;
}
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) {
return false;
}
}
// all interfaces supported
return true;
}
/**
* @notice Query if a contract implements an interface, does not check ERC165 support
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Assumes that account contains a contract that supports ERC165, otherwise
* the behavior of this method is undefined. This precondition can be checked
* with {supportsERC165}.
*
* Some precompiled contracts will falsely indicate support for a given interface, so caution
* should be exercised when using this function.
*
* Interface identification is specified in ERC-165.
*/
function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) {
// prepare call
bytes memory encodedParams = abi.encodeWithSelector(IERC165Upgradeable.supportsInterface.selector, interfaceId);
// perform static call
bool success;
uint256 returnSize;
uint256 returnValue;
assembly {
success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
returnSize := returndatasize()
returnValue := mload(0x00)
}
return success && returnSize >= 0x20 && returnValue > 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { AttestationPayload } from "../types/Structs.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/**
* @title Abstract Module
* @author Consensys
* @notice Defines the minimal Module interface
*/
abstract contract AbstractModule is IERC165 {
/// @notice Error thrown when someone else than the portal's owner is trying to revoke
error OnlyPortalOwner();
/**
* @notice Executes the module's custom logic.
* @param attestationPayload The incoming attestation data.
* @param validationPayload Additional data required for verification.
* @param txSender The transaction sender's address.
* @param value The transaction value.
*/
function run(
AttestationPayload memory attestationPayload,
bytes memory validationPayload,
address txSender,
uint256 value
) public virtual;
/**
* @notice Checks if the contract implements the Module interface.
* @param interfaceID The ID of the interface to check.
* @return A boolean indicating interface support.
*/
function supportsInterface(bytes4 interfaceID) public pure virtual override returns (bool) {
return interfaceID == type(AbstractModule).interfaceId || interfaceID == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { AttestationPayload } from "../types/Structs.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
/**
* @title Abstract Module V2
* @author Consensys
* @notice Defines the minimal Module V2 interface
*/
abstract contract AbstractModuleV2 is IERC165 {
/// @notice Error thrown when someone else than the portal's owner is trying to revoke
error OnlyPortalOwner();
/**
* @notice Executes the module's custom logic
* @param attestationPayload The incoming attestation data
* @param validationPayload Additional data required for verification
* @param initialCaller The address of the initial caller (transaction sender)
* @param value The value (ETH) optionally passed in the attesting transaction
* @param attester The address defined by the Portal as the attester for this payload
* @param portal The issuing Portal's address
*/
function run(
AttestationPayload memory attestationPayload,
bytes memory validationPayload,
address initialCaller,
uint256 value,
address attester,
address portal
) public virtual;
/**
* @notice Checks if the contract implements the Module interface.
* @param interfaceID The ID of the interface to check.
* @return A boolean indicating interface support.
*/
function supportsInterface(bytes4 interfaceID) public pure virtual override returns (bool) {
return interfaceID == type(AbstractModuleV2).interfaceId || interfaceID == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { AttestationRegistry } from "../AttestationRegistry.sol";
import { ModuleRegistry } from "../ModuleRegistry.sol";
import { PortalRegistry } from "../PortalRegistry.sol";
import { AttestationPayload } from "../types/Structs.sol";
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import { IRouter } from "../interfaces/IRouter.sol";
import { IPortal } from "../interfaces/IPortal.sol";
/**
* @title Abstract Portal
* @author Consensys
* @notice This contract is an abstracts contract with basic Portal logic
* to be inherited. We strongly encourage all Portals to implement
* this contract.
*/
abstract contract AbstractPortal is IPortal {
IRouter public router;
address[] public modules;
ModuleRegistry public moduleRegistry;
AttestationRegistry public attestationRegistry;
PortalRegistry public portalRegistry;
/// @notice Error thrown when someone else than the portal's owner is trying to revoke
error OnlyPortalOwner();
/**
* @notice Contract constructor
* @param _modules list of modules to use for the portal (can be empty)
* @param _router Router's address
* @dev This sets the addresses for the AttestationRegistry, ModuleRegistry and PortalRegistry
*/
constructor(address[] memory _modules, address _router) {
modules = _modules;
router = IRouter(_router);
attestationRegistry = AttestationRegistry(router.getAttestationRegistry());
moduleRegistry = ModuleRegistry(router.getModuleRegistry());
portalRegistry = PortalRegistry(router.getPortalRegistry());
}
/**
* @notice Optional method to withdraw funds from the Portal
* @param to the address to send the funds to
* @param amount the amount to withdraw
*/
function withdraw(address payable to, uint256 amount) external virtual;
/**
* @notice Attest the schema with given attestationPayload and validationPayload
* @param attestationPayload the payload to attest
* @param validationPayloads the payloads to validate via the modules to issue the attestations
* @dev Runs all modules for the portal and registers the attestation using AttestationRegistry
*/
function attest(AttestationPayload memory attestationPayload, bytes[] memory validationPayloads) public payable {
moduleRegistry.runModules(modules, attestationPayload, validationPayloads, msg.value);
_onAttest(attestationPayload, getAttester(), msg.value);
attestationRegistry.attest(attestationPayload, getAttester());
}
/**
* @notice Attest the schema with given attestationPayload and validationPayload
* @param attestationPayload the payload to attest
* @param validationPayloads the payloads to validate via the modules to issue the attestations
* @dev Runs all modules for the portal and registers the attestation using AttestationRegistry
*/
function attestV2(AttestationPayload memory attestationPayload, bytes[] memory validationPayloads) public payable {
moduleRegistry.runModulesV2(modules, attestationPayload, validationPayloads, msg.value, msg.sender, getAttester());
_onAttestV2(attestationPayload, validationPayloads, msg.value);
attestationRegistry.attest(attestationPayload, getAttester());
}
/**
* @notice Bulk attest the schema with payloads to attest and validation payloads
* @param attestationsPayloads the payloads to attest
* @param validationPayloads the payloads to validate via the modules to issue the attestations
*/
function bulkAttest(AttestationPayload[] memory attestationsPayloads, bytes[][] memory validationPayloads) public {
moduleRegistry.bulkRunModules(modules, attestationsPayloads, validationPayloads);
_onBulkAttest(attestationsPayloads, validationPayloads);
attestationRegistry.bulkAttest(attestationsPayloads, getAttester());
}
/**
* @notice Bulk attest the schema with payloads to attest and validation payloads
* @param attestationPayloads the payloads to attest
* @param validationPayloads the payloads to validate via the modules to issue the attestations
*/
function bulkAttestV2(AttestationPayload[] memory attestationPayloads, bytes[][] memory validationPayloads) public {
moduleRegistry.bulkRunModulesV2(modules, attestationPayloads, validationPayloads, msg.sender, getAttester());
_onBulkAttest(attestationPayloads, validationPayloads);
attestationRegistry.bulkAttest(attestationPayloads, getAttester());
}
/**
* @notice Replaces the attestation for the given identifier and replaces it with a new attestation
* @param attestationId the ID of the attestation to replace
* @param attestationPayload the attestation payload to create the new attestation and register it
* @param validationPayloads the payloads to validate via the modules to issue the attestation
* @dev Runs all modules for the portal and registers the attestation using AttestationRegistry
*/
function replace(
bytes32 attestationId,
AttestationPayload memory attestationPayload,
bytes[] memory validationPayloads
) public payable {
moduleRegistry.runModules(modules, attestationPayload, validationPayloads, msg.value);
_onReplace(attestationId, attestationPayload, getAttester(), msg.value);
attestationRegistry.replace(attestationId, attestationPayload, getAttester());
}
/**
* @notice Bulk replaces the attestation for the given identifiers and replaces them with new attestations
* @param attestationIds the list of IDs of the attestations to replace
* @param attestationsPayloads the list of attestation payloads to create the new attestations and register them
* @param validationPayloads the payloads to validate via the modules to issue the attestations
*/
function bulkReplace(
bytes32[] memory attestationIds,
AttestationPayload[] memory attestationsPayloads,
bytes[][] memory validationPayloads
) public {
moduleRegistry.bulkRunModules(modules, attestationsPayloads, validationPayloads);
_onBulkReplace(attestationIds, attestationsPayloads, validationPayloads);
attestationRegistry.bulkReplace(attestationIds, attestationsPayloads, getAttester());
}
/**
* @notice Revokes an attestation for the given identifier
* @param attestationId the ID of the attestation to revoke
* @dev By default, revocation is only possible by the portal owner
* We strongly encourage implementing such a rule in your Portal if you intend on overriding this method
*/
function revoke(bytes32 attestationId) public {
_onRevoke(attestationId);
attestationRegistry.revoke(attestationId);
}
/**
* @notice Bulk revokes a list of attestations for the given identifiers
* @param attestationIds the IDs of the attestations to revoke
*/
function bulkRevoke(bytes32[] memory attestationIds) public {
_onBulkRevoke(attestationIds);
attestationRegistry.bulkRevoke(attestationIds);
}
/**
* @notice Get all the modules addresses used by the Portal
* @return The list of modules addresses linked to the Portal
*/
function getModules() external view returns (address[] memory) {
return modules;
}
/**
* @notice Verifies that a specific interface is implemented by the Portal, following ERC-165 specification
* @param interfaceID the interface identifier checked in this call
* @return The list of modules addresses linked to the Portal
*/
function supportsInterface(bytes4 interfaceID) public pure virtual override returns (bool) {
return
interfaceID == type(AbstractPortal).interfaceId ||
interfaceID == type(IPortal).interfaceId ||
interfaceID == type(IERC165).interfaceId;
}
/**
* @notice Defines the address of the entity issuing attestations to the subject
* @dev We strongly encourage a reflection when overriding this rule: who should be set as the attester?
*/
function getAttester() public view virtual returns (address) {
return msg.sender;
}
/**
* @notice Optional method run before a payload is attested
* @param attestationPayload the attestation payload supposed to be attested
* @param attester the address of the attester
* @param value the value sent with the attestation
*/
function _onAttest(AttestationPayload memory attestationPayload, address attester, uint256 value) internal virtual {}
/**
* @notice Optional method run before a payload is attested
* @param attestationPayload the attestation payload to attest
* @param validationPayloads the payloads to validate via the modules
* @param value the value sent with the attestation
*/
function _onAttestV2(
AttestationPayload memory attestationPayload,
bytes[] memory validationPayloads,
uint256 value
) internal virtual {}
/**
* @notice Optional method run when an attestation is replaced
* @param attestationId the ID of the attestation being replaced
* @param attestationPayload the attestation payload to create attestation and register it
* @param attester the address of the attester
* @param value the value sent with the attestation
*/
function _onReplace(
bytes32 attestationId,
AttestationPayload memory attestationPayload,
address attester,
uint256 value
) internal virtual {}
/**
* @notice Optional method run when attesting a batch of payloads
* @param attestationsPayloads the payloads to attest
* @param validationPayloads the payloads to validate in order to issue the attestations
*/
function _onBulkAttest(
AttestationPayload[] memory attestationsPayloads,
bytes[][] memory validationPayloads
) internal virtual {}
function _onBulkReplace(
bytes32[] memory attestationIds,
AttestationPayload[] memory attestationsPayloads,
bytes[][] memory validationPayloads
) internal virtual {}
/**
* @notice Optional method run when an attestation is revoked or replaced
* @dev IMPORTANT NOTE: By default, revocation is only possible by the portal owner
*/
function _onRevoke(bytes32 /*attestationId*/) internal virtual {
if (msg.sender != portalRegistry.getPortalByAddress(address(this)).ownerAddress) revert OnlyPortalOwner();
}
/**
* @notice Optional method run when a batch of attestations are revoked or replaced
* @dev IMPORTANT NOTE: By default, revocation is only possible by the portal owner
*/
function _onBulkRevoke(bytes32[] memory /*attestationIds*/) internal virtual {
if (msg.sender != portalRegistry.getPortalByAddress(address(this)).ownerAddress) revert OnlyPortalOwner();
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { Attestation, AttestationPayload } from "./types/Structs.sol";
import { PortalRegistry } from "./PortalRegistry.sol";
import { SchemaRegistry } from "./SchemaRegistry.sol";
import { IRouter } from "./interfaces/IRouter.sol";
import { uncheckedInc256 } from "./Common.sol";
/**
* @title Attestation Registry
* @author Consensys
* @notice This contract stores a registry of all attestations
*/
contract AttestationRegistry is OwnableUpgradeable {
IRouter public router;
uint16 private version;
uint32 private attestationIdCounter;
mapping(bytes32 attestationId => Attestation attestation) private attestations;
uint256 private chainPrefix;
/// @notice Error thrown when a non-portal tries to call a method that can only be called by a portal
error OnlyPortal();
/// @notice Error thrown when an invalid Router address is given
error RouterInvalid();
/// @notice Error thrown when an attestation is not registered in the AttestationRegistry
error AttestationNotAttested();
/// @notice Error thrown when an attempt is made to revoke an attestation by an entity other than the attesting portal
error OnlyAttestingPortal();
/// @notice Error thrown when a schema id is not registered
error SchemaNotRegistered();
/// @notice Error thrown when an attestation subject is empty
error AttestationSubjectFieldEmpty();
/// @notice Error thrown when an attestation data field is empty
error AttestationDataFieldEmpty();
/// @notice Error thrown when an attempt is made to bulk replace with mismatched parameter array lengths
error ArrayLengthMismatch();
/// @notice Error thrown when an attempt is made to revoke an attestation that was already revoked
error AlreadyRevoked();
/// @notice Error thrown when an attempt is made to revoke an attestation based on a non-revocable schema
error AttestationNotRevocable();
/// @notice Event emitted when an attestation is registered
event AttestationRegistered(bytes32 indexed attestationId);
/// @notice Event emitted when an attestation is replaced
event AttestationReplaced(bytes32 attestationId, bytes32 replacedBy);
/// @notice Event emitted when an attestation is revoked
event AttestationRevoked(bytes32 attestationId);
/// @notice Event emitted when the version number is incremented
event VersionUpdated(uint16 version);
/**
* @notice Checks if the caller is a registered portal
* @param portal the portal address
*/
modifier onlyPortals(address portal) {
bool isPortalRegistered = PortalRegistry(router.getPortalRegistry()).isRegistered(portal);
if (!isPortalRegistered) revert OnlyPortal();
_;
}
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
/**
* @notice Contract initialization
*/
function initialize() public initializer {
__Ownable_init();
}
/**
* @notice Changes the address for the Router
* @dev Only the registry owner can call this method
*/
function updateRouter(address _router) public onlyOwner {
if (_router == address(0)) revert RouterInvalid();
router = IRouter(_router);
}
/**
* @notice Changes the chain prefix for the attestation IDs
* @dev Only the registry owner can call this method
*/
function updateChainPrefix(uint256 _chainPrefix) public onlyOwner {
chainPrefix = _chainPrefix;
}
/**
* @notice Registers an attestation to the AttestationRegistry
* @param attestationPayload the attestation payload to create attestation and register it
* @param attester the account address issuing the attestation
* @dev This method is only callable by a registered Portal
*/
function attest(AttestationPayload calldata attestationPayload, address attester) public onlyPortals(msg.sender) {
// Verify the schema id exists
SchemaRegistry schemaRegistry = SchemaRegistry(router.getSchemaRegistry());
if (!schemaRegistry.isRegistered(attestationPayload.schemaId)) revert SchemaNotRegistered();
// Verify the subject field is not blank
if (attestationPayload.subject.length == 0) revert AttestationSubjectFieldEmpty();
// Verify the attestationData field is not blank
if (attestationPayload.attestationData.length == 0) revert AttestationDataFieldEmpty();
// Auto increment attestation counter
attestationIdCounter++;
// Generate the full attestation ID, padded with the chain prefix
bytes32 id = generateAttestationId(attestationIdCounter);
// Create attestation
attestations[id] = Attestation(
id,
attestationPayload.schemaId,
bytes32(0),
attester,
msg.sender,
uint64(block.timestamp),
attestationPayload.expirationDate,
0,
version,
false,
attestationPayload.subject,
attestationPayload.attestationData
);
emit AttestationRegistered(id);
}
/**
* @notice Registers attestations to the AttestationRegistry
* @param attestationsPayloads the attestations payloads to create attestations and register them
*/
function bulkAttest(AttestationPayload[] calldata attestationsPayloads, address attester) public {
for (uint256 i = 0; i < attestationsPayloads.length; i = uncheckedInc256(i)) {
attest(attestationsPayloads[i], attester);
}
}
function massImport(AttestationPayload[] calldata attestationsPayloads, address portal) public onlyOwner {
for (uint256 i = 0; i < attestationsPayloads.length; i = uncheckedInc256(i)) {
// Auto increment attestation counter
attestationIdCounter++;
// Generate the full attestation ID, padded with the chain prefix
bytes32 id = generateAttestationId(attestationIdCounter);
// Create attestation
attestations[id] = Attestation(
id,
attestationsPayloads[i].schemaId,
bytes32(0),
msg.sender,
portal,
uint64(block.timestamp),
attestationsPayloads[i].expirationDate,
0,
version,
false,
attestationsPayloads[i].subject,
attestationsPayloads[i].attestationData
);
emit AttestationRegistered(id);
}
}
/**
* @notice Replaces an attestation for the given identifier and replaces it with a new attestation
* @param attestationId the ID of the attestation to replace
* @param attestationPayload the attestation payload to create the new attestation and register it
* @param attester the account address issuing the attestation
*/
function replace(bytes32 attestationId, AttestationPayload calldata attestationPayload, address attester) public {
attest(attestationPayload, attester);
revoke(attestationId);
bytes32 replacedBy = generateAttestationId(attestationIdCounter);
attestations[attestationId].replacedBy = replacedBy;
emit AttestationReplaced(attestationId, replacedBy);
}
/**
* @notice Replaces attestations for given identifiers and replaces them with new attestations
* @param attestationIds the list of IDs of the attestations to replace
* @param attestationPayloads the list of attestation payloads to create the new attestations and register them
* @param attester the account address issuing the attestation
*/
function bulkReplace(
bytes32[] calldata attestationIds,
AttestationPayload[] calldata attestationPayloads,
address attester
) public {
if (attestationIds.length != attestationPayloads.length) revert ArrayLengthMismatch();
for (uint256 i = 0; i < attestationIds.length; i = uncheckedInc256(i)) {
replace(attestationIds[i], attestationPayloads[i], attester);
}
}
/**
* @notice Revokes an attestation for a given identifier
* @param attestationId the ID of the attestation to revoke
*/
function revoke(bytes32 attestationId) public {
if (!isRegistered(attestationId)) revert AttestationNotAttested();
if (attestations[attestationId].revoked) revert AlreadyRevoked();
if (msg.sender != attestations[attestationId].portal) revert OnlyAttestingPortal();
if (!isRevocable(attestations[attestationId].portal)) revert AttestationNotRevocable();
attestations[attestationId].revoked = true;
attestations[attestationId].revocationDate = uint64(block.timestamp);
emit AttestationRevoked(attestationId);
}
/**
* @notice Bulk revokes a list of attestations for the given identifiers
* @param attestationIds the IDs of the attestations to revoke
*/
function bulkRevoke(bytes32[] memory attestationIds) external {
for (uint256 i = 0; i < attestationIds.length; i = uncheckedInc256(i)) {
revoke(attestationIds[i]);
}
}
/**
* @notice Checks if an attestation is registered
* @param attestationId the attestation identifier
* @return true if the attestation is registered, false otherwise
*/
function isRegistered(bytes32 attestationId) public view returns (bool) {
return attestations[attestationId].attestationId != bytes32(0);
}
/**
* @notice Checks whether a portal issues revocable attestations
* @param portalId the portal address (ID)
* @return true if the attestations issued by this portal are revocable, false otherwise
*/
function isRevocable(address portalId) public view returns (bool) {
PortalRegistry portalRegistry = PortalRegistry(router.getPortalRegistry());
return portalRegistry.getPortalByAddress(portalId).isRevocable;
}
/**
* @notice Gets an attestation by its identifier
* @param attestationId the attestation identifier
* @return the attestation
*/
function getAttestation(bytes32 attestationId) public view returns (Attestation memory) {
if (!isRegistered(attestationId)) revert AttestationNotAttested();
return attestations[attestationId];
}
/**
* @notice Increments the registry version
* @return The new version number
*/
function incrementVersionNumber() public onlyOwner returns (uint16) {
++version;
emit VersionUpdated(version);
return version;
}
/**
* @notice Gets the registry version
* @return The current version number
*/
function getVersionNumber() public view returns (uint16) {
return version;
}
/**
* @notice Gets the attestation counter
* @return The attestation counter
*/
function getAttestationIdCounter() public view returns (uint32) {
return attestationIdCounter;
}
/**
* @notice Gets the chain prefix used to generate the attestation IDs
* @return The chain prefix
*/
function getChainPrefix() public view returns (uint256) {
return chainPrefix;
}
/**
* @notice Checks if an address owns a given attestation following ERC-1155
* @param account The address of the token holder
* @param id ID of the attestation
* @return The _owner's balance of the attestations on a given attestation ID
*/
function balanceOf(address account, uint256 id) public view returns (uint256) {
bytes32 attestationId = generateAttestationId(id);
Attestation memory attestation = attestations[attestationId];
if (attestation.subject.length > 20 && keccak256(attestation.subject) == keccak256(abi.encode(account))) {
return 1;
}
if (attestation.subject.length == 20 && keccak256(attestation.subject) == keccak256(abi.encodePacked(account))) {
return 1;
}
return 0;
}
/**
* @notice Get the balance of multiple account/attestation pairs following ERC-1155
* @param accounts The addresses of the attestation holders
* @param ids ID of the attestations
* @return The _owner's balance of the attestation for a given address (i.e. balance for each (owner, id) pair)
*/
function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view returns (uint256[] memory) {
if (accounts.length != ids.length) revert ArrayLengthMismatch();
uint256[] memory result = new uint256[](accounts.length);
for (uint256 i = 0; i < accounts.length; i = uncheckedInc256(i)) {
result[i] = balanceOf(accounts[i], ids[i]);
}
return result;
}
/**
* @notice Generate an attestation ID, prefixed by the Verax chain identifier
* @param id The attestation ID (coming after the chain prefix)
* @return The attestation ID
*/
function generateAttestationId(uint256 id) internal view returns (bytes32) {
// Combine the chain prefix and the ID
return bytes32(abi.encode(chainPrefix + id));
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
/**
* @notice This function is inspired by PADO Labs' codebase
* solhint-disable-next-line max-line-length
* https://github.com/pado-labs/offchain-data-hooks/blob/c6f37ad2a42d0eb40cf2295aed68ea3b94ee0925/src/hooks/Common.sol#L45
* @dev A helper function to work with unchecked uint256 iterators in loops
*/
function uncheckedInc256(uint256 i) pure returns (uint256 j) {
unchecked {
j = i + 1;
}
}
/**
* @notice This function is inspired by PADO Labs' codebase
* solhint-disable-next-line max-line-length
* https://github.com/pado-labs/offchain-data-hooks/blob/c6f37ad2a42d0eb40cf2295aed68ea3b94ee0925/src/hooks/Common.sol#L45
* @dev A helper function to work with unchecked uint32 iterators in loops
*/
function uncheckedInc32(uint32 i) pure returns (uint32 j) {
unchecked {
j = i + 1;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { AbstractPortal } from "./abstracts/AbstractPortal.sol";
/**
* @title Default Portal
* @author Consensys
* @notice This contract aims to provide a default portal
* @dev This Portal does not add any logic to the AbstractPortal
*/
contract DefaultPortal is AbstractPortal {
/**
* @notice Contract constructor
* @param modules list of modules to use for the portal (can be empty)
* @param router the Router's address
* @dev This sets the addresses for the AttestationRegistry, ModuleRegistry and PortalRegistry
*/
constructor(address[] memory modules, address router) AbstractPortal(modules, router) {}
/// @inheritdoc AbstractPortal
function withdraw(address payable to, uint256 amount) external override {}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { IERC165 } from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
/**
* @title IPortal
* @author Consensys
* @notice This contract is the interface to be implemented by any Portal.
* NOTE: A portal must implement this interface to registered on
* the PortalRegistry contract.
*/
interface IPortal is IERC165 {
/**
* @notice Get all the modules addresses used by the Portal
* @return The list of modules addresses linked to the Portal
*/
function getModules() external view returns (address[] memory);
/**
* @notice Defines the address of the entity issuing attestations to the subject
* @dev We strongly encourage a reflection when implementing this method
*/
function getAttester() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
/**
* @title Router
* @author Consensys
* @notice This contract aims to provides a single entrypoint for the Verax registries
*/
interface IRouter {
/**
* @notice Gives the address for the AttestationRegistry contract
* @return The current address of the AttestationRegistry contract
*/
function getAttestationRegistry() external view returns (address);
/**
* @notice Gives the address for the ModuleRegistry contract
* @return The current address of the ModuleRegistry contract
*/
function getModuleRegistry() external view returns (address);
/**
* @notice Gives the address for the PortalRegistry contract
* @return The current address of the PortalRegistry contract
*/
function getPortalRegistry() external view returns (address);
/**
* @notice Gives the address for the SchemaRegistry contract
* @return The current address of the SchemaRegistry contract
*/
function getSchemaRegistry() external view returns (address);
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { AttestationPayload, Module } from "./types/Structs.sol";
import { AbstractModule } from "./abstracts/AbstractModule.sol";
import { AbstractModuleV2 } from "./abstracts/AbstractModuleV2.sol";
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
// solhint-disable-next-line max-line-length
import { ERC165CheckerUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165CheckerUpgradeable.sol";
import { PortalRegistry } from "./PortalRegistry.sol";
import { IRouter } from "./interfaces/IRouter.sol";
import { uncheckedInc32 } from "./Common.sol";
/**
* @title Module Registry
* @author Consensys
* @notice This contract aims to manage the Modules used by the Portals, including their discoverability
*/
contract ModuleRegistry is OwnableUpgradeable {
IRouter public router;
/// @dev The list of Modules, accessed by their address
mapping(address id => Module module) public modules;
/// @dev The list of Module addresses
address[] public moduleAddresses;
/// @notice Error thrown when an invalid Router address is given
error RouterInvalid();
/// @notice Error thrown when a non-issuer tries to call a method that can only be called by an issuer
error OnlyIssuer();
/// @notice Error thrown when an identical Module was already registered
error ModuleAlreadyExists();
/// @notice Error thrown when attempting to add a Module without a name
error ModuleNameMissing();
/// @notice Error thrown when attempting to add a Module without an address of deployed smart contract
error ModuleAddressInvalid();
/// @notice Error thrown when attempting to add a Module which has not implemented the IModule interface
error ModuleInvalid();
/// @notice Error thrown when attempting to run modules with no attestation payload provided
error AttestationPayloadMissing();
/// @notice Error thrown when module is not registered
error ModuleNotRegistered();
/// @notice Error thrown when module addresses and validation payload length mismatch
error ModuleValidationPayloadMismatch();
/// @notice Event emitted when a Module is registered
event ModuleRegistered(string name, string description, address moduleAddress);
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
/**
* @notice Contract initialization
*/
function initialize() public initializer {
__Ownable_init();
}
/**
* @notice Checks if the caller is a registered issuer.
* @param issuer the issuer address
*/
modifier onlyIssuers(address issuer) {
bool isIssuerRegistered = PortalRegistry(router.getPortalRegistry()).isIssuer(issuer);
if (!isIssuerRegistered) revert OnlyIssuer();
_;
}
/**
* @notice Changes the address for the Router
* @dev Only the registry owner can call this method
*/
function updateRouter(address _router) public onlyOwner {
if (_router == address(0)) revert RouterInvalid();
router = IRouter(_router);
}
/**
* Check if address is smart contract and not EOA
* @param contractAddress address to be verified
* @return the result as true if it is a smart contract else false
*/
function isContractAddress(address contractAddress) public view returns (bool) {
return contractAddress.code.length > 0;
}
/**
* @notice Registers a Module, with its metadata and run some checks:
* - mandatory name
* - mandatory module's deployed smart contract address
* - the module must be unique
* @param name the module name
* @param description the module description
* @param moduleAddress the address of the deployed smart contract
* @dev the module is stored in a mapping, the number of modules is incremented and an event is emitted
*/
function register(
string memory name,
string memory description,
address moduleAddress
) public onlyIssuers(msg.sender) {
if (bytes(name).length == 0) revert ModuleNameMissing();
// Check if moduleAddress is a smart contract address
if (!isContractAddress(moduleAddress)) revert ModuleAddressInvalid();
// Check if module has implemented AbstractModule or AbstractModuleV2
if (
!ERC165CheckerUpgradeable.supportsInterface(moduleAddress, type(AbstractModule).interfaceId) &&
!ERC165CheckerUpgradeable.supportsInterface(moduleAddress, type(AbstractModuleV2).interfaceId)
) {
revert ModuleInvalid();
}
// Module address is used to identify uniqueness of the module
if (bytes(modules[moduleAddress].name).length > 0) revert ModuleAlreadyExists();
modules[moduleAddress] = Module(moduleAddress, name, description);
moduleAddresses.push(moduleAddress);
emit ModuleRegistered(name, description, moduleAddress);
}
/**
* @notice Executes the run method for all given Modules that are registered
* @param modulesAddresses the addresses of the registered modules
* @param attestationPayload the payload to attest
* @param validationPayloads the payloads to check for each module (one payload per module)
* @dev check if modules are registered and execute run method for each module
*/
function runModules(
address[] memory modulesAddresses,
AttestationPayload memory attestationPayload,
bytes[] memory validationPayloads,
uint256 value
) public {
// If no module provided, bypass module validation
if (modulesAddresses.length == 0) return;
// Each module involved must have a corresponding item from the validation payload
if (modulesAddresses.length != validationPayloads.length) revert ModuleValidationPayloadMismatch();
// For each module, check if it is registered and call its run method
for (uint32 i = 0; i < modulesAddresses.length; i = uncheckedInc32(i)) {
if (!isRegistered(modulesAddresses[i])) revert ModuleNotRegistered();
// solhint-disable avoid-tx-origin
AbstractModule(modulesAddresses[i]).run(attestationPayload, validationPayloads[i], tx.origin, value);
}
}
/**
* @notice Executes the V2 run method for all given Modules that are registered
* @param modulesAddresses the addresses of the registered modules
* @param attestationPayload the payload to attest
* @param validationPayloads the payloads to check for each module (one payload per module)
* @param value the value (ETH) optionally passed in the attesting transaction
* @param initialCaller the address of the initial caller (transaction sender)
* @param attester the address defined by the Portal as the attester for this payload
* @dev check if modules are registered and execute the V2 run method for each module
*/
function runModulesV2(
address[] memory modulesAddresses,
AttestationPayload memory attestationPayload,
bytes[] memory validationPayloads,
uint256 value,
address initialCaller,
address attester
) public {
// If no module provided, bypass module validation
if (modulesAddresses.length == 0) return;
// Each module involved must have a corresponding item from the validation payload
if (modulesAddresses.length != validationPayloads.length) revert ModuleValidationPayloadMismatch();
// For each module, check if it is registered and call its run method
for (uint32 i = 0; i < modulesAddresses.length; i = uncheckedInc32(i)) {
if (!isRegistered(modulesAddresses[i])) revert ModuleNotRegistered();
AbstractModuleV2(modulesAddresses[i]).run(
attestationPayload,
validationPayloads[i],
initialCaller,
value,
attester,
msg.sender
);
}
}
/**
* @notice Executes the modules validation for all attestations payloads for all given Modules that are registered
* @param modulesAddresses the addresses of the registered modules
* @param attestationsPayloads the payloads to attest
* @param validationPayloads the payloads to check for each module
* @dev NOTE: Currently the bulk run modules does not handle payable modules
* a default value of 0 is used.
*/
function bulkRunModules(
address[] memory modulesAddresses,
AttestationPayload[] memory attestationsPayloads,
bytes[][] memory validationPayloads
) public {
for (uint32 i = 0; i < attestationsPayloads.length; i = uncheckedInc32(i)) {
runModules(modulesAddresses, attestationsPayloads[i], validationPayloads[i], 0);
}
}
/**
* @notice Executes the V2 modules validation for all attestations payloads for all given V2 Modules that are registered
* @param modulesAddresses the addresses of the registered modules
* @param attestationPayloads the payloads to attest
* @param validationPayloads the payloads to check for each module
* @dev NOTE: Currently the bulk run modules does not handle payable modules
* a default value of 0 is used.
*/
function bulkRunModulesV2(
address[] memory modulesAddresses,
AttestationPayload[] memory attestationPayloads,
bytes[][] memory validationPayloads,
address initialCaller,
address attester
) public {
for (uint32 i = 0; i < attestationPayloads.length; i = uncheckedInc32(i)) {
runModulesV2(modulesAddresses, attestationPayloads[i], validationPayloads[i], 0, initialCaller, attester);
}
}
/**
* @notice Get the number of Modules managed by the contract
* @return The number of Modules already registered
* @dev Returns the length of the `moduleAddresses` array
*/
function getModulesNumber() public view returns (uint256) {
return moduleAddresses.length;
}
/**
* @notice Checks that a module is registered in the module registry
* @param moduleAddress The address of the Module to check
* @return True if the Module is registered, False otherwise
*/
function isRegistered(address moduleAddress) public view returns (bool) {
return bytes(modules[moduleAddress].name).length > 0;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
// solhint-disable-next-line max-line-length
import { ERC165CheckerUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/introspection/ERC165CheckerUpgradeable.sol";
import { AbstractPortal } from "./abstracts/AbstractPortal.sol";
import { DefaultPortal } from "./DefaultPortal.sol";
import { SchemaRegistry } from "./SchemaRegistry.sol";
import { Portal } from "./types/Structs.sol";
import { IRouter } from "./interfaces/IRouter.sol";
import { IPortal } from "./interfaces/IPortal.sol";
import { uncheckedInc256 } from "./Common.sol";
/**
* @title Portal Registry
* @author Consensys
* @notice This contract aims to manage the Portals used by attestation issuers
*/
contract PortalRegistry is OwnableUpgradeable {
IRouter public router;
mapping(address id => Portal portal) private portals;
mapping(address issuerAddress => bool isIssuer) private issuers;
address[] private portalAddresses;
/// @notice Error thrown when an invalid Router address is given
error RouterInvalid();
/// @notice Error thrown when a non-issuer tries to call a method that can only be called by an issuer
error OnlyIssuer();
/// @notice Error thrown when attempting to register a Portal twice
error PortalAlreadyExists();
/// @notice Error thrown when attempting to register a Portal that is not a smart contract
error PortalAddressInvalid();
/// @notice Error thrown when attempting to register a Portal with an empty name
error PortalNameMissing();
/// @notice Error thrown when attempting to register a Portal with an empty description
error PortalDescriptionMissing();
/// @notice Error thrown when attempting to register a Portal with an empty owner name
error PortalOwnerNameMissing();
/// @notice Error thrown when attempting to register a Portal that does not implement IPortal interface
error PortalInvalid();
/// @notice Error thrown when attempting to get a Portal that is not registered
error PortalNotRegistered();
/// @notice Event emitted when a Portal is registered
event PortalRegistered(string name, string description, address portalAddress);
/// @notice Event emitted when a new issuer is added
event IssuerAdded(address issuerAddress);
/// @notice Event emitted when the issuer is removed
event IssuerRemoved(address issuerAddress);
/// @notice Event emitted when a Portal is revoked
event PortalRevoked(address portalAddress);
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
/**
* @notice Contract initialization
*/
function initialize() public initializer {
__Ownable_init();
}
/**
* @notice Changes the address for the Router
* @dev Only the registry owner can call this method
*/
function updateRouter(address _router) public onlyOwner {
if (_router == address(0)) revert RouterInvalid();
router = IRouter(_router);
}
/**
* @notice Registers an address as been an issuer
* @param issuer the address to register as an issuer
*/
function setIssuer(address issuer) public onlyOwner {
issuers[issuer] = true;
// Emit event
emit IssuerAdded(issuer);
}
/**
* @notice Revokes issuer status from an address
* @param issuer the address to be revoked as an issuer
*/
function removeIssuer(address issuer) public onlyOwner {
issuers[issuer] = false;
SchemaRegistry(router.getSchemaRegistry()).updateMatchingSchemaIssuers(issuer, msg.sender);
// Emit event
emit IssuerRemoved(issuer);
}
/**
* @notice Checks if a given address is an issuer
* @return A flag indicating whether the given address is an issuer
*/
function isIssuer(address issuer) public view returns (bool) {
return issuers[issuer];
}
/**
* @notice Checks if the caller is a registered issuer.
* @param issuer the issuer address
*/
modifier onlyIssuers(address issuer) {
if (!isIssuer(issuer)) revert OnlyIssuer();
_;
}
/**
* @notice Registers a Portal to the PortalRegistry
* @param id the portal address
* @param name the portal name
* @param description the portal description
* @param isRevocable whether the portal issues revocable attestations
* @param ownerName name of this portal's owner
*/
function register(
address id,
string memory name,
string memory description,
bool isRevocable,
string memory ownerName
) public onlyIssuers(msg.sender) {
// Check if portal already exists
if (portals[id].id != address(0)) revert PortalAlreadyExists();
// Check if portal is a smart contract
if (!isContractAddress(id)) revert PortalAddressInvalid();
// Check if name is not empty
if (bytes(name).length == 0) revert PortalNameMissing();
// Check if description is not empty
if (bytes(description).length == 0) revert PortalDescriptionMissing();
// Check if the owner's name is not empty
if (bytes(ownerName).length == 0) revert PortalOwnerNameMissing();
// Check if portal has implemented AbstractPortal
if (!ERC165CheckerUpgradeable.supportsInterface(id, type(IPortal).interfaceId)) revert PortalInvalid();
// Get the array of modules implemented by the portal
address[] memory modules = AbstractPortal(id).getModules();
// Add portal to mapping
Portal memory newPortal = Portal(id, msg.sender, modules, isRevocable, name, description, ownerName);
portals[id] = newPortal;
portalAddresses.push(id);
// Emit event
emit PortalRegistered(name, description, id);
}
/**
* @notice Revokes a Portal from the PortalRegistry
* @param id the portal address
* @dev Only the registry owner can call this method
*/
function revoke(address id) public onlyOwner {
if (!isRegistered(id)) revert PortalNotRegistered();
portals[id] = Portal(address(0), address(0), new address[](0), false, "", "", "");
uint256 portalAddressIndex;
for (uint256 i = 0; i < portalAddresses.length; i = uncheckedInc256(i)) {
if (portalAddresses[i] == id) {
portalAddressIndex = i;
}
}
if (portalAddressIndex >= portalAddresses.length) {
revert PortalNotRegistered();
}
portalAddresses[portalAddressIndex] = portalAddresses[portalAddresses.length - 1];
portalAddresses.pop();
emit PortalRevoked(id);
}
/**
* @notice Deploys and registers a clone of default portal
* @param modules the modules addresses
* @param name the portal name
* @param description the portal description
* @param ownerName name of this portal's owner
*/
function deployDefaultPortal(
address[] calldata modules,
string memory name,
string memory description,
bool isRevocable,
string memory ownerName
) external onlyIssuers(msg.sender) {
DefaultPortal defaultPortal = new DefaultPortal(modules, address(router));
register(address(defaultPortal), name, description, isRevocable, ownerName);
}
/**
* @notice Get a Portal by its address
* @param id The address of the Portal
* @return The Portal
*/
function getPortalByAddress(address id) public view returns (Portal memory) {
if (!isRegistered(id)) revert PortalNotRegistered();
return portals[id];
}
/**
* @notice Check if a Portal is registered
* @param id The address of the Portal
* @return True if the Portal is registered, false otherwise
*/
function isRegistered(address id) public view returns (bool) {
return portals[id].id != address(0);
}
/**
* @notice Get the number of Portals managed by the contract
* @return The number of Portals already registered
* @dev Returns the length of the `portalAddresses` array
*/
function getPortalsCount() public view returns (uint256) {
return portalAddresses.length;
}
/**
* Check if address is smart contract and not EOA
* @param contractAddress address to be verified
* @return the result as true if it is a smart contract else false
*/
function isContractAddress(address contractAddress) internal view returns (bool) {
return contractAddress.code.length > 0;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { OwnableUpgradeable } from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import { Schema } from "./types/Structs.sol";
import { PortalRegistry } from "./PortalRegistry.sol";
import { IRouter } from "./interfaces/IRouter.sol";
import { uncheckedInc256 } from "./Common.sol";
/**
* @title Schema Registry
* @author Consensys
* @notice This contract aims to manage the Schemas used by the Portals, including their discoverability
*/
contract SchemaRegistry is OwnableUpgradeable {
IRouter public router;
/// @dev The list of Schemas, accessed by their ID
mapping(bytes32 id => Schema schema) private schemas;
/// @dev The list of Schema IDs
bytes32[] public schemaIds;
/// @dev Associates a Schema ID with the address of the Issuer who created it
mapping(bytes32 id => address issuer) private schemasIssuers;
/// @notice Error thrown when an invalid Router address is given
error RouterInvalid();
/// @notice Error thrown when a non-issuer tries to call a method that can only be called by an issuer
error OnlyIssuer();
/// @notice Error thrown when any address which is not a portal registry tries to call a method
error OnlyPortalRegistry();
/// @notice Error thrown when a non-assigned issuer tries to call a method that can only be called by an assigned issuer
error OnlyAssignedIssuer();
/// @notice Error thrown when an invalid Issuer address is given
error IssuerInvalid();
/// @notice Error thrown when an identical Schema was already registered
error SchemaAlreadyExists();
/// @notice Error thrown when attempting to add a Schema without a name
error SchemaNameMissing();
/// @notice Error thrown when attempting to add a Schema without a string to define it
error SchemaStringMissing();
/// @notice Error thrown when attempting to get a Schema that is not registered
error SchemaNotRegistered();
/// @notice Event emitted when a Schema is created and registered
event SchemaCreated(bytes32 indexed id, string name, string description, string context, string schemaString);
/// @notice Event emitted when a Schema context is updated
event SchemaContextUpdated(bytes32 indexed id);
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() {
_disableInitializers();
}
/**
* @notice Contract initialization
*/
function initialize() public initializer {
__Ownable_init();
}
/**
* @notice Checks if the caller is a registered issuer.
* @param issuer the issuer address
*/
modifier onlyIssuers(address issuer) {
bool isIssuerRegistered = PortalRegistry(router.getPortalRegistry()).isIssuer(issuer);
if (!isIssuerRegistered) revert OnlyIssuer();
_;
}
/**
* @notice Checks if the caller is the portal registry.
* @param caller the caller address
*/
modifier onlyPortalRegistry(address caller) {
bool isCallerPortalRegistry = router.getPortalRegistry() == caller;
if (!isCallerPortalRegistry) revert OnlyPortalRegistry();
_;
}
/**
* @notice Changes the address for the Router
* @dev Only the registry owner can call this method
*/
function updateRouter(address _router) public onlyOwner {
if (_router == address(0)) revert RouterInvalid();
router = IRouter(_router);
}
/**
* @notice Updates a given Schema's Issuer
* @param schemaId the Schema's ID
* @param issuer the address of the issuer who created the given Schema
* @dev Updates issuer for the given schemaId in the `schemaIssuers` mapping
* The issuer must already be registered as an Issuer via the `PortalRegistry`
*/
function updateSchemaIssuer(bytes32 schemaId, address issuer) public onlyOwner {
if (!isRegistered(schemaId)) revert SchemaNotRegistered();
if (issuer == address(0)) revert IssuerInvalid();
schemasIssuers[schemaId] = issuer;
}
/**
* @notice Updates issuer address for all schemas associated with old issuer address
* @param oldIssuer the address of old issuer
* @param newIssuer the address of new issuer
* @dev Finds all the schemaIds associated with old issuer and updates the mapping `schemasIssuers`
* for schemaIds found with new issuer
*/
function updateMatchingSchemaIssuers(address oldIssuer, address newIssuer) public onlyPortalRegistry(msg.sender) {
for (uint256 i = 0; i < schemaIds.length; i = uncheckedInc256(i)) {
if (schemasIssuers[schemaIds[i]] == oldIssuer) {
schemasIssuers[schemaIds[i]] = newIssuer;
}
}
}
/**
* Generate an ID for a given schema
* @param schema the string defining a schema
* @return the schema ID
* @dev encodes a schema string to unique bytes
*/
function getIdFromSchemaString(string memory schema) public pure returns (bytes32) {
return keccak256(abi.encodePacked(schema));
}
/**
* @notice Creates a Schema, with its metadata and runs some checks:
* - mandatory name
* - mandatory string defining the schema
* - the Schema must be unique
* @param name the Schema name
* @param description the Schema description
* @param context the Schema context
* @param schemaString the string defining a Schema
* @dev The Schema is stored in the `schemas` mapping, its ID is added to an array of IDs and an event is emitted
* The caller is assigned as the creator of the Schema, via the `schemasIssuers` mapping
*/
function createSchema(
string memory name,
string memory description,
string memory context,
string memory schemaString
) public onlyIssuers(msg.sender) {
if (bytes(name).length == 0) revert SchemaNameMissing();
if (bytes(schemaString).length == 0) revert SchemaStringMissing();
bytes32 schemaId = getIdFromSchemaString(schemaString);
if (isRegistered(schemaId)) {
revert SchemaAlreadyExists();
}
schemas[schemaId] = Schema(name, description, context, schemaString);
schemaIds.push(schemaId);
schemasIssuers[schemaId] = msg.sender;
emit SchemaCreated(schemaId, name, description, context, schemaString);
}
/**
* @notice Updates the context of a given schema
* @param schemaId the schema ID
* @param context the Schema context
* @dev Retrieve the Schema with given ID and update its context with new value and an event is emitted
* The caller must be the creator of the given Schema (through the `schemaIssuers` mapping)
*/
function updateContext(bytes32 schemaId, string memory context) public {
if (!isRegistered(schemaId)) revert SchemaNotRegistered();
if (schemasIssuers[schemaId] != msg.sender) revert OnlyAssignedIssuer();
schemas[schemaId].context = context;
emit SchemaContextUpdated(schemaId);
}
/**
* @notice Gets a schema by its identifier
* @param schemaId the schema ID
* @return the schema
*/
function getSchema(bytes32 schemaId) public view returns (Schema memory) {
if (!isRegistered(schemaId)) revert SchemaNotRegistered();
return schemas[schemaId];
}
/**
* @notice Get the number of Schemas managed by the contract
* @return The number of Schemas already registered
* @dev Returns the length of the `schemaIds` array
*/
function getSchemasNumber() public view returns (uint256) {
return schemaIds.length;
}
/**
* @notice Check if a Schema is registered
* @param schemaId The ID of the Schema
* @return True if the Schema is registered, false otherwise
*/
function isRegistered(bytes32 schemaId) public view returns (bool) {
return bytes(schemas[schemaId].name).length > 0;
}
}// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
struct AttestationPayload {
bytes32 schemaId; // The identifier of the schema this attestation adheres to.
uint64 expirationDate; // The expiration date of the attestation.
bytes subject; // The ID of the attestee, EVM address, DID, URL etc.
bytes attestationData; // The attestation data.
}
struct Attestation {
bytes32 attestationId; // The unique identifier of the attestation.
bytes32 schemaId; // The identifier of the schema this attestation adheres to.
bytes32 replacedBy; // Whether the attestation was replaced by a new one.
address attester; // The address issuing the attestation to the subject.
address portal; // The id of the portal that created the attestation.
uint64 attestedDate; // The date the attestation is issued.
uint64 expirationDate; // The expiration date of the attestation.
uint64 revocationDate; // The date when the attestation was revoked.
uint16 version; // Version of the registry when the attestation was created.
bool revoked; // Whether the attestation is revoked or not.
bytes subject; // The ID of the attestee, EVM address, DID, URL etc.
bytes attestationData; // The attestation data.
}
struct Schema {
string name; // The name of the schema.
string description; // A description of the schema.
string context; // The context of the schema.
string schema; // The schema definition.
}
struct Portal {
address id; // The unique identifier of the portal.
address ownerAddress; // The address of the owner of this portal.
address[] modules; // Addresses of modules implemented by the portal.
bool isRevocable; // Whether attestations issued can be revoked.
string name; // The name of the portal.
string description; // A description of the portal.
string ownerName; // The name of the owner of this portal.
}
struct Module {
address moduleAddress; // The address of the module.
string name; // The name of the module.
string description; // A description of the module.
}{
"evmVersion": "paris",
"optimizer": {
"enabled": false,
"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[{"inputs":[{"internalType":"address[]","name":"modules","type":"address[]"},{"internalType":"address","name":"router","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"OnlyPortalOwner","type":"error"},{"inputs":[{"components":[{"internalType":"bytes32","name":"schemaId","type":"bytes32"},{"internalType":"uint64","name":"expirationDate","type":"uint64"},{"internalType":"bytes","name":"subject","type":"bytes"},{"internalType":"bytes","name":"attestationData","type":"bytes"}],"internalType":"struct AttestationPayload","name":"attestationPayload","type":"tuple"},{"internalType":"bytes[]","name":"validationPayloads","type":"bytes[]"}],"name":"attest","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"schemaId","type":"bytes32"},{"internalType":"uint64","name":"expirationDate","type":"uint64"},{"internalType":"bytes","name":"subject","type":"bytes"},{"internalType":"bytes","name":"attestationData","type":"bytes"}],"internalType":"struct AttestationPayload","name":"attestationPayload","type":"tuple"},{"internalType":"bytes[]","name":"validationPayloads","type":"bytes[]"}],"name":"attestV2","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"attestationRegistry","outputs":[{"internalType":"contract AttestationRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"schemaId","type":"bytes32"},{"internalType":"uint64","name":"expirationDate","type":"uint64"},{"internalType":"bytes","name":"subject","type":"bytes"},{"internalType":"bytes","name":"attestationData","type":"bytes"}],"internalType":"struct AttestationPayload[]","name":"attestationsPayloads","type":"tuple[]"},{"internalType":"bytes[][]","name":"validationPayloads","type":"bytes[][]"}],"name":"bulkAttest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"bytes32","name":"schemaId","type":"bytes32"},{"internalType":"uint64","name":"expirationDate","type":"uint64"},{"internalType":"bytes","name":"subject","type":"bytes"},{"internalType":"bytes","name":"attestationData","type":"bytes"}],"internalType":"struct AttestationPayload[]","name":"attestationPayloads","type":"tuple[]"},{"internalType":"bytes[][]","name":"validationPayloads","type":"bytes[][]"}],"name":"bulkAttestV2","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"attestationIds","type":"bytes32[]"},{"components":[{"internalType":"bytes32","name":"schemaId","type":"bytes32"},{"internalType":"uint64","name":"expirationDate","type":"uint64"},{"internalType":"bytes","name":"subject","type":"bytes"},{"internalType":"bytes","name":"attestationData","type":"bytes"}],"internalType":"struct AttestationPayload[]","name":"attestationsPayloads","type":"tuple[]"},{"internalType":"bytes[][]","name":"validationPayloads","type":"bytes[][]"}],"name":"bulkReplace","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32[]","name":"attestationIds","type":"bytes32[]"}],"name":"bulkRevoke","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAttester","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getModules","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"moduleRegistry","outputs":[{"internalType":"contract ModuleRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"modules","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"portalRegistry","outputs":[{"internalType":"contract PortalRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"attestationId","type":"bytes32"},{"components":[{"internalType":"bytes32","name":"schemaId","type":"bytes32"},{"internalType":"uint64","name":"expirationDate","type":"uint64"},{"internalType":"bytes","name":"subject","type":"bytes"},{"internalType":"bytes","name":"attestationData","type":"bytes"}],"internalType":"struct AttestationPayload","name":"attestationPayload","type":"tuple"},{"internalType":"bytes[]","name":"validationPayloads","type":"bytes[]"}],"name":"replace","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"attestationId","type":"bytes32"}],"name":"revoke","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceID","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address payable","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b5060405162003242380380620032428339818101604052810190620000379190620005ae565b818181600190805190602001906200005192919062000312565b50806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bfa665856040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000124919062000614565b600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663edec79526040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001d0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001f6919062000614565b600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b7dac9766040518163ffffffff1660e01b8152600401602060405180830381865afa158015620002a2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620002c8919062000614565b600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050505062000646565b8280548282559060005260206000209081019282156200038e579160200282015b828111156200038d5782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019062000333565b5b5090506200039d9190620003a1565b5090565b5b80821115620003bc576000816000905550600101620003a2565b5090565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200042482620003d9565b810181811067ffffffffffffffff82111715620004465762000445620003ea565b5b80604052505050565b60006200045b620003c0565b905062000469828262000419565b919050565b600067ffffffffffffffff8211156200048c576200048b620003ea565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620004cf82620004a2565b9050919050565b620004e181620004c2565b8114620004ed57600080fd5b50565b6000815190506200050181620004d6565b92915050565b60006200051e62000518846200046e565b6200044f565b905080838252602082019050602084028301858111156200054457620005436200049d565b5b835b818110156200057157806200055c8882620004f0565b84526020840193505060208101905062000546565b5050509392505050565b600082601f830112620005935762000592620003d4565b5b8151620005a584826020860162000507565b91505092915050565b60008060408385031215620005c857620005c7620003ca565b5b600083015167ffffffffffffffff811115620005e957620005e8620003cf565b5b620005f7858286016200057b565b92505060206200060a85828601620004f0565b9150509250929050565b6000602082840312156200062d576200062c620003ca565b5b60006200063d84828501620004f0565b91505092915050565b612bec80620006566000396000f3fe6080604052600436106100fe5760003560e01c8063b2494df311610095578063c08b0ace11610064578063c08b0ace14610312578063ecdbb4fd1461032e578063ed6d73f91461034a578063f3fef3a314610375578063f887ea401461039e576100fe565b8063b2494df314610268578063b666493414610293578063b75c7dc6146102be578063b95459e4146102e7576100fe565b8063523ba7ca116100d1578063523ba7ca146101ae5780637deb12dc146101d757806381b2248a146102005780638388e2261461023d576100fe565b806301ffc9a71461010357806307432196146101405780633cc30e2a1461015c5780634ada807614610185575b600080fd5b34801561010f57600080fd5b5061012a600480360381019061012591906113cc565b6103c9565b6040516101379190611414565b60405180910390f35b61015a6004803603810190610155919061178b565b610503565b005b34801561016857600080fd5b50610183600480360381019061017e9190611a88565b610643565b005b34801561019157600080fd5b506101ac60048036038101906101a79190611b2f565b61077d565b005b3480156101ba57600080fd5b506101d560048036038101906101d09190611b78565b610816565b005b3480156101e357600080fd5b506101fe60048036038101906101f99190611b78565b61094c565b005b34801561020c57600080fd5b5061022760048036038101906102229190611c26565b610a8d565b6040516102349190611c94565b60405180910390f35b34801561024957600080fd5b50610252610acc565b60405161025f9190611c94565b60405180910390f35b34801561027457600080fd5b5061027d610ad4565b60405161028a9190611d6d565b60405180910390f35b34801561029f57600080fd5b506102a8610b62565b6040516102b59190611dee565b60405180910390f35b3480156102ca57600080fd5b506102e560048036038101906102e09190611e09565b610b88565b005b3480156102f357600080fd5b506102fc610c21565b6040516103099190611e57565b60405180910390f35b61032c6004803603810190610327919061178b565b610c47565b005b61034860048036038101906103439190611e72565b610d8b565b005b34801561035657600080fd5b5061035f610ecf565b60405161036c9190611f1e565b60405180910390f35b34801561038157600080fd5b5061039c60048036038101906103979190611f77565b610ef5565b005b3480156103aa57600080fd5b506103b3610ef9565b6040516103c09190611fd8565b60405180910390f35b60007f9d2ce11b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061049457507f31c1afd5000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806104fc57507f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e8e253ca60018484346040518563ffffffff1660e01b815260040161056594939291906122b7565b600060405180830381600087803b15801561057f57600080fd5b505af1158015610593573d6000803e3d6000fd5b505050506105a9826105a3610acc565b34610f1d565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166362fa3d45836105f0610acc565b6040518363ffffffff1660e01b815260040161060d929190612311565b600060405180830381600087803b15801561062757600080fd5b505af115801561063b573d6000803e3d6000fd5b505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2baec4a600184846040518463ffffffff1660e01b81526004016106a3939291906125b5565b600060405180830381600087803b1580156106bd57600080fd5b505af11580156106d1573d6000803e3d6000fd5b505050506106e0838383610f22565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ec4d4cb8484610728610acc565b6040518463ffffffff1660e01b8152600401610746939291906126b0565b600060405180830381600087803b15801561076057600080fd5b505af1158015610774573d6000803e3d6000fd5b50505050505050565b61078681611030565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634ada8076826040518263ffffffff1660e01b81526004016107e191906126f5565b600060405180830381600087803b1580156107fb57600080fd5b505af115801561080f573d6000803e3d6000fd5b5050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2baec4a600184846040518463ffffffff1660e01b8152600401610876939291906125b5565b600060405180830381600087803b15801561089057600080fd5b505af11580156108a4573d6000803e3d6000fd5b505050506108b2828261113c565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a8e2812d836108f9610acc565b6040518363ffffffff1660e01b8152600401610916929190612717565b600060405180830381600087803b15801561093057600080fd5b505af1158015610944573d6000803e3d6000fd5b505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631b04d9e16001848433610997610acc565b6040518663ffffffff1660e01b81526004016109b7959493929190612747565b600060405180830381600087803b1580156109d157600080fd5b505af11580156109e5573d6000803e3d6000fd5b505050506109f3828261113c565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a8e2812d83610a3a610acc565b6040518363ffffffff1660e01b8152600401610a57929190612717565b600060405180830381600087803b158015610a7157600080fd5b505af1158015610a85573d6000803e3d6000fd5b505050505050565b60018181548110610a9d57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b60606001805480602002602001604051908101604052809291908181526020018280548015610b5857602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610b0e575b5050505050905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b9181611140565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b75c7dc6826040518263ffffffff1660e01b8152600401610bec91906127be565b600060405180830381600087803b158015610c0657600080fd5b505af1158015610c1a573d6000803e3d6000fd5b5050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e26a8afb600184843433610c93610acc565b6040518763ffffffff1660e01b8152600401610cb4969594939291906127d9565b600060405180830381600087803b158015610cce57600080fd5b505af1158015610ce2573d6000803e3d6000fd5b50505050610cf182823461124c565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166362fa3d4583610d38610acc565b6040518363ffffffff1660e01b8152600401610d55929190612311565b600060405180830381600087803b158015610d6f57600080fd5b505af1158015610d83573d6000803e3d6000fd5b505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e8e253ca60018484346040518563ffffffff1660e01b8152600401610ded94939291906122b7565b600060405180830381600087803b158015610e0757600080fd5b505af1158015610e1b573d6000803e3d6000fd5b50505050610e328383610e2c610acc565b34611251565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638ffa736b8484610e7a610acc565b6040518463ffffffff1660e01b8152600401610e989392919061284f565b600060405180830381600087803b158015610eb257600080fd5b505af1158015610ec6573d6000803e3d6000fd5b50505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0fbc748306040518263ffffffff1660e01b8152600401610f7d9190611c94565b600060405180830381865afa158015610f9a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610fc39190612b6d565b6020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461102b576040517f71f63e3100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0fbc748306040518263ffffffff1660e01b815260040161108b9190611c94565b600060405180830381865afa1580156110a8573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906110d19190612b6d565b6020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611139576040517f71f63e3100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b5050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0fbc748306040518263ffffffff1660e01b815260040161119b9190611c94565b600060405180830381865afa1580156111b8573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906111e19190612b6d565b6020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611249576040517f71f63e3100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0fbc748306040518263ffffffff1660e01b81526004016112ac9190611c94565b600060405180830381865afa1580156112c9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906112f29190612b6d565b6020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461135a576040517f71f63e3100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113a981611374565b81146113b457600080fd5b50565b6000813590506113c6816113a0565b92915050565b6000602082840312156113e2576113e161136a565b5b60006113f0848285016113b7565b91505092915050565b60008115159050919050565b61140e816113f9565b82525050565b60006020820190506114296000830184611405565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61147d82611434565b810181811067ffffffffffffffff8211171561149c5761149b611445565b5b80604052505050565b60006114af611360565b90506114bb8282611474565b919050565b600080fd5b6000819050919050565b6114d8816114c5565b81146114e357600080fd5b50565b6000813590506114f5816114cf565b92915050565b600067ffffffffffffffff82169050919050565b611518816114fb565b811461152357600080fd5b50565b6000813590506115358161150f565b92915050565b600080fd5b600080fd5b600067ffffffffffffffff8211156115605761155f611445565b5b61156982611434565b9050602081019050919050565b82818337600083830152505050565b600061159861159384611545565b6114a5565b9050828152602081018484840111156115b4576115b3611540565b5b6115bf848285611576565b509392505050565b600082601f8301126115dc576115db61153b565b5b81356115ec848260208601611585565b91505092915050565b60006080828403121561160b5761160a61142f565b5b61161560806114a5565b90506000611625848285016114e6565b600083015250602061163984828501611526565b602083015250604082013567ffffffffffffffff81111561165d5761165c6114c0565b5b611669848285016115c7565b604083015250606082013567ffffffffffffffff81111561168d5761168c6114c0565b5b611699848285016115c7565b60608301525092915050565b600067ffffffffffffffff8211156116c0576116bf611445565b5b602082029050602081019050919050565b600080fd5b60006116e96116e4846116a5565b6114a5565b9050808382526020820190506020840283018581111561170c5761170b6116d1565b5b835b8181101561175357803567ffffffffffffffff8111156117315761173061153b565b5b80860161173e89826115c7565b8552602085019450505060208101905061170e565b5050509392505050565b600082601f8301126117725761177161153b565b5b81356117828482602086016116d6565b91505092915050565b600080604083850312156117a2576117a161136a565b5b600083013567ffffffffffffffff8111156117c0576117bf61136f565b5b6117cc858286016115f5565b925050602083013567ffffffffffffffff8111156117ed576117ec61136f565b5b6117f98582860161175d565b9150509250929050565b600067ffffffffffffffff82111561181e5761181d611445565b5b602082029050602081019050919050565b600061184261183d84611803565b6114a5565b90508083825260208201905060208402830185811115611865576118646116d1565b5b835b8181101561188e578061187a88826114e6565b845260208401935050602081019050611867565b5050509392505050565b600082601f8301126118ad576118ac61153b565b5b81356118bd84826020860161182f565b91505092915050565b600067ffffffffffffffff8211156118e1576118e0611445565b5b602082029050602081019050919050565b6000611905611900846118c6565b6114a5565b90508083825260208201905060208402830185811115611928576119276116d1565b5b835b8181101561196f57803567ffffffffffffffff81111561194d5761194c61153b565b5b80860161195a89826115f5565b8552602085019450505060208101905061192a565b5050509392505050565b600082601f83011261198e5761198d61153b565b5b813561199e8482602086016118f2565b91505092915050565b600067ffffffffffffffff8211156119c2576119c1611445565b5b602082029050602081019050919050565b60006119e66119e1846119a7565b6114a5565b90508083825260208201905060208402830185811115611a0957611a086116d1565b5b835b81811015611a5057803567ffffffffffffffff811115611a2e57611a2d61153b565b5b808601611a3b898261175d565b85526020850194505050602081019050611a0b565b5050509392505050565b600082601f830112611a6f57611a6e61153b565b5b8135611a7f8482602086016119d3565b91505092915050565b600080600060608486031215611aa157611aa061136a565b5b600084013567ffffffffffffffff811115611abf57611abe61136f565b5b611acb86828701611898565b935050602084013567ffffffffffffffff811115611aec57611aeb61136f565b5b611af886828701611979565b925050604084013567ffffffffffffffff811115611b1957611b1861136f565b5b611b2586828701611a5a565b9150509250925092565b600060208284031215611b4557611b4461136a565b5b600082013567ffffffffffffffff811115611b6357611b6261136f565b5b611b6f84828501611898565b91505092915050565b60008060408385031215611b8f57611b8e61136a565b5b600083013567ffffffffffffffff811115611bad57611bac61136f565b5b611bb985828601611979565b925050602083013567ffffffffffffffff811115611bda57611bd961136f565b5b611be685828601611a5a565b9150509250929050565b6000819050919050565b611c0381611bf0565b8114611c0e57600080fd5b50565b600081359050611c2081611bfa565b92915050565b600060208284031215611c3c57611c3b61136a565b5b6000611c4a84828501611c11565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611c7e82611c53565b9050919050565b611c8e81611c73565b82525050565b6000602082019050611ca96000830184611c85565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611ce481611c73565b82525050565b6000611cf68383611cdb565b60208301905092915050565b6000602082019050919050565b6000611d1a82611caf565b611d248185611cba565b9350611d2f83611ccb565b8060005b83811015611d60578151611d478882611cea565b9750611d5283611d02565b925050600181019050611d33565b5085935050505092915050565b60006020820190508181036000830152611d878184611d0f565b905092915050565b6000819050919050565b6000611db4611daf611daa84611c53565b611d8f565b611c53565b9050919050565b6000611dc682611d99565b9050919050565b6000611dd882611dbb565b9050919050565b611de881611dcd565b82525050565b6000602082019050611e036000830184611ddf565b92915050565b600060208284031215611e1f57611e1e61136a565b5b6000611e2d848285016114e6565b91505092915050565b6000611e4182611dbb565b9050919050565b611e5181611e36565b82525050565b6000602082019050611e6c6000830184611e48565b92915050565b600080600060608486031215611e8b57611e8a61136a565b5b6000611e99868287016114e6565b935050602084013567ffffffffffffffff811115611eba57611eb961136f565b5b611ec6868287016115f5565b925050604084013567ffffffffffffffff811115611ee757611ee661136f565b5b611ef38682870161175d565b9150509250925092565b6000611f0882611dbb565b9050919050565b611f1881611efd565b82525050565b6000602082019050611f336000830184611f0f565b92915050565b6000611f4482611c53565b9050919050565b611f5481611f39565b8114611f5f57600080fd5b50565b600081359050611f7181611f4b565b92915050565b60008060408385031215611f8e57611f8d61136a565b5b6000611f9c85828601611f62565b9250506020611fad85828601611c11565b9150509250929050565b6000611fc282611dbb565b9050919050565b611fd281611fb7565b82525050565b6000602082019050611fed6000830184611fc9565b92915050565b600081549050919050565b60008190508160005260206000209050919050565b60008160001c9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061205361204e83612013565b612020565b9050919050565b60006120668254612040565b9050919050565b6000600182019050919050565b600061208582611ff3565b61208f8185611cba565b935061209a83611ffe565b8060005b838110156120d2576120af8261205a565b6120b98882611cea565b97506120c48361206d565b92505060018101905061209e565b5085935050505092915050565b6120e8816114c5565b82525050565b6120f7816114fb565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561213757808201518184015260208101905061211c565b60008484015250505050565b600061214e826120fd565b6121588185612108565b9350612168818560208601612119565b61217181611434565b840191505092915050565b600060808301600083015161219460008601826120df565b5060208301516121a760208601826120ee565b50604083015184820360408601526121bf8282612143565b915050606083015184820360608601526121d98282612143565b9150508091505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061221e8383612143565b905092915050565b6000602082019050919050565b600061223e826121e6565b61224881856121f1565b93508360208202850161225a85612202565b8060005b8581101561229657848403895281516122778582612212565b945061228283612226565b925060208a0199505060018101905061225e565b50829750879550505050505092915050565b6122b181611bf0565b82525050565b600060808201905081810360008301526122d1818761207a565b905081810360208301526122e5818661217c565b905081810360408301526122f98185612233565b905061230860608301846122a8565b95945050505050565b6000604082019050818103600083015261232b818561217c565b905061233a6020830184611c85565b9392505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600060808301600083015161238560008601826120df565b50602083015161239860208601826120ee565b50604083015184820360408601526123b08282612143565b915050606083015184820360608601526123ca8282612143565b9150508091505092915050565b60006123e3838361236d565b905092915050565b6000602082019050919050565b600061240382612341565b61240d818561234c565b93508360208202850161241f8561235d565b8060005b8581101561245b578484038952815161243c85826123d7565b9450612447836123eb565b925060208a01995050600181019050612423565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600082825260208201905092915050565b60006124b5826121e6565b6124bf8185612499565b9350836020820285016124d185612202565b8060005b8581101561250d57848403895281516124ee8582612212565b94506124f983612226565b925060208a019950506001810190506124d5565b50829750879550505050505092915050565b600061252b83836124aa565b905092915050565b6000602082019050919050565b600061254b8261246d565b6125558185612478565b93508360208202850161256785612489565b8060005b858110156125a35784840389528151612584858261251f565b945061258f83612533565b925060208a0199505060018101905061256b565b50829750879550505050505092915050565b600060608201905081810360008301526125cf818661207a565b905081810360208301526125e381856123f8565b905081810360408301526125f78184612540565b9050949350505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061263983836120df565b60208301905092915050565b6000602082019050919050565b600061265d82612601565b612667818561260c565b93506126728361261d565b8060005b838110156126a357815161268a888261262d565b975061269583612645565b925050600181019050612676565b5085935050505092915050565b600060608201905081810360008301526126ca8186612652565b905081810360208301526126de81856123f8565b90506126ed6040830184611c85565b949350505050565b6000602082019050818103600083015261270f8184612652565b905092915050565b6000604082019050818103600083015261273181856123f8565b90506127406020830184611c85565b9392505050565b600060a0820190508181036000830152612761818861207a565b9050818103602083015261277581876123f8565b905081810360408301526127898186612540565b90506127986060830185611c85565b6127a56080830184611c85565b9695505050505050565b6127b8816114c5565b82525050565b60006020820190506127d360008301846127af565b92915050565b600060c08201905081810360008301526127f3818961207a565b90508181036020830152612807818861217c565b9050818103604083015261281b8187612233565b905061282a60608301866122a8565b6128376080830185611c85565b61284460a0830184611c85565b979650505050505050565b600060608201905061286460008301866127af565b8181036020830152612876818561217c565b90506128856040830184611c85565b949350505050565b61289681611c73565b81146128a157600080fd5b50565b6000815190506128b38161288d565b92915050565b600067ffffffffffffffff8211156128d4576128d3611445565b5b602082029050602081019050919050565b60006128f86128f3846128b9565b6114a5565b9050808382526020820190506020840283018581111561291b5761291a6116d1565b5b835b81811015612944578061293088826128a4565b84526020840193505060208101905061291d565b5050509392505050565b600082601f8301126129635761296261153b565b5b81516129738482602086016128e5565b91505092915050565b612985816113f9565b811461299057600080fd5b50565b6000815190506129a28161297c565b92915050565b600067ffffffffffffffff8211156129c3576129c2611445565b5b6129cc82611434565b9050602081019050919050565b60006129ec6129e7846129a8565b6114a5565b905082815260208101848484011115612a0857612a07611540565b5b612a13848285612119565b509392505050565b600082601f830112612a3057612a2f61153b565b5b8151612a408482602086016129d9565b91505092915050565b600060e08284031215612a5f57612a5e61142f565b5b612a6960e06114a5565b90506000612a79848285016128a4565b6000830152506020612a8d848285016128a4565b602083015250604082015167ffffffffffffffff811115612ab157612ab06114c0565b5b612abd8482850161294e565b6040830152506060612ad184828501612993565b606083015250608082015167ffffffffffffffff811115612af557612af46114c0565b5b612b0184828501612a1b565b60808301525060a082015167ffffffffffffffff811115612b2557612b246114c0565b5b612b3184828501612a1b565b60a08301525060c082015167ffffffffffffffff811115612b5557612b546114c0565b5b612b6184828501612a1b565b60c08301525092915050565b600060208284031215612b8357612b8261136a565b5b600082015167ffffffffffffffff811115612ba157612ba061136f565b5b612bad84828501612a49565b9150509291505056fea2646970667358221220f3879aeaee48b9affdd829ac2fec0bef57b252f6de17aecb916924cc3dc5bead64736f6c6343000815003300000000000000000000000000000000000000000000000000000000000000400000000000000000000000004d3a380a03f3a18a5dc44b01119839d8674a552e0000000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x6080604052600436106100fe5760003560e01c8063b2494df311610095578063c08b0ace11610064578063c08b0ace14610312578063ecdbb4fd1461032e578063ed6d73f91461034a578063f3fef3a314610375578063f887ea401461039e576100fe565b8063b2494df314610268578063b666493414610293578063b75c7dc6146102be578063b95459e4146102e7576100fe565b8063523ba7ca116100d1578063523ba7ca146101ae5780637deb12dc146101d757806381b2248a146102005780638388e2261461023d576100fe565b806301ffc9a71461010357806307432196146101405780633cc30e2a1461015c5780634ada807614610185575b600080fd5b34801561010f57600080fd5b5061012a600480360381019061012591906113cc565b6103c9565b6040516101379190611414565b60405180910390f35b61015a6004803603810190610155919061178b565b610503565b005b34801561016857600080fd5b50610183600480360381019061017e9190611a88565b610643565b005b34801561019157600080fd5b506101ac60048036038101906101a79190611b2f565b61077d565b005b3480156101ba57600080fd5b506101d560048036038101906101d09190611b78565b610816565b005b3480156101e357600080fd5b506101fe60048036038101906101f99190611b78565b61094c565b005b34801561020c57600080fd5b5061022760048036038101906102229190611c26565b610a8d565b6040516102349190611c94565b60405180910390f35b34801561024957600080fd5b50610252610acc565b60405161025f9190611c94565b60405180910390f35b34801561027457600080fd5b5061027d610ad4565b60405161028a9190611d6d565b60405180910390f35b34801561029f57600080fd5b506102a8610b62565b6040516102b59190611dee565b60405180910390f35b3480156102ca57600080fd5b506102e560048036038101906102e09190611e09565b610b88565b005b3480156102f357600080fd5b506102fc610c21565b6040516103099190611e57565b60405180910390f35b61032c6004803603810190610327919061178b565b610c47565b005b61034860048036038101906103439190611e72565b610d8b565b005b34801561035657600080fd5b5061035f610ecf565b60405161036c9190611f1e565b60405180910390f35b34801561038157600080fd5b5061039c60048036038101906103979190611f77565b610ef5565b005b3480156103aa57600080fd5b506103b3610ef9565b6040516103c09190611fd8565b60405180910390f35b60007f9d2ce11b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061049457507f31c1afd5000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b806104fc57507f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e8e253ca60018484346040518563ffffffff1660e01b815260040161056594939291906122b7565b600060405180830381600087803b15801561057f57600080fd5b505af1158015610593573d6000803e3d6000fd5b505050506105a9826105a3610acc565b34610f1d565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166362fa3d45836105f0610acc565b6040518363ffffffff1660e01b815260040161060d929190612311565b600060405180830381600087803b15801561062757600080fd5b505af115801561063b573d6000803e3d6000fd5b505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2baec4a600184846040518463ffffffff1660e01b81526004016106a3939291906125b5565b600060405180830381600087803b1580156106bd57600080fd5b505af11580156106d1573d6000803e3d6000fd5b505050506106e0838383610f22565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ec4d4cb8484610728610acc565b6040518463ffffffff1660e01b8152600401610746939291906126b0565b600060405180830381600087803b15801561076057600080fd5b505af1158015610774573d6000803e3d6000fd5b50505050505050565b61078681611030565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634ada8076826040518263ffffffff1660e01b81526004016107e191906126f5565b600060405180830381600087803b1580156107fb57600080fd5b505af115801561080f573d6000803e3d6000fd5b5050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2baec4a600184846040518463ffffffff1660e01b8152600401610876939291906125b5565b600060405180830381600087803b15801561089057600080fd5b505af11580156108a4573d6000803e3d6000fd5b505050506108b2828261113c565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a8e2812d836108f9610acc565b6040518363ffffffff1660e01b8152600401610916929190612717565b600060405180830381600087803b15801561093057600080fd5b505af1158015610944573d6000803e3d6000fd5b505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631b04d9e16001848433610997610acc565b6040518663ffffffff1660e01b81526004016109b7959493929190612747565b600060405180830381600087803b1580156109d157600080fd5b505af11580156109e5573d6000803e3d6000fd5b505050506109f3828261113c565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a8e2812d83610a3a610acc565b6040518363ffffffff1660e01b8152600401610a57929190612717565b600060405180830381600087803b158015610a7157600080fd5b505af1158015610a85573d6000803e3d6000fd5b505050505050565b60018181548110610a9d57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b60606001805480602002602001604051908101604052809291908181526020018280548015610b5857602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311610b0e575b5050505050905090565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b9181611140565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b75c7dc6826040518263ffffffff1660e01b8152600401610bec91906127be565b600060405180830381600087803b158015610c0657600080fd5b505af1158015610c1a573d6000803e3d6000fd5b5050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e26a8afb600184843433610c93610acc565b6040518763ffffffff1660e01b8152600401610cb4969594939291906127d9565b600060405180830381600087803b158015610cce57600080fd5b505af1158015610ce2573d6000803e3d6000fd5b50505050610cf182823461124c565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166362fa3d4583610d38610acc565b6040518363ffffffff1660e01b8152600401610d55929190612311565b600060405180830381600087803b158015610d6f57600080fd5b505af1158015610d83573d6000803e3d6000fd5b505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e8e253ca60018484346040518563ffffffff1660e01b8152600401610ded94939291906122b7565b600060405180830381600087803b158015610e0757600080fd5b505af1158015610e1b573d6000803e3d6000fd5b50505050610e328383610e2c610acc565b34611251565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638ffa736b8484610e7a610acc565b6040518463ffffffff1660e01b8152600401610e989392919061284f565b600060405180830381600087803b158015610eb257600080fd5b505af1158015610ec6573d6000803e3d6000fd5b50505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0fbc748306040518263ffffffff1660e01b8152600401610f7d9190611c94565b600060405180830381865afa158015610f9a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250810190610fc39190612b6d565b6020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461102b576040517f71f63e3100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0fbc748306040518263ffffffff1660e01b815260040161108b9190611c94565b600060405180830381865afa1580156110a8573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906110d19190612b6d565b6020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611139576040517f71f63e3100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b5050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0fbc748306040518263ffffffff1660e01b815260040161119b9190611c94565b600060405180830381865afa1580156111b8573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906111e19190612b6d565b6020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611249576040517f71f63e3100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50565b505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c0fbc748306040518263ffffffff1660e01b81526004016112ac9190611c94565b600060405180830381865afa1580156112c9573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906112f29190612b6d565b6020015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461135a576040517f71f63e3100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50505050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b6113a981611374565b81146113b457600080fd5b50565b6000813590506113c6816113a0565b92915050565b6000602082840312156113e2576113e161136a565b5b60006113f0848285016113b7565b91505092915050565b60008115159050919050565b61140e816113f9565b82525050565b60006020820190506114296000830184611405565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61147d82611434565b810181811067ffffffffffffffff8211171561149c5761149b611445565b5b80604052505050565b60006114af611360565b90506114bb8282611474565b919050565b600080fd5b6000819050919050565b6114d8816114c5565b81146114e357600080fd5b50565b6000813590506114f5816114cf565b92915050565b600067ffffffffffffffff82169050919050565b611518816114fb565b811461152357600080fd5b50565b6000813590506115358161150f565b92915050565b600080fd5b600080fd5b600067ffffffffffffffff8211156115605761155f611445565b5b61156982611434565b9050602081019050919050565b82818337600083830152505050565b600061159861159384611545565b6114a5565b9050828152602081018484840111156115b4576115b3611540565b5b6115bf848285611576565b509392505050565b600082601f8301126115dc576115db61153b565b5b81356115ec848260208601611585565b91505092915050565b60006080828403121561160b5761160a61142f565b5b61161560806114a5565b90506000611625848285016114e6565b600083015250602061163984828501611526565b602083015250604082013567ffffffffffffffff81111561165d5761165c6114c0565b5b611669848285016115c7565b604083015250606082013567ffffffffffffffff81111561168d5761168c6114c0565b5b611699848285016115c7565b60608301525092915050565b600067ffffffffffffffff8211156116c0576116bf611445565b5b602082029050602081019050919050565b600080fd5b60006116e96116e4846116a5565b6114a5565b9050808382526020820190506020840283018581111561170c5761170b6116d1565b5b835b8181101561175357803567ffffffffffffffff8111156117315761173061153b565b5b80860161173e89826115c7565b8552602085019450505060208101905061170e565b5050509392505050565b600082601f8301126117725761177161153b565b5b81356117828482602086016116d6565b91505092915050565b600080604083850312156117a2576117a161136a565b5b600083013567ffffffffffffffff8111156117c0576117bf61136f565b5b6117cc858286016115f5565b925050602083013567ffffffffffffffff8111156117ed576117ec61136f565b5b6117f98582860161175d565b9150509250929050565b600067ffffffffffffffff82111561181e5761181d611445565b5b602082029050602081019050919050565b600061184261183d84611803565b6114a5565b90508083825260208201905060208402830185811115611865576118646116d1565b5b835b8181101561188e578061187a88826114e6565b845260208401935050602081019050611867565b5050509392505050565b600082601f8301126118ad576118ac61153b565b5b81356118bd84826020860161182f565b91505092915050565b600067ffffffffffffffff8211156118e1576118e0611445565b5b602082029050602081019050919050565b6000611905611900846118c6565b6114a5565b90508083825260208201905060208402830185811115611928576119276116d1565b5b835b8181101561196f57803567ffffffffffffffff81111561194d5761194c61153b565b5b80860161195a89826115f5565b8552602085019450505060208101905061192a565b5050509392505050565b600082601f83011261198e5761198d61153b565b5b813561199e8482602086016118f2565b91505092915050565b600067ffffffffffffffff8211156119c2576119c1611445565b5b602082029050602081019050919050565b60006119e66119e1846119a7565b6114a5565b90508083825260208201905060208402830185811115611a0957611a086116d1565b5b835b81811015611a5057803567ffffffffffffffff811115611a2e57611a2d61153b565b5b808601611a3b898261175d565b85526020850194505050602081019050611a0b565b5050509392505050565b600082601f830112611a6f57611a6e61153b565b5b8135611a7f8482602086016119d3565b91505092915050565b600080600060608486031215611aa157611aa061136a565b5b600084013567ffffffffffffffff811115611abf57611abe61136f565b5b611acb86828701611898565b935050602084013567ffffffffffffffff811115611aec57611aeb61136f565b5b611af886828701611979565b925050604084013567ffffffffffffffff811115611b1957611b1861136f565b5b611b2586828701611a5a565b9150509250925092565b600060208284031215611b4557611b4461136a565b5b600082013567ffffffffffffffff811115611b6357611b6261136f565b5b611b6f84828501611898565b91505092915050565b60008060408385031215611b8f57611b8e61136a565b5b600083013567ffffffffffffffff811115611bad57611bac61136f565b5b611bb985828601611979565b925050602083013567ffffffffffffffff811115611bda57611bd961136f565b5b611be685828601611a5a565b9150509250929050565b6000819050919050565b611c0381611bf0565b8114611c0e57600080fd5b50565b600081359050611c2081611bfa565b92915050565b600060208284031215611c3c57611c3b61136a565b5b6000611c4a84828501611c11565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611c7e82611c53565b9050919050565b611c8e81611c73565b82525050565b6000602082019050611ca96000830184611c85565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611ce481611c73565b82525050565b6000611cf68383611cdb565b60208301905092915050565b6000602082019050919050565b6000611d1a82611caf565b611d248185611cba565b9350611d2f83611ccb565b8060005b83811015611d60578151611d478882611cea565b9750611d5283611d02565b925050600181019050611d33565b5085935050505092915050565b60006020820190508181036000830152611d878184611d0f565b905092915050565b6000819050919050565b6000611db4611daf611daa84611c53565b611d8f565b611c53565b9050919050565b6000611dc682611d99565b9050919050565b6000611dd882611dbb565b9050919050565b611de881611dcd565b82525050565b6000602082019050611e036000830184611ddf565b92915050565b600060208284031215611e1f57611e1e61136a565b5b6000611e2d848285016114e6565b91505092915050565b6000611e4182611dbb565b9050919050565b611e5181611e36565b82525050565b6000602082019050611e6c6000830184611e48565b92915050565b600080600060608486031215611e8b57611e8a61136a565b5b6000611e99868287016114e6565b935050602084013567ffffffffffffffff811115611eba57611eb961136f565b5b611ec6868287016115f5565b925050604084013567ffffffffffffffff811115611ee757611ee661136f565b5b611ef38682870161175d565b9150509250925092565b6000611f0882611dbb565b9050919050565b611f1881611efd565b82525050565b6000602082019050611f336000830184611f0f565b92915050565b6000611f4482611c53565b9050919050565b611f5481611f39565b8114611f5f57600080fd5b50565b600081359050611f7181611f4b565b92915050565b60008060408385031215611f8e57611f8d61136a565b5b6000611f9c85828601611f62565b9250506020611fad85828601611c11565b9150509250929050565b6000611fc282611dbb565b9050919050565b611fd281611fb7565b82525050565b6000602082019050611fed6000830184611fc9565b92915050565b600081549050919050565b60008190508160005260206000209050919050565b60008160001c9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061205361204e83612013565b612020565b9050919050565b60006120668254612040565b9050919050565b6000600182019050919050565b600061208582611ff3565b61208f8185611cba565b935061209a83611ffe565b8060005b838110156120d2576120af8261205a565b6120b98882611cea565b97506120c48361206d565b92505060018101905061209e565b5085935050505092915050565b6120e8816114c5565b82525050565b6120f7816114fb565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561213757808201518184015260208101905061211c565b60008484015250505050565b600061214e826120fd565b6121588185612108565b9350612168818560208601612119565b61217181611434565b840191505092915050565b600060808301600083015161219460008601826120df565b5060208301516121a760208601826120ee565b50604083015184820360408601526121bf8282612143565b915050606083015184820360608601526121d98282612143565b9150508091505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061221e8383612143565b905092915050565b6000602082019050919050565b600061223e826121e6565b61224881856121f1565b93508360208202850161225a85612202565b8060005b8581101561229657848403895281516122778582612212565b945061228283612226565b925060208a0199505060018101905061225e565b50829750879550505050505092915050565b6122b181611bf0565b82525050565b600060808201905081810360008301526122d1818761207a565b905081810360208301526122e5818661217c565b905081810360408301526122f98185612233565b905061230860608301846122a8565b95945050505050565b6000604082019050818103600083015261232b818561217c565b905061233a6020830184611c85565b9392505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600060808301600083015161238560008601826120df565b50602083015161239860208601826120ee565b50604083015184820360408601526123b08282612143565b915050606083015184820360608601526123ca8282612143565b9150508091505092915050565b60006123e3838361236d565b905092915050565b6000602082019050919050565b600061240382612341565b61240d818561234c565b93508360208202850161241f8561235d565b8060005b8581101561245b578484038952815161243c85826123d7565b9450612447836123eb565b925060208a01995050600181019050612423565b50829750879550505050505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600082825260208201905092915050565b60006124b5826121e6565b6124bf8185612499565b9350836020820285016124d185612202565b8060005b8581101561250d57848403895281516124ee8582612212565b94506124f983612226565b925060208a019950506001810190506124d5565b50829750879550505050505092915050565b600061252b83836124aa565b905092915050565b6000602082019050919050565b600061254b8261246d565b6125558185612478565b93508360208202850161256785612489565b8060005b858110156125a35784840389528151612584858261251f565b945061258f83612533565b925060208a0199505060018101905061256b565b50829750879550505050505092915050565b600060608201905081810360008301526125cf818661207a565b905081810360208301526125e381856123f8565b905081810360408301526125f78184612540565b9050949350505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600061263983836120df565b60208301905092915050565b6000602082019050919050565b600061265d82612601565b612667818561260c565b93506126728361261d565b8060005b838110156126a357815161268a888261262d565b975061269583612645565b925050600181019050612676565b5085935050505092915050565b600060608201905081810360008301526126ca8186612652565b905081810360208301526126de81856123f8565b90506126ed6040830184611c85565b949350505050565b6000602082019050818103600083015261270f8184612652565b905092915050565b6000604082019050818103600083015261273181856123f8565b90506127406020830184611c85565b9392505050565b600060a0820190508181036000830152612761818861207a565b9050818103602083015261277581876123f8565b905081810360408301526127898186612540565b90506127986060830185611c85565b6127a56080830184611c85565b9695505050505050565b6127b8816114c5565b82525050565b60006020820190506127d360008301846127af565b92915050565b600060c08201905081810360008301526127f3818961207a565b90508181036020830152612807818861217c565b9050818103604083015261281b8187612233565b905061282a60608301866122a8565b6128376080830185611c85565b61284460a0830184611c85565b979650505050505050565b600060608201905061286460008301866127af565b8181036020830152612876818561217c565b90506128856040830184611c85565b949350505050565b61289681611c73565b81146128a157600080fd5b50565b6000815190506128b38161288d565b92915050565b600067ffffffffffffffff8211156128d4576128d3611445565b5b602082029050602081019050919050565b60006128f86128f3846128b9565b6114a5565b9050808382526020820190506020840283018581111561291b5761291a6116d1565b5b835b81811015612944578061293088826128a4565b84526020840193505060208101905061291d565b5050509392505050565b600082601f8301126129635761296261153b565b5b81516129738482602086016128e5565b91505092915050565b612985816113f9565b811461299057600080fd5b50565b6000815190506129a28161297c565b92915050565b600067ffffffffffffffff8211156129c3576129c2611445565b5b6129cc82611434565b9050602081019050919050565b60006129ec6129e7846129a8565b6114a5565b905082815260208101848484011115612a0857612a07611540565b5b612a13848285612119565b509392505050565b600082601f830112612a3057612a2f61153b565b5b8151612a408482602086016129d9565b91505092915050565b600060e08284031215612a5f57612a5e61142f565b5b612a6960e06114a5565b90506000612a79848285016128a4565b6000830152506020612a8d848285016128a4565b602083015250604082015167ffffffffffffffff811115612ab157612ab06114c0565b5b612abd8482850161294e565b6040830152506060612ad184828501612993565b606083015250608082015167ffffffffffffffff811115612af557612af46114c0565b5b612b0184828501612a1b565b60808301525060a082015167ffffffffffffffff811115612b2557612b246114c0565b5b612b3184828501612a1b565b60a08301525060c082015167ffffffffffffffff811115612b5557612b546114c0565b5b612b6184828501612a1b565b60c08301525092915050565b600060208284031215612b8357612b8261136a565b5b600082015167ffffffffffffffff811115612ba157612ba061136f565b5b612bad84828501612a49565b9150509291505056fea2646970667358221220f3879aeaee48b9affdd829ac2fec0bef57b252f6de17aecb916924cc3dc5bead64736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000000000000000000000000000000000000000000400000000000000000000000004d3a380a03f3a18a5dc44b01119839d8674a552e0000000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : modules (address[]):
Arg [1] : router (address): 0x4d3a380A03f3a18A5dC44b01119839D8674a552E
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000040
Arg [1] : 0000000000000000000000004d3a380a03f3a18a5dc44b01119839d8674a552e
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$13.36
Net Worth in ETH
Token Allocations
AVAX
100.00%
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| AVAX | 100.00% | $11.71 | 1.1407 | $13.36 |
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ 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.