Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
16194532 | 693 days ago | Contract Creation | 0 ETH |
Loading...
Loading
Contract Name:
ForwarderRegistry
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {IERC1271} from "./../cryptography/interfaces/IERC1271.sol"; import {IForwarderRegistry} from "./interfaces/IForwarderRegistry.sol"; import {IERC2771} from "./interfaces/IERC2771.sol"; import {ERC2771Calldata} from "./libraries/ERC2771Calldata.sol"; import {Address} from "@openzeppelin/contracts/utils/Address.sol"; import {ECDSA} from "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; /// @title Universal Meta-Transactions Forwarder Registry. /// @notice Users can allow specific EIP-2771 forwarders to forward meta-transactions on their behalf. /// @dev This contract should be deployed uniquely per network, in a non-upgradeable way. /// @dev Derived from https://github.com/wighawag/universal-forwarder (MIT licence) contract ForwarderRegistry is IForwarderRegistry, IERC2771 { using Address for address; using ECDSA for bytes32; struct Forwarder { uint248 nonce; bool approved; } error ForwarderNotApproved(address sender, address forwarder); error InvalidEIP1271Signature(); error WrongSigner(); bytes4 private constant EIP1271_MAGICVALUE = 0x1626ba7e; bytes32 private constant EIP712_DOMAIN_NAME = keccak256("ForwarderRegistry"); bytes32 private constant APPROVAL_TYPEHASH = keccak256("ForwarderApproval(address sender,address forwarder,bool approved,uint256 nonce)"); mapping(address => mapping(address => Forwarder)) private _forwarders; uint256 private immutable _deploymentChainId; bytes32 private immutable _deploymentDomainSeparator; /// @notice Emitted when a forwarder is approved or disapproved. /// @param sender The account for which `forwarder` is approved or disapproved. /// @param forwarder The account approved or disapproved as forwarder. /// @param approved True for an approval, false for a disapproval. /// @param nonce The `sender`'s account nonce before the approval change. event ForwarderApproval(address indexed sender, address indexed forwarder, bool approved, uint256 nonce); constructor() { uint256 chainId; assembly { chainId := chainid() } _deploymentChainId = chainId; _deploymentDomainSeparator = _calculateDomainSeparator(chainId); } /// @notice Disapproves a forwarder for the sender. /// @dev Emits a {ForwarderApproval} event. /// @param forwarder The address of the forwarder to disapprove. function removeForwarderApproval(address forwarder) external { Forwarder storage forwarderData = _forwarders[msg.sender][forwarder]; _setForwarderApproval(forwarderData, msg.sender, forwarder, false, forwarderData.nonce); } /// @notice Approves or disapproves a forwarder using a signature. /// @dev Reverts with {InvalidEIP1271Signature} if `isEIP1271Signature` is true and the signature is reported invalid by the `sender` contract. /// @dev Reverts with {WrongSigner} if `isEIP1271Signature` is false and `sender` is not the actual signer. /// @dev Emits a {ForwarderApproval} event. /// @param sender The address which signed the approval of the approval. /// @param forwarder The address of the forwarder to change the approval of. /// @param approved Whether to approve or disapprove the forwarder. /// @param signature Signature by `sender` for approving forwarder. /// @param isEIP1271Signature True if `sender` is a contract that provides authorization via EIP-1271. function setForwarderApproval(address sender, address forwarder, bool approved, bytes calldata signature, bool isEIP1271Signature) public { Forwarder storage forwarderData = _forwarders[sender][forwarder]; uint256 nonce = forwarderData.nonce; _requireValidSignature(sender, forwarder, approved, nonce, signature, isEIP1271Signature); _setForwarderApproval(forwarderData, sender, forwarder, approved, nonce); } /// @notice Forwards the meta-transaction using EIP-2771. /// @dev Reverts with {ForwarderNotApproved} if the caller has not been previously approved as a forwarder by the sender. /// @param target The destination of the call (that will receive the meta-transaction). /// @param data The content of the call (the `sender` address will be appended to it according to EIP-2771). function forward(address target, bytes calldata data) external payable { address sender = ERC2771Calldata.msgSender(); if (!_forwarders[sender][msg.sender].approved) revert ForwarderNotApproved(sender, msg.sender); target.functionCallWithValue(abi.encodePacked(data, sender), msg.value); } /// @notice Approves the forwarder and forwards the meta-transaction using EIP-2771. /// @dev Reverts with {InvalidEIP1271Signature} if `isEIP1271Signature` is true and the signature is reported invalid by the `sender` contract. /// @dev Reverts with {WrongSigner} if `isEIP1271Signature` is false and `sender` is not the actual signer. /// @dev Emits a {ForwarderApproval} event. /// @param signature Signature by `sender` for approving the forwarder. /// @param isEIP1271Signature True if `sender` is a contract that provides authorization via EIP-1271. /// @param target The destination of the call (that will receive the meta-transaction). /// @param data The content of the call (the `sender` address will be appended to it according to EIP-2771). function approveAndForward(bytes calldata signature, bool isEIP1271Signature, address target, bytes calldata data) external payable { address sender = ERC2771Calldata.msgSender(); setForwarderApproval(sender, msg.sender, true, signature, isEIP1271Signature); target.functionCallWithValue(abi.encodePacked(data, sender), msg.value); } /// @notice Returns the EIP-712 DOMAIN_SEPARATOR. /// @return domainSeparator The EIP-712 domain separator. // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() public view returns (bytes32 domainSeparator) { uint256 chainId; assembly { chainId := chainid() } // in case a fork happens, to support the chain that had to change its chainId, we compute the domain operator return chainId == _deploymentChainId ? _deploymentDomainSeparator : _calculateDomainSeparator(chainId); } /// @notice Gets the current nonce for the sender/forwarder pair. /// @param sender The sender account. /// @param forwarder The forwarder account. /// @return nonce The current nonce for the `sender`/`forwarder` pair. function getNonce(address sender, address forwarder) external view returns (uint256 nonce) { return _forwarders[sender][forwarder].nonce; } /// @inheritdoc IForwarderRegistry function isApprovedForwarder(address sender, address forwarder) external view override returns (bool) { return _forwarders[sender][forwarder].approved; } /// @inheritdoc IERC2771 function isTrustedForwarder(address) external pure override returns (bool) { return true; } function _requireValidSignature( address sender, address forwarder, bool approved, uint256 nonce, bytes calldata signature, bool isEIP1271Signature ) private view { bytes memory data = abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256(abi.encode(APPROVAL_TYPEHASH, sender, forwarder, approved, nonce)) ); if (isEIP1271Signature) { if (IERC1271(sender).isValidSignature(keccak256(data), signature) != EIP1271_MAGICVALUE) revert InvalidEIP1271Signature(); } else { if (keccak256(data).recover(signature) != sender) revert WrongSigner(); } } function _setForwarderApproval(Forwarder storage forwarderData, address sender, address forwarder, bool approved, uint256 nonce) private { forwarderData.approved = approved; unchecked { forwarderData.nonce = uint248(nonce + 1); } emit ForwarderApproval(sender, forwarder, approved, nonce); } function _calculateDomainSeparator(uint256 chainId) private view returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"), EIP712_DOMAIN_NAME, chainId, address(this) ) ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.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 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.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @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] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title Standard Signature Validation Method for Contracts. /// @dev See https://eips.ethereum.org/EIPS/eip-1271 interface IERC1271 { /// @notice Returns whether the signature is valid for the data hash. /// @param hash The hash of the signed data. /// @param signature The signature for `hash`. /// @return magicValue `0x1626ba7e` (`bytes4(keccak256("isValidSignature(bytes32,bytes)")`) if the signature is valid, else any other value. function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title Secure Protocol for Native Meta Transactions. /// @dev See https://eips.ethereum.org/EIPS/eip-2771 interface IERC2771 { /// @notice Checks whether a forwarder is trusted. /// @param forwarder The forwarder to check. /// @return isTrusted True if `forwarder` is trusted, false if not. function isTrustedForwarder(address forwarder) external view returns (bool isTrusted); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @title Universal Meta-Transactions Forwarder Registry. /// @dev Derived from https://github.com/wighawag/universal-forwarder (MIT licence) interface IForwarderRegistry { /// @notice Checks whether an account is as an approved meta-transaction forwarder for a sender account. /// @param sender The sender account. /// @param forwarder The forwarder account. /// @return isApproved True if `forwarder` is an approved meta-transaction forwarder for `sender`, false otherwise. function isApprovedForwarder(address sender, address forwarder) external view returns (bool isApproved); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.8; /// @dev Derived from https://github.com/OpenZeppelin/openzeppelin-contracts (MIT licence) /// @dev See https://eips.ethereum.org/EIPS/eip-2771 library ERC2771Calldata { /// @notice Returns the sender address appended at the end of the calldata, as specified in EIP-2771. function msgSender() internal pure returns (address sender) { assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } /// @notice Returns the calldata while omitting the appended sender address, as specified in EIP-2771. function msgData() internal pure returns (bytes calldata data) { unchecked { return msg.data[:msg.data.length - 20]; } } }
{ "evmVersion": "london", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 99999 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"forwarder","type":"address"}],"name":"ForwarderNotApproved","type":"error"},{"inputs":[],"name":"InvalidEIP1271Signature","type":"error"},{"inputs":[],"name":"WrongSigner","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"forwarder","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"},{"indexed":false,"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"ForwarderApproval","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"domainSeparator","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bool","name":"isEIP1271Signature","type":"bool"},{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"approveAndForward","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"forward","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"forwarder","type":"address"}],"name":"getNonce","outputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"forwarder","type":"address"}],"name":"isApprovedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"removeForwarderApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"forwarder","type":"address"},{"internalType":"bool","name":"approved","type":"bool"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bool","name":"isEIP1271Signature","type":"bool"}],"name":"setForwarderApproval","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60c060405234801561001057600080fd5b50466080818152604080517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666020808301919091527f06a520fda4ca688235391b02e357c6a65eb2a3bb40a69c0199f3f7f9cccee041828401526060820185905230828501528251808303909401845260a0909101909152815191012060a0525060805160a0516112036100b660003960006102d60152600061022f01526112036000f3fe60806040526004361061007b5760003560e01c80638929a8ca1161004e5780638929a8ca1461010e5780639438f7f3146101855780639c6a442414610198578063d828435d146101b857600080fd5b80633644e51514610080578063572b6c05146100a85780636ed0f382146100d95780636fadcf72146100fb575b600080fd5b34801561008c57600080fd5b5061009561022a565b6040519081526020015b60405180910390f35b3480156100b457600080fd5b506100c96100c3366004610e02565b50600190565b604051901515815260200161009f565b3480156100e557600080fd5b506100f96100f4366004610e02565b6102fc565b005b6100f9610109366004610e66565b610361565b34801561011a57600080fd5b506100c9610129366004610eb9565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152602081815260408083209390941682529190915220547f0100000000000000000000000000000000000000000000000000000000000000900460ff1690565b6100f9610193366004610efc565b61048a565b3480156101a457600080fd5b506100f96101b3366004610f90565b6104e2565b3480156101c457600080fd5b506100956101d3366004610eb9565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152602081815260408083209390941682529190915220547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b6000467f000000000000000000000000000000000000000000000000000000000000000081146102d457604080517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666020808301919091527f06a520fda4ca688235391b02e357c6a65eb2a3bb40a69c0199f3f7f9cccee0418284015260608201849052306080808401919091528351808403909101815260a090920190925280519101206102f6565b7f00000000000000000000000000000000000000000000000000000000000000005b91505090565b3360008181526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915281208054909261035d9284928691907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1661054d565b5050565b367fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec013560601c6000818152602081815260408083203384529091529020547f0100000000000000000000000000000000000000000000000000000000000000900460ff1661041f576040517f3e29ee2e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201523360248201526044015b60405180910390fd5b61048383838360405160200161043793929190611015565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905273ffffffffffffffffffffffffffffffffffffffff8616903461061d565b5050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c6104c0813360018a8a8a6104e2565b6104d883838360405160200161043793929190611015565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff80871660009081526020818152604080832093891683529290522080547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff166105448888888489898961064b565b6104d882898989855b600181017effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff168215157f010000000000000000000000000000000000000000000000000000000000000081027fff0000000000000000000000000000000000000000000000000000000000000016919091178655604080519182526020820183905273ffffffffffffffffffffffffffffffffffffffff85811692908716917f1e416512661bbe7bb72d89bfee596249d7767c125e8c56cf7cf82ee698b63a6a910160405180910390a35050505050565b60606106438484846040518060600160405280602981526020016111a5602991396108ce565b949350505050565b600061065561022a565b604080517f510634d3c850f3aab02dc8ab54bbb9b76a576f7e4edd8462a252673876bec9e5602082015273ffffffffffffffffffffffffffffffffffffffff808c16928201929092529089166060820152871515608082015260a0810187905260c001604051602081830303815290604052805190602001206040516020016107109291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6040516020818303038152906040529050811561082357805160208201206040517f1626ba7e000000000000000000000000000000000000000000000000000000008082529173ffffffffffffffffffffffffffffffffffffffff8b1691631626ba7e91610784918990899060040161104e565b602060405180830381865afa1580156107a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c591906110a2565b7fffffffff00000000000000000000000000000000000000000000000000000000161461081e576040517f5d52cbe300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104d8565b8773ffffffffffffffffffffffffffffffffffffffff1661088185858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505085516020870120929150506109e7565b73ffffffffffffffffffffffffffffffffffffffff16146104d8576040517fa7932e6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606082471015610960576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610416565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516109899190611108565b60006040518083038185875af1925050503d80600081146109c6576040519150601f19603f3d011682016040523d82523d6000602084013e6109cb565b606091505b50915091506109dc87838387610a0b565b979650505050505050565b60008060006109f68585610aab565b91509150610a0381610af0565b509392505050565b60608315610aa1578251600003610a9a5773ffffffffffffffffffffffffffffffffffffffff85163b610a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610416565b5081610643565b6106438383610ca6565b6000808251604103610ae15760208301516040840151606085015160001a610ad587828585610cea565b94509450505050610ae9565b506000905060025b9250929050565b6000816004811115610b0457610b04611124565b03610b0c5750565b6001816004811115610b2057610b20611124565b03610b87576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610416565b6002816004811115610b9b57610b9b611124565b03610c02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610416565b6003816004811115610c1657610c16611124565b03610ca3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610416565b50565b815115610cb65781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104169190611153565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610d215750600090506003610dd0565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610d75573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116610dc957600060019250925050610dd0565b9150600090505b94509492505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610dfd57600080fd5b919050565b600060208284031215610e1457600080fd5b610e1d82610dd9565b9392505050565b60008083601f840112610e3657600080fd5b50813567ffffffffffffffff811115610e4e57600080fd5b602083019150836020828501011115610ae957600080fd5b600080600060408486031215610e7b57600080fd5b610e8484610dd9565b9250602084013567ffffffffffffffff811115610ea057600080fd5b610eac86828701610e24565b9497909650939450505050565b60008060408385031215610ecc57600080fd5b610ed583610dd9565b9150610ee360208401610dd9565b90509250929050565b80358015158114610dfd57600080fd5b60008060008060008060808789031215610f1557600080fd5b863567ffffffffffffffff80821115610f2d57600080fd5b610f398a838b01610e24565b9098509650869150610f4d60208a01610eec565b9550610f5b60408a01610dd9565b94506060890135915080821115610f7157600080fd5b50610f7e89828a01610e24565b979a9699509497509295939492505050565b60008060008060008060a08789031215610fa957600080fd5b610fb287610dd9565b9550610fc060208801610dd9565b9450610fce60408801610eec565b9350606087013567ffffffffffffffff811115610fea57600080fd5b610ff689828a01610e24565b9094509250611009905060808801610eec565b90509295509295509295565b8284823760609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169101908152601401919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b6000602082840312156110b457600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610e1d57600080fd5b60005b838110156110ff5781810151838201526020016110e7565b50506000910152565b6000825161111a8184602087016110e4565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208152600082518060208401526111728160408501602087016110e4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a264697066735822122014638630f4786a3d8517e68dcd12f5d54a303dbaab0ad85750359be4653ce04664736f6c63430008110033
Deployed Bytecode
0x60806040526004361061007b5760003560e01c80638929a8ca1161004e5780638929a8ca1461010e5780639438f7f3146101855780639c6a442414610198578063d828435d146101b857600080fd5b80633644e51514610080578063572b6c05146100a85780636ed0f382146100d95780636fadcf72146100fb575b600080fd5b34801561008c57600080fd5b5061009561022a565b6040519081526020015b60405180910390f35b3480156100b457600080fd5b506100c96100c3366004610e02565b50600190565b604051901515815260200161009f565b3480156100e557600080fd5b506100f96100f4366004610e02565b6102fc565b005b6100f9610109366004610e66565b610361565b34801561011a57600080fd5b506100c9610129366004610eb9565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152602081815260408083209390941682529190915220547f0100000000000000000000000000000000000000000000000000000000000000900460ff1690565b6100f9610193366004610efc565b61048a565b3480156101a457600080fd5b506100f96101b3366004610f90565b6104e2565b3480156101c457600080fd5b506100956101d3366004610eb9565b73ffffffffffffffffffffffffffffffffffffffff9182166000908152602081815260408083209390941682529190915220547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1690565b6000467f000000000000000000000000000000000000000000000000000000000000000181146102d457604080517f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666020808301919091527f06a520fda4ca688235391b02e357c6a65eb2a3bb40a69c0199f3f7f9cccee0418284015260608201849052306080808401919091528351808403909101815260a090920190925280519101206102f6565b7fdd4f057577fa4d6b635ea635ff5ff00d11b3adbf7afc8650dde4da8569eafc495b91505090565b3360008181526020818152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915281208054909261035d9284928691907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1661054d565b5050565b367fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec013560601c6000818152602081815260408083203384529091529020547f0100000000000000000000000000000000000000000000000000000000000000900460ff1661041f576040517f3e29ee2e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff821660048201523360248201526044015b60405180910390fd5b61048383838360405160200161043793929190611015565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815291905273ffffffffffffffffffffffffffffffffffffffff8616903461061d565b5050505050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec36013560601c6104c0813360018a8a8a6104e2565b6104d883838360405160200161043793929190611015565b5050505050505050565b73ffffffffffffffffffffffffffffffffffffffff80871660009081526020818152604080832093891683529290522080547effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff166105448888888489898961064b565b6104d882898989855b600181017effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff168215157f010000000000000000000000000000000000000000000000000000000000000081027fff0000000000000000000000000000000000000000000000000000000000000016919091178655604080519182526020820183905273ffffffffffffffffffffffffffffffffffffffff85811692908716917f1e416512661bbe7bb72d89bfee596249d7767c125e8c56cf7cf82ee698b63a6a910160405180910390a35050505050565b60606106438484846040518060600160405280602981526020016111a5602991396108ce565b949350505050565b600061065561022a565b604080517f510634d3c850f3aab02dc8ab54bbb9b76a576f7e4edd8462a252673876bec9e5602082015273ffffffffffffffffffffffffffffffffffffffff808c16928201929092529089166060820152871515608082015260a0810187905260c001604051602081830303815290604052805190602001206040516020016107109291907f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6040516020818303038152906040529050811561082357805160208201206040517f1626ba7e000000000000000000000000000000000000000000000000000000008082529173ffffffffffffffffffffffffffffffffffffffff8b1691631626ba7e91610784918990899060040161104e565b602060405180830381865afa1580156107a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c591906110a2565b7fffffffff00000000000000000000000000000000000000000000000000000000161461081e576040517f5d52cbe300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6104d8565b8773ffffffffffffffffffffffffffffffffffffffff1661088185858080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152505085516020870120929150506109e7565b73ffffffffffffffffffffffffffffffffffffffff16146104d8576040517fa7932e6a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b606082471015610960576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610416565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516109899190611108565b60006040518083038185875af1925050503d80600081146109c6576040519150601f19603f3d011682016040523d82523d6000602084013e6109cb565b606091505b50915091506109dc87838387610a0b565b979650505050505050565b60008060006109f68585610aab565b91509150610a0381610af0565b509392505050565b60608315610aa1578251600003610a9a5773ffffffffffffffffffffffffffffffffffffffff85163b610a9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610416565b5081610643565b6106438383610ca6565b6000808251604103610ae15760208301516040840151606085015160001a610ad587828585610cea565b94509450505050610ae9565b506000905060025b9250929050565b6000816004811115610b0457610b04611124565b03610b0c5750565b6001816004811115610b2057610b20611124565b03610b87576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610416565b6002816004811115610b9b57610b9b611124565b03610c02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610416565b6003816004811115610c1657610c16611124565b03610ca3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610416565b50565b815115610cb65781518083602001fd5b806040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104169190611153565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115610d215750600090506003610dd0565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015610d75573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116610dc957600060019250925050610dd0565b9150600090505b94509492505050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610dfd57600080fd5b919050565b600060208284031215610e1457600080fd5b610e1d82610dd9565b9392505050565b60008083601f840112610e3657600080fd5b50813567ffffffffffffffff811115610e4e57600080fd5b602083019150836020828501011115610ae957600080fd5b600080600060408486031215610e7b57600080fd5b610e8484610dd9565b9250602084013567ffffffffffffffff811115610ea057600080fd5b610eac86828701610e24565b9497909650939450505050565b60008060408385031215610ecc57600080fd5b610ed583610dd9565b9150610ee360208401610dd9565b90509250929050565b80358015158114610dfd57600080fd5b60008060008060008060808789031215610f1557600080fd5b863567ffffffffffffffff80821115610f2d57600080fd5b610f398a838b01610e24565b9098509650869150610f4d60208a01610eec565b9550610f5b60408a01610dd9565b94506060890135915080821115610f7157600080fd5b50610f7e89828a01610e24565b979a9699509497509295939492505050565b60008060008060008060a08789031215610fa957600080fd5b610fb287610dd9565b9550610fc060208801610dd9565b9450610fce60408801610eec565b9350606087013567ffffffffffffffff811115610fea57600080fd5b610ff689828a01610e24565b9094509250611009905060808801610eec565b90509295509295509295565b8284823760609190911b7fffffffffffffffffffffffffffffffffffffffff000000000000000000000000169101908152601401919050565b83815260406020820152816040820152818360608301376000818301606090810191909152601f9092017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016010192915050565b6000602082840312156110b457600080fd5b81517fffffffff0000000000000000000000000000000000000000000000000000000081168114610e1d57600080fd5b60005b838110156110ff5781810151838201526020016110e7565b50506000910152565b6000825161111a8184602087016110e4565b9190910192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60208152600082518060208401526111728160408501602087016110e4565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fe416464726573733a206c6f772d6c6576656c2063616c6c20776974682076616c7565206661696c6564a264697066735822122014638630f4786a3d8517e68dcd12f5d54a303dbaab0ad85750359be4653ce04664736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.