Overview
Max Total Supply
4,946,870,319.626332417314824002 RIZE
Holders
15,994 (0.00%)
Transfers
-
241 ( 62.84%)
Market
Price
$0.00 @ 0.000000 ETH
Onchain Market Cap
$0.00
Circulating Supply Market Cap
$0.00
Other Info
Token Contract (WITH 18 Decimals)
Loading...
Loading
Loading...
Loading
Loading...
Loading
Contract Name:
RizeToken
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
paris EvmVersion, Audited
Contract Source Code (Solidity Standard Json-Input format)Audit Report
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {ERC20FlashMint} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20FlashMint.sol";
import {ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import {ERC20Capped} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol";
import {EIP3009} from "./EIP3009.sol";
import {AccessRestricted, IAccessList} from "./configuration/AccessRestricted.sol";
/**
* @title Wrapped Rize Token
* @author Michael Duchesne ([email protected])
* @notice
*
* This is the ERC20 RIZE Token on non-native chains
*
*/
contract RizeToken is
ERC20FlashMint,
ERC20Permit,
ERC20Capped,
EIP3009,
AccessRestricted
{
uint256 private _feesBps;
event FlashloanFeesUpdated(uint256 newValue);
error FeeTooBig(uint256 fee);
error TransferFailed(address from, uint256 amount);
constructor(
address accessList
)
ERC20("RIZE", "RIZE")
ERC20FlashMint()
ERC20Permit("RIZE")
ERC20Capped(5_000_000_000 * 10 ** decimals())
AccessRestricted(accessList)
{}
function setFeesBps(uint256 feesBps) external onlyCommittee {
if (feesBps > 10_000) {
revert FeeTooBig(feesBps);
}
_feesBps = feesBps;
emit FlashloanFeesUpdated(feesBps);
}
/**
* @notice Execute a transfer with a signed authorization
* @param from Payer's address (Authorizer)
* @param to Payee's address
* @param value Amount to be transferred
* @param validAfter The time after which this is valid (unix time)
* @param validBefore The time before which this is valid (unix time)
* @param nonce Unique nonce
* @param v v of the signature
* @param r r of the signature
* @param s s of the signature
*/
function transferWithAuthorization(
address from,
address to,
uint256 value,
uint256 validAfter,
uint256 validBefore,
bytes32 nonce,
uint8 v,
bytes32 r,
bytes32 s
) external {
_transferWithAuthorization(
from,
to,
value,
validAfter,
validBefore,
nonce,
v,
r,
s
);
}
/**
* @notice Receive a transfer with a signed authorization from the payer
* @dev This has an additional check to ensure that the payee's address matches
* the caller of this function to prevent front-running attacks. (See security
* considerations)
* @param from Payer's address (Authorizer)
* @param to Payee's address
* @param value Amount to be transferred
* @param validAfter The time after which this is valid (unix time)
* @param validBefore The time before which this is valid (unix time)
* @param nonce Unique nonce
* @param v v of the signature
* @param r r of the signature
* @param s s of the signature
*/
function receiveWithAuthorization(
address from,
address to,
uint256 value,
uint256 validAfter,
uint256 validBefore,
bytes32 nonce,
uint8 v,
bytes32 r,
bytes32 s
) external {
_receiveWithAuthorization(
from,
to,
value,
validAfter,
validBefore,
nonce,
v,
r,
s
);
}
/**
* @notice Attempt to cancel an authorization
* @param authorizer Authorizer's address
* @param nonce Nonce of the authorization
* @param v v of the signature
* @param r r of the signature
* @param s s of the signature
*/
function cancelAuthorization(
address authorizer,
bytes32 nonce,
uint8 v,
bytes32 r,
bytes32 s
) external {
_cancelAuthorization(authorizer, nonce, v, r, s);
}
function mint(uint256 amount) public onlyBridge {
_mint(msg.sender, amount);
}
function burn(uint256 amount) public onlyBridge {
_burn(msg.sender, amount);
}
function maxFlashLoan(
address token
) public view virtual override returns (uint256) {
return token == address(this) ? type(uint256).max - totalSupply() : 0;
}
function _authorizedTransfer(
address from,
address to,
uint256 amount
) internal virtual override {
_transfer(from, to, amount);
}
function _update(
address from,
address to,
uint256 value
) internal virtual override(ERC20Capped, ERC20) {
ERC20Capped._update(from, to, value);
}
function _flashFee(
address token,
uint256 value
) internal view virtual override returns (uint256) {
// silence warning about unused variable without the addition of bytecode.
token;
return (value * _feesBps) / 10_000;
}
function _flashFeeReceiver()
internal
view
virtual
override
returns (address)
{
IAccessList accessList = IAccessList(getAccessList());
return accessList.getTreasury();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @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.
*/
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 `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC1271.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC1271 standard signature validation method for
* contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271].
*/
interface IERC1271 {
/**
* @dev Should return whether the signature provided is valid for the provided data
* @param hash Hash of the data to be signed
* @param signature Signature byte array associated with _data
*/
function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC3156FlashBorrower.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC3156 FlashBorrower, as defined in
* https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
*/
interface IERC3156FlashBorrower {
/**
* @dev Receive a flash loan.
* @param initiator The initiator of the loan.
* @param token The loan currency.
* @param amount The amount of tokens lent.
* @param fee The additional amount of tokens to repay.
* @param data Arbitrary data structure, intended to contain user-defined parameters.
* @return The keccak256 hash of "ERC3156FlashBorrower.onFlashLoan"
*/
function onFlashLoan(
address initiator,
address token,
uint256 amount,
uint256 fee,
bytes calldata data
) external returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC3156FlashLender.sol)
pragma solidity ^0.8.20;
import {IERC3156FlashBorrower} from "./IERC3156FlashBorrower.sol";
/**
* @dev Interface of the ERC3156 FlashLender, as defined in
* https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
*/
interface IERC3156FlashLender {
/**
* @dev The amount of currency available to be lended.
* @param token The loan currency.
* @return The amount of `token` that can be borrowed.
*/
function maxFlashLoan(address token) external view returns (uint256);
/**
* @dev The fee to be charged for a given loan.
* @param token The loan currency.
* @param amount The amount of tokens lent.
* @return The amount of `token` to be charged for the loan, on top of the returned principal.
*/
function flashFee(address token, uint256 amount) external view returns (uint256);
/**
* @dev Initiate a flash loan.
* @param receiver The receiver of the tokens in the loan, and the receiver of the callback.
* @param token The loan currency.
* @param amount The amount of tokens lent.
* @param data Arbitrary data structure, intended to contain user-defined parameters.
*/
function flashLoan(
IERC3156FlashBorrower receiver,
address token,
uint256 amount,
bytes calldata data
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC5267.sol)
pragma solidity ^0.8.20;
interface IERC5267 {
/**
* @dev MAY be emitted to signal that the domain could have changed.
*/
event EIP712DomainChanged();
/**
* @dev returns the fields and values that describe the domain separator used by this contract for EIP-712
* signature.
*/
function eip712Domain()
external
view
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*/
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address account => uint256) private _balances;
mapping(address account => mapping(address spender => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(address from, address to, uint256 value) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(address from, address to, uint256 value) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(address owner, address spender, uint256 value) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
* ```
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(spender, currentAllowance, value);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC20Capped.sol)
pragma solidity ^0.8.20;
import {ERC20} from "../ERC20.sol";
/**
* @dev Extension of {ERC20} that adds a cap to the supply of tokens.
*/
abstract contract ERC20Capped is ERC20 {
uint256 private immutable _cap;
/**
* @dev Total supply cap has been exceeded.
*/
error ERC20ExceededCap(uint256 increasedSupply, uint256 cap);
/**
* @dev The supplied cap is not a valid cap.
*/
error ERC20InvalidCap(uint256 cap);
/**
* @dev Sets the value of the `cap`. This value is immutable, it can only be
* set once during construction.
*/
constructor(uint256 cap_) {
if (cap_ == 0) {
revert ERC20InvalidCap(0);
}
_cap = cap_;
}
/**
* @dev Returns the cap on the token's total supply.
*/
function cap() public view virtual returns (uint256) {
return _cap;
}
/**
* @dev See {ERC20-_update}.
*/
function _update(address from, address to, uint256 value) internal virtual override {
super._update(from, to, value);
if (from == address(0)) {
uint256 maxSupply = cap();
uint256 supply = totalSupply();
if (supply > maxSupply) {
revert ERC20ExceededCap(supply, maxSupply);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC20FlashMint.sol)
pragma solidity ^0.8.20;
import {IERC3156FlashBorrower} from "../../../interfaces/IERC3156FlashBorrower.sol";
import {IERC3156FlashLender} from "../../../interfaces/IERC3156FlashLender.sol";
import {ERC20} from "../ERC20.sol";
/**
* @dev Implementation of the ERC3156 Flash loans extension, as defined in
* https://eips.ethereum.org/EIPS/eip-3156[ERC-3156].
*
* Adds the {flashLoan} method, which provides flash loan support at the token
* level. By default there is no fee, but this can be changed by overriding {flashFee}.
*
* NOTE: When this extension is used along with the {ERC20Capped} or {ERC20Votes} extensions,
* {maxFlashLoan} will not correctly reflect the maximum that can be flash minted. We recommend
* overriding {maxFlashLoan} so that it correctly reflects the supply cap.
*/
abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender {
bytes32 private constant RETURN_VALUE = keccak256("ERC3156FlashBorrower.onFlashLoan");
/**
* @dev The loan token is not valid.
*/
error ERC3156UnsupportedToken(address token);
/**
* @dev The requested loan exceeds the max loan value for `token`.
*/
error ERC3156ExceededMaxLoan(uint256 maxLoan);
/**
* @dev The receiver of a flashloan is not a valid {onFlashLoan} implementer.
*/
error ERC3156InvalidReceiver(address receiver);
/**
* @dev Returns the maximum amount of tokens available for loan.
* @param token The address of the token that is requested.
* @return The amount of token that can be loaned.
*
* NOTE: This function does not consider any form of supply cap, so in case
* it's used in a token with a cap like {ERC20Capped}, make sure to override this
* function to integrate the cap instead of `type(uint256).max`.
*/
function maxFlashLoan(address token) public view virtual returns (uint256) {
return token == address(this) ? type(uint256).max - totalSupply() : 0;
}
/**
* @dev Returns the fee applied when doing flash loans. This function calls
* the {_flashFee} function which returns the fee applied when doing flash
* loans.
* @param token The token to be flash loaned.
* @param value The amount of tokens to be loaned.
* @return The fees applied to the corresponding flash loan.
*/
function flashFee(address token, uint256 value) public view virtual returns (uint256) {
if (token != address(this)) {
revert ERC3156UnsupportedToken(token);
}
return _flashFee(token, value);
}
/**
* @dev Returns the fee applied when doing flash loans. By default this
* implementation has 0 fees. This function can be overloaded to make
* the flash loan mechanism deflationary.
* @param token The token to be flash loaned.
* @param value The amount of tokens to be loaned.
* @return The fees applied to the corresponding flash loan.
*/
function _flashFee(address token, uint256 value) internal view virtual returns (uint256) {
// silence warning about unused variable without the addition of bytecode.
token;
value;
return 0;
}
/**
* @dev Returns the receiver address of the flash fee. By default this
* implementation returns the address(0) which means the fee amount will be burnt.
* This function can be overloaded to change the fee receiver.
* @return The address for which the flash fee will be sent to.
*/
function _flashFeeReceiver() internal view virtual returns (address) {
return address(0);
}
/**
* @dev Performs a flash loan. New tokens are minted and sent to the
* `receiver`, who is required to implement the {IERC3156FlashBorrower}
* interface. By the end of the flash loan, the receiver is expected to own
* value + fee tokens and have them approved back to the token contract itself so
* they can be burned.
* @param receiver The receiver of the flash loan. Should implement the
* {IERC3156FlashBorrower-onFlashLoan} interface.
* @param token The token to be flash loaned. Only `address(this)` is
* supported.
* @param value The amount of tokens to be loaned.
* @param data An arbitrary datafield that is passed to the receiver.
* @return `true` if the flash loan was successful.
*/
// This function can reenter, but it doesn't pose a risk because it always preserves the property that the amount
// minted at the beginning is always recovered and burned at the end, or else the entire function will revert.
// slither-disable-next-line reentrancy-no-eth
function flashLoan(
IERC3156FlashBorrower receiver,
address token,
uint256 value,
bytes calldata data
) public virtual returns (bool) {
uint256 maxLoan = maxFlashLoan(token);
if (value > maxLoan) {
revert ERC3156ExceededMaxLoan(maxLoan);
}
uint256 fee = flashFee(token, value);
_mint(address(receiver), value);
if (receiver.onFlashLoan(_msgSender(), token, value, fee, data) != RETURN_VALUE) {
revert ERC3156InvalidReceiver(address(receiver));
}
address flashFeeReceiver = _flashFeeReceiver();
_spendAllowance(address(receiver), address(this), value + fee);
if (fee == 0 || flashFeeReceiver == address(0)) {
_burn(address(receiver), value + fee);
} else {
_burn(address(receiver), value);
_transfer(address(receiver), flashFeeReceiver, fee);
}
return true;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/ERC20Permit.sol)
pragma solidity ^0.8.20;
import {IERC20Permit} from "./IERC20Permit.sol";
import {ERC20} from "../ERC20.sol";
import {ECDSA} from "../../../utils/cryptography/ECDSA.sol";
import {EIP712} from "../../../utils/cryptography/EIP712.sol";
import {Nonces} from "../../../utils/Nonces.sol";
/**
* @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces {
bytes32 private constant PERMIT_TYPEHASH =
keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
/**
* @dev Permit deadline has expired.
*/
error ERC2612ExpiredSignature(uint256 deadline);
/**
* @dev Mismatched signature.
*/
error ERC2612InvalidSigner(address signer, address owner);
/**
* @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`.
*
* It's a good idea to use the same `name` that is defined as the ERC20 token name.
*/
constructor(string memory name) EIP712(name, "1") {}
/**
* @inheritdoc IERC20Permit
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual {
if (block.timestamp > deadline) {
revert ERC2612ExpiredSignature(deadline);
}
bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));
bytes32 hash = _hashTypedDataV4(structHash);
address signer = ECDSA.recover(hash, v, r, s);
if (signer != owner) {
revert ERC2612InvalidSigner(signer, owner);
}
_approve(owner, spender, value);
}
/**
* @inheritdoc IERC20Permit
*/
function nonces(address owner) public view virtual override(IERC20Permit, Nonces) returns (uint256) {
return super.nonces(owner);
}
/**
* @inheritdoc IERC20Permit
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view virtual returns (bytes32) {
return _domainSeparatorV4();
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
import {IERC20} from "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* ==== Security Considerations
*
* There are two important considerations concerning the use of `permit`. The first is that a valid permit signature
* expresses an allowance, and it should not be assumed to convey additional meaning. In particular, it should not be
* considered as an intention to spend the allowance in any specific way. The second is that because permits have
* built-in replay protection and can be submitted by anyone, they can be frontrun. A protocol that uses permits should
* take this into consideration and allow a `permit` call to fail. Combining these two aspects, a pattern that may be
* generally recommended is:
*
* ```solidity
* function doThingWithPermit(..., uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
* try token.permit(msg.sender, address(this), value, deadline, v, r, s) {} catch {}
* doThing(..., value);
* }
*
* function doThing(..., uint256 value) public {
* token.safeTransferFrom(msg.sender, address(this), value);
* ...
* }
* ```
*
* Observe that: 1) `msg.sender` is used as the owner, leaving no ambiguity as to the signer intent, and 2) the use of
* `try/catch` allows the permit to fail and makes the code tolerant to frontrunning. (See also
* {SafeERC20-safeTransferFrom}).
*
* Additionally, note that smart contract wallets (such as Argent or Safe) are not able to produce permit signatures, so
* contracts should have entry points that don't rely on permit.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*
* CAUTION: See Security Considerations above.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.20;
/**
* @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
}
/**
* @dev The signature derives the `address(0)`.
*/
error ECDSAInvalidSignature();
/**
* @dev The signature has an invalid length.
*/
error ECDSAInvalidSignatureLength(uint256 length);
/**
* @dev The signature has an S value that is in the upper half order.
*/
error ECDSAInvalidSignatureS(bytes32 s);
/**
* @dev Returns the address that signed a hashed message (`hash`) with `signature` or an error. This will not
* return address(0) without also returning an error description. Errors are documented using an enum (error type)
* and a bytes32 providing additional information about the error.
*
* If no error is returned, then the address can be used for verification purposes.
*
* The `ecrecover` EVM precompile 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 {MessageHashUtils-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]
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) {
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, bytes32(signature.length));
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM precompile 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 {MessageHashUtils-toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, signature);
_throwError(error, errorArg);
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]
*/
function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) {
unchecked {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
// We do not check for an overflow here since the shift operation results in 0 or 1.
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.
*/
function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) {
(address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError, bytes32) {
// 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, s);
}
// 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, bytes32(0));
}
return (signer, RecoverError.NoError, bytes32(0));
}
/**
* @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, bytes32 errorArg) = tryRecover(hash, v, r, s);
_throwError(error, errorArg);
return recovered;
}
/**
* @dev Optionally reverts with the corresponding custom error according to the `error` argument provided.
*/
function _throwError(RecoverError error, bytes32 errorArg) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert ECDSAInvalidSignature();
} else if (error == RecoverError.InvalidSignatureLength) {
revert ECDSAInvalidSignatureLength(uint256(errorArg));
} else if (error == RecoverError.InvalidSignatureS) {
revert ECDSAInvalidSignatureS(errorArg);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/EIP712.sol)
pragma solidity ^0.8.20;
import {MessageHashUtils} from "./MessageHashUtils.sol";
import {ShortStrings, ShortString} from "../ShortStrings.sol";
import {IERC5267} from "../../interfaces/IERC5267.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding scheme specified in the EIP requires a domain separator and a hash of the typed structured data, whose
* encoding is very generic and therefore its implementation in Solidity is not feasible, thus this contract
* does not implement the encoding itself. Protocols need to implement the type-specific encoding they need in order to
* produce the hash of their typed data using a combination of `abi.encode` and `keccak256`.
*
* This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding
* scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA
* ({_hashTypedDataV4}).
*
* The implementation of the domain separator was designed to be as efficient as possible while still properly updating
* the chain id to protect against replay attacks on an eventual fork of the chain.
*
* NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method
* https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].
*
* NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain
* separator of the implementation contract. This will cause the {_domainSeparatorV4} function to always rebuild the
* separator from the immutable values, which is cheaper than accessing a cached version in cold storage.
*
* @custom:oz-upgrades-unsafe-allow state-variable-immutable
*/
abstract contract EIP712 is IERC5267 {
using ShortStrings for *;
bytes32 private constant TYPE_HASH =
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
// Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to
// invalidate the cached domain separator if the chain id changes.
bytes32 private immutable _cachedDomainSeparator;
uint256 private immutable _cachedChainId;
address private immutable _cachedThis;
bytes32 private immutable _hashedName;
bytes32 private immutable _hashedVersion;
ShortString private immutable _name;
ShortString private immutable _version;
string private _nameFallback;
string private _versionFallback;
/**
* @dev Initializes the domain separator and parameter caches.
*
* The meaning of `name` and `version` is specified in
* https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:
*
* - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.
* - `version`: the current major version of the signing domain.
*
* NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart
* contract upgrade].
*/
constructor(string memory name, string memory version) {
_name = name.toShortStringWithFallback(_nameFallback);
_version = version.toShortStringWithFallback(_versionFallback);
_hashedName = keccak256(bytes(name));
_hashedVersion = keccak256(bytes(version));
_cachedChainId = block.chainid;
_cachedDomainSeparator = _buildDomainSeparator();
_cachedThis = address(this);
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
if (address(this) == _cachedThis && block.chainid == _cachedChainId) {
return _cachedDomainSeparator;
} else {
return _buildDomainSeparator();
}
}
function _buildDomainSeparator() private view returns (bytes32) {
return keccak256(abi.encode(TYPE_HASH, _hashedName, _hashedVersion, block.chainid, address(this)));
}
/**
* @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this
* function returns the hash of the fully encoded EIP712 message for this domain.
*
* This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:
*
* ```solidity
* bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(
* keccak256("Mail(address to,string contents)"),
* mailTo,
* keccak256(bytes(mailContents))
* )));
* address signer = ECDSA.recover(digest, signature);
* ```
*/
function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {
return MessageHashUtils.toTypedDataHash(_domainSeparatorV4(), structHash);
}
/**
* @dev See {IERC-5267}.
*/
function eip712Domain()
public
view
virtual
returns (
bytes1 fields,
string memory name,
string memory version,
uint256 chainId,
address verifyingContract,
bytes32 salt,
uint256[] memory extensions
)
{
return (
hex"0f", // 01111
_EIP712Name(),
_EIP712Version(),
block.chainid,
address(this),
bytes32(0),
new uint256[](0)
);
}
/**
* @dev The name parameter for the EIP712 domain.
*
* NOTE: By default this function reads _name which is an immutable value.
* It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
*/
// solhint-disable-next-line func-name-mixedcase
function _EIP712Name() internal view returns (string memory) {
return _name.toStringWithFallback(_nameFallback);
}
/**
* @dev The version parameter for the EIP712 domain.
*
* NOTE: By default this function reads _version which is an immutable value.
* It only reads from storage if necessary (in case the value is too large to fit in a ShortString).
*/
// solhint-disable-next-line func-name-mixedcase
function _EIP712Version() internal view returns (string memory) {
return _version.toStringWithFallback(_versionFallback);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/MessageHashUtils.sol)
pragma solidity ^0.8.20;
import {Strings} from "../Strings.sol";
/**
* @dev Signature message hash utilities for producing digests to be consumed by {ECDSA} recovery or signing.
*
* The library provides methods for generating a hash of a message that conforms to the
* https://eips.ethereum.org/EIPS/eip-191[EIP 191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
* specifications.
*/
library MessageHashUtils {
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing a bytes32 `messageHash` with
* `"\x19Ethereum Signed Message:\n32"` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* NOTE: The `messageHash` parameter is intended to be the result of hashing a raw message with
* keccak256, although any bytes32 value can be safely used because the final digest will
* be re-hashed.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes32 messageHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
mstore(0x00, "\x19Ethereum Signed Message:\n32") // 32 is the bytes-length of messageHash
mstore(0x1c, messageHash) // 0x1c (28) is the length of the prefix
digest := keccak256(0x00, 0x3c) // 0x3c is the length of the prefix (0x1c) + messageHash (0x20)
}
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x45` (`personal_sign` messages).
*
* The digest is calculated by prefixing an arbitrary `message` with
* `"\x19Ethereum Signed Message:\n" + len(message)` and hashing the result. It corresponds with the
* hash signed when using the https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] JSON-RPC method.
*
* See {ECDSA-recover}.
*/
function toEthSignedMessageHash(bytes memory message) internal pure returns (bytes32) {
return
keccak256(bytes.concat("\x19Ethereum Signed Message:\n", bytes(Strings.toString(message.length)), message));
}
/**
* @dev Returns the keccak256 digest of an EIP-191 signed data with version
* `0x00` (data with intended validator).
*
* The digest is calculated by prefixing an arbitrary `data` with `"\x19\x00"` and the intended
* `validator` address. Then hashing the result.
*
* See {ECDSA-recover}.
*/
function toDataWithIntendedValidatorHash(address validator, bytes memory data) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(hex"19_00", validator, data));
}
/**
* @dev Returns the keccak256 digest of an EIP-712 typed data (EIP-191 version `0x01`).
*
* The digest is calculated from a `domainSeparator` and a `structHash`, by prefixing them with
* `\x19\x01` and hashing the result. It corresponds to the hash signed by the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] JSON-RPC method as part of EIP-712.
*
* See {ECDSA-recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32 digest) {
/// @solidity memory-safe-assembly
assembly {
let ptr := mload(0x40)
mstore(ptr, hex"19_01")
mstore(add(ptr, 0x02), domainSeparator)
mstore(add(ptr, 0x22), structHash)
digest := keccak256(ptr, 0x42)
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/cryptography/SignatureChecker.sol)
pragma solidity ^0.8.20;
import {ECDSA} from "./ECDSA.sol";
import {IERC1271} from "../../interfaces/IERC1271.sol";
/**
* @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA
* signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like
* Argent and Safe Wallet (previously Gnosis Safe).
*/
library SignatureChecker {
/**
* @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the
* signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`.
*
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
* change through time. It could return true at block N and false at block N+1 (or the opposite).
*/
function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {
(address recovered, ECDSA.RecoverError error, ) = ECDSA.tryRecover(hash, signature);
return
(error == ECDSA.RecoverError.NoError && recovered == signer) ||
isValidERC1271SignatureNow(signer, hash, signature);
}
/**
* @dev Checks if a signature is valid for a given signer and data hash. The signature is validated
* against the signer smart contract using ERC1271.
*
* NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus
* change through time. It could return true at block N and false at block N+1 (or the opposite).
*/
function isValidERC1271SignatureNow(
address signer,
bytes32 hash,
bytes memory signature
) internal view returns (bool) {
(bool success, bytes memory result) = signer.staticcall(
abi.encodeCall(IERC1271.isValidSignature, (hash, signature))
);
return (success &&
result.length >= 32 &&
abi.decode(result, (bytes32)) == bytes32(IERC1271.isValidSignature.selector));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
/**
* @dev Muldiv operation overflow.
*/
error MathOverflowedMulDiv();
enum Rounding {
Floor, // Toward negative infinity
Ceil, // Toward positive infinity
Trunc, // Toward zero
Expand // Away from zero
}
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @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 towards infinity instead
* of rounding towards zero.
*/
function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
if (b == 0) {
// Guarantee the same behavior as in a regular Solidity division.
return a / b;
}
// (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 = x * y; // Least significant 256 bits of the product
uint256 prod1; // Most significant 256 bits of the product
assembly {
let mm := mulmod(x, y, not(0))
prod1 := sub(sub(mm, prod0), lt(mm, prod0))
}
// Handle non-overflow cases, 256 by 256 division.
if (prod1 == 0) {
// Solidity will revert if denominator == 0, unlike the div opcode on its own.
// The surrounding unchecked block does not change this fact.
// See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
return prod0 / denominator;
}
// Make sure the result is less than 2^256. Also prevents denominator == 0.
if (denominator <= prod1) {
revert MathOverflowedMulDiv();
}
///////////////////////////////////////////////
// 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.
uint256 twos = denominator & (0 - denominator);
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 (unsignedRoundsUp(rounding) && 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
* towards zero.
*
* 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
}
}
/**
* @dev Return the log in base 2 of a positive value rounded towards zero.
* 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 10 of a positive value rounded towards zero.
* 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
}
}
/**
* @dev Return the log in base 256 of a positive value rounded towards zero.
* 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 256, 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
}
}
/**
* @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
*/
function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
return uint8(rounding) % 2 == 1;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return a > b ? a : b;
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two signed numbers without overflow.
* The result is rounded towards zero.
*/
function average(int256 a, int256 b) internal pure returns (int256) {
// Formula from the book "Hacker's Delight"
int256 x = (a & b) + ((a ^ b) >> 1);
return x + (int256(uint256(x) >> 255) & (a ^ b));
}
/**
* @dev Returns the absolute unsigned value of a signed value.
*/
function abs(int256 n) internal pure returns (uint256) {
unchecked {
// must be unchecked in order to support `n = type(int256).min`
return uint256(n >= 0 ? n : -n);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Nonces.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides tracking nonces for addresses. Nonces will only increment.
*/
abstract contract Nonces {
/**
* @dev The nonce used for an `account` is not the expected current nonce.
*/
error InvalidAccountNonce(address account, uint256 currentNonce);
mapping(address account => uint256) private _nonces;
/**
* @dev Returns the next unused nonce for an address.
*/
function nonces(address owner) public view virtual returns (uint256) {
return _nonces[owner];
}
/**
* @dev Consumes a nonce.
*
* Returns the current value and increments nonce.
*/
function _useNonce(address owner) internal virtual returns (uint256) {
// For each account, the nonce has an initial value of 0, can only be incremented by one, and cannot be
// decremented or reset. This guarantees that the nonce never overflows.
unchecked {
// It is important to do x++ and not ++x here.
return _nonces[owner]++;
}
}
/**
* @dev Same as {_useNonce} but checking that `nonce` is the next valid for `owner`.
*/
function _useCheckedNonce(address owner, uint256 nonce) internal virtual {
uint256 current = _useNonce(owner);
if (nonce != current) {
revert InvalidAccountNonce(owner, current);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/ShortStrings.sol)
pragma solidity ^0.8.20;
import {StorageSlot} from "./StorageSlot.sol";
// | string | 0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA |
// | length | 0x BB |
type ShortString is bytes32;
/**
* @dev This library provides functions to convert short memory strings
* into a `ShortString` type that can be used as an immutable variable.
*
* Strings of arbitrary length can be optimized using this library if
* they are short enough (up to 31 bytes) by packing them with their
* length (1 byte) in a single EVM word (32 bytes). Additionally, a
* fallback mechanism can be used for every other case.
*
* Usage example:
*
* ```solidity
* contract Named {
* using ShortStrings for *;
*
* ShortString private immutable _name;
* string private _nameFallback;
*
* constructor(string memory contractName) {
* _name = contractName.toShortStringWithFallback(_nameFallback);
* }
*
* function name() external view returns (string memory) {
* return _name.toStringWithFallback(_nameFallback);
* }
* }
* ```
*/
library ShortStrings {
// Used as an identifier for strings longer than 31 bytes.
bytes32 private constant FALLBACK_SENTINEL = 0x00000000000000000000000000000000000000000000000000000000000000FF;
error StringTooLong(string str);
error InvalidShortString();
/**
* @dev Encode a string of at most 31 chars into a `ShortString`.
*
* This will trigger a `StringTooLong` error is the input string is too long.
*/
function toShortString(string memory str) internal pure returns (ShortString) {
bytes memory bstr = bytes(str);
if (bstr.length > 31) {
revert StringTooLong(str);
}
return ShortString.wrap(bytes32(uint256(bytes32(bstr)) | bstr.length));
}
/**
* @dev Decode a `ShortString` back to a "normal" string.
*/
function toString(ShortString sstr) internal pure returns (string memory) {
uint256 len = byteLength(sstr);
// using `new string(len)` would work locally but is not memory safe.
string memory str = new string(32);
/// @solidity memory-safe-assembly
assembly {
mstore(str, len)
mstore(add(str, 0x20), sstr)
}
return str;
}
/**
* @dev Return the length of a `ShortString`.
*/
function byteLength(ShortString sstr) internal pure returns (uint256) {
uint256 result = uint256(ShortString.unwrap(sstr)) & 0xFF;
if (result > 31) {
revert InvalidShortString();
}
return result;
}
/**
* @dev Encode a string into a `ShortString`, or write it to storage if it is too long.
*/
function toShortStringWithFallback(string memory value, string storage store) internal returns (ShortString) {
if (bytes(value).length < 32) {
return toShortString(value);
} else {
StorageSlot.getStringSlot(store).value = value;
return ShortString.wrap(FALLBACK_SENTINEL);
}
}
/**
* @dev Decode a string that was encoded to `ShortString` or written to storage using {setWithFallback}.
*/
function toStringWithFallback(ShortString value, string storage store) internal pure returns (string memory) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return toString(value);
} else {
return store;
}
}
/**
* @dev Return the length of a string that was encoded to `ShortString` or written to storage using
* {setWithFallback}.
*
* WARNING: This will return the "byte length" of the string. This may not reflect the actual length in terms of
* actual characters as the UTF-8 encoding of a single character can span over multiple bytes.
*/
function byteLengthWithFallback(ShortString value, string storage store) internal view returns (uint256) {
if (ShortString.unwrap(value) != FALLBACK_SENTINEL) {
return byteLength(value);
} else {
return bytes(store).length;
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.
pragma solidity ^0.8.20;
/**
* @dev Library for reading and writing primitive types to specific storage slots.
*
* Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
* This library helps with reading and writing to such slots without the need for inline assembly.
*
* The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
*
* Example usage to set ERC1967 implementation slot:
* ```solidity
* contract ERC1967 {
* bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
*
* function _getImplementation() internal view returns (address) {
* return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
* }
*
* function _setImplementation(address newImplementation) internal {
* require(newImplementation.code.length > 0);
* StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
* }
* }
* ```
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct StringSlot {
string value;
}
struct BytesSlot {
bytes value;
}
/**
* @dev Returns an `AddressSlot` with member `value` located at `slot`.
*/
function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `StringSlot` representation of the string storage pointer `store`.
*/
function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
/**
* @dev Returns an `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := slot
}
}
/**
* @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
*/
function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
/// @solidity memory-safe-assembly
assembly {
r.slot := store.slot
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
bytes16 private constant HEX_DIGITS = "0123456789abcdef";
uint8 private constant ADDRESS_LENGTH = 20;
/**
* @dev The `value` string doesn't fit in the specified `length`.
*/
error StringsInsufficientHexLength(uint256 value, uint256 length);
/**
* @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), HEX_DIGITS))
}
value /= 10;
if (value == 0) break;
}
return buffer;
}
}
/**
* @dev Converts a `int256` to its ASCII `string` decimal representation.
*/
function toStringSigned(int256 value) internal pure returns (string memory) {
return string.concat(value < 0 ? "-" : "", toString(SignedMath.abs(value)));
}
/**
* @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) {
uint256 localValue = value;
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_DIGITS[localValue & 0xf];
localValue >>= 4;
}
if (localValue != 0) {
revert StringsInsufficientHexLength(value, length);
}
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);
}
/**
* @dev Returns true if the two strings are equal.
*/
function equal(string memory a, string memory b) internal pure returns (bool) {
return bytes(a).length == bytes(b).length && keccak256(bytes(a)) == keccak256(bytes(b));
}
}// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
import {IAccessList} from "contracts/interfaces/IAccessList.sol";
abstract contract AccessRestricted {
IAccessList private immutable _ACCESS_LIST;
error SenderNotCommittee(address sender);
error SenderNotBridge(address sender);
modifier onlyCommittee() {
if (_ACCESS_LIST.isCommittee(msg.sender) == false) {
revert SenderNotCommittee(msg.sender);
}
_;
}
modifier onlyBridge() {
if (_ACCESS_LIST.isBridge(msg.sender) == false) {
revert SenderNotBridge(msg.sender);
}
_;
}
constructor(address accessList) {
_ACCESS_LIST = IAccessList(accessList);
}
function getAccessList() public view virtual returns (address) {
return address(_ACCESS_LIST);
}
}/** * SPDX-License-Identifier: Apache-2.0 * * Copyright (c) 2023, Circle Internet Financial, LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * TAKEN FROM: https://etherscan.io/address/0x43506849d7c04f9138d1a2050bbf3a0c054402dd#code#F9#L1 * * CHANGELOG: * 2024-08-20: Michael Duchesne ([email protected]) * - replaced imports with OpenZeppelin imports * - bumped solidity version to 0.8.24 * - replaced require with string literal for `error`s */ pragma solidity ^0.8.24; import {EIP712} from "@openzeppelin/contracts/utils/cryptography/EIP712.sol"; import {SignatureChecker} from "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; import {MessageHashUtils} from "@openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol"; error EIP3009InvalidSignature(); error EIP3009AuthorizationNotYetValid(); error EIP3009AuthorizationExpired(); error EIP3009AuthorizationUsedOrCancel(); error EIP3009ReceiverNotSender(); /** * @title EIP-3009 * @notice Provide internal implementation for gas-abstracted transfers * @dev Contracts that inherit from this must wrap these with publicly * accessible functions, optionally adding modifiers where necessary */ abstract contract EIP3009 is EIP712 { // solhint-disable-next-line // keccak256("TransferWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)") bytes32 public constant TRANSFER_WITH_AUTHORIZATION_TYPEHASH = 0x7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a2267; // solhint-disable-next-line // keccak256("ReceiveWithAuthorization(address from,address to,uint256 value,uint256 validAfter,uint256 validBefore,bytes32 nonce)") bytes32 public constant RECEIVE_WITH_AUTHORIZATION_TYPEHASH = 0xd099cc98ef71107a616c4f0f941f04c322d8e254fe26b3c6668db87aae413de8; // solhint-disable-next-line // keccak256("CancelAuthorization(address authorizer,bytes32 nonce)") bytes32 public constant CANCEL_AUTHORIZATION_TYPEHASH = 0x158b0a9edf7a828aad02f63cd515c68ef2f50ba807396f6d12842833a1597429; /** * @dev authorizer address => nonce => bool (true if nonce is used) */ mapping(address => mapping(bytes32 => bool)) private _authorizationStates; event AuthorizationUsed(address indexed authorizer, bytes32 indexed nonce); event AuthorizationCanceled( address indexed authorizer, bytes32 indexed nonce ); /** * @notice Returns the state of an authorization * @dev Nonces are randomly generated 32-byte data unique to the * authorizer's address * @param authorizer Authorizer's address * @param nonce Nonce of the authorization * @return True if the nonce is used */ function authorizationState( address authorizer, bytes32 nonce ) external view returns (bool) { return _authorizationStates[authorizer][nonce]; } function _authorizedTransfer( address from, address to, uint256 value ) internal virtual; /** * @notice Execute a transfer with a signed authorization * @param from Payer's address (Authorizer) * @param to Payee's address * @param value Amount to be transferred * @param validAfter The time after which this is valid (unix time) * @param validBefore The time before which this is valid (unix time) * @param nonce Unique nonce * @param v v of the signature * @param r r of the signature * @param s s of the signature */ function _transferWithAuthorization( address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) internal { _transferWithAuthorization( from, to, value, validAfter, validBefore, nonce, abi.encodePacked(r, s, v) ); } /** * @notice Execute a transfer with a signed authorization * @dev EOA wallet signatures should be packed in the order of r, s, v. * @param from Payer's address (Authorizer) * @param to Payee's address * @param value Amount to be transferred * @param validAfter The time after which this is valid (unix time) * @param validBefore The time before which this is valid (unix time) * @param nonce Unique nonce * @param signature Signature byte array produced by an EOA wallet or a contract wallet */ function _transferWithAuthorization( address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, bytes memory signature ) internal { _requireValidAuthorization(from, nonce, validAfter, validBefore); _requireValidSignature( from, keccak256( abi.encode( TRANSFER_WITH_AUTHORIZATION_TYPEHASH, from, to, value, validAfter, validBefore, nonce ) ), signature ); _markAuthorizationAsUsed(from, nonce); _authorizedTransfer(from, to, value); } /** * @notice Receive a transfer with a signed authorization from the payer * @dev This has an additional check to ensure that the payee's address * matches the caller of this function to prevent front-running attacks. * @param from Payer's address (Authorizer) * @param to Payee's address * @param value Amount to be transferred * @param validAfter The time after which this is valid (unix time) * @param validBefore The time before which this is valid (unix time) * @param nonce Unique nonce * @param v v of the signature * @param r r of the signature * @param s s of the signature */ function _receiveWithAuthorization( address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) internal { _receiveWithAuthorization( from, to, value, validAfter, validBefore, nonce, abi.encodePacked(r, s, v) ); } /** * @notice Receive a transfer with a signed authorization from the payer * @dev This has an additional check to ensure that the payee's address * matches the caller of this function to prevent front-running attacks. * EOA wallet signatures should be packed in the order of r, s, v. * @param from Payer's address (Authorizer) * @param to Payee's address * @param value Amount to be transferred * @param validAfter The time after which this is valid (unix time) * @param validBefore The time before which this is valid (unix time) * @param nonce Unique nonce * @param signature Signature byte array produced by an EOA wallet or a contract wallet */ function _receiveWithAuthorization( address from, address to, uint256 value, uint256 validAfter, uint256 validBefore, bytes32 nonce, bytes memory signature ) internal { if (to != msg.sender) { revert EIP3009ReceiverNotSender(); } _requireValidAuthorization(from, nonce, validAfter, validBefore); _requireValidSignature( from, keccak256( abi.encode( RECEIVE_WITH_AUTHORIZATION_TYPEHASH, from, to, value, validAfter, validBefore, nonce ) ), signature ); _markAuthorizationAsUsed(from, nonce); _authorizedTransfer(from, to, value); } /** * @notice Attempt to cancel an authorization * @param authorizer Authorizer's address * @param nonce Nonce of the authorization * @param v v of the signature * @param r r of the signature * @param s s of the signature */ function _cancelAuthorization( address authorizer, bytes32 nonce, uint8 v, bytes32 r, bytes32 s ) internal { _cancelAuthorization(authorizer, nonce, abi.encodePacked(r, s, v)); } /** * @notice Attempt to cancel an authorization * @dev EOA wallet signatures should be packed in the order of r, s, v. * @param authorizer Authorizer's address * @param nonce Nonce of the authorization * @param signature Signature byte array produced by an EOA wallet or a contract wallet */ function _cancelAuthorization( address authorizer, bytes32 nonce, bytes memory signature ) internal { _requireUnusedAuthorization(authorizer, nonce); _requireValidSignature( authorizer, keccak256( abi.encode(CANCEL_AUTHORIZATION_TYPEHASH, authorizer, nonce) ), signature ); _authorizationStates[authorizer][nonce] = true; emit AuthorizationCanceled(authorizer, nonce); } /** * @notice Mark an authorization as used * @param authorizer Authorizer's address * @param nonce Nonce of the authorization */ function _markAuthorizationAsUsed( address authorizer, bytes32 nonce ) private { _authorizationStates[authorizer][nonce] = true; emit AuthorizationUsed(authorizer, nonce); } /** * @notice Validates that signature against input data struct * @param signer Signer's address * @param dataHash Hash of encoded data struct * @param signature Signature byte array produced by an EOA wallet or a contract wallet */ function _requireValidSignature( address signer, bytes32 dataHash, bytes memory signature ) private view { if ( !SignatureChecker.isValidSignatureNow( signer, MessageHashUtils.toTypedDataHash( _domainSeparatorV4(), dataHash ), signature ) ) { revert EIP3009InvalidSignature(); } } /** * @notice Check that an authorization is unused * @param authorizer Authorizer's address * @param nonce Nonce of the authorization */ function _requireUnusedAuthorization( address authorizer, bytes32 nonce ) private view { if(_authorizationStates[authorizer][nonce]) { revert EIP3009AuthorizationUsedOrCancel(); } } /** * @notice Check that authorization is valid * @param authorizer Authorizer's address * @param nonce Nonce of the authorization * @param validAfter The time after which this is valid (unix time) * @param validBefore The time before which this is valid (unix time) */ function _requireValidAuthorization( address authorizer, bytes32 nonce, uint256 validAfter, uint256 validBefore ) private view { if(block.timestamp <= validAfter) { // solhint-disable-line not-rely-on-time revert EIP3009AuthorizationNotYetValid(); } if(block.timestamp >= validBefore) { // solhint-disable-line not-rely-on-time revert EIP3009AuthorizationExpired(); } _requireUnusedAuthorization(authorizer, nonce); } }
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.24;
import { IAccessControl} from "@openzeppelin/contracts/access/IAccessControl.sol";
/**
* @title RizeAccessList
* @author [email protected]
* @notice
*
* Contains addresses of system contracts and roles
*
*/
interface IAccessList is IAccessControl {
function setRoleAdmin(bytes32 role, bytes32 admin) external;
function isCommittee(address addrezz) external view returns(bool);
function isBridge(address addrezz) external view returns(bool);
function getBonds() external view returns(address);
function getToken() external view returns(address);
function getGovernanceBonding() external view returns(address);
function getTreasury() external view returns(address);
}{
"viaIR": true,
"optimizer": {
"enabled": true,
"runs": 200,
"details": {
"yulDetails": {
"optimizerSteps": "u"
}
}
},
"evmVersion": "paris",
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- Hashlock - March 2025 - Security Audit Report
Contract ABI
API[{"inputs":[{"internalType":"address","name":"accessList","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ECDSAInvalidSignature","type":"error"},{"inputs":[{"internalType":"uint256","name":"length","type":"uint256"}],"name":"ECDSAInvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"ECDSAInvalidSignatureS","type":"error"},{"inputs":[],"name":"EIP3009AuthorizationExpired","type":"error"},{"inputs":[],"name":"EIP3009AuthorizationNotYetValid","type":"error"},{"inputs":[],"name":"EIP3009AuthorizationUsedOrCancel","type":"error"},{"inputs":[],"name":"EIP3009InvalidSignature","type":"error"},{"inputs":[],"name":"EIP3009ReceiverNotSender","type":"error"},{"inputs":[{"internalType":"uint256","name":"increasedSupply","type":"uint256"},{"internalType":"uint256","name":"cap","type":"uint256"}],"name":"ERC20ExceededCap","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"allowance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientAllowance","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"}],"name":"ERC20InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC20InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"cap","type":"uint256"}],"name":"ERC20InvalidCap","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC20InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC20InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"spender","type":"address"}],"name":"ERC20InvalidSpender","type":"error"},{"inputs":[{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"ERC2612ExpiredSignature","type":"error"},{"inputs":[{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC2612InvalidSigner","type":"error"},{"inputs":[{"internalType":"uint256","name":"maxLoan","type":"uint256"}],"name":"ERC3156ExceededMaxLoan","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC3156InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"ERC3156UnsupportedToken","type":"error"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"FeeTooBig","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"currentNonce","type":"uint256"}],"name":"InvalidAccountNonce","type":"error"},{"inputs":[],"name":"InvalidShortString","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"SenderNotBridge","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"SenderNotCommittee","type":"error"},{"inputs":[{"internalType":"string","name":"str","type":"string"}],"name":"StringTooLong","type":"error"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TransferFailed","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"authorizer","type":"address"},{"indexed":true,"internalType":"bytes32","name":"nonce","type":"bytes32"}],"name":"AuthorizationCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"authorizer","type":"address"},{"indexed":true,"internalType":"bytes32","name":"nonce","type":"bytes32"}],"name":"AuthorizationUsed","type":"event"},{"anonymous":false,"inputs":[],"name":"EIP712DomainChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newValue","type":"uint256"}],"name":"FlashloanFeesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"inputs":[],"name":"CANCEL_AUTHORIZATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"RECEIVE_WITH_AUTHORIZATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TRANSFER_WITH_AUTHORIZATION_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"authorizer","type":"address"},{"internalType":"bytes32","name":"nonce","type":"bytes32"}],"name":"authorizationState","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"authorizer","type":"address"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"cancelAuthorization","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"eip712Domain","outputs":[{"internalType":"bytes1","name":"fields","type":"bytes1"},{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"uint256","name":"chainId","type":"uint256"},{"internalType":"address","name":"verifyingContract","type":"address"},{"internalType":"bytes32","name":"salt","type":"bytes32"},{"internalType":"uint256[]","name":"extensions","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"flashFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC3156FlashBorrower","name":"receiver","type":"address"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"flashLoan","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getAccessList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"}],"name":"maxFlashLoan","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"validAfter","type":"uint256"},{"internalType":"uint256","name":"validBefore","type":"uint256"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"receiveWithAuthorization","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"feesBps","type":"uint256"}],"name":"setFeesBps","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"validAfter","type":"uint256"},{"internalType":"uint256","name":"validBefore","type":"uint256"},{"internalType":"bytes32","name":"nonce","type":"bytes32"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"transferWithAuthorization","outputs":[],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
6101a060405234620000a3576200001f6200001962000146565b6200021d565b6040516126036200087b8239608051816116f2015260a0518161171f015260c051816116bf015260e05181611be201526101005181611bc1015261012051816118ca015261014051816118f70152610160518181816103cb01526120f2015261018051818181610c26015281816110cf015281816111020152611409015261260390f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b90601f01601f191681019081106001600160401b03821117620000e057604052565b620000a8565b90620000fd620000f560405190565b9283620000be565b565b6001600160a01b031690565b90565b6001600160a01b03811603620000a357565b90505190620000fd826200010e565b90602082820312620000a3576200010b9162000120565b6200010b62002e7e803803806200015d81620000e6565b9283398101906200012f565b634e487b7160e01b600052601160045260246000fd5b60ff16604d81116200019157600a0a90565b62000169565b6200010b6200010b6200010b9290565b818102929181159184041417156200019157565b6001600160401b038111620000e057602090601f01601f19160190565b0190565b90620001f2620001ec83620001bb565b620000e6565b918252565b620002036004620001dc565b6352495a4560e01b602082015290565b6200010b620001f7565b620000fd90620002506200023a6200023462000622565b6200017f565b6200024a64012a05f20062000197565b620001a7565b6200025a62000213565b6200026462000213565b916200026f62000213565b93620002a2565b6200010b90620000ff906001600160a01b031682565b6200010b9062000276565b6200010b906200028c565b92620002b492620002ba9592620002c0565b62000297565b61018052565b90620000fd939291620002ef565b620002d99062000197565b9052565b602081019291620000fd9190620002ce565b929091620002fd926200035b565b62000309600062000197565b8114620003165761016052565b60405163392e1e2760e01b81528062000334600060048301620002dd565b0390fd5b620003446001620001dc565b603160f81b602082015290565b6200010b62000338565b90620000fd92916200036c62000351565b620000fd93929162000388620003c894620003ad9394620003fb565b620003956005826200063a565b61012052620003a66006846200063a565b6101405290565b620003c1620003ba825190565b9160200190565b2060e05290565b620003d5620003ba825190565b20610100524660a052620003e8620006d3565b608052620003f63062000297565b60c052565b620000fd91829182918291620005f2565b634e487b7160e01b600052602260045260246000fd5b906001600283049216801562000445575b60208310146200043f57565b6200040c565b91607f169162000433565b9190620004656200010b6200047d9362000197565b90835460001960089290920291821b191691901b1790565b9055565b620000fd9160009162000450565b8181106200049b575050565b80620004ab600060019362000481565b016200048f565b9190601f8111620004c257505050565b620004d6620000fd93600052602060002090565b906020601f840181900483019310620004fa575b6020601f9091010401906200048f565b9091508190620004ea565b906200050f815190565b906001600160401b038211620000e057620005378262000530855462000422565b85620004b2565b602090601f831160011462000576576200047d9291600091836200056a575b5050600019600883021c1916906002021790565b01519050388062000556565b601f198316916200058c85600052602060002090565b9260005b818110620005cd57509160029391856001969410620005b3575b50505002019055565b01516000196008601f8516021c19169055388080620005aa565b9193602060018192878701518155019501920162000590565b90620000fd9162000505565b9062000604620000fd926003620005e6565b6004620005e6565b6200061c6200010b6200010b9290565b60ff1690565b6200010b60126200060c565b6200010b60ff62000197565b8051620006506200064c602062000197565b9190565b101562000663576200010b915062000805565b600062000671620006789390565b01620005e6565b6200010b6200010b6200062e565b90959492620000fd94620006bd620006c492620006b6608096620006af60a088019c6000890152565b6020870152565b6040850152565b6060830152565b01906001600160a01b03169052565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620007376200070260e05190565b61010051906200072a620007163062000297565b604051958694602086019446928662000686565b90810382520382620000be565b62000744620003ba825190565b2090565b60005b8381106200075c5750506000910152565b81810151838201526020016200074b565b620007926200079c602093620001d89362000786815190565b80835293849260200190565b9586910162000748565b601f01601f191690565b60208082526200010b929101906200076d565b620007d5620007d1620007ca835190565b9260200190565b5190565b9060208110620007e3575090565b620007f690600019906020036008021b90565b1690565b6200010b9062000197565b806200080f825190565b6200081f6200064c601f62000197565b116200085457506200010b816200084d62000848620008426200010b95620007b9565b620007fa565b915190565b1762000197565b62000334906200086360405190565b63305a27a960e01b815291829160048301620007a656fe6080604052600436101561001257600080fd5b60003560e01c806306fdde03146101d2578063095ea7b3146101cd57806318160ddd146101c857806323b872dd146101c3578063313ce567146101be578063355274ea146101b95780633644e515146101b457806342966c68146101af5780635a049a70146101aa5780635cffe9de146101a5578063613255ab146101a057806370a082311461019b5780637ecebe00146101965780637f2eecc31461019157806384b0196e1461018c5780638d5ddbb31461018757806395d89b4114610182578063a0712d681461017d578063a0cc6a6814610178578063a9059cbb14610173578063d505accf1461016e578063d916948714610169578063d9d98ce414610164578063dd62ed3e1461015f578063e3ee160e1461015a578063e94a010214610155578063ec2cbbf4146101505763ef55bec6036101e2576109ff565b6109e7565b6109cb565b6109a9565b61090e565b6108cf565b6108b4565b610864565b6107e9565b6107ce565b610785565b61076a565b610735565b610701565b610614565b6105bb565b6105a0565b610585565b610552565b610496565b61041e565b6103ef565b6103b6565b610387565b61036b565b610316565b6102e8565b610256565b60009103126101e257565b600080fd5b60005b8381106101fa5750506000910152565b81810151838201526020016101ea565b61022b61023460209361023e9361021f815190565b80835293849260200190565b958691016101e7565b601f01601f191690565b0190565b60208082526102539291019061020a565b90565b346101e2576102663660046101d7565b61027d610271610b56565b60405191829182610242565b0390f35b6001600160a01b031690565b6001600160a01b0381165b036101e257565b905035906102ac8261028d565b565b80610298565b905035906102ac826102ae565b91906040838203126101e2576102539060206102dd828661029f565b94016102b4565b9052565b346101e25761027d6103046102fe3660046102c1565b90610b60565b60405191829182901515815260200190565b346101e2576103263660046101d7565b61027d610331610b81565b6040515b9182918290815260200190565b90916060828403126101e25761025361035b848461029f565b9360406102dd826020870161029f565b346101e25761027d610304610381366004610342565b91610b8b565b346101e2576103973660046101d7565b61027d6103a2610bb4565b6040519182918260ff909116815260200190565b346101e2576103c63660046101d7565b61027d7f0000000000000000000000000000000000000000000000000000000000000000610331565b346101e2576103ff3660046101d7565b61027d610331610bbe565b906020828203126101e257610253916102b4565b346101e25761043661043136600461040a565b610cf3565b604051005b60ff8116610298565b905035906102ac8261043b565b919060a0838203126101e257610467818461029f565b9261047582602083016102b4565b926102536104868460408501610444565b9360806102dd82606087016102b4565b346101e2576104366104a9366004610451565b93929092610cfc565b6001600160a01b038116610298565b905035906102ac826104b2565b909182601f830112156101e25781359167ffffffffffffffff83116101e25760200192600183028401116101e257565b906080828203126101e25761051381836104c1565b92610521826020850161029f565b9261052f83604083016102b4565b92606082013567ffffffffffffffff81116101e25761054e92016104ce565b9091565b346101e25761027d6103046105683660046104fe565b93929092610dea565b906020828203126101e2576102539161029f565b346101e25761027d61033161059b366004610571565b610f9e565b346101e25761027d6103316105b6366004610571565b610ff4565b346101e25761027d6103316105d1366004610571565b611010565b6102536102536102539290565b6102537fd099cc98ef71107a616c4f0f941f04c322d8e254fe26b3c6668db87aae413de86105d6565b6102536105e3565b346101e2576106243660046101d7565b61027d61033161060c565b9061064f61064861063e845190565b8084529260200190565b9260200190565b9060005b8181106106605750505090565b90919261067d6106766001928651815260200190565b9460200190565b929101610653565b939591946106dd6106d56106f4956106c76106ed956102539c9a6106ba60e08c019260008d01906001600160f81b0319169052565b8a820360208c015261020a565b9088820360408a015261020a565b976060870152565b6001600160a01b03166080850152565b60a0830152565b60c081840391015261062f565b346101e2576107113660046101d7565b61027d61071c611084565b9361072c97959793919360405190565b97889788610685565b346101e2576107453660046101d7565b61027d6107506110ca565b604051918291826001600160a01b03909116815260200190565b346101e25761077a3660046101d7565b61027d6102716110f3565b346101e25761043661079836600461040a565b61119c565b6102537f7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a22676105d6565b61025361079d565b346101e2576107de3660046101d7565b61027d6103316107c6565b346101e25761027d6103046107ff3660046102c1565b906111a5565b60e0818303126101e257610819828261029f565b92610827836020840161029f565b9261083581604085016102b4565b9261084382606083016102b4565b926102536108548460808501610444565b9360c06102dd8260a087016102b4565b346101e257610436610877366004610805565b95949094939193611234565b6102537f158b0a9edf7a828aad02f63cd515c68ef2f50ba807396f6d12842833a15974296105d6565b610253610883565b346101e2576108c43660046101d7565b61027d6103316108ac565b346101e25761027d6103316108e53660046102c1565b9061133d565b91906040838203126101e257610253906020610907828661029f565b940161029f565b346101e25761027d6103316109243660046108eb565b90611395565b9091610120828403126101e257610941838361029f565b9261094f816020850161029f565b9261095d82604083016102b4565b9261096b83606084016102b4565b9261097981608085016102b4565b926109878260a083016102b4565b926102536109988460c08501610444565b936101006102dd8260e087016102b4565b346101e2576104366109bc36600461092a565b979690969591959492946113b5565b346101e25761027d6103046109e13660046102c1565b906113df565b346101e2576104366109fa36600461040a565b611549565b346101e257610436610a1236600461092a565b97969096959195949294611552565b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015610a57575b6020831014610a5257565b610a21565b91607f1691610a47565b80546000939291610a7e610a7483610a37565b8085529360200190565b9160018116908115610ad05750600114610a9757505050565b610aaa9192939450600052602060002090565b916000925b818410610abc5750500190565b805484840152602090930192600101610aaf565b92949550505060ff1916825215156020020190565b9061025391610a61565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff821117610b2757604052565b610aef565b906102ac610b4692610b3d60405190565b93848092610ae5565b0383610b05565b61025390610b2c565b6102536003610b4d565b610b6b919033611563565b600190565b6102539081565b6102539054610b70565b6102536002610b77565b610b6b929190610b9c833383611597565b6115fc565b610bae6102536102539290565b60ff1690565b6102536012610ba1565b6102536116a9565b61025390610281906001600160a01b031682565b61025390610bc6565b61025390610bda565b801515610298565b905051906102ac82610bec565b906020828203126101e25761025391610bf4565b6040513d6000823e3d90fd5b610c4a7f0000000000000000000000000000000000000000000000000000000000000000610be3565b6020610c5560405190565b633933006760e11b815233600482015291829060249082905afa908115610ce457600091610cb5575b50610c8b60005b91151590565b14610c99576102ac90610ce9565b604051632058b2c960e01b8152336004820152602490fd5b0390fd5b610cd7915060203d602011610cdd575b610ccf8183610b05565b810190610c01565b38610c7e565b503d610cc5565b610c15565b6102ac9033611745565b6102ac90610c21565b906102ac9493929161179e565b905051906102ac826102ae565b906020828203126101e25761025391610d09565b90826000939282370152565b919061023481610d4d8161023e9560209181520190565b8095610d2a565b9193610d98610d9f929694610d916102539997610d8160a088019a60008901906001600160a01b03169052565b6001600160a01b03166020870152565b6040850152565b6060830152565b6080818503910152610d36565b634e487b7160e01b600052601160045260246000fd5b91908201809211610dcf57565b610dac565b6102816102536102539290565b61025390610dd4565b919392610df682610f9e565b808611610f6a575081602091610e48610e19610e1389809761133d565b96610be3565b96610e2486896117e3565b339287610e3060405190565b97889687966323e30c8b60e01b885260048801610d54565b03816000875af1908115610ce457600091610f3b575b50610e887f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd95b9190565b03610f0b57610e95611841565b610eb2610ea130610be3565b610eab8487610dc2565b9085611597565b610ebc60006105d6565b82148015610eed575b15610ede5750610ed890610b6b93610dc2565b90611745565b9091610b9c610b6b9482611745565b50610efb6102816000610de1565b6001600160a01b03821614610ec5565b610cb182610f1860405190565b62678c5b60e81b8152918291600483016001600160a01b03909116815260200190565b610f5d915060203d602011610f63575b610f558183610b05565b810190610d16565b38610e5e565b503d610f4b565b610cb190610f7760405190565b63fd9a760960e01b81529182916004830190815260200190565b91908203918211610dcf57565b610fba610fad61028130610be3565b916001600160a01b031690565b03610fd257610253610fca610b81565b600019610f91565b61025360006105d6565b90610fe690610be3565b600052602052604060002090565b61100b61025391611003600090565b506000610fdc565b610b77565b610253906118ae565b906102ac61102660405190565b9283610b05565b67ffffffffffffffff8111610b275760208091020190565b906110576110528361102d565b611019565b918252565b369037565b906102ac61107761107184611045565b9361102d565b601f19016020840161105c565b61108c6118c5565b906110956118f2565b9061109f30610be3565b6110a960006105d6565b6110bb6110b660006105d6565b611061565b600f60f81b9594934693929190565b6102537f0000000000000000000000000000000000000000000000000000000000000000610be3565b6102536004610b4d565b6111267f0000000000000000000000000000000000000000000000000000000000000000610be3565b602061113160405190565b633933006760e11b815233600482015291829060249082905afa908115610ce457600091611173575b506111656000610c85565b14610c99576102ac90611192565b61118c915060203d602011610cdd57610ccf8183610b05565b3861115a565b6102ac90336117e3565b6102ac906110fd565b610b6b9190336115fc565b91946111ff611206929897956111f860a0966111e86102ac9a6111d860c08a019e60008b0152565b6001600160a01b03166020890152565b6001600160a01b03166040870152565b6060850152565b6080830152565b0152565b6001600160a01b0390911681526040810192916102ac916020905b01906001600160a01b03169052565b9695929491949390936112448190565b421161131657906112c9856112b18a6112ce9796956112a56112837f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c990565b9161128d8461191d565b8d61129760405190565b9788966020880196876111b0565b90810382520382610b05565b6112c36112bc825190565b9160200190565b20611940565b611969565b6001600160a01b0385166001600160a01b038216036112f257506102ac9293611563565b8490610cb161130060405190565b6325c0072360e11b81529283926004840161120a565b610cb19061132360405190565b63313c898160e11b81529182916004830190815260200190565b919061134b61028130610be3565b6001600160a01b038416036113645761025391926119c2565b610cb18361137160405190565b635ad3edc960e11b8152918291600483016001600160a01b03909116815260200190565b610253916113b061100b926113a8600090565b506001610fdc565b610fdc565b906102ac98979695949392916119f4565b90610fe6565b61025390610bae565b61025390546113cc565b610253916113fa6113ff926113f2600090565b506008610fdc565b6113c6565b6113d5565b61142d7f0000000000000000000000000000000000000000000000000000000000000000610be3565b602061143860405190565b638c9540d360e01b815233600482015291829060249082905afa908115610ce457600091611492575b5061146c6000610c85565b1461147a576102ac906114dc565b6040516344a2365760e01b8152336004820152602490fd5b6114ab915060203d602011610cdd57610ccf8183610b05565b38611461565b90600019905b9181191691161790565b906114d16102536114d8926105d6565b82546114b1565b9055565b6114e76127106105d6565b81116115225761151d816103317fa30f95d0e8219f814ad2f2deda3c45af61229359c8102895c736253d1dae174e9360096114c1565b0390a1565b610cb19061152f60405190565b631e57e2d960e21b81529182916004830190815260200190565b6102ac90611404565b906102ac9897969594939291611a3d565b916001916102ac93611a5d565b6001600160a01b0390911681526060810193926102ac929091604091611206906020830152565b916115a28284611395565b60001981036115b2575b50505050565b8181106115d857916115c96115cf94926000940390565b91611a5d565b388080806115ac565b82610cb1836115e660405190565b637dc7a0d960e11b815293849360048501611570565b9291906116096000610de1565b936001600160a01b0385166001600160a01b03821614611678576001600160a01b0385166001600160a01b03831614611647576102ac939450611b65565b610cb18561165460405190565b63ec442f0560e01b8152918291600483016001600160a01b03909116815260200190565b610cb18561168560405190565b634b637e8f60e11b8152918291600483016001600160a01b03909116815260200190565b6116b230610be3565b6116e46001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016610fad565b148061171c575b15611714577f000000000000000000000000000000000000000000000000000000000000000090565b610253611b9b565b507f000000000000000000000000000000000000000000000000000000000000000046146116eb565b91906117516000610de1565b926001600160a01b0384166001600160a01b0382161461177657926102ac9293611b65565b610cb18461168560405190565b6102e49060ff1660f81b90565b01918252565b018092611783565b9091926102ac946117de916117d26117b560405190565b60208082019384529097889460019261023e916117968288611790565b90810382520384610b05565b611c72565b91906117ef6000610de1565b926001600160a01b0384166001600160a01b03821614611813576102ac9293611b65565b610cb18461165460405190565b905051906102ac8261028d565b906020828203126101e25761025391611820565b61185461184f61184f6110ca565b610be3565b602061185f60405190565b631d8cf42560e11b815291829060049082905afa908115610ce457600091611885575090565b610253915060203d6020116118a7575b61189f8183610b05565b81019061182d565b503d611895565b61100b610253916118bd600090565b506007610fdc565b6102537f000000000000000000000000000000000000000000000000000000000000000060055b90611da7565b6102537f000000000000000000000000000000000000000000000000000000000000000060066118ec565b6119289060006118bd565b61025361193482610b77565b91600183015b906114c1565b6102539061194c6116a9565b6042916040519161190160f01b8352600283015260228201522090565b9161025393916119819361197b600090565b50611e09565b90929192611eff565b81810292918115918404141715610dcf57565b634e487b7160e01b600052601260045260246000fd5b81156119bd570490565b61199d565b506119e3610253916119d2600090565b506119dd6009610b77565b9061198a565b6119ee6127106105d6565b906119b3565b909192939495966102ac98611a3891611a2c611a0f60405190565b6020808201938452909b8c9460019261023e916117968288611790565b90810382520388610b05565b611fc8565b909192939495966102ac98611a5891611a2c611a0f60405190565b612069565b909192611a6a6000610de1565b6001600160a01b0381166001600160a01b03841614611b34576001600160a01b0381166001600160a01b03851614611b035750611ab584611ab0856113b0866001610fdc565b6114c1565b611abe57505050565b611afe611af4611aee7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92593610be3565b93610be3565b9361033560405190565b0390a3565b610cb190611b1060405190565b634a1406b160e11b8152918291600483016001600160a01b03909116815260200190565b610cb190611b4160405190565b63e602df0560e01b8152918291600483016001600160a01b03909116815260200190565b906102ac92916120ce565b909594926102ac94610d9861122592610d91608096611b9460a088019c6000890152565b6020870152565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611c207f00000000000000000000000000000000000000000000000000000000000000007f00000000000000000000000000000000000000000000000000000000000000006112a5611c0d30610be3565b6040519586946020860194469286611b70565b611c2b6112bc825190565b2090565b9081526001600160a01b0390911660208201526060810192916102ac9160400152565b9060ff906114b7565b90611c6b6102536114d892151590565b8254611c52565b610e8490611cc0611cd99394611c888684612146565b611c90610883565b611cae611c9c60405190565b80926112a58a88602085019384611c2f565b611cb96112bc825190565b2083612170565b61184f6001611cd4866113fa856008610fdc565b611c5b565b907f1cdd46ff242716cdaa72d159d339a485b3438398348d68f09d7c8c0a59353d81611d0460405190565b8080611afe565b61025360ff6105d6565b80546000939291611d28610a7483610a37565b9160018116908115610ad05750600114611d4157505050565b611d549192939450600052602060002090565b916000925b818410611d665750500190565b805484840152602090930192600101611d59565b9061025391611d15565b906102ac610b4692611d9560405190565b93848092611d7a565b61025390611d84565b9081611db7610e84610253611d0b565b14611dc65750610253906121e6565b6102539150611d9e565b610253906105d6565b6112066102ac94611e02606094989795611df8608086019a6000870152565b60ff166020850152565b6040830152565b9091611e1484611dd0565b611e40610e847f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a06105d6565b11611ebc5790611e6260209460009493611e5960405190565b94859485611dd9565b838052039060015afa15610ce457600051600091611e7f83610de1565b6001600160a01b0381166001600160a01b03841614611ea85750611ea2836105d6565b91929190565b915091611eb4906105d6565b909160019190565b505050611ec96000610de1565b9160039190565b634e487b7160e01b600052602160045260246000fd5b60041115611ef057565b611ed0565b906102ac82611ee6565b611f096000611ef5565b611f1282611ef5565b03611f1b575050565b611f256001611ef5565b611f2e82611ef5565b03611f455760405163f645eedf60e01b8152600490fd5b611f4f6002611ef5565b611f5882611ef5565b03611f8657610cb1611f6983611dd0565b60405163fce698f760e01b81529182916004830190815260200190565b611f99611f936003611ef5565b91611ef5565b14611fa15750565b610cb190611fae60405190565b6335e2f38360e21b81529182916004830190815260200190565b926102ac968261204c86866112a58b612064999c989b61205e98611fee8282858961220d565b611ff661079d565b9461200060405190565b9889976020890197889081526001600160a01b03909116602082015260e081019695949093909290916001600160a01b031660408501526060840152608083015260a082015260c00152565b6120576112bc825190565b2085612170565b8261224b565b612291565b919490939192336001600160a01b038616036120a9576102ac968561204c86896112a58789886120a16120649c61205e9b858961220d565b611ff66105e3565b60405163e463812b60e01b8152600490fd5b9081526040810192916102ac9160200152565b916120d9918361229c565b6120e9610fad6102816000610de1565b146120f057565b7f0000000000000000000000000000000000000000000000000000000000000000612119610b81565b818111612124575050565b610cb161213060405190565b63279e7e1560e21b8152928392600484016120bb565b612158916113fa6113ff926008610fdc565b61215e57565b604051636d79346160e11b8152600490fd5b9161218e9261218461218a9361194c6116a9565b906123d1565b1590565b61219457565b60405163a6acd33360e01b8152600490fd5b67ffffffffffffffff8111610b2757602090601f01601f19160190565b90611057611052836121a6565b906102ac6110776121e0846121c3565b936121a6565b6121ef81612433565b906122026121fd60206105d6565b6121d0565b918252602082015290565b92909142111561223957421015612227576102ac91612146565b60405163b914715760e01b8152600490fd5b604051631cd39ae560e21b8152600490fd5b610e846122669161184f6001611cd4866113fa856008610fdc565b907f98de503528ee59b575ef0c0a2576a82497bfc029a5685b209e9ec333479b10a5611d0460405190565b906102ac92916115fc565b8160006122a881610de1565b6001600160a01b0381166001600160a01b0385160361234f577fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef93611afe93611af49361230f611aee946102816123088c6123036002610b77565b610dc2565b60026114c1565b6001600160a01b0383160361233557505061184f612308886123316002610b77565b0390565b61184f9161234291610fdc565b61193a8961023e83610b77565b90915061235f61100b8484610fdc565b8581106123ad577fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9385611afe9461230f611af4956102816123a38c611aee980390565b611ab08786610fdc565b83610cb1876123bb60405190565b63391434e360e21b815293849360048501611570565b91906123dd828261247b565b506123ee611f936000969396611ef5565b149384612416575b508315612404575b50505090565b61240e935061251a565b3880806123fe565b90935061242b6001600160a01b038516610fad565b1492386123f6565b61244661244b91612442600090565b5090565b611dd0565b61245560ff6105d6565b16612460601f6105d6565b81116124695790565b604051632cd44ac360e21b8152600490fd5b90600091612487825190565b612494610e8460416105d6565b036124be576124b792506020820151906060604084015193015160001a90611e09565b9192909190565b5090506124db6124d66124d16000610de1565b925190565b6105d6565b909160029190565b9081526040602082018190526102539291019061020a565b3d156125155761250a3d6121c3565b903d6000602084013e565b606090565b91600092612560849361252b600090565b5061255161253860405190565b630b135d3f60e11b6020820152948592602484016124e3565b60208201810382520383610b05565b602082519201905afa6125716124fb565b816125ae575b81612580575090565b61259a9150602061258f825190565b818301019101610d16565b6125aa630b135d3f60e11b610e84565b1490565b90506125b8815190565b6125c5610e8460206105d6565b10159061257756fea2646970667358221220d6e3a94a3f839edfb51aab97804a8439f7847cf5f675068d7d3da499665b16ab64736f6c63430008180033000000000000000000000000136a429bee94a5a02240ff74023b46347cae87c9
Deployed Bytecode
0x6080604052600436101561001257600080fd5b60003560e01c806306fdde03146101d2578063095ea7b3146101cd57806318160ddd146101c857806323b872dd146101c3578063313ce567146101be578063355274ea146101b95780633644e515146101b457806342966c68146101af5780635a049a70146101aa5780635cffe9de146101a5578063613255ab146101a057806370a082311461019b5780637ecebe00146101965780637f2eecc31461019157806384b0196e1461018c5780638d5ddbb31461018757806395d89b4114610182578063a0712d681461017d578063a0cc6a6814610178578063a9059cbb14610173578063d505accf1461016e578063d916948714610169578063d9d98ce414610164578063dd62ed3e1461015f578063e3ee160e1461015a578063e94a010214610155578063ec2cbbf4146101505763ef55bec6036101e2576109ff565b6109e7565b6109cb565b6109a9565b61090e565b6108cf565b6108b4565b610864565b6107e9565b6107ce565b610785565b61076a565b610735565b610701565b610614565b6105bb565b6105a0565b610585565b610552565b610496565b61041e565b6103ef565b6103b6565b610387565b61036b565b610316565b6102e8565b610256565b60009103126101e257565b600080fd5b60005b8381106101fa5750506000910152565b81810151838201526020016101ea565b61022b61023460209361023e9361021f815190565b80835293849260200190565b958691016101e7565b601f01601f191690565b0190565b60208082526102539291019061020a565b90565b346101e2576102663660046101d7565b61027d610271610b56565b60405191829182610242565b0390f35b6001600160a01b031690565b6001600160a01b0381165b036101e257565b905035906102ac8261028d565b565b80610298565b905035906102ac826102ae565b91906040838203126101e2576102539060206102dd828661029f565b94016102b4565b9052565b346101e25761027d6103046102fe3660046102c1565b90610b60565b60405191829182901515815260200190565b346101e2576103263660046101d7565b61027d610331610b81565b6040515b9182918290815260200190565b90916060828403126101e25761025361035b848461029f565b9360406102dd826020870161029f565b346101e25761027d610304610381366004610342565b91610b8b565b346101e2576103973660046101d7565b61027d6103a2610bb4565b6040519182918260ff909116815260200190565b346101e2576103c63660046101d7565b61027d7f00000000000000000000000000000000000000001027e72f1f12813088000000610331565b346101e2576103ff3660046101d7565b61027d610331610bbe565b906020828203126101e257610253916102b4565b346101e25761043661043136600461040a565b610cf3565b604051005b60ff8116610298565b905035906102ac8261043b565b919060a0838203126101e257610467818461029f565b9261047582602083016102b4565b926102536104868460408501610444565b9360806102dd82606087016102b4565b346101e2576104366104a9366004610451565b93929092610cfc565b6001600160a01b038116610298565b905035906102ac826104b2565b909182601f830112156101e25781359167ffffffffffffffff83116101e25760200192600183028401116101e257565b906080828203126101e25761051381836104c1565b92610521826020850161029f565b9261052f83604083016102b4565b92606082013567ffffffffffffffff81116101e25761054e92016104ce565b9091565b346101e25761027d6103046105683660046104fe565b93929092610dea565b906020828203126101e2576102539161029f565b346101e25761027d61033161059b366004610571565b610f9e565b346101e25761027d6103316105b6366004610571565b610ff4565b346101e25761027d6103316105d1366004610571565b611010565b6102536102536102539290565b6102537fd099cc98ef71107a616c4f0f941f04c322d8e254fe26b3c6668db87aae413de86105d6565b6102536105e3565b346101e2576106243660046101d7565b61027d61033161060c565b9061064f61064861063e845190565b8084529260200190565b9260200190565b9060005b8181106106605750505090565b90919261067d6106766001928651815260200190565b9460200190565b929101610653565b939591946106dd6106d56106f4956106c76106ed956102539c9a6106ba60e08c019260008d01906001600160f81b0319169052565b8a820360208c015261020a565b9088820360408a015261020a565b976060870152565b6001600160a01b03166080850152565b60a0830152565b60c081840391015261062f565b346101e2576107113660046101d7565b61027d61071c611084565b9361072c97959793919360405190565b97889788610685565b346101e2576107453660046101d7565b61027d6107506110ca565b604051918291826001600160a01b03909116815260200190565b346101e25761077a3660046101d7565b61027d6102716110f3565b346101e25761043661079836600461040a565b61119c565b6102537f7c7c6cdb67a18743f49ec6fa9b35f50d52ed05cbed4cc592e13b44501c1a22676105d6565b61025361079d565b346101e2576107de3660046101d7565b61027d6103316107c6565b346101e25761027d6103046107ff3660046102c1565b906111a5565b60e0818303126101e257610819828261029f565b92610827836020840161029f565b9261083581604085016102b4565b9261084382606083016102b4565b926102536108548460808501610444565b9360c06102dd8260a087016102b4565b346101e257610436610877366004610805565b95949094939193611234565b6102537f158b0a9edf7a828aad02f63cd515c68ef2f50ba807396f6d12842833a15974296105d6565b610253610883565b346101e2576108c43660046101d7565b61027d6103316108ac565b346101e25761027d6103316108e53660046102c1565b9061133d565b91906040838203126101e257610253906020610907828661029f565b940161029f565b346101e25761027d6103316109243660046108eb565b90611395565b9091610120828403126101e257610941838361029f565b9261094f816020850161029f565b9261095d82604083016102b4565b9261096b83606084016102b4565b9261097981608085016102b4565b926109878260a083016102b4565b926102536109988460c08501610444565b936101006102dd8260e087016102b4565b346101e2576104366109bc36600461092a565b979690969591959492946113b5565b346101e25761027d6103046109e13660046102c1565b906113df565b346101e2576104366109fa36600461040a565b611549565b346101e257610436610a1236600461092a565b97969096959195949294611552565b634e487b7160e01b600052602260045260246000fd5b9060016002830492168015610a57575b6020831014610a5257565b610a21565b91607f1691610a47565b80546000939291610a7e610a7483610a37565b8085529360200190565b9160018116908115610ad05750600114610a9757505050565b610aaa9192939450600052602060002090565b916000925b818410610abc5750500190565b805484840152602090930192600101610aaf565b92949550505060ff1916825215156020020190565b9061025391610a61565b634e487b7160e01b600052604160045260246000fd5b90601f01601f1916810190811067ffffffffffffffff821117610b2757604052565b610aef565b906102ac610b4692610b3d60405190565b93848092610ae5565b0383610b05565b61025390610b2c565b6102536003610b4d565b610b6b919033611563565b600190565b6102539081565b6102539054610b70565b6102536002610b77565b610b6b929190610b9c833383611597565b6115fc565b610bae6102536102539290565b60ff1690565b6102536012610ba1565b6102536116a9565b61025390610281906001600160a01b031682565b61025390610bc6565b61025390610bda565b801515610298565b905051906102ac82610bec565b906020828203126101e25761025391610bf4565b6040513d6000823e3d90fd5b610c4a7f000000000000000000000000136a429bee94a5a02240ff74023b46347cae87c9610be3565b6020610c5560405190565b633933006760e11b815233600482015291829060249082905afa908115610ce457600091610cb5575b50610c8b60005b91151590565b14610c99576102ac90610ce9565b604051632058b2c960e01b8152336004820152602490fd5b0390fd5b610cd7915060203d602011610cdd575b610ccf8183610b05565b810190610c01565b38610c7e565b503d610cc5565b610c15565b6102ac9033611745565b6102ac90610c21565b906102ac9493929161179e565b905051906102ac826102ae565b906020828203126101e25761025391610d09565b90826000939282370152565b919061023481610d4d8161023e9560209181520190565b8095610d2a565b9193610d98610d9f929694610d916102539997610d8160a088019a60008901906001600160a01b03169052565b6001600160a01b03166020870152565b6040850152565b6060830152565b6080818503910152610d36565b634e487b7160e01b600052601160045260246000fd5b91908201809211610dcf57565b610dac565b6102816102536102539290565b61025390610dd4565b919392610df682610f9e565b808611610f6a575081602091610e48610e19610e1389809761133d565b96610be3565b96610e2486896117e3565b339287610e3060405190565b97889687966323e30c8b60e01b885260048801610d54565b03816000875af1908115610ce457600091610f3b575b50610e887f439148f0bbc682ca079e46d6e2c2f0c1e3b820f1a291b069d8882abf8cf18dd95b9190565b03610f0b57610e95611841565b610eb2610ea130610be3565b610eab8487610dc2565b9085611597565b610ebc60006105d6565b82148015610eed575b15610ede5750610ed890610b6b93610dc2565b90611745565b9091610b9c610b6b9482611745565b50610efb6102816000610de1565b6001600160a01b03821614610ec5565b610cb182610f1860405190565b62678c5b60e81b8152918291600483016001600160a01b03909116815260200190565b610f5d915060203d602011610f63575b610f558183610b05565b810190610d16565b38610e5e565b503d610f4b565b610cb190610f7760405190565b63fd9a760960e01b81529182916004830190815260200190565b91908203918211610dcf57565b610fba610fad61028130610be3565b916001600160a01b031690565b03610fd257610253610fca610b81565b600019610f91565b61025360006105d6565b90610fe690610be3565b600052602052604060002090565b61100b61025391611003600090565b506000610fdc565b610b77565b610253906118ae565b906102ac61102660405190565b9283610b05565b67ffffffffffffffff8111610b275760208091020190565b906110576110528361102d565b611019565b918252565b369037565b906102ac61107761107184611045565b9361102d565b601f19016020840161105c565b61108c6118c5565b906110956118f2565b9061109f30610be3565b6110a960006105d6565b6110bb6110b660006105d6565b611061565b600f60f81b9594934693929190565b6102537f000000000000000000000000136a429bee94a5a02240ff74023b46347cae87c9610be3565b6102536004610b4d565b6111267f000000000000000000000000136a429bee94a5a02240ff74023b46347cae87c9610be3565b602061113160405190565b633933006760e11b815233600482015291829060249082905afa908115610ce457600091611173575b506111656000610c85565b14610c99576102ac90611192565b61118c915060203d602011610cdd57610ccf8183610b05565b3861115a565b6102ac90336117e3565b6102ac906110fd565b610b6b9190336115fc565b91946111ff611206929897956111f860a0966111e86102ac9a6111d860c08a019e60008b0152565b6001600160a01b03166020890152565b6001600160a01b03166040870152565b6060850152565b6080830152565b0152565b6001600160a01b0390911681526040810192916102ac916020905b01906001600160a01b03169052565b9695929491949390936112448190565b421161131657906112c9856112b18a6112ce9796956112a56112837f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c990565b9161128d8461191d565b8d61129760405190565b9788966020880196876111b0565b90810382520382610b05565b6112c36112bc825190565b9160200190565b20611940565b611969565b6001600160a01b0385166001600160a01b038216036112f257506102ac9293611563565b8490610cb161130060405190565b6325c0072360e11b81529283926004840161120a565b610cb19061132360405190565b63313c898160e11b81529182916004830190815260200190565b919061134b61028130610be3565b6001600160a01b038416036113645761025391926119c2565b610cb18361137160405190565b635ad3edc960e11b8152918291600483016001600160a01b03909116815260200190565b610253916113b061100b926113a8600090565b506001610fdc565b610fdc565b906102ac98979695949392916119f4565b90610fe6565b61025390610bae565b61025390546113cc565b610253916113fa6113ff926113f2600090565b506008610fdc565b6113c6565b6113d5565b61142d7f000000000000000000000000136a429bee94a5a02240ff74023b46347cae87c9610be3565b602061143860405190565b638c9540d360e01b815233600482015291829060249082905afa908115610ce457600091611492575b5061146c6000610c85565b1461147a576102ac906114dc565b6040516344a2365760e01b8152336004820152602490fd5b6114ab915060203d602011610cdd57610ccf8183610b05565b38611461565b90600019905b9181191691161790565b906114d16102536114d8926105d6565b82546114b1565b9055565b6114e76127106105d6565b81116115225761151d816103317fa30f95d0e8219f814ad2f2deda3c45af61229359c8102895c736253d1dae174e9360096114c1565b0390a1565b610cb19061152f60405190565b631e57e2d960e21b81529182916004830190815260200190565b6102ac90611404565b906102ac9897969594939291611a3d565b916001916102ac93611a5d565b6001600160a01b0390911681526060810193926102ac929091604091611206906020830152565b916115a28284611395565b60001981036115b2575b50505050565b8181106115d857916115c96115cf94926000940390565b91611a5d565b388080806115ac565b82610cb1836115e660405190565b637dc7a0d960e11b815293849360048501611570565b9291906116096000610de1565b936001600160a01b0385166001600160a01b03821614611678576001600160a01b0385166001600160a01b03831614611647576102ac939450611b65565b610cb18561165460405190565b63ec442f0560e01b8152918291600483016001600160a01b03909116815260200190565b610cb18561168560405190565b634b637e8f60e11b8152918291600483016001600160a01b03909116815260200190565b6116b230610be3565b6116e46001600160a01b037f0000000000000000000000009818b6c09f5ecc843060927e8587c427c7c9358316610fad565b148061171c575b15611714577f79696cfe764a443748dc0a0136b344ab06b51af601740ecefbdf512a0429d52f90565b610253611b9b565b507f000000000000000000000000000000000000000000000000000000000000210546146116eb565b91906117516000610de1565b926001600160a01b0384166001600160a01b0382161461177657926102ac9293611b65565b610cb18461168560405190565b6102e49060ff1660f81b90565b01918252565b018092611783565b9091926102ac946117de916117d26117b560405190565b60208082019384529097889460019261023e916117968288611790565b90810382520384610b05565b611c72565b91906117ef6000610de1565b926001600160a01b0384166001600160a01b03821614611813576102ac9293611b65565b610cb18461165460405190565b905051906102ac8261028d565b906020828203126101e25761025391611820565b61185461184f61184f6110ca565b610be3565b602061185f60405190565b631d8cf42560e11b815291829060049082905afa908115610ce457600091611885575090565b610253915060203d6020116118a7575b61189f8183610b05565b81019061182d565b503d611895565b61100b610253916118bd600090565b506007610fdc565b6102537f52495a450000000000000000000000000000000000000000000000000000000460055b90611da7565b6102537f310000000000000000000000000000000000000000000000000000000000000160066118ec565b6119289060006118bd565b61025361193482610b77565b91600183015b906114c1565b6102539061194c6116a9565b6042916040519161190160f01b8352600283015260228201522090565b9161025393916119819361197b600090565b50611e09565b90929192611eff565b81810292918115918404141715610dcf57565b634e487b7160e01b600052601260045260246000fd5b81156119bd570490565b61199d565b506119e3610253916119d2600090565b506119dd6009610b77565b9061198a565b6119ee6127106105d6565b906119b3565b909192939495966102ac98611a3891611a2c611a0f60405190565b6020808201938452909b8c9460019261023e916117968288611790565b90810382520388610b05565b611fc8565b909192939495966102ac98611a5891611a2c611a0f60405190565b612069565b909192611a6a6000610de1565b6001600160a01b0381166001600160a01b03841614611b34576001600160a01b0381166001600160a01b03851614611b035750611ab584611ab0856113b0866001610fdc565b6114c1565b611abe57505050565b611afe611af4611aee7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92593610be3565b93610be3565b9361033560405190565b0390a3565b610cb190611b1060405190565b634a1406b160e11b8152918291600483016001600160a01b03909116815260200190565b610cb190611b4160405190565b63e602df0560e01b8152918291600483016001600160a01b03909116815260200190565b906102ac92916120ce565b909594926102ac94610d9861122592610d91608096611b9460a088019c6000890152565b6020870152565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611c207fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc67f843adfd1d45fb5aea1b6ad0f710d1d42694b5790e092c73c51b91ed5c49c12396112a5611c0d30610be3565b6040519586946020860194469286611b70565b611c2b6112bc825190565b2090565b9081526001600160a01b0390911660208201526060810192916102ac9160400152565b9060ff906114b7565b90611c6b6102536114d892151590565b8254611c52565b610e8490611cc0611cd99394611c888684612146565b611c90610883565b611cae611c9c60405190565b80926112a58a88602085019384611c2f565b611cb96112bc825190565b2083612170565b61184f6001611cd4866113fa856008610fdc565b611c5b565b907f1cdd46ff242716cdaa72d159d339a485b3438398348d68f09d7c8c0a59353d81611d0460405190565b8080611afe565b61025360ff6105d6565b80546000939291611d28610a7483610a37565b9160018116908115610ad05750600114611d4157505050565b611d549192939450600052602060002090565b916000925b818410611d665750500190565b805484840152602090930192600101611d59565b9061025391611d15565b906102ac610b4692611d9560405190565b93848092611d7a565b61025390611d84565b9081611db7610e84610253611d0b565b14611dc65750610253906121e6565b6102539150611d9e565b610253906105d6565b6112066102ac94611e02606094989795611df8608086019a6000870152565b60ff166020850152565b6040830152565b9091611e1484611dd0565b611e40610e847f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a06105d6565b11611ebc5790611e6260209460009493611e5960405190565b94859485611dd9565b838052039060015afa15610ce457600051600091611e7f83610de1565b6001600160a01b0381166001600160a01b03841614611ea85750611ea2836105d6565b91929190565b915091611eb4906105d6565b909160019190565b505050611ec96000610de1565b9160039190565b634e487b7160e01b600052602160045260246000fd5b60041115611ef057565b611ed0565b906102ac82611ee6565b611f096000611ef5565b611f1282611ef5565b03611f1b575050565b611f256001611ef5565b611f2e82611ef5565b03611f455760405163f645eedf60e01b8152600490fd5b611f4f6002611ef5565b611f5882611ef5565b03611f8657610cb1611f6983611dd0565b60405163fce698f760e01b81529182916004830190815260200190565b611f99611f936003611ef5565b91611ef5565b14611fa15750565b610cb190611fae60405190565b6335e2f38360e21b81529182916004830190815260200190565b926102ac968261204c86866112a58b612064999c989b61205e98611fee8282858961220d565b611ff661079d565b9461200060405190565b9889976020890197889081526001600160a01b03909116602082015260e081019695949093909290916001600160a01b031660408501526060840152608083015260a082015260c00152565b6120576112bc825190565b2085612170565b8261224b565b612291565b919490939192336001600160a01b038616036120a9576102ac968561204c86896112a58789886120a16120649c61205e9b858961220d565b611ff66105e3565b60405163e463812b60e01b8152600490fd5b9081526040810192916102ac9160200152565b916120d9918361229c565b6120e9610fad6102816000610de1565b146120f057565b7f00000000000000000000000000000000000000001027e72f1f12813088000000612119610b81565b818111612124575050565b610cb161213060405190565b63279e7e1560e21b8152928392600484016120bb565b612158916113fa6113ff926008610fdc565b61215e57565b604051636d79346160e11b8152600490fd5b9161218e9261218461218a9361194c6116a9565b906123d1565b1590565b61219457565b60405163a6acd33360e01b8152600490fd5b67ffffffffffffffff8111610b2757602090601f01601f19160190565b90611057611052836121a6565b906102ac6110776121e0846121c3565b936121a6565b6121ef81612433565b906122026121fd60206105d6565b6121d0565b918252602082015290565b92909142111561223957421015612227576102ac91612146565b60405163b914715760e01b8152600490fd5b604051631cd39ae560e21b8152600490fd5b610e846122669161184f6001611cd4866113fa856008610fdc565b907f98de503528ee59b575ef0c0a2576a82497bfc029a5685b209e9ec333479b10a5611d0460405190565b906102ac92916115fc565b8160006122a881610de1565b6001600160a01b0381166001600160a01b0385160361234f577fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef93611afe93611af49361230f611aee946102816123088c6123036002610b77565b610dc2565b60026114c1565b6001600160a01b0383160361233557505061184f612308886123316002610b77565b0390565b61184f9161234291610fdc565b61193a8961023e83610b77565b90915061235f61100b8484610fdc565b8581106123ad577fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9385611afe9461230f611af4956102816123a38c611aee980390565b611ab08786610fdc565b83610cb1876123bb60405190565b63391434e360e21b815293849360048501611570565b91906123dd828261247b565b506123ee611f936000969396611ef5565b149384612416575b508315612404575b50505090565b61240e935061251a565b3880806123fe565b90935061242b6001600160a01b038516610fad565b1492386123f6565b61244661244b91612442600090565b5090565b611dd0565b61245560ff6105d6565b16612460601f6105d6565b81116124695790565b604051632cd44ac360e21b8152600490fd5b90600091612487825190565b612494610e8460416105d6565b036124be576124b792506020820151906060604084015193015160001a90611e09565b9192909190565b5090506124db6124d66124d16000610de1565b925190565b6105d6565b909160029190565b9081526040602082018190526102539291019061020a565b3d156125155761250a3d6121c3565b903d6000602084013e565b606090565b91600092612560849361252b600090565b5061255161253860405190565b630b135d3f60e11b6020820152948592602484016124e3565b60208201810382520383610b05565b602082519201905afa6125716124fb565b816125ae575b81612580575090565b61259a9150602061258f825190565b818301019101610d16565b6125aa630b135d3f60e11b610e84565b1490565b90506125b8815190565b6125c5610e8460206105d6565b10159061257756fea2646970667358221220d6e3a94a3f839edfb51aab97804a8439f7847cf5f675068d7d3da499665b16ab64736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000136a429bee94a5a02240ff74023b46347cae87c9
-----Decoded View---------------
Arg [0] : accessList (address): 0x136A429bEE94a5A02240Ff74023B46347cae87c9
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000136a429bee94a5a02240ff74023b46347cae87c9
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.
Add Token to MetaMask (Web3)