Overview
ETH Balance
ETH Value
$0.00Latest 25 from a total of 3,257 transactions
| Transaction Hash |
|
Block
|
From
|
To
|
|||||
|---|---|---|---|---|---|---|---|---|---|
| Deploy Proxy By ... | 153494879 | 792 days ago | IN | 0 ETH | 0.00017355 | ||||
| Deploy Proxy By ... | 151546606 | 798 days ago | IN | 0 ETH | 0.00016117 | ||||
| Deploy Proxy By ... | 150724524 | 800 days ago | IN | 0 ETH | 0.00037084 | ||||
| Deploy Proxy By ... | 148559560 | 807 days ago | IN | 0 ETH | 0.00026493 | ||||
| Deploy Proxy By ... | 148516209 | 807 days ago | IN | 0 ETH | 0.00021821 | ||||
| Deploy Proxy By ... | 148503943 | 807 days ago | IN | 0 ETH | 0.00024992 | ||||
| Deploy Proxy By ... | 146471876 | 813 days ago | IN | 0 ETH | 0.00023184 | ||||
| Deploy Proxy By ... | 145181221 | 817 days ago | IN | 0 ETH | 0.00019234 | ||||
| Deploy Proxy By ... | 145075565 | 818 days ago | IN | 0 ETH | 0.00017004 | ||||
| Deploy Proxy By ... | 144787143 | 819 days ago | IN | 0 ETH | 0.00014093 | ||||
| Deploy Proxy By ... | 144283844 | 820 days ago | IN | 0 ETH | 0.0001721 | ||||
| Deploy Proxy By ... | 142811109 | 825 days ago | IN | 0 ETH | 0.00010212 | ||||
| Deploy Proxy By ... | 141798349 | 828 days ago | IN | 0 ETH | 0.00013929 | ||||
| Deploy Proxy By ... | 141164359 | 830 days ago | IN | 0 ETH | 0.00017409 | ||||
| Deploy Proxy By ... | 140969876 | 831 days ago | IN | 0 ETH | 0.00011692 | ||||
| Deploy Proxy By ... | 138465047 | 839 days ago | IN | 0 ETH | 0.00011372 | ||||
| Deploy Proxy By ... | 137769176 | 842 days ago | IN | 0 ETH | 0.00014391 | ||||
| Deploy Proxy By ... | 137315233 | 843 days ago | IN | 0 ETH | 0.00012572 | ||||
| Deploy Proxy By ... | 137230577 | 843 days ago | IN | 0 ETH | 0.00017006 | ||||
| Deploy Proxy By ... | 137166430 | 843 days ago | IN | 0 ETH | 0.00021995 | ||||
| Deploy Proxy By ... | 136094056 | 847 days ago | IN | 0 ETH | 0.00011423 | ||||
| Deploy Proxy By ... | 136072497 | 847 days ago | IN | 0 ETH | 0.00012449 | ||||
| Deploy Proxy By ... | 136010182 | 847 days ago | IN | 0 ETH | 0.00011387 | ||||
| Deploy Proxy By ... | 135872093 | 847 days ago | IN | 0 ETH | 0.00011205 | ||||
| Deploy Proxy By ... | 135742182 | 848 days ago | IN | 0 ETH | 0.00012105 |
Latest 25 internal transactions (View All)
Cross-Chain Transactions
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
import "./TWRegistry.sol";
import "./interfaces/IThirdwebContract.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
import "@openzeppelin/contracts/utils/Create2.sol";
import "@openzeppelin/contracts/utils/Multicall.sol";
import "@openzeppelin/contracts/proxy/Clones.sol";
contract TWFactory is Multicall, ERC2771Context, AccessControlEnumerable {
/// @dev Only FACTORY_ROLE holders can approve/unapprove implementations for proxies to point to.
bytes32 public constant FACTORY_ROLE = keccak256("FACTORY_ROLE");
TWRegistry public immutable registry;
/// @dev Emitted when a proxy is deployed.
event ProxyDeployed(address indexed implementation, address proxy, address indexed deployer);
event ImplementationAdded(address implementation, bytes32 indexed contractType, uint256 version);
event ImplementationApproved(address implementation, bool isApproved);
/// @dev mapping of implementation address to deployment approval
mapping(address => bool) public approval;
/// @dev mapping of implementation address to implementation added version
mapping(bytes32 => uint256) public currentVersion;
/// @dev mapping of contract type to module version to implementation address
mapping(bytes32 => mapping(uint256 => address)) public implementation;
/// @dev mapping of proxy address to deployer address
mapping(address => address) public deployer;
constructor(address _trustedForwarder, address _registry) ERC2771Context(_trustedForwarder) {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_setupRole(FACTORY_ROLE, _msgSender());
registry = TWRegistry(_registry);
}
/// @dev Deploys a proxy that points to the latest version of the given contract type.
function deployProxy(bytes32 _type, bytes memory _data) external returns (address) {
bytes32 salt = bytes32(registry.count(_msgSender()));
return deployProxyDeterministic(_type, _data, salt);
}
/**
* @dev Deploys a proxy at a deterministic address by taking in `salt` as a parameter.
* Proxy points to the latest version of the given contract type.
*/
function deployProxyDeterministic(
bytes32 _type,
bytes memory _data,
bytes32 _salt
) public returns (address) {
address _implementation = implementation[_type][currentVersion[_type]];
return deployProxyByImplementation(_implementation, _data, _salt);
}
/// @dev Deploys a proxy that points to the given implementation.
function deployProxyByImplementation(
address _implementation,
bytes memory _data,
bytes32 _salt
) public returns (address deployedProxy) {
require(approval[_implementation], "implementation not approved");
bytes32 salthash = keccak256(abi.encodePacked(_msgSender(), _salt));
deployedProxy = Clones.cloneDeterministic(_implementation, salthash);
deployer[deployedProxy] = _msgSender();
emit ProxyDeployed(_implementation, deployedProxy, _msgSender());
registry.add(_msgSender(), deployedProxy);
if (_data.length > 0) {
// slither-disable-next-line unused-return
Address.functionCall(deployedProxy, _data);
}
}
/// @dev Lets a contract admin set the address of a contract type x version.
function addImplementation(address _implementation) external {
require(hasRole(FACTORY_ROLE, _msgSender()), "not admin.");
IThirdwebContract module = IThirdwebContract(_implementation);
bytes32 ctype = module.contractType();
require(ctype.length > 0, "invalid module");
uint8 version = module.contractVersion();
uint8 currentVersionOfType = uint8(currentVersion[ctype]);
require(version >= currentVersionOfType, "wrong module version");
currentVersion[ctype] = version;
implementation[ctype][version] = _implementation;
approval[_implementation] = true;
emit ImplementationAdded(_implementation, ctype, version);
}
/// @dev Lets a contract admin approve a specific contract for deployment.
function approveImplementation(address _implementation, bool _toApprove) external {
require(hasRole(FACTORY_ROLE, _msgSender()), "not admin.");
approval[_implementation] = _toApprove;
emit ImplementationApproved(_implementation, _toApprove);
}
/// @dev Returns the implementation given a contract type and version.
function getImplementation(bytes32 _type, uint256 _version) external view returns (address) {
return implementation[_type][_version];
}
/// @dev Returns the latest implementation given a contract type.
function getLatestImplementation(bytes32 _type) external view returns (address) {
return implementation[_type][currentVersion[_type]];
}
function _msgSender() internal view virtual override(Context, ERC2771Context) returns (address sender) {
return ERC2771Context._msgSender();
}
function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) {
return ERC2771Context._msgData();
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
import "@openzeppelin/contracts/utils/Multicall.sol";
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
contract TWRegistry is Multicall, ERC2771Context, AccessControlEnumerable {
bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");
using EnumerableSet for EnumerableSet.AddressSet;
/// @dev wallet address => [contract addresses]
mapping(address => EnumerableSet.AddressSet) private deployments;
event Added(address indexed deployer, address indexed deployment);
event Deleted(address indexed deployer, address indexed deployment);
constructor(address _trustedForwarder) ERC2771Context(_trustedForwarder) {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
}
// slither-disable-next-line similar-names
function add(address _deployer, address _deployment) external {
require(hasRole(OPERATOR_ROLE, _msgSender()) || _deployer == _msgSender(), "not operator or deployer.");
bool added = deployments[_deployer].add(_deployment);
require(added, "failed to add");
emit Added(_deployer, _deployment);
}
// slither-disable-next-line similar-names
function remove(address _deployer, address _deployment) external {
require(hasRole(OPERATOR_ROLE, _msgSender()) || _deployer == _msgSender(), "not operator or deployer.");
bool removed = deployments[_deployer].remove(_deployment);
require(removed, "failed to remove");
emit Deleted(_deployer, _deployment);
}
function getAll(address _deployer) external view returns (address[] memory) {
return deployments[_deployer].values();
}
function count(address _deployer) external view returns (uint256) {
return deployments[_deployer].length();
}
function _msgSender() internal view virtual override(Context, ERC2771Context) returns (address sender) {
return ERC2771Context._msgSender();
}
function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) {
return ERC2771Context._msgData();
}
}// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.11;
interface IThirdwebContract {
/// @dev Returns the module type of the contract.
function contractType() external pure returns (bytes32);
/// @dev Returns the version of the contract.
function contractVersion() external pure returns (uint8);
/// @dev Returns the metadata URI of the contract.
function contractURI() external view returns (string memory);
/**
* @dev Sets contract URI for the storefront-level metadata of the contract.
* Only module admin can call this function.
*/
function setContractURI(string calldata _uri) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControlEnumerable.sol";
import "./AccessControl.sol";
import "../utils/structs/EnumerableSet.sol";
/**
* @dev Extension of {AccessControl} that allows enumerating the members of each role.
*/
abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl {
using EnumerableSet for EnumerableSet.AddressSet;
mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
return _roleMembers[role].at(index);
}
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
return _roleMembers[role].length();
}
/**
* @dev Overload {_grantRole} to track enumerable memberships
*/
function _grantRole(bytes32 role, address account) internal virtual override {
super._grantRole(role, account);
_roleMembers[role].add(account);
}
/**
* @dev Overload {_revokeRole} to track enumerable memberships
*/
function _revokeRole(bytes32 role, address account) internal virtual override {
super._revokeRole(role, account);
_roleMembers[role].remove(account);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (metatx/ERC2771Context.sol)
pragma solidity ^0.8.9;
import "../utils/Context.sol";
/**
* @dev Context variant with ERC2771 support.
*/
abstract contract ERC2771Context is Context {
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable
address private immutable _trustedForwarder;
/// @custom:oz-upgrades-unsafe-allow constructor
constructor(address trustedForwarder) {
_trustedForwarder = trustedForwarder;
}
function isTrustedForwarder(address forwarder) public view virtual returns (bool) {
return forwarder == _trustedForwarder;
}
function _msgSender() internal view virtual override returns (address sender) {
if (isTrustedForwarder(msg.sender)) {
// The assembly code is more direct than the Solidity version using `abi.decode`.
assembly {
sender := shr(96, calldataload(sub(calldatasize(), 20)))
}
} else {
return super._msgSender();
}
}
function _msgData() internal view virtual override returns (bytes calldata) {
if (isTrustedForwarder(msg.sender)) {
return msg.data[:msg.data.length - 20];
} else {
return super._msgData();
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Create2.sol)
pragma solidity ^0.8.0;
/**
* @dev Helper to make usage of the `CREATE2` EVM opcode easier and safer.
* `CREATE2` can be used to compute in advance the address where a smart
* contract will be deployed, which allows for interesting new mechanisms known
* as 'counterfactual interactions'.
*
* See the https://eips.ethereum.org/EIPS/eip-1014#motivation[EIP] for more
* information.
*/
library Create2 {
/**
* @dev Deploys a contract using `CREATE2`. The address where the contract
* will be deployed can be known in advance via {computeAddress}.
*
* The bytecode for a contract can be obtained from Solidity with
* `type(contractName).creationCode`.
*
* Requirements:
*
* - `bytecode` must not be empty.
* - `salt` must have not been used for `bytecode` already.
* - the factory must have a balance of at least `amount`.
* - if `amount` is non-zero, `bytecode` must have a `payable` constructor.
*/
function deploy(
uint256 amount,
bytes32 salt,
bytes memory bytecode
) internal returns (address) {
address addr;
require(address(this).balance >= amount, "Create2: insufficient balance");
require(bytecode.length != 0, "Create2: bytecode length is zero");
assembly {
addr := create2(amount, add(bytecode, 0x20), mload(bytecode), salt)
}
require(addr != address(0), "Create2: Failed on deploy");
return addr;
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy}. Any change in the
* `bytecodeHash` or `salt` will result in a new destination address.
*/
function computeAddress(bytes32 salt, bytes32 bytecodeHash) internal view returns (address) {
return computeAddress(salt, bytecodeHash, address(this));
}
/**
* @dev Returns the address where a contract will be stored if deployed via {deploy} from a contract located at
* `deployer`. If `deployer` is this contract's address, returns the same value as {computeAddress}.
*/
function computeAddress(
bytes32 salt,
bytes32 bytecodeHash,
address deployer
) internal pure returns (address) {
bytes32 _data = keccak256(abi.encodePacked(bytes1(0xff), deployer, salt, bytecodeHash));
return address(uint160(uint256(_data)));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Multicall.sol)
pragma solidity ^0.8.0;
import "./Address.sol";
/**
* @dev Provides a function to batch together multiple calls in a single external call.
*
* _Available since v4.1._
*/
abstract contract Multicall {
/**
* @dev Receives and executes a batch of function calls on this contract.
*/
function multicall(bytes[] calldata data) external virtual returns (bytes[] memory results) {
results = new bytes[](data.length);
for (uint256 i = 0; i < data.length; i++) {
results[i] = Address.functionDelegateCall(address(this), data[i]);
}
return results;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/Clones.sol)
pragma solidity ^0.8.0;
/**
* @dev https://eips.ethereum.org/EIPS/eip-1167[EIP 1167] is a standard for
* deploying minimal proxy contracts, also known as "clones".
*
* > To simply and cheaply clone contract functionality in an immutable way, this standard specifies
* > a minimal bytecode implementation that delegates all calls to a known, fixed address.
*
* The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2`
* (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the
* deterministic method.
*
* _Available since v3.4._
*/
library Clones {
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create opcode, which should never revert.
*/
function clone(address implementation) internal returns (address instance) {
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, implementation))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
instance := create(0, ptr, 0x37)
}
require(instance != address(0), "ERC1167: create failed");
}
/**
* @dev Deploys and returns the address of a clone that mimics the behaviour of `implementation`.
*
* This function uses the create2 opcode and a `salt` to deterministically deploy
* the clone. Using the same `implementation` and `salt` multiple time will revert, since
* the clones cannot be deployed twice at the same address.
*/
function cloneDeterministic(address implementation, bytes32 salt) internal returns (address instance) {
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, implementation))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
instance := create2(0, ptr, 0x37, salt)
}
require(instance != address(0), "ERC1167: create2 failed");
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(
address implementation,
bytes32 salt,
address deployer
) internal pure returns (address predicted) {
assembly {
let ptr := mload(0x40)
mstore(ptr, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(ptr, 0x14), shl(0x60, implementation))
mstore(add(ptr, 0x28), 0x5af43d82803e903d91602b57fd5bf3ff00000000000000000000000000000000)
mstore(add(ptr, 0x38), shl(0x60, deployer))
mstore(add(ptr, 0x4c), salt)
mstore(add(ptr, 0x6c), keccak256(ptr, 0x37))
predicted := keccak256(add(ptr, 0x37), 0x55)
}
}
/**
* @dev Computes the address of a clone deployed using {Clones-cloneDeterministic}.
*/
function predictDeterministicAddress(address implementation, bytes32 salt)
internal
view
returns (address predicted)
{
return predictDeterministicAddress(implementation, salt, address(this));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol)
pragma solidity ^0.8.0;
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
* and `uint256` (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping(bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) {
// Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
if (lastIndex != toDeleteIndex) {
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = valueIndex; // Replace lastvalue's index to valueIndex
}
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
return set._values[index];
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function _values(Set storage set) private view returns (bytes32[] memory) {
return set._values;
}
// Bytes32Set
struct Bytes32Set {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _add(set._inner, value);
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
return _remove(set._inner, value);
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
return _contains(set._inner, value);
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(Bytes32Set storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
return _at(set._inner, index);
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(Bytes32Set storage set) internal view returns (bytes32[] memory) {
return _values(set._inner);
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(uint160(value))));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint160(uint256(_at(set._inner, index))));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(AddressSet storage set) internal view returns (address[] memory) {
bytes32[] memory store = _values(set._inner);
address[] memory result;
assembly {
result := store
}
return result;
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
/**
* @dev Return the entire set in an array
*
* WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed
* to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that
* this function has an unbounded cost, and using it as part of a state-changing function may render the function
* uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block.
*/
function values(UintSet storage set) internal view returns (uint256[] memory) {
bytes32[] memory store = _values(set._inner);
uint256[] memory result;
assembly {
result := store
}
return result;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
*/
interface IAccessControlEnumerable is IAccessControl {
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) external view returns (address);
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControl.sol";
import "../utils/Context.sol";
import "../utils/Strings.sol";
import "../utils/introspection/ERC165.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
Strings.toHexString(uint160(account), 20),
" is missing role ",
Strings.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)
pragma solidity ^0.8.0;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*
* _Available since v3.1._
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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 Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// 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
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @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
* ====
*
* [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://diligence.consensys.net/posts/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.5.11/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 functionCall(target, data, "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");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(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) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(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) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason 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 {
// 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
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}{
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 800
},
"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":"_trustedForwarder","type":"address"},{"internalType":"address","name":"_registry","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"implementation","type":"address"},{"indexed":true,"internalType":"bytes32","name":"contractType","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"version","type":"uint256"}],"name":"ImplementationAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"bool","name":"isApproved","type":"bool"}],"name":"ImplementationApproved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"},{"indexed":false,"internalType":"address","name":"proxy","type":"address"},{"indexed":true,"internalType":"address","name":"deployer","type":"address"}],"name":"ProxyDeployed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FACTORY_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"}],"name":"addImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"approval","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"bool","name":"_toApprove","type":"bool"}],"name":"approveImplementation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"currentVersion","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_type","type":"bytes32"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"deployProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_implementation","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"deployProxyByImplementation","outputs":[{"internalType":"address","name":"deployedProxy","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_type","type":"bytes32"},{"internalType":"bytes","name":"_data","type":"bytes"},{"internalType":"bytes32","name":"_salt","type":"bytes32"}],"name":"deployProxyDeterministic","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"deployer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_type","type":"bytes32"},{"internalType":"uint256","name":"_version","type":"uint256"}],"name":"getImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_type","type":"bytes32"}],"name":"getLatestImplementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"implementation","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"data","type":"bytes[]"}],"name":"multicall","outputs":[{"internalType":"bytes[]","name":"results","type":"bytes[]"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract TWRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60c06040523480156200001157600080fd5b5060405162001f9038038062001f90833981016040819052620000349162000276565b6001600160a01b0382166080526200005760006200005162000099565b620000b5565b620000867fdfbefbf47cfe66b701d8cfdbce1de81c821590819cb07e71cb01b6602fb0ee276200005162000099565b6001600160a01b031660a05250620002ae565b6000620000b0620000c560201b62000d211760201c565b905090565b620000c18282620000fe565b5050565b6080516000906001600160a01b0316331415620000e9575060131936013560601c90565b620000b06200014160201b62000d6b1760201c565b6200011582826200014560201b62000d6f1760201c565b60008281526001602090815260409091206200013c91839062000e0e620001e7821b17901c565b505050565b3390565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16620000c1576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620001a362000099565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000620001fe836001600160a01b03841662000207565b90505b92915050565b6000818152600183016020526040812054620002505750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915562000201565b50600062000201565b80516001600160a01b03811681146200027157600080fd5b919050565b600080604083850312156200028a57600080fd5b620002958362000259565b9150620002a56020840162000259565b90509250929050565b60805160a051611ca7620002e960003960008181610336015281816106510152610c6f0152600081816103010152610d250152611ca76000f3fe608060405234801561001057600080fd5b50600436106101985760003560e01c80639010d07c116100e3578063c6e2a4001161008c578063dd47595a11610066578063dd47595a1461044f578063e92016a414610483578063ec54d72f146104b757600080fd5b8063c6e2a40014610416578063ca15c87314610429578063d547741f1461043c57600080fd5b8063a217fddf116100bd578063a217fddf146103c5578063ac9650d8146103cd578063b9caf9d9146103ed57600080fd5b80639010d07c1461035857806391d148541461036b5780639430b496146103a257600080fd5b806336568abe1161014557806356fb09581161011f57806356fb0958146102de578063572b6c05146102f15780637b1039991461033157600080fd5b806336568abe146102705780633b426d3f1461028357806344ab6680146102a357600080fd5b80631e5e1e99116101765780631e5e1e9914610225578063248a9ca3146102385780632f2ff15d1461025b57600080fd5b806301ffc9a71461019d57806304a0fb17146101c557806311b804ab146101fa575b600080fd5b6101b06101ab3660046116a3565b6104ca565b60405190151581526020015b60405180910390f35b6101ec7fdfbefbf47cfe66b701d8cfdbce1de81c821590819cb07e71cb01b6602fb0ee2781565b6040519081526020016101bc565b61020d61020836600461178c565b6104f5565b6040516001600160a01b0390911681526020016101bc565b61020d6102333660046117e3565b610705565b6101ec610246366004611816565b60009081526020819052604090206001015490565b61026e61026936600461182f565b610745565b005b61026e61027e36600461182f565b610777565b6101ec610291366004611816565b60036020526000908152604090205481565b61020d6102b1366004611816565b6000908152600460209081526040808320600383528184205484529091529020546001600160a01b031690565b61026e6102ec36600461185b565b610813565b6101b06102ff366004611897565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0390811691161490565b61020d7f000000000000000000000000000000000000000000000000000000000000000081565b61020d6103663660046118b2565b6108db565b6101b061037936600461182f565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6101b06103b0366004611897565b60026020526000908152604090205460ff1681565b6101ec600081565b6103e06103db3660046118d4565b6108f3565b6040516101bc91906119a5565b61020d6103fb366004611897565b6005602052600090815260409020546001600160a01b031681565b61026e610424366004611897565b6109e8565b6101ec610437366004611816565b610c2b565b61026e61044a36600461182f565b610c42565b61020d61045d3660046118b2565b60009182526004602090815260408084209284529190529020546001600160a01b031690565b61020d6104913660046118b2565b60046020908152600092835260408084209091529082529020546001600160a01b031681565b61020d6104c5366004611a07565b610c6a565b60006001600160e01b03198216635a05180f60e01b14806104ef57506104ef82610e23565b92915050565b6001600160a01b03831660009081526002602052604081205460ff166105625760405162461bcd60e51b815260206004820152601b60248201527f696d706c656d656e746174696f6e206e6f7420617070726f766564000000000060448201526064015b60405180910390fd5b600061056c610e58565b8360405160200161059b92919060609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6040516020818303038152906040528051906020012090506105bd8582610e62565b91506105c7610e58565b6001600160a01b038381166000908152600560205260409020805473ffffffffffffffffffffffffffffffffffffffff19169290911691909117905561060b610e58565b6040516001600160a01b038481168252918216918716907f9e0862c4ebff2150fbbfd3f8547483f55bdec0c34fd977d3fccaa55d6c4ce7849060200160405180910390a37f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166352c28fab610686610e58565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401600060405180830381600087803b1580156106cf57600080fd5b505af11580156106e3573d6000803e3d6000fd5b505050506000845111156106fd576106fb8285610f19565b505b509392505050565b6000838152600460209081526040808320600383528184205484529091528120546001600160a01b031661073a8185856104f5565b9150505b9392505050565b60008281526020819052604090206001015461076881610763610e58565b610f5b565b6107728383610fd9565b505050565b61077f610e58565b6001600160a01b0316816001600160a01b0316146108055760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610559565b61080f8282610ffb565b5050565b61083f7fdfbefbf47cfe66b701d8cfdbce1de81c821590819cb07e71cb01b6602fb0ee27610379610e58565b6108785760405162461bcd60e51b815260206004820152600a6024820152693737ba1030b236b4b71760b11b6044820152606401610559565b6001600160a01b038216600081815260026020908152604091829020805460ff19168515159081179091558251938452908301527f46c2f0868ef35772e9324a42eb6fa484490cca8494538a909cf05c897d7d4108910160405180910390a15050565b600082815260016020526040812061073e908361101d565b60608167ffffffffffffffff81111561090e5761090e6116e9565b60405190808252806020026020018201604052801561094157816020015b606081526020019060019003908161092c5790505b50905060005b828110156109e1576109b13085858481811061096557610965611a4e565b90506020028101906109779190611a64565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061102992505050565b8282815181106109c3576109c3611a4e565b602002602001018190525080806109d990611ac8565b915050610947565b5092915050565b610a147fdfbefbf47cfe66b701d8cfdbce1de81c821590819cb07e71cb01b6602fb0ee27610379610e58565b610a4d5760405162461bcd60e51b815260206004820152600a6024820152693737ba1030b236b4b71760b11b6044820152606401610559565b60008190506000816001600160a01b031663cb2ef6f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab69190611ae3565b90506000826001600160a01b031663a0a8e4606040518163ffffffff1660e01b8152600401602060405180830381865afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190611afc565b60008381526003602052604090205490915060ff8082169083161015610b845760405162461bcd60e51b815260206004820152601460248201527f77726f6e67206d6f64756c652076657273696f6e0000000000000000000000006044820152606401610559565b600083815260036020908152604080832060ff861690819055600483528184208185528352818420805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038b169081179091558085526002845293829020805460ff1916600117905581519384529183019190915284917fc39db2d47bafbb20367a9c840abffa57a2bc243c1f1e67c939ea0e89e59ed01a910160405180910390a25050505050565b60008181526001602052604081206104ef9061104e565b600082815260208190526040902060010154610c6081610763610e58565b6107728383610ffb565b6000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166305d85eda610ca4610e58565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c9190611ae3565b9050610d19848483610705565b949350505050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316331415610d61575060131936013560601c90565b503390565b905090565b3390565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661080f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610dca610e58565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061073e836001600160a01b038416611058565b60006001600160e01b03198216637965db0b60e01b14806104ef57506301ffc9a760e01b6001600160e01b03198316146104ef565b6000610d66610d21565b60006040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528360601b60148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f59150506001600160a01b0381166104ef5760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401610559565b606061073e83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c656400008152506110a7565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661080f57610f97816001600160a01b031660146110b6565b610fa28360206110b6565b604051602001610fb3929190611b1f565b60408051601f198184030181529082905262461bcd60e51b825261055991600401611ba0565b610fe38282610d6f565b60008281526001602052604090206107729082610e0e565b611005828261125f565b600082815260016020526040902061077290826112fc565b600061073e8383611311565b606061073e8383604051806060016040528060278152602001611c4b6027913961133b565b60006104ef825490565b600081815260018301602052604081205461109f575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104ef565b5060006104ef565b6060610d19848460008561142f565b606060006110c5836002611bb3565b6110d0906002611bd2565b67ffffffffffffffff8111156110e8576110e86116e9565b6040519080825280601f01601f191660200182016040528015611112576020820181803683370190505b509050600360fc1b8160008151811061112d5761112d611a4e565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061115c5761115c611a4e565b60200101906001600160f81b031916908160001a9053506000611180846002611bb3565b61118b906001611bd2565b90505b6001811115611210577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106111cc576111cc611a4e565b1a60f81b8282815181106111e2576111e2611a4e565b60200101906001600160f81b031916908160001a90535060049490941c9361120981611bea565b905061118e565b50831561073e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610559565b6000828152602081815260408083206001600160a01b038516845290915290205460ff161561080f576000828152602081815260408083206001600160a01b03851684529091529020805460ff191690556112b8610e58565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600061073e836001600160a01b038416611577565b600082600001828154811061132857611328611a4e565b9060005260206000200154905092915050565b60606001600160a01b0384163b6113ba5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610559565b600080856001600160a01b0316856040516113d59190611c01565b600060405180830381855af49150503d8060008114611410576040519150601f19603f3d011682016040523d82523d6000602084013e611415565b606091505b509150915061142582828661166a565b9695505050505050565b6060824710156114a75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610559565b6001600160a01b0385163b6114fe5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610559565b600080866001600160a01b0316858760405161151a9190611c01565b60006040518083038185875af1925050503d8060008114611557576040519150601f19603f3d011682016040523d82523d6000602084013e61155c565b606091505b509150915061156c82828661166a565b979650505050505050565b6000818152600183016020526040812054801561166057600061159b600183611c1d565b85549091506000906115af90600190611c1d565b90508181146116145760008660000182815481106115cf576115cf611a4e565b90600052602060002001549050808760000184815481106115f2576115f2611a4e565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061162557611625611c34565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104ef565b60009150506104ef565b6060831561167957508161073e565b8251156116895782518084602001fd5b8160405162461bcd60e51b81526004016105599190611ba0565b6000602082840312156116b557600080fd5b81356001600160e01b03198116811461073e57600080fd5b80356001600160a01b03811681146116e457600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261171057600080fd5b813567ffffffffffffffff8082111561172b5761172b6116e9565b604051601f8301601f19908116603f01168101908282118183101715611753576117536116e9565b8160405283815286602085880101111561176c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156117a157600080fd5b6117aa846116cd565b9250602084013567ffffffffffffffff8111156117c657600080fd5b6117d2868287016116ff565b925050604084013590509250925092565b6000806000606084860312156117f857600080fd5b83359250602084013567ffffffffffffffff8111156117c657600080fd5b60006020828403121561182857600080fd5b5035919050565b6000806040838503121561184257600080fd5b82359150611852602084016116cd565b90509250929050565b6000806040838503121561186e57600080fd5b611877836116cd565b91506020830135801515811461188c57600080fd5b809150509250929050565b6000602082840312156118a957600080fd5b61073e826116cd565b600080604083850312156118c557600080fd5b50508035926020909101359150565b600080602083850312156118e757600080fd5b823567ffffffffffffffff808211156118ff57600080fd5b818501915085601f83011261191357600080fd5b81358181111561192257600080fd5b8660208260051b850101111561193757600080fd5b60209290920196919550909350505050565b60005b8381101561196457818101518382015260200161194c565b83811115611973576000848401525b50505050565b60008151808452611991816020860160208601611949565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156119fa57603f198886030184526119e8858351611979565b945092850192908501906001016119cc565b5092979650505050505050565b60008060408385031215611a1a57600080fd5b82359150602083013567ffffffffffffffff811115611a3857600080fd5b611a44858286016116ff565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611a7b57600080fd5b83018035915067ffffffffffffffff821115611a9657600080fd5b602001915036819003821315611aab57600080fd5b9250929050565b634e487b7160e01b600052601160045260246000fd5b6000600019821415611adc57611adc611ab2565b5060010190565b600060208284031215611af557600080fd5b5051919050565b600060208284031215611b0e57600080fd5b815160ff8116811461073e57600080fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611b57816017850160208801611949565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611b94816028840160208801611949565b01602801949350505050565b60208152600061073e6020830184611979565b6000816000190483118215151615611bcd57611bcd611ab2565b500290565b60008219821115611be557611be5611ab2565b500190565b600081611bf957611bf9611ab2565b506000190190565b60008251611c13818460208701611949565b9190910192915050565b600082821015611c2f57611c2f611ab2565b500390565b634e487b7160e01b600052603160045260246000fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204a60adfd4ac745a12212cfbe407a4a471d073d684a24521ce305c9b796b52fbf64736f6c634300080c00330000000000000000000000008cbc8b5d71702032904750a66aefe8b603ebc5380000000000000000000000007c487845f98938bb955b1d5ad069d9a30e4131fd
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101985760003560e01c80639010d07c116100e3578063c6e2a4001161008c578063dd47595a11610066578063dd47595a1461044f578063e92016a414610483578063ec54d72f146104b757600080fd5b8063c6e2a40014610416578063ca15c87314610429578063d547741f1461043c57600080fd5b8063a217fddf116100bd578063a217fddf146103c5578063ac9650d8146103cd578063b9caf9d9146103ed57600080fd5b80639010d07c1461035857806391d148541461036b5780639430b496146103a257600080fd5b806336568abe1161014557806356fb09581161011f57806356fb0958146102de578063572b6c05146102f15780637b1039991461033157600080fd5b806336568abe146102705780633b426d3f1461028357806344ab6680146102a357600080fd5b80631e5e1e99116101765780631e5e1e9914610225578063248a9ca3146102385780632f2ff15d1461025b57600080fd5b806301ffc9a71461019d57806304a0fb17146101c557806311b804ab146101fa575b600080fd5b6101b06101ab3660046116a3565b6104ca565b60405190151581526020015b60405180910390f35b6101ec7fdfbefbf47cfe66b701d8cfdbce1de81c821590819cb07e71cb01b6602fb0ee2781565b6040519081526020016101bc565b61020d61020836600461178c565b6104f5565b6040516001600160a01b0390911681526020016101bc565b61020d6102333660046117e3565b610705565b6101ec610246366004611816565b60009081526020819052604090206001015490565b61026e61026936600461182f565b610745565b005b61026e61027e36600461182f565b610777565b6101ec610291366004611816565b60036020526000908152604090205481565b61020d6102b1366004611816565b6000908152600460209081526040808320600383528184205484529091529020546001600160a01b031690565b61026e6102ec36600461185b565b610813565b6101b06102ff366004611897565b7f0000000000000000000000008cbc8b5d71702032904750a66aefe8b603ebc5386001600160a01b0390811691161490565b61020d7f0000000000000000000000007c487845f98938bb955b1d5ad069d9a30e4131fd81565b61020d6103663660046118b2565b6108db565b6101b061037936600461182f565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6101b06103b0366004611897565b60026020526000908152604090205460ff1681565b6101ec600081565b6103e06103db3660046118d4565b6108f3565b6040516101bc91906119a5565b61020d6103fb366004611897565b6005602052600090815260409020546001600160a01b031681565b61026e610424366004611897565b6109e8565b6101ec610437366004611816565b610c2b565b61026e61044a36600461182f565b610c42565b61020d61045d3660046118b2565b60009182526004602090815260408084209284529190529020546001600160a01b031690565b61020d6104913660046118b2565b60046020908152600092835260408084209091529082529020546001600160a01b031681565b61020d6104c5366004611a07565b610c6a565b60006001600160e01b03198216635a05180f60e01b14806104ef57506104ef82610e23565b92915050565b6001600160a01b03831660009081526002602052604081205460ff166105625760405162461bcd60e51b815260206004820152601b60248201527f696d706c656d656e746174696f6e206e6f7420617070726f766564000000000060448201526064015b60405180910390fd5b600061056c610e58565b8360405160200161059b92919060609290921b6bffffffffffffffffffffffff19168252601482015260340190565b6040516020818303038152906040528051906020012090506105bd8582610e62565b91506105c7610e58565b6001600160a01b038381166000908152600560205260409020805473ffffffffffffffffffffffffffffffffffffffff19169290911691909117905561060b610e58565b6040516001600160a01b038481168252918216918716907f9e0862c4ebff2150fbbfd3f8547483f55bdec0c34fd977d3fccaa55d6c4ce7849060200160405180910390a37f0000000000000000000000007c487845f98938bb955b1d5ad069d9a30e4131fd6001600160a01b03166352c28fab610686610e58565b6040516001600160e01b031960e084901b1681526001600160a01b0391821660048201529085166024820152604401600060405180830381600087803b1580156106cf57600080fd5b505af11580156106e3573d6000803e3d6000fd5b505050506000845111156106fd576106fb8285610f19565b505b509392505050565b6000838152600460209081526040808320600383528184205484529091528120546001600160a01b031661073a8185856104f5565b9150505b9392505050565b60008281526020819052604090206001015461076881610763610e58565b610f5b565b6107728383610fd9565b505050565b61077f610e58565b6001600160a01b0316816001600160a01b0316146108055760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201527f20726f6c657320666f722073656c6600000000000000000000000000000000006064820152608401610559565b61080f8282610ffb565b5050565b61083f7fdfbefbf47cfe66b701d8cfdbce1de81c821590819cb07e71cb01b6602fb0ee27610379610e58565b6108785760405162461bcd60e51b815260206004820152600a6024820152693737ba1030b236b4b71760b11b6044820152606401610559565b6001600160a01b038216600081815260026020908152604091829020805460ff19168515159081179091558251938452908301527f46c2f0868ef35772e9324a42eb6fa484490cca8494538a909cf05c897d7d4108910160405180910390a15050565b600082815260016020526040812061073e908361101d565b60608167ffffffffffffffff81111561090e5761090e6116e9565b60405190808252806020026020018201604052801561094157816020015b606081526020019060019003908161092c5790505b50905060005b828110156109e1576109b13085858481811061096557610965611a4e565b90506020028101906109779190611a64565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061102992505050565b8282815181106109c3576109c3611a4e565b602002602001018190525080806109d990611ac8565b915050610947565b5092915050565b610a147fdfbefbf47cfe66b701d8cfdbce1de81c821590819cb07e71cb01b6602fb0ee27610379610e58565b610a4d5760405162461bcd60e51b815260206004820152600a6024820152693737ba1030b236b4b71760b11b6044820152606401610559565b60008190506000816001600160a01b031663cb2ef6f76040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab69190611ae3565b90506000826001600160a01b031663a0a8e4606040518163ffffffff1660e01b8152600401602060405180830381865afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190611afc565b60008381526003602052604090205490915060ff8082169083161015610b845760405162461bcd60e51b815260206004820152601460248201527f77726f6e67206d6f64756c652076657273696f6e0000000000000000000000006044820152606401610559565b600083815260036020908152604080832060ff861690819055600483528184208185528352818420805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038b169081179091558085526002845293829020805460ff1916600117905581519384529183019190915284917fc39db2d47bafbb20367a9c840abffa57a2bc243c1f1e67c939ea0e89e59ed01a910160405180910390a25050505050565b60008181526001602052604081206104ef9061104e565b600082815260208190526040902060010154610c6081610763610e58565b6107728383610ffb565b6000807f0000000000000000000000007c487845f98938bb955b1d5ad069d9a30e4131fd6001600160a01b03166305d85eda610ca4610e58565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015610ce8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0c9190611ae3565b9050610d19848483610705565b949350505050565b60007f0000000000000000000000008cbc8b5d71702032904750a66aefe8b603ebc5386001600160a01b0316331415610d61575060131936013560601c90565b503390565b905090565b3390565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661080f576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055610dca610e58565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600061073e836001600160a01b038416611058565b60006001600160e01b03198216637965db0b60e01b14806104ef57506301ffc9a760e01b6001600160e01b03198316146104ef565b6000610d66610d21565b60006040517f3d602d80600a3d3981f3363d3d373d3d3d363d7300000000000000000000000081528360601b60148201527f5af43d82803e903d91602b57fd5bf300000000000000000000000000000000006028820152826037826000f59150506001600160a01b0381166104ef5760405162461bcd60e51b815260206004820152601760248201527f455243313136373a2063726561746532206661696c65640000000000000000006044820152606401610559565b606061073e83836040518060400160405280601e81526020017f416464726573733a206c6f772d6c6576656c2063616c6c206661696c656400008152506110a7565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1661080f57610f97816001600160a01b031660146110b6565b610fa28360206110b6565b604051602001610fb3929190611b1f565b60408051601f198184030181529082905262461bcd60e51b825261055991600401611ba0565b610fe38282610d6f565b60008281526001602052604090206107729082610e0e565b611005828261125f565b600082815260016020526040902061077290826112fc565b600061073e8383611311565b606061073e8383604051806060016040528060278152602001611c4b6027913961133b565b60006104ef825490565b600081815260018301602052604081205461109f575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556104ef565b5060006104ef565b6060610d19848460008561142f565b606060006110c5836002611bb3565b6110d0906002611bd2565b67ffffffffffffffff8111156110e8576110e86116e9565b6040519080825280601f01601f191660200182016040528015611112576020820181803683370190505b509050600360fc1b8160008151811061112d5761112d611a4e565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061115c5761115c611a4e565b60200101906001600160f81b031916908160001a9053506000611180846002611bb3565b61118b906001611bd2565b90505b6001811115611210577f303132333435363738396162636465660000000000000000000000000000000085600f16601081106111cc576111cc611a4e565b1a60f81b8282815181106111e2576111e2611a4e565b60200101906001600160f81b031916908160001a90535060049490941c9361120981611bea565b905061118e565b50831561073e5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610559565b6000828152602081815260408083206001600160a01b038516845290915290205460ff161561080f576000828152602081815260408083206001600160a01b03851684529091529020805460ff191690556112b8610e58565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600061073e836001600160a01b038416611577565b600082600001828154811061132857611328611a4e565b9060005260206000200154905092915050565b60606001600160a01b0384163b6113ba5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f60448201527f6e747261637400000000000000000000000000000000000000000000000000006064820152608401610559565b600080856001600160a01b0316856040516113d59190611c01565b600060405180830381855af49150503d8060008114611410576040519150601f19603f3d011682016040523d82523d6000602084013e611415565b606091505b509150915061142582828661166a565b9695505050505050565b6060824710156114a75760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610559565b6001600160a01b0385163b6114fe5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610559565b600080866001600160a01b0316858760405161151a9190611c01565b60006040518083038185875af1925050503d8060008114611557576040519150601f19603f3d011682016040523d82523d6000602084013e61155c565b606091505b509150915061156c82828661166a565b979650505050505050565b6000818152600183016020526040812054801561166057600061159b600183611c1d565b85549091506000906115af90600190611c1d565b90508181146116145760008660000182815481106115cf576115cf611a4e565b90600052602060002001549050808760000184815481106115f2576115f2611a4e565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061162557611625611c34565b6001900381819060005260206000200160009055905585600101600086815260200190815260200160002060009055600193505050506104ef565b60009150506104ef565b6060831561167957508161073e565b8251156116895782518084602001fd5b8160405162461bcd60e51b81526004016105599190611ba0565b6000602082840312156116b557600080fd5b81356001600160e01b03198116811461073e57600080fd5b80356001600160a01b03811681146116e457600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261171057600080fd5b813567ffffffffffffffff8082111561172b5761172b6116e9565b604051601f8301601f19908116603f01168101908282118183101715611753576117536116e9565b8160405283815286602085880101111561176c57600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000606084860312156117a157600080fd5b6117aa846116cd565b9250602084013567ffffffffffffffff8111156117c657600080fd5b6117d2868287016116ff565b925050604084013590509250925092565b6000806000606084860312156117f857600080fd5b83359250602084013567ffffffffffffffff8111156117c657600080fd5b60006020828403121561182857600080fd5b5035919050565b6000806040838503121561184257600080fd5b82359150611852602084016116cd565b90509250929050565b6000806040838503121561186e57600080fd5b611877836116cd565b91506020830135801515811461188c57600080fd5b809150509250929050565b6000602082840312156118a957600080fd5b61073e826116cd565b600080604083850312156118c557600080fd5b50508035926020909101359150565b600080602083850312156118e757600080fd5b823567ffffffffffffffff808211156118ff57600080fd5b818501915085601f83011261191357600080fd5b81358181111561192257600080fd5b8660208260051b850101111561193757600080fd5b60209290920196919550909350505050565b60005b8381101561196457818101518382015260200161194c565b83811115611973576000848401525b50505050565b60008151808452611991816020860160208601611949565b601f01601f19169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156119fa57603f198886030184526119e8858351611979565b945092850192908501906001016119cc565b5092979650505050505050565b60008060408385031215611a1a57600080fd5b82359150602083013567ffffffffffffffff811115611a3857600080fd5b611a44858286016116ff565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b6000808335601e19843603018112611a7b57600080fd5b83018035915067ffffffffffffffff821115611a9657600080fd5b602001915036819003821315611aab57600080fd5b9250929050565b634e487b7160e01b600052601160045260246000fd5b6000600019821415611adc57611adc611ab2565b5060010190565b600060208284031215611af557600080fd5b5051919050565b600060208284031215611b0e57600080fd5b815160ff8116811461073e57600080fd5b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351611b57816017850160208801611949565b7f206973206d697373696e6720726f6c65200000000000000000000000000000006017918401918201528351611b94816028840160208801611949565b01602801949350505050565b60208152600061073e6020830184611979565b6000816000190483118215151615611bcd57611bcd611ab2565b500290565b60008219821115611be557611be5611ab2565b500190565b600081611bf957611bf9611ab2565b506000190190565b60008251611c13818460208701611949565b9190910192915050565b600082821015611c2f57611c2f611ab2565b500390565b634e487b7160e01b600052603160045260246000fdfe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204a60adfd4ac745a12212cfbe407a4a471d073d684a24521ce305c9b796b52fbf64736f6c634300080c0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000008cbc8b5d71702032904750a66aefe8b603ebc5380000000000000000000000007c487845f98938bb955b1d5ad069d9a30e4131fd
-----Decoded View---------------
Arg [0] : _trustedForwarder (address): 0x8cbc8B5d71702032904750A66AEfE8B603eBC538
Arg [1] : _registry (address): 0x7c487845f98938Bb955B1D5AD069d9a30e4131fd
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 0000000000000000000000008cbc8b5d71702032904750a66aefe8b603ebc538
Arg [1] : 0000000000000000000000007c487845f98938bb955b1d5ad069d9a30e4131fd
Net Worth in USD
Net Worth in ETH
Token Allocations
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|---|---|---|---|---|
| OP | 100.00% | $0.300841 | 17.1035 | $5.15 |
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.