Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save coresilver/f741bc4c2057e73cbeda179c5ca4b956 to your computer and use it in GitHub Desktop.
Save coresilver/f741bc4c2057e73cbeda179c5ca4b956 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.20+commit.a1b79de6.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
import {Context} from "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* The initial owner is set to the address provided by the deployer. This can
* later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 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 ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-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 ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 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/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 v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.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 ERC-20
* applications.
*/
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}.
*
* Skips emitting an {Approval} event indicating an allowance update. This is not
* required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
*
* 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:
*
* ```solidity
* 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/ERC20Burnable.sol)
pragma solidity ^0.8.20;
import {ERC20} from "../ERC20.sol";
import {Context} from "../../../utils/Context.sol";
/**
* @dev Extension of {ERC20} that allows token holders to destroy both their own
* tokens and those that they have an allowance for, in a way that can be
* recognized off-chain (via event analysis).
*/
abstract contract ERC20Burnable is Context, ERC20 {
/**
* @dev Destroys a `value` amount of tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 value) public virtual {
_burn(_msgSender(), value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, deducting from
* the caller's allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `value`.
*/
function burnFrom(address account, uint256 value) public virtual {
_spendAllowance(account, _msgSender(), value);
_burn(account, value);
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.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 ERC-20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC-20 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 ERC-20 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.1.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 ERC-20 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.1.0) (token/ERC20/extensions/IERC20Permit.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[ERC-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC-20 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.1.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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.1.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 recovered, RecoverError err, bytes32 errArg) {
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.
assembly ("memory-safe") {
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[ERC-2098 short signatures]
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address recovered, RecoverError err, bytes32 errArg) {
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 recovered, RecoverError err, bytes32 errArg) {
// 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.1.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.1.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[ERC-191] and https://eips.ethereum.org/EIPS/eip-712[EIP 712]
* specifications.
*/
library MessageHashUtils {
/**
* @dev Returns the keccak256 digest of an ERC-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) {
assembly ("memory-safe") {
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 ERC-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 ERC-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 (ERC-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) {
assembly ("memory-safe") {
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.1.0) (utils/math/Math.sol)
pragma solidity ^0.8.20;
import {Panic} from "../Panic.sol";
import {SafeCast} from "./SafeCast.sol";
/**
* @dev Standard math utilities missing in the Solidity language.
*/
library Math {
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 success flag (no overflow).
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an success flag (no overflow).
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an success flag (no overflow).
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
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 success flag (no division by zero).
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a success flag (no division by zero).
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool success, uint256 result) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, uint256 a, uint256 b) internal pure returns (uint256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * SafeCast.toUint(condition));
}
}
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return ternary(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.
Panic.panic(Panic.DIVISION_BY_ZERO);
}
// The following calculation ensures accurate ceiling division without overflow.
// Since a is non-zero, (a - 1) / b will not overflow.
// The largest possible result occurs when (a - 1) / b is type(uint256).max,
// but the largest value we can obtain is type(uint256).max - 1, which happens
// when a = type(uint256).max and b = 1.
unchecked {
return SafeCast.toUint(a > 0) * ((a - 1) / b + 1);
}
}
/**
* @dev Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or
* denominator == 0.
*
* 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²⁵⁶ and mod 2²⁵⁶ - 1, then use
// the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
// variables such that product = prod1 * 2²⁵⁶ + 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²⁵⁶. Also prevents denominator == 0.
if (denominator <= prod1) {
Panic.panic(ternary(denominator == 0, Panic.DIVISION_BY_ZERO, Panic.UNDER_OVERFLOW));
}
///////////////////////////////////////////////
// 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²⁵⁶ / 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²⁵⁶. Now that denominator is an odd number, it has an inverse modulo 2²⁵⁶ such
// that denominator * inv ≡ 1 mod 2²⁵⁶. Compute the inverse by starting with a seed that is correct for
// four bits. That is, denominator * inv ≡ 1 mod 2⁴.
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⁸
inverse *= 2 - denominator * inverse; // inverse mod 2¹⁶
inverse *= 2 - denominator * inverse; // inverse mod 2³²
inverse *= 2 - denominator * inverse; // inverse mod 2⁶⁴
inverse *= 2 - denominator * inverse; // inverse mod 2¹²⁸
inverse *= 2 - denominator * inverse; // inverse mod 2²⁵⁶
// 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²⁵⁶. Since the preconditions guarantee that the outcome is
// less than 2²⁵⁶, 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;
}
}
/**
* @dev 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) {
return mulDiv(x, y, denominator) + SafeCast.toUint(unsignedRoundsUp(rounding) && mulmod(x, y, denominator) > 0);
}
/**
* @dev Calculate the modular multiplicative inverse of a number in Z/nZ.
*
* If n is a prime, then Z/nZ is a field. In that case all elements are inversible, except 0.
* If n is not a prime, then Z/nZ is not a field, and some elements might not be inversible.
*
* If the input value is not inversible, 0 is returned.
*
* NOTE: If you know for sure that n is (big) a prime, it may be cheaper to use Fermat's little theorem and get the
* inverse using `Math.modExp(a, n - 2, n)`. See {invModPrime}.
*/
function invMod(uint256 a, uint256 n) internal pure returns (uint256) {
unchecked {
if (n == 0) return 0;
// The inverse modulo is calculated using the Extended Euclidean Algorithm (iterative version)
// Used to compute integers x and y such that: ax + ny = gcd(a, n).
// When the gcd is 1, then the inverse of a modulo n exists and it's x.
// ax + ny = 1
// ax = 1 + (-y)n
// ax ≡ 1 (mod n) # x is the inverse of a modulo n
// If the remainder is 0 the gcd is n right away.
uint256 remainder = a % n;
uint256 gcd = n;
// Therefore the initial coefficients are:
// ax + ny = gcd(a, n) = n
// 0a + 1n = n
int256 x = 0;
int256 y = 1;
while (remainder != 0) {
uint256 quotient = gcd / remainder;
(gcd, remainder) = (
// The old remainder is the next gcd to try.
remainder,
// Compute the next remainder.
// Can't overflow given that (a % gcd) * (gcd // (a % gcd)) <= gcd
// where gcd is at most n (capped to type(uint256).max)
gcd - remainder * quotient
);
(x, y) = (
// Increment the coefficient of a.
y,
// Decrement the coefficient of n.
// Can overflow, but the result is casted to uint256 so that the
// next value of y is "wrapped around" to a value between 0 and n - 1.
x - y * int256(quotient)
);
}
if (gcd != 1) return 0; // No inverse exists.
return ternary(x < 0, n - uint256(-x), uint256(x)); // Wrap the result if it's negative.
}
}
/**
* @dev Variant of {invMod}. More efficient, but only works if `p` is known to be a prime greater than `2`.
*
* From https://en.wikipedia.org/wiki/Fermat%27s_little_theorem[Fermat's little theorem], we know that if p is
* prime, then `a**(p-1) ≡ 1 mod p`. As a consequence, we have `a * a**(p-2) ≡ 1 mod p`, which means that
* `a**(p-2)` is the modular multiplicative inverse of a in Fp.
*
* NOTE: this function does NOT check that `p` is a prime greater than `2`.
*/
function invModPrime(uint256 a, uint256 p) internal view returns (uint256) {
unchecked {
return Math.modExp(a, p - 2, p);
}
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m)
*
* Requirements:
* - modulus can't be zero
* - underlying staticcall to precompile must succeed
*
* IMPORTANT: The result is only valid if the underlying call succeeds. When using this function, make
* sure the chain you're using it on supports the precompiled contract for modular exponentiation
* at address 0x05 as specified in https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise,
* the underlying function will succeed given the lack of a revert, but the result may be incorrectly
* interpreted as 0.
*/
function modExp(uint256 b, uint256 e, uint256 m) internal view returns (uint256) {
(bool success, uint256 result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Returns the modular exponentiation of the specified base, exponent and modulus (b ** e % m).
* It includes a success flag indicating if the operation succeeded. Operation will be marked as failed if trying
* to operate modulo 0 or if the underlying precompile reverted.
*
* IMPORTANT: The result is only valid if the success flag is true. When using this function, make sure the chain
* you're using it on supports the precompiled contract for modular exponentiation at address 0x05 as specified in
* https://eips.ethereum.org/EIPS/eip-198[EIP-198]. Otherwise, the underlying function will succeed given the lack
* of a revert, but the result may be incorrectly interpreted as 0.
*/
function tryModExp(uint256 b, uint256 e, uint256 m) internal view returns (bool success, uint256 result) {
if (m == 0) return (false, 0);
assembly ("memory-safe") {
let ptr := mload(0x40)
// | Offset | Content | Content (Hex) |
// |-----------|------------|--------------------------------------------------------------------|
// | 0x00:0x1f | size of b | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x20:0x3f | size of e | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x40:0x5f | size of m | 0x0000000000000000000000000000000000000000000000000000000000000020 |
// | 0x60:0x7f | value of b | 0x<.............................................................b> |
// | 0x80:0x9f | value of e | 0x<.............................................................e> |
// | 0xa0:0xbf | value of m | 0x<.............................................................m> |
mstore(ptr, 0x20)
mstore(add(ptr, 0x20), 0x20)
mstore(add(ptr, 0x40), 0x20)
mstore(add(ptr, 0x60), b)
mstore(add(ptr, 0x80), e)
mstore(add(ptr, 0xa0), m)
// Given the result < m, it's guaranteed to fit in 32 bytes,
// so we can use the memory scratch space located at offset 0.
success := staticcall(gas(), 0x05, ptr, 0xc0, 0x00, 0x20)
result := mload(0x00)
}
}
/**
* @dev Variant of {modExp} that supports inputs of arbitrary length.
*/
function modExp(bytes memory b, bytes memory e, bytes memory m) internal view returns (bytes memory) {
(bool success, bytes memory result) = tryModExp(b, e, m);
if (!success) {
Panic.panic(Panic.DIVISION_BY_ZERO);
}
return result;
}
/**
* @dev Variant of {tryModExp} that supports inputs of arbitrary length.
*/
function tryModExp(
bytes memory b,
bytes memory e,
bytes memory m
) internal view returns (bool success, bytes memory result) {
if (_zeroBytes(m)) return (false, new bytes(0));
uint256 mLen = m.length;
// Encode call args in result and move the free memory pointer
result = abi.encodePacked(b.length, e.length, mLen, b, e, m);
assembly ("memory-safe") {
let dataPtr := add(result, 0x20)
// Write result on top of args to avoid allocating extra memory.
success := staticcall(gas(), 0x05, dataPtr, mload(result), dataPtr, mLen)
// Overwrite the length.
// result.length > returndatasize() is guaranteed because returndatasize() == m.length
mstore(result, mLen)
// Set the memory pointer after the returned data.
mstore(0x40, add(dataPtr, mLen))
}
}
/**
* @dev Returns whether the provided byte array is zero.
*/
function _zeroBytes(bytes memory byteArray) private pure returns (bool) {
for (uint256 i = 0; i < byteArray.length; ++i) {
if (byteArray[i] != 0) {
return false;
}
}
return true;
}
/**
* @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded
* towards zero.
*
* This method is based on Newton's method for computing square roots; the algorithm is restricted to only
* using integer operations.
*/
function sqrt(uint256 a) internal pure returns (uint256) {
unchecked {
// Take care of easy edge cases when a == 0 or a == 1
if (a <= 1) {
return a;
}
// In this function, we use Newton's method to get a root of `f(x) := x² - a`. It involves building a
// sequence x_n that converges toward sqrt(a). For each iteration x_n, we also define the error between
// the current value as `ε_n = | x_n - sqrt(a) |`.
//
// For our first estimation, we consider `e` the smallest power of 2 which is bigger than the square root
// of the target. (i.e. `2**(e-1) ≤ sqrt(a) < 2**e`). We know that `e ≤ 128` because `(2¹²⁸)² = 2²⁵⁶` is
// bigger than any uint256.
//
// By noticing that
// `2**(e-1) ≤ sqrt(a) < 2**e → (2**(e-1))² ≤ a < (2**e)² → 2**(2*e-2) ≤ a < 2**(2*e)`
// we can deduce that `e - 1` is `log2(a) / 2`. We can thus compute `x_n = 2**(e-1)` using a method similar
// to the msb function.
uint256 aa = a;
uint256 xn = 1;
if (aa >= (1 << 128)) {
aa >>= 128;
xn <<= 64;
}
if (aa >= (1 << 64)) {
aa >>= 64;
xn <<= 32;
}
if (aa >= (1 << 32)) {
aa >>= 32;
xn <<= 16;
}
if (aa >= (1 << 16)) {
aa >>= 16;
xn <<= 8;
}
if (aa >= (1 << 8)) {
aa >>= 8;
xn <<= 4;
}
if (aa >= (1 << 4)) {
aa >>= 4;
xn <<= 2;
}
if (aa >= (1 << 2)) {
xn <<= 1;
}
// We now have x_n such that `x_n = 2**(e-1) ≤ sqrt(a) < 2**e = 2 * x_n`. This implies ε_n ≤ 2**(e-1).
//
// We can refine our estimation by noticing that the middle of that interval minimizes the error.
// If we move x_n to equal 2**(e-1) + 2**(e-2), then we reduce the error to ε_n ≤ 2**(e-2).
// This is going to be our x_0 (and ε_0)
xn = (3 * xn) >> 1; // ε_0 := | x_0 - sqrt(a) | ≤ 2**(e-2)
// From here, Newton's method give us:
// x_{n+1} = (x_n + a / x_n) / 2
//
// One should note that:
// x_{n+1}² - a = ((x_n + a / x_n) / 2)² - a
// = ((x_n² + a) / (2 * x_n))² - a
// = (x_n⁴ + 2 * a * x_n² + a²) / (4 * x_n²) - a
// = (x_n⁴ + 2 * a * x_n² + a² - 4 * a * x_n²) / (4 * x_n²)
// = (x_n⁴ - 2 * a * x_n² + a²) / (4 * x_n²)
// = (x_n² - a)² / (2 * x_n)²
// = ((x_n² - a) / (2 * x_n))²
// ≥ 0
// Which proves that for all n ≥ 1, sqrt(a) ≤ x_n
//
// This gives us the proof of quadratic convergence of the sequence:
// ε_{n+1} = | x_{n+1} - sqrt(a) |
// = | (x_n + a / x_n) / 2 - sqrt(a) |
// = | (x_n² + a - 2*x_n*sqrt(a)) / (2 * x_n) |
// = | (x_n - sqrt(a))² / (2 * x_n) |
// = | ε_n² / (2 * x_n) |
// = ε_n² / | (2 * x_n) |
//
// For the first iteration, we have a special case where x_0 is known:
// ε_1 = ε_0² / | (2 * x_0) |
// ≤ (2**(e-2))² / (2 * (2**(e-1) + 2**(e-2)))
// ≤ 2**(2*e-4) / (3 * 2**(e-1))
// ≤ 2**(e-3) / 3
// ≤ 2**(e-3-log2(3))
// ≤ 2**(e-4.5)
//
// For the following iterations, we use the fact that, 2**(e-1) ≤ sqrt(a) ≤ x_n:
// ε_{n+1} = ε_n² / | (2 * x_n) |
// ≤ (2**(e-k))² / (2 * 2**(e-1))
// ≤ 2**(2*e-2*k) / 2**e
// ≤ 2**(e-2*k)
xn = (xn + a / xn) >> 1; // ε_1 := | x_1 - sqrt(a) | ≤ 2**(e-4.5) -- special case, see above
xn = (xn + a / xn) >> 1; // ε_2 := | x_2 - sqrt(a) | ≤ 2**(e-9) -- general case with k = 4.5
xn = (xn + a / xn) >> 1; // ε_3 := | x_3 - sqrt(a) | ≤ 2**(e-18) -- general case with k = 9
xn = (xn + a / xn) >> 1; // ε_4 := | x_4 - sqrt(a) | ≤ 2**(e-36) -- general case with k = 18
xn = (xn + a / xn) >> 1; // ε_5 := | x_5 - sqrt(a) | ≤ 2**(e-72) -- general case with k = 36
xn = (xn + a / xn) >> 1; // ε_6 := | x_6 - sqrt(a) | ≤ 2**(e-144) -- general case with k = 72
// Because e ≤ 128 (as discussed during the first estimation phase), we know have reached a precision
// ε_6 ≤ 2**(e-144) < 1. Given we're operating on integers, then we can ensure that xn is now either
// sqrt(a) or sqrt(a) + 1.
return xn - SafeCast.toUint(xn > a / xn);
}
}
/**
* @dev 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && result * result < a);
}
}
/**
* @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;
uint256 exp;
unchecked {
exp = 128 * SafeCast.toUint(value > (1 << 128) - 1);
value >>= exp;
result += exp;
exp = 64 * SafeCast.toUint(value > (1 << 64) - 1);
value >>= exp;
result += exp;
exp = 32 * SafeCast.toUint(value > (1 << 32) - 1);
value >>= exp;
result += exp;
exp = 16 * SafeCast.toUint(value > (1 << 16) - 1);
value >>= exp;
result += exp;
exp = 8 * SafeCast.toUint(value > (1 << 8) - 1);
value >>= exp;
result += exp;
exp = 4 * SafeCast.toUint(value > (1 << 4) - 1);
value >>= exp;
result += exp;
exp = 2 * SafeCast.toUint(value > (1 << 2) - 1);
value >>= exp;
result += exp;
result += SafeCast.toUint(value > 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << result < value);
}
}
/**
* @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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 10 ** result < value);
}
}
/**
* @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;
uint256 isGt;
unchecked {
isGt = SafeCast.toUint(value > (1 << 128) - 1);
value >>= isGt * 128;
result += isGt * 16;
isGt = SafeCast.toUint(value > (1 << 64) - 1);
value >>= isGt * 64;
result += isGt * 8;
isGt = SafeCast.toUint(value > (1 << 32) - 1);
value >>= isGt * 32;
result += isGt * 4;
isGt = SafeCast.toUint(value > (1 << 16) - 1);
value >>= isGt * 16;
result += isGt * 2;
result += SafeCast.toUint(value > (1 << 8) - 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 + SafeCast.toUint(unsignedRoundsUp(rounding) && 1 << (result << 3) < value);
}
}
/**
* @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.1.0) (utils/math/SafeCast.sol)
// This file was procedurally generated from scripts/generate/templates/SafeCast.js.
pragma solidity ^0.8.20;
/**
* @dev Wrappers over Solidity's uintXX/intXX/bool casting operators with added overflow
* checks.
*
* Downcasting from uint256/int256 in Solidity does not revert on overflow. This can
* easily result in undesired exploitation or bugs, since developers usually
* assume that overflows raise errors. `SafeCast` restores this intuition by
* reverting the transaction when such an operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeCast {
/**
* @dev Value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedUintDowncast(uint8 bits, uint256 value);
/**
* @dev An int value doesn't fit in an uint of `bits` size.
*/
error SafeCastOverflowedIntToUint(int256 value);
/**
* @dev Value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedIntDowncast(uint8 bits, int256 value);
/**
* @dev An uint value doesn't fit in an int of `bits` size.
*/
error SafeCastOverflowedUintToInt(uint256 value);
/**
* @dev Returns the downcasted uint248 from uint256, reverting on
* overflow (when the input is greater than largest uint248).
*
* Counterpart to Solidity's `uint248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toUint248(uint256 value) internal pure returns (uint248) {
if (value > type(uint248).max) {
revert SafeCastOverflowedUintDowncast(248, value);
}
return uint248(value);
}
/**
* @dev Returns the downcasted uint240 from uint256, reverting on
* overflow (when the input is greater than largest uint240).
*
* Counterpart to Solidity's `uint240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toUint240(uint256 value) internal pure returns (uint240) {
if (value > type(uint240).max) {
revert SafeCastOverflowedUintDowncast(240, value);
}
return uint240(value);
}
/**
* @dev Returns the downcasted uint232 from uint256, reverting on
* overflow (when the input is greater than largest uint232).
*
* Counterpart to Solidity's `uint232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toUint232(uint256 value) internal pure returns (uint232) {
if (value > type(uint232).max) {
revert SafeCastOverflowedUintDowncast(232, value);
}
return uint232(value);
}
/**
* @dev Returns the downcasted uint224 from uint256, reverting on
* overflow (when the input is greater than largest uint224).
*
* Counterpart to Solidity's `uint224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toUint224(uint256 value) internal pure returns (uint224) {
if (value > type(uint224).max) {
revert SafeCastOverflowedUintDowncast(224, value);
}
return uint224(value);
}
/**
* @dev Returns the downcasted uint216 from uint256, reverting on
* overflow (when the input is greater than largest uint216).
*
* Counterpart to Solidity's `uint216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toUint216(uint256 value) internal pure returns (uint216) {
if (value > type(uint216).max) {
revert SafeCastOverflowedUintDowncast(216, value);
}
return uint216(value);
}
/**
* @dev Returns the downcasted uint208 from uint256, reverting on
* overflow (when the input is greater than largest uint208).
*
* Counterpart to Solidity's `uint208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toUint208(uint256 value) internal pure returns (uint208) {
if (value > type(uint208).max) {
revert SafeCastOverflowedUintDowncast(208, value);
}
return uint208(value);
}
/**
* @dev Returns the downcasted uint200 from uint256, reverting on
* overflow (when the input is greater than largest uint200).
*
* Counterpart to Solidity's `uint200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toUint200(uint256 value) internal pure returns (uint200) {
if (value > type(uint200).max) {
revert SafeCastOverflowedUintDowncast(200, value);
}
return uint200(value);
}
/**
* @dev Returns the downcasted uint192 from uint256, reverting on
* overflow (when the input is greater than largest uint192).
*
* Counterpart to Solidity's `uint192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toUint192(uint256 value) internal pure returns (uint192) {
if (value > type(uint192).max) {
revert SafeCastOverflowedUintDowncast(192, value);
}
return uint192(value);
}
/**
* @dev Returns the downcasted uint184 from uint256, reverting on
* overflow (when the input is greater than largest uint184).
*
* Counterpart to Solidity's `uint184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toUint184(uint256 value) internal pure returns (uint184) {
if (value > type(uint184).max) {
revert SafeCastOverflowedUintDowncast(184, value);
}
return uint184(value);
}
/**
* @dev Returns the downcasted uint176 from uint256, reverting on
* overflow (when the input is greater than largest uint176).
*
* Counterpart to Solidity's `uint176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toUint176(uint256 value) internal pure returns (uint176) {
if (value > type(uint176).max) {
revert SafeCastOverflowedUintDowncast(176, value);
}
return uint176(value);
}
/**
* @dev Returns the downcasted uint168 from uint256, reverting on
* overflow (when the input is greater than largest uint168).
*
* Counterpart to Solidity's `uint168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toUint168(uint256 value) internal pure returns (uint168) {
if (value > type(uint168).max) {
revert SafeCastOverflowedUintDowncast(168, value);
}
return uint168(value);
}
/**
* @dev Returns the downcasted uint160 from uint256, reverting on
* overflow (when the input is greater than largest uint160).
*
* Counterpart to Solidity's `uint160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toUint160(uint256 value) internal pure returns (uint160) {
if (value > type(uint160).max) {
revert SafeCastOverflowedUintDowncast(160, value);
}
return uint160(value);
}
/**
* @dev Returns the downcasted uint152 from uint256, reverting on
* overflow (when the input is greater than largest uint152).
*
* Counterpart to Solidity's `uint152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toUint152(uint256 value) internal pure returns (uint152) {
if (value > type(uint152).max) {
revert SafeCastOverflowedUintDowncast(152, value);
}
return uint152(value);
}
/**
* @dev Returns the downcasted uint144 from uint256, reverting on
* overflow (when the input is greater than largest uint144).
*
* Counterpart to Solidity's `uint144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toUint144(uint256 value) internal pure returns (uint144) {
if (value > type(uint144).max) {
revert SafeCastOverflowedUintDowncast(144, value);
}
return uint144(value);
}
/**
* @dev Returns the downcasted uint136 from uint256, reverting on
* overflow (when the input is greater than largest uint136).
*
* Counterpart to Solidity's `uint136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toUint136(uint256 value) internal pure returns (uint136) {
if (value > type(uint136).max) {
revert SafeCastOverflowedUintDowncast(136, value);
}
return uint136(value);
}
/**
* @dev Returns the downcasted uint128 from uint256, reverting on
* overflow (when the input is greater than largest uint128).
*
* Counterpart to Solidity's `uint128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toUint128(uint256 value) internal pure returns (uint128) {
if (value > type(uint128).max) {
revert SafeCastOverflowedUintDowncast(128, value);
}
return uint128(value);
}
/**
* @dev Returns the downcasted uint120 from uint256, reverting on
* overflow (when the input is greater than largest uint120).
*
* Counterpart to Solidity's `uint120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toUint120(uint256 value) internal pure returns (uint120) {
if (value > type(uint120).max) {
revert SafeCastOverflowedUintDowncast(120, value);
}
return uint120(value);
}
/**
* @dev Returns the downcasted uint112 from uint256, reverting on
* overflow (when the input is greater than largest uint112).
*
* Counterpart to Solidity's `uint112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toUint112(uint256 value) internal pure returns (uint112) {
if (value > type(uint112).max) {
revert SafeCastOverflowedUintDowncast(112, value);
}
return uint112(value);
}
/**
* @dev Returns the downcasted uint104 from uint256, reverting on
* overflow (when the input is greater than largest uint104).
*
* Counterpart to Solidity's `uint104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toUint104(uint256 value) internal pure returns (uint104) {
if (value > type(uint104).max) {
revert SafeCastOverflowedUintDowncast(104, value);
}
return uint104(value);
}
/**
* @dev Returns the downcasted uint96 from uint256, reverting on
* overflow (when the input is greater than largest uint96).
*
* Counterpart to Solidity's `uint96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toUint96(uint256 value) internal pure returns (uint96) {
if (value > type(uint96).max) {
revert SafeCastOverflowedUintDowncast(96, value);
}
return uint96(value);
}
/**
* @dev Returns the downcasted uint88 from uint256, reverting on
* overflow (when the input is greater than largest uint88).
*
* Counterpart to Solidity's `uint88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toUint88(uint256 value) internal pure returns (uint88) {
if (value > type(uint88).max) {
revert SafeCastOverflowedUintDowncast(88, value);
}
return uint88(value);
}
/**
* @dev Returns the downcasted uint80 from uint256, reverting on
* overflow (when the input is greater than largest uint80).
*
* Counterpart to Solidity's `uint80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toUint80(uint256 value) internal pure returns (uint80) {
if (value > type(uint80).max) {
revert SafeCastOverflowedUintDowncast(80, value);
}
return uint80(value);
}
/**
* @dev Returns the downcasted uint72 from uint256, reverting on
* overflow (when the input is greater than largest uint72).
*
* Counterpart to Solidity's `uint72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toUint72(uint256 value) internal pure returns (uint72) {
if (value > type(uint72).max) {
revert SafeCastOverflowedUintDowncast(72, value);
}
return uint72(value);
}
/**
* @dev Returns the downcasted uint64 from uint256, reverting on
* overflow (when the input is greater than largest uint64).
*
* Counterpart to Solidity's `uint64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toUint64(uint256 value) internal pure returns (uint64) {
if (value > type(uint64).max) {
revert SafeCastOverflowedUintDowncast(64, value);
}
return uint64(value);
}
/**
* @dev Returns the downcasted uint56 from uint256, reverting on
* overflow (when the input is greater than largest uint56).
*
* Counterpart to Solidity's `uint56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toUint56(uint256 value) internal pure returns (uint56) {
if (value > type(uint56).max) {
revert SafeCastOverflowedUintDowncast(56, value);
}
return uint56(value);
}
/**
* @dev Returns the downcasted uint48 from uint256, reverting on
* overflow (when the input is greater than largest uint48).
*
* Counterpart to Solidity's `uint48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toUint48(uint256 value) internal pure returns (uint48) {
if (value > type(uint48).max) {
revert SafeCastOverflowedUintDowncast(48, value);
}
return uint48(value);
}
/**
* @dev Returns the downcasted uint40 from uint256, reverting on
* overflow (when the input is greater than largest uint40).
*
* Counterpart to Solidity's `uint40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toUint40(uint256 value) internal pure returns (uint40) {
if (value > type(uint40).max) {
revert SafeCastOverflowedUintDowncast(40, value);
}
return uint40(value);
}
/**
* @dev Returns the downcasted uint32 from uint256, reverting on
* overflow (when the input is greater than largest uint32).
*
* Counterpart to Solidity's `uint32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toUint32(uint256 value) internal pure returns (uint32) {
if (value > type(uint32).max) {
revert SafeCastOverflowedUintDowncast(32, value);
}
return uint32(value);
}
/**
* @dev Returns the downcasted uint24 from uint256, reverting on
* overflow (when the input is greater than largest uint24).
*
* Counterpart to Solidity's `uint24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toUint24(uint256 value) internal pure returns (uint24) {
if (value > type(uint24).max) {
revert SafeCastOverflowedUintDowncast(24, value);
}
return uint24(value);
}
/**
* @dev Returns the downcasted uint16 from uint256, reverting on
* overflow (when the input is greater than largest uint16).
*
* Counterpart to Solidity's `uint16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toUint16(uint256 value) internal pure returns (uint16) {
if (value > type(uint16).max) {
revert SafeCastOverflowedUintDowncast(16, value);
}
return uint16(value);
}
/**
* @dev Returns the downcasted uint8 from uint256, reverting on
* overflow (when the input is greater than largest uint8).
*
* Counterpart to Solidity's `uint8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toUint8(uint256 value) internal pure returns (uint8) {
if (value > type(uint8).max) {
revert SafeCastOverflowedUintDowncast(8, value);
}
return uint8(value);
}
/**
* @dev Converts a signed int256 into an unsigned uint256.
*
* Requirements:
*
* - input must be greater than or equal to 0.
*/
function toUint256(int256 value) internal pure returns (uint256) {
if (value < 0) {
revert SafeCastOverflowedIntToUint(value);
}
return uint256(value);
}
/**
* @dev Returns the downcasted int248 from int256, reverting on
* overflow (when the input is less than smallest int248 or
* greater than largest int248).
*
* Counterpart to Solidity's `int248` operator.
*
* Requirements:
*
* - input must fit into 248 bits
*/
function toInt248(int256 value) internal pure returns (int248 downcasted) {
downcasted = int248(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(248, value);
}
}
/**
* @dev Returns the downcasted int240 from int256, reverting on
* overflow (when the input is less than smallest int240 or
* greater than largest int240).
*
* Counterpart to Solidity's `int240` operator.
*
* Requirements:
*
* - input must fit into 240 bits
*/
function toInt240(int256 value) internal pure returns (int240 downcasted) {
downcasted = int240(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(240, value);
}
}
/**
* @dev Returns the downcasted int232 from int256, reverting on
* overflow (when the input is less than smallest int232 or
* greater than largest int232).
*
* Counterpart to Solidity's `int232` operator.
*
* Requirements:
*
* - input must fit into 232 bits
*/
function toInt232(int256 value) internal pure returns (int232 downcasted) {
downcasted = int232(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(232, value);
}
}
/**
* @dev Returns the downcasted int224 from int256, reverting on
* overflow (when the input is less than smallest int224 or
* greater than largest int224).
*
* Counterpart to Solidity's `int224` operator.
*
* Requirements:
*
* - input must fit into 224 bits
*/
function toInt224(int256 value) internal pure returns (int224 downcasted) {
downcasted = int224(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(224, value);
}
}
/**
* @dev Returns the downcasted int216 from int256, reverting on
* overflow (when the input is less than smallest int216 or
* greater than largest int216).
*
* Counterpart to Solidity's `int216` operator.
*
* Requirements:
*
* - input must fit into 216 bits
*/
function toInt216(int256 value) internal pure returns (int216 downcasted) {
downcasted = int216(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(216, value);
}
}
/**
* @dev Returns the downcasted int208 from int256, reverting on
* overflow (when the input is less than smallest int208 or
* greater than largest int208).
*
* Counterpart to Solidity's `int208` operator.
*
* Requirements:
*
* - input must fit into 208 bits
*/
function toInt208(int256 value) internal pure returns (int208 downcasted) {
downcasted = int208(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(208, value);
}
}
/**
* @dev Returns the downcasted int200 from int256, reverting on
* overflow (when the input is less than smallest int200 or
* greater than largest int200).
*
* Counterpart to Solidity's `int200` operator.
*
* Requirements:
*
* - input must fit into 200 bits
*/
function toInt200(int256 value) internal pure returns (int200 downcasted) {
downcasted = int200(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(200, value);
}
}
/**
* @dev Returns the downcasted int192 from int256, reverting on
* overflow (when the input is less than smallest int192 or
* greater than largest int192).
*
* Counterpart to Solidity's `int192` operator.
*
* Requirements:
*
* - input must fit into 192 bits
*/
function toInt192(int256 value) internal pure returns (int192 downcasted) {
downcasted = int192(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(192, value);
}
}
/**
* @dev Returns the downcasted int184 from int256, reverting on
* overflow (when the input is less than smallest int184 or
* greater than largest int184).
*
* Counterpart to Solidity's `int184` operator.
*
* Requirements:
*
* - input must fit into 184 bits
*/
function toInt184(int256 value) internal pure returns (int184 downcasted) {
downcasted = int184(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(184, value);
}
}
/**
* @dev Returns the downcasted int176 from int256, reverting on
* overflow (when the input is less than smallest int176 or
* greater than largest int176).
*
* Counterpart to Solidity's `int176` operator.
*
* Requirements:
*
* - input must fit into 176 bits
*/
function toInt176(int256 value) internal pure returns (int176 downcasted) {
downcasted = int176(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(176, value);
}
}
/**
* @dev Returns the downcasted int168 from int256, reverting on
* overflow (when the input is less than smallest int168 or
* greater than largest int168).
*
* Counterpart to Solidity's `int168` operator.
*
* Requirements:
*
* - input must fit into 168 bits
*/
function toInt168(int256 value) internal pure returns (int168 downcasted) {
downcasted = int168(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(168, value);
}
}
/**
* @dev Returns the downcasted int160 from int256, reverting on
* overflow (when the input is less than smallest int160 or
* greater than largest int160).
*
* Counterpart to Solidity's `int160` operator.
*
* Requirements:
*
* - input must fit into 160 bits
*/
function toInt160(int256 value) internal pure returns (int160 downcasted) {
downcasted = int160(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(160, value);
}
}
/**
* @dev Returns the downcasted int152 from int256, reverting on
* overflow (when the input is less than smallest int152 or
* greater than largest int152).
*
* Counterpart to Solidity's `int152` operator.
*
* Requirements:
*
* - input must fit into 152 bits
*/
function toInt152(int256 value) internal pure returns (int152 downcasted) {
downcasted = int152(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(152, value);
}
}
/**
* @dev Returns the downcasted int144 from int256, reverting on
* overflow (when the input is less than smallest int144 or
* greater than largest int144).
*
* Counterpart to Solidity's `int144` operator.
*
* Requirements:
*
* - input must fit into 144 bits
*/
function toInt144(int256 value) internal pure returns (int144 downcasted) {
downcasted = int144(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(144, value);
}
}
/**
* @dev Returns the downcasted int136 from int256, reverting on
* overflow (when the input is less than smallest int136 or
* greater than largest int136).
*
* Counterpart to Solidity's `int136` operator.
*
* Requirements:
*
* - input must fit into 136 bits
*/
function toInt136(int256 value) internal pure returns (int136 downcasted) {
downcasted = int136(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(136, value);
}
}
/**
* @dev Returns the downcasted int128 from int256, reverting on
* overflow (when the input is less than smallest int128 or
* greater than largest int128).
*
* Counterpart to Solidity's `int128` operator.
*
* Requirements:
*
* - input must fit into 128 bits
*/
function toInt128(int256 value) internal pure returns (int128 downcasted) {
downcasted = int128(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(128, value);
}
}
/**
* @dev Returns the downcasted int120 from int256, reverting on
* overflow (when the input is less than smallest int120 or
* greater than largest int120).
*
* Counterpart to Solidity's `int120` operator.
*
* Requirements:
*
* - input must fit into 120 bits
*/
function toInt120(int256 value) internal pure returns (int120 downcasted) {
downcasted = int120(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(120, value);
}
}
/**
* @dev Returns the downcasted int112 from int256, reverting on
* overflow (when the input is less than smallest int112 or
* greater than largest int112).
*
* Counterpart to Solidity's `int112` operator.
*
* Requirements:
*
* - input must fit into 112 bits
*/
function toInt112(int256 value) internal pure returns (int112 downcasted) {
downcasted = int112(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(112, value);
}
}
/**
* @dev Returns the downcasted int104 from int256, reverting on
* overflow (when the input is less than smallest int104 or
* greater than largest int104).
*
* Counterpart to Solidity's `int104` operator.
*
* Requirements:
*
* - input must fit into 104 bits
*/
function toInt104(int256 value) internal pure returns (int104 downcasted) {
downcasted = int104(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(104, value);
}
}
/**
* @dev Returns the downcasted int96 from int256, reverting on
* overflow (when the input is less than smallest int96 or
* greater than largest int96).
*
* Counterpart to Solidity's `int96` operator.
*
* Requirements:
*
* - input must fit into 96 bits
*/
function toInt96(int256 value) internal pure returns (int96 downcasted) {
downcasted = int96(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(96, value);
}
}
/**
* @dev Returns the downcasted int88 from int256, reverting on
* overflow (when the input is less than smallest int88 or
* greater than largest int88).
*
* Counterpart to Solidity's `int88` operator.
*
* Requirements:
*
* - input must fit into 88 bits
*/
function toInt88(int256 value) internal pure returns (int88 downcasted) {
downcasted = int88(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(88, value);
}
}
/**
* @dev Returns the downcasted int80 from int256, reverting on
* overflow (when the input is less than smallest int80 or
* greater than largest int80).
*
* Counterpart to Solidity's `int80` operator.
*
* Requirements:
*
* - input must fit into 80 bits
*/
function toInt80(int256 value) internal pure returns (int80 downcasted) {
downcasted = int80(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(80, value);
}
}
/**
* @dev Returns the downcasted int72 from int256, reverting on
* overflow (when the input is less than smallest int72 or
* greater than largest int72).
*
* Counterpart to Solidity's `int72` operator.
*
* Requirements:
*
* - input must fit into 72 bits
*/
function toInt72(int256 value) internal pure returns (int72 downcasted) {
downcasted = int72(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(72, value);
}
}
/**
* @dev Returns the downcasted int64 from int256, reverting on
* overflow (when the input is less than smallest int64 or
* greater than largest int64).
*
* Counterpart to Solidity's `int64` operator.
*
* Requirements:
*
* - input must fit into 64 bits
*/
function toInt64(int256 value) internal pure returns (int64 downcasted) {
downcasted = int64(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(64, value);
}
}
/**
* @dev Returns the downcasted int56 from int256, reverting on
* overflow (when the input is less than smallest int56 or
* greater than largest int56).
*
* Counterpart to Solidity's `int56` operator.
*
* Requirements:
*
* - input must fit into 56 bits
*/
function toInt56(int256 value) internal pure returns (int56 downcasted) {
downcasted = int56(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(56, value);
}
}
/**
* @dev Returns the downcasted int48 from int256, reverting on
* overflow (when the input is less than smallest int48 or
* greater than largest int48).
*
* Counterpart to Solidity's `int48` operator.
*
* Requirements:
*
* - input must fit into 48 bits
*/
function toInt48(int256 value) internal pure returns (int48 downcasted) {
downcasted = int48(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(48, value);
}
}
/**
* @dev Returns the downcasted int40 from int256, reverting on
* overflow (when the input is less than smallest int40 or
* greater than largest int40).
*
* Counterpart to Solidity's `int40` operator.
*
* Requirements:
*
* - input must fit into 40 bits
*/
function toInt40(int256 value) internal pure returns (int40 downcasted) {
downcasted = int40(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(40, value);
}
}
/**
* @dev Returns the downcasted int32 from int256, reverting on
* overflow (when the input is less than smallest int32 or
* greater than largest int32).
*
* Counterpart to Solidity's `int32` operator.
*
* Requirements:
*
* - input must fit into 32 bits
*/
function toInt32(int256 value) internal pure returns (int32 downcasted) {
downcasted = int32(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(32, value);
}
}
/**
* @dev Returns the downcasted int24 from int256, reverting on
* overflow (when the input is less than smallest int24 or
* greater than largest int24).
*
* Counterpart to Solidity's `int24` operator.
*
* Requirements:
*
* - input must fit into 24 bits
*/
function toInt24(int256 value) internal pure returns (int24 downcasted) {
downcasted = int24(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(24, value);
}
}
/**
* @dev Returns the downcasted int16 from int256, reverting on
* overflow (when the input is less than smallest int16 or
* greater than largest int16).
*
* Counterpart to Solidity's `int16` operator.
*
* Requirements:
*
* - input must fit into 16 bits
*/
function toInt16(int256 value) internal pure returns (int16 downcasted) {
downcasted = int16(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(16, value);
}
}
/**
* @dev Returns the downcasted int8 from int256, reverting on
* overflow (when the input is less than smallest int8 or
* greater than largest int8).
*
* Counterpart to Solidity's `int8` operator.
*
* Requirements:
*
* - input must fit into 8 bits
*/
function toInt8(int256 value) internal pure returns (int8 downcasted) {
downcasted = int8(value);
if (downcasted != value) {
revert SafeCastOverflowedIntDowncast(8, value);
}
}
/**
* @dev Converts an unsigned uint256 into a signed int256.
*
* Requirements:
*
* - input must be less than or equal to maxInt256.
*/
function toInt256(uint256 value) internal pure returns (int256) {
// Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive
if (value > uint256(type(int256).max)) {
revert SafeCastOverflowedUintToInt(value);
}
return int256(value);
}
/**
* @dev Cast a boolean (false or true) to a uint256 (0 or 1) with no jump.
*/
function toUint(bool b) internal pure returns (uint256 u) {
assembly ("memory-safe") {
u := iszero(iszero(b))
}
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.0) (utils/math/SignedMath.sol)
pragma solidity ^0.8.20;
import {SafeCast} from "./SafeCast.sol";
/**
* @dev Standard signed math utilities missing in the Solidity language.
*/
library SignedMath {
/**
* @dev Branchless ternary evaluation for `a ? b : c`. Gas costs are constant.
*
* IMPORTANT: This function may reduce bytecode size and consume less gas when used standalone.
* However, the compiler may optimize Solidity ternary operations (i.e. `a ? b : c`) to only compute
* one branch when needed, making this function more expensive.
*/
function ternary(bool condition, int256 a, int256 b) internal pure returns (int256) {
unchecked {
// branchless ternary works because:
// b ^ (a ^ b) == a
// b ^ 0 == b
return b ^ ((a ^ b) * int256(SafeCast.toUint(condition)));
}
}
/**
* @dev Returns the largest of two signed numbers.
*/
function max(int256 a, int256 b) internal pure returns (int256) {
return ternary(a > b, a, b);
}
/**
* @dev Returns the smallest of two signed numbers.
*/
function min(int256 a, int256 b) internal pure returns (int256) {
return ternary(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 {
// Formula from the "Bit Twiddling Hacks" by Sean Eron Anderson.
// Since `n` is a signed integer, the generated bytecode will use the SAR opcode to perform the right shift,
// taking advantage of the most significant (or "sign" bit) in two's complement representation.
// This opcode adds new most significant bits set to the value of the previous most significant bit. As a result,
// the mask will either be `bytes32(0)` (if n is positive) or `~bytes32(0)` (if n is negative).
int256 mask = n >> 255;
// A `bytes32(0)` mask leaves the input unchanged, while a `~bytes32(0)` mask complements it.
return uint256((n + mask) ^ mask);
}
}
}
// 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.1.0) (utils/Panic.sol)
pragma solidity ^0.8.20;
/**
* @dev Helper library for emitting standardized panic codes.
*
* ```solidity
* contract Example {
* using Panic for uint256;
*
* // Use any of the declared internal constants
* function foo() { Panic.GENERIC.panic(); }
*
* // Alternatively
* function foo() { Panic.panic(Panic.GENERIC); }
* }
* ```
*
* Follows the list from https://github.com/ethereum/solidity/blob/v0.8.24/libsolutil/ErrorCodes.h[libsolutil].
*
* _Available since v5.1._
*/
// slither-disable-next-line unused-state
library Panic {
/// @dev generic / unspecified error
uint256 internal constant GENERIC = 0x00;
/// @dev used by the assert() builtin
uint256 internal constant ASSERT = 0x01;
/// @dev arithmetic underflow or overflow
uint256 internal constant UNDER_OVERFLOW = 0x11;
/// @dev division or modulo by zero
uint256 internal constant DIVISION_BY_ZERO = 0x12;
/// @dev enum conversion error
uint256 internal constant ENUM_CONVERSION_ERROR = 0x21;
/// @dev invalid encoding in storage
uint256 internal constant STORAGE_ENCODING_ERROR = 0x22;
/// @dev empty array pop
uint256 internal constant EMPTY_ARRAY_POP = 0x31;
/// @dev array out of bounds access
uint256 internal constant ARRAY_OUT_OF_BOUNDS = 0x32;
/// @dev resource error (too large allocation or too large array)
uint256 internal constant RESOURCE_ERROR = 0x41;
/// @dev calling invalid internal function
uint256 internal constant INVALID_INTERNAL_FUNCTION = 0x51;
/// @dev Reverts with a panic code. Recommended to use with
/// the internal constants with predefined codes.
function panic(uint256 code) internal pure {
assembly ("memory-safe") {
mstore(0x00, 0x4e487b71)
mstore(0x20, code)
revert(0x1c, 0x24)
}
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.1.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);
assembly ("memory-safe") {
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.1.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 ERC-1967 implementation slot:
* ```solidity
* contract ERC1967 {
* // Define the slot. Alternatively, use the SlotDerivation library to derive the slot.
* 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;
* }
* }
* ```
*
* TIP: Consider using this library along with {SlotDerivation}.
*/
library StorageSlot {
struct AddressSlot {
address value;
}
struct BooleanSlot {
bool value;
}
struct Bytes32Slot {
bytes32 value;
}
struct Uint256Slot {
uint256 value;
}
struct Int256Slot {
int256 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) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `BooleanSlot` with member `value` located at `slot`.
*/
function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Bytes32Slot` with member `value` located at `slot`.
*/
function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Uint256Slot` with member `value` located at `slot`.
*/
function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `Int256Slot` with member `value` located at `slot`.
*/
function getInt256Slot(bytes32 slot) internal pure returns (Int256Slot storage r) {
assembly ("memory-safe") {
r.slot := slot
}
}
/**
* @dev Returns a `StringSlot` with member `value` located at `slot`.
*/
function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
assembly ("memory-safe") {
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) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
/**
* @dev Returns a `BytesSlot` with member `value` located at `slot`.
*/
function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
assembly ("memory-safe") {
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) {
assembly ("memory-safe") {
r.slot := store.slot
}
}
}
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.2.0) (utils/Strings.sol)
pragma solidity ^0.8.20;
import {Math} from "./math/Math.sol";
import {SafeCast} from "./math/SafeCast.sol";
import {SignedMath} from "./math/SignedMath.sol";
/**
* @dev String operations.
*/
library Strings {
using SafeCast for *;
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 The string being parsed contains characters that are not in scope of the given base.
*/
error StringsInvalidChar();
/**
* @dev The string being parsed is not a properly formatted address.
*/
error StringsInvalidAddressFormat();
/**
* @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;
assembly ("memory-safe") {
ptr := add(buffer, add(32, length))
}
while (true) {
ptr--;
assembly ("memory-safe") {
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 Converts an `address` with fixed length of 20 bytes to its checksummed ASCII `string` hexadecimal
* representation, according to EIP-55.
*/
function toChecksumHexString(address addr) internal pure returns (string memory) {
bytes memory buffer = bytes(toHexString(addr));
// hash the hex part of buffer (skip length + 2 bytes, length 40)
uint256 hashValue;
assembly ("memory-safe") {
hashValue := shr(96, keccak256(add(buffer, 0x22), 40))
}
for (uint256 i = 41; i > 1; --i) {
// possible values for buffer[i] are 48 (0) to 57 (9) and 97 (a) to 102 (f)
if (hashValue & 0xf > 7 && uint8(buffer[i]) > 96) {
// case shift by xoring with 0x20
buffer[i] ^= 0x20;
}
hashValue >>= 4;
}
return string(buffer);
}
/**
* @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));
}
/**
* @dev Parse a decimal string and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input) internal pure returns (uint256) {
return parseUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[0-9]*`
* - The result must fit into an `uint256` type
*/
function parseUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseUint-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseUint} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
uint256 result = 0;
for (uint256 i = begin; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 9) return (false, 0);
result *= 10;
result += chr;
}
return (true, result);
}
/**
* @dev Parse a decimal string and returns the value as a `int256`.
*
* Requirements:
* - The string must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input) internal pure returns (int256) {
return parseInt(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseInt-string} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `[-+]?[0-9]*`
* - The result must fit in an `int256` type.
*/
function parseInt(string memory input, uint256 begin, uint256 end) internal pure returns (int256) {
(bool success, int256 value) = tryParseInt(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseInt-string} that returns false if the parsing fails because of an invalid character or if
* the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(string memory input) internal pure returns (bool success, int256 value) {
return _tryParseIntUncheckedBounds(input, 0, bytes(input).length);
}
uint256 private constant ABS_MIN_INT256 = 2 ** 255;
/**
* @dev Variant of {parseInt-string-uint256-uint256} that returns false if the parsing fails because of an invalid
* character or if the result does not fit in a `int256`.
*
* NOTE: This function will revert if the absolute value of the result does not fit in a `uint256`.
*/
function tryParseInt(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, int256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseIntUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseInt} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseIntUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, int256 value) {
bytes memory buffer = bytes(input);
// Check presence of a negative sign.
bytes1 sign = begin == end ? bytes1(0) : bytes1(_unsafeReadBytesOffset(buffer, begin)); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
bool positiveSign = sign == bytes1("+");
bool negativeSign = sign == bytes1("-");
uint256 offset = (positiveSign || negativeSign).toUint();
(bool absSuccess, uint256 absValue) = tryParseUint(input, begin + offset, end);
if (absSuccess && absValue < ABS_MIN_INT256) {
return (true, negativeSign ? -int256(absValue) : int256(absValue));
} else if (absSuccess && negativeSign && absValue == ABS_MIN_INT256) {
return (true, type(int256).min);
} else return (false, 0);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as a `uint256`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input) internal pure returns (uint256) {
return parseHexUint(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]*`
* - The result must fit in an `uint256` type.
*/
function parseHexUint(string memory input, uint256 begin, uint256 end) internal pure returns (uint256) {
(bool success, uint256 value) = tryParseHexUint(input, begin, end);
if (!success) revert StringsInvalidChar();
return value;
}
/**
* @dev Variant of {parseHexUint-string} that returns false if the parsing fails because of an invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(string memory input) internal pure returns (bool success, uint256 value) {
return _tryParseHexUintUncheckedBounds(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseHexUint-string-uint256-uint256} that returns false if the parsing fails because of an
* invalid character.
*
* NOTE: This function will revert if the result does not fit in a `uint256`.
*/
function tryParseHexUint(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, uint256 value) {
if (end > bytes(input).length || begin > end) return (false, 0);
return _tryParseHexUintUncheckedBounds(input, begin, end);
}
/**
* @dev Implementation of {tryParseHexUint} that does not check bounds. Caller should make sure that
* `begin <= end <= input.length`. Other inputs would result in undefined behavior.
*/
function _tryParseHexUintUncheckedBounds(
string memory input,
uint256 begin,
uint256 end
) private pure returns (bool success, uint256 value) {
bytes memory buffer = bytes(input);
// skip 0x prefix if present
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(buffer, begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 offset = hasPrefix.toUint() * 2;
uint256 result = 0;
for (uint256 i = begin + offset; i < end; ++i) {
uint8 chr = _tryParseChr(bytes1(_unsafeReadBytesOffset(buffer, i)));
if (chr > 15) return (false, 0);
result *= 16;
unchecked {
// Multiplying by 16 is equivalent to a shift of 4 bits (with additional overflow check).
// This guaratees that adding a value < 16 will not cause an overflow, hence the unchecked.
result += chr;
}
}
return (true, result);
}
/**
* @dev Parse a hexadecimal string (with or without "0x" prefix), and returns the value as an `address`.
*
* Requirements:
* - The string must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input) internal pure returns (address) {
return parseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress} that parses a substring of `input` located between position `begin` (included) and
* `end` (excluded).
*
* Requirements:
* - The substring must be formatted as `(0x)?[0-9a-fA-F]{40}`
*/
function parseAddress(string memory input, uint256 begin, uint256 end) internal pure returns (address) {
(bool success, address value) = tryParseAddress(input, begin, end);
if (!success) revert StringsInvalidAddressFormat();
return value;
}
/**
* @dev Variant of {parseAddress-string} that returns false if the parsing fails because the input is not a properly
* formatted address. See {parseAddress} requirements.
*/
function tryParseAddress(string memory input) internal pure returns (bool success, address value) {
return tryParseAddress(input, 0, bytes(input).length);
}
/**
* @dev Variant of {parseAddress-string-uint256-uint256} that returns false if the parsing fails because input is not a properly
* formatted address. See {parseAddress} requirements.
*/
function tryParseAddress(
string memory input,
uint256 begin,
uint256 end
) internal pure returns (bool success, address value) {
if (end > bytes(input).length || begin > end) return (false, address(0));
bool hasPrefix = (end > begin + 1) && bytes2(_unsafeReadBytesOffset(bytes(input), begin)) == bytes2("0x"); // don't do out-of-bound (possibly unsafe) read if sub-string is empty
uint256 expectedLength = 40 + hasPrefix.toUint() * 2;
// check that input is the correct length
if (end - begin == expectedLength) {
// length guarantees that this does not overflow, and value is at most type(uint160).max
(bool s, uint256 v) = _tryParseHexUintUncheckedBounds(input, begin, end);
return (s, address(uint160(v)));
} else {
return (false, address(0));
}
}
function _tryParseChr(bytes1 chr) private pure returns (uint8) {
uint8 value = uint8(chr);
// Try to parse `chr`:
// - Case 1: [0-9]
// - Case 2: [a-f]
// - Case 3: [A-F]
// - otherwise not supported
unchecked {
if (value > 47 && value < 58) value -= 48;
else if (value > 96 && value < 103) value -= 87;
else if (value > 64 && value < 71) value -= 55;
else return type(uint8).max;
}
return value;
}
/**
* @dev Reads a bytes32 from a bytes array without bounds checking.
*
* NOTE: making this function internal would mean it could be used with memory unsafe offset, and marking the
* assembly block as such would prevent some optimizations.
*/
function _unsafeReadBytesOffset(bytes memory buffer, uint256 offset) private pure returns (bytes32 value) {
// This is not memory safe in the general case, but all calls to this private function are within bounds.
assembly ("memory-safe") {
value := mload(add(buffer, add(0x20, offset)))
}
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
library TestsAccounts {
function getAccount(uint index) pure public returns (address) {
return address(0);
}
}
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
library Assert {
event AssertionEvent(
bool passed,
string message,
string methodName
);
event AssertionEventUint(
bool passed,
string message,
string methodName,
uint256 returned,
uint256 expected
);
event AssertionEventInt(
bool passed,
string message,
string methodName,
int256 returned,
int256 expected
);
event AssertionEventBool(
bool passed,
string message,
string methodName,
bool returned,
bool expected
);
event AssertionEventAddress(
bool passed,
string message,
string methodName,
address returned,
address expected
);
event AssertionEventBytes32(
bool passed,
string message,
string methodName,
bytes32 returned,
bytes32 expected
);
event AssertionEventString(
bool passed,
string message,
string methodName,
string returned,
string expected
);
event AssertionEventUintInt(
bool passed,
string message,
string methodName,
uint256 returned,
int256 expected
);
event AssertionEventIntUint(
bool passed,
string message,
string methodName,
int256 returned,
uint256 expected
);
function ok(bool a, string memory message) public returns (bool result) {
result = a;
emit AssertionEvent(result, message, "ok");
}
function equal(uint256 a, uint256 b, string memory message) public returns (bool result) {
result = (a == b);
emit AssertionEventUint(result, message, "equal", a, b);
}
function equal(int256 a, int256 b, string memory message) public returns (bool result) {
result = (a == b);
emit AssertionEventInt(result, message, "equal", a, b);
}
function equal(bool a, bool b, string memory message) public returns (bool result) {
result = (a == b);
emit AssertionEventBool(result, message, "equal", a, b);
}
// TODO: only for certain versions of solc
//function equal(fixed a, fixed b, string message) public returns (bool result) {
// result = (a == b);
// emit AssertionEvent(result, message);
//}
// TODO: only for certain versions of solc
//function equal(ufixed a, ufixed b, string message) public returns (bool result) {
// result = (a == b);
// emit AssertionEvent(result, message);
//}
function equal(address a, address b, string memory message) public returns (bool result) {
result = (a == b);
emit AssertionEventAddress(result, message, "equal", a, b);
}
function equal(bytes32 a, bytes32 b, string memory message) public returns (bool result) {
result = (a == b);
emit AssertionEventBytes32(result, message, "equal", a, b);
}
function equal(string memory a, string memory b, string memory message) public returns (bool result) {
result = (keccak256(abi.encodePacked(a)) == keccak256(abi.encodePacked(b)));
emit AssertionEventString(result, message, "equal", a, b);
}
function notEqual(uint256 a, uint256 b, string memory message) public returns (bool result) {
result = (a != b);
emit AssertionEventUint(result, message, "notEqual", a, b);
}
function notEqual(int256 a, int256 b, string memory message) public returns (bool result) {
result = (a != b);
emit AssertionEventInt(result, message, "notEqual", a, b);
}
function notEqual(bool a, bool b, string memory message) public returns (bool result) {
result = (a != b);
emit AssertionEventBool(result, message, "notEqual", a, b);
}
// TODO: only for certain versions of solc
//function notEqual(fixed a, fixed b, string message) public returns (bool result) {
// result = (a != b);
// emit AssertionEvent(result, message);
//}
// TODO: only for certain versions of solc
//function notEqual(ufixed a, ufixed b, string message) public returns (bool result) {
// result = (a != b);
// emit AssertionEvent(result, message);
//}
function notEqual(address a, address b, string memory message) public returns (bool result) {
result = (a != b);
emit AssertionEventAddress(result, message, "notEqual", a, b);
}
function notEqual(bytes32 a, bytes32 b, string memory message) public returns (bool result) {
result = (a != b);
emit AssertionEventBytes32(result, message, "notEqual", a, b);
}
function notEqual(string memory a, string memory b, string memory message) public returns (bool result) {
result = (keccak256(abi.encodePacked(a)) != keccak256(abi.encodePacked(b)));
emit AssertionEventString(result, message, "notEqual", a, b);
}
/*----------------- Greater than --------------------*/
function greaterThan(uint256 a, uint256 b, string memory message) public returns (bool result) {
result = (a > b);
emit AssertionEventUint(result, message, "greaterThan", a, b);
}
function greaterThan(int256 a, int256 b, string memory message) public returns (bool result) {
result = (a > b);
emit AssertionEventInt(result, message, "greaterThan", a, b);
}
// TODO: safely compare between uint and int
function greaterThan(uint256 a, int256 b, string memory message) public returns (bool result) {
if(b < int(0)) {
// int is negative uint "a" always greater
result = true;
} else {
result = (a > uint(b));
}
emit AssertionEventUintInt(result, message, "greaterThan", a, b);
}
function greaterThan(int256 a, uint256 b, string memory message) public returns (bool result) {
if(a < int(0)) {
// int is negative uint "b" always greater
result = false;
} else {
result = (uint(a) > b);
}
emit AssertionEventIntUint(result, message, "greaterThan", a, b);
}
/*----------------- Lesser than --------------------*/
function lesserThan(uint256 a, uint256 b, string memory message) public returns (bool result) {
result = (a < b);
emit AssertionEventUint(result, message, "lesserThan", a, b);
}
function lesserThan(int256 a, int256 b, string memory message) public returns (bool result) {
result = (a < b);
emit AssertionEventInt(result, message, "lesserThan", a, b);
}
// TODO: safely compare between uint and int
function lesserThan(uint256 a, int256 b, string memory message) public returns (bool result) {
if(b < int(0)) {
// int is negative int "b" always lesser
result = false;
} else {
result = (a < uint(b));
}
emit AssertionEventUintInt(result, message, "lesserThan", a, b);
}
function lesserThan(int256 a, uint256 b, string memory message) public returns (bool result) {
if(a < int(0)) {
// int is negative int "a" always lesser
result = true;
} else {
result = (uint(a) < b);
}
emit AssertionEventIntUint(result, message, "lesserThan", a, b);
}
}
[core]
repositoryformatversion = 0
filemode = false
bare = false
logallrefupdates = true
symlinks = false
ignorecase = true
ref: refs/heads/main
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
}
},
{
"files": "*.yml",
"options": {}
},
{
"files": "*.yaml",
"options": {}
},
{
"files": "*.toml",
"options": {}
},
{
"files": "*.json",
"options": {}
},
{
"files": "*.js",
"options": {}
},
{
"files": "*.ts",
"options": {}
}
]
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "6055604b600b8282823980515f1a607314603f577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea264697066735822122050a50ea457725d1bb833ad764c623758be96809144ebf3b2c264da011f69e70e64736f6c634300081c0033",
"opcodes": "PUSH1 0x55 PUSH1 0x4B PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH0 BYTE PUSH1 0x73 EQ PUSH1 0x3F JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH0 MSTORE PUSH0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH0 REVERT JUMPDEST ADDRESS PUSH0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 PUSH0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 POP 0xA5 0xE LOG4 JUMPI PUSH19 0x5D1BB833AD764C623758BE96809144EBF3B2C2 PUSH5 0xDA011F69E7 0xE PUSH5 0x736F6C6343 STOP ADDMOD SHR STOP CALLER ",
"sourceMap": "10720:19064:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "730000000000000000000000000000000000000000301460806040525f5ffdfea264697066735822122050a50ea457725d1bb833ad764c623758be96809144ebf3b2c264da011f69e70e64736f6c634300081c0033",
"opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 PUSH0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 POP 0xA5 0xE LOG4 JUMPI PUSH19 0x5D1BB833AD764C623758BE96809144EBF3B2C2 PUSH5 0xDA011F69E7 0xE PUSH5 0x736F6C6343 STOP ADDMOD SHR STOP CALLER ",
"sourceMap": "10720:19064:1:-:0;;;;;;;;"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "17000",
"executionCost": "92",
"totalCost": "17092"
},
"internal": {
"concat(bytes memory,bytes memory)": "infinite",
"concatStorage(bytes storage pointer,bytes memory)": "infinite",
"equal(bytes memory,bytes memory)": "infinite",
"equalStorage(bytes storage pointer,bytes memory)": "infinite",
"slice(bytes memory,uint256,uint256)": "infinite",
"toAddress(bytes memory,uint256)": "infinite",
"toBytes32(bytes memory,uint256)": "infinite",
"toUint128(bytes memory,uint256)": "infinite",
"toUint16(bytes memory,uint256)": "infinite",
"toUint256(bytes memory,uint256)": "infinite",
"toUint32(bytes memory,uint256)": "infinite",
"toUint64(bytes memory,uint256)": "infinite",
"toUint8(bytes memory,uint256)": "infinite",
"toUint96(bytes memory,uint256)": "infinite"
}
},
"methodIdentifiers": {}
},
"abi": []
}
{
"compiler": {
"version": "0.8.28+commit.7893614a"
},
"language": "Solidity",
"output": {
"abi": [],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/access/Ownable.sol": "BytesLib"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"/contracts/utils/Context.sol": {
"keccak256": "0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de",
"license": "MIT",
"urls": [
"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc",
"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6"
]
},
"contracts/access/Ownable.sol": {
"keccak256": "0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982",
"license": "MIT",
"urls": [
"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887",
"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "6055604b600b8282823980515f1a607314603f577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220e0c7ced395096aabef52a06882111151517b2fa4ac4f600e53bddf8e3c3e143e64736f6c634300081c0033",
"opcodes": "PUSH1 0x55 PUSH1 0x4B PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH0 BYTE PUSH1 0x73 EQ PUSH1 0x3F JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH0 MSTORE PUSH0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH0 REVERT JUMPDEST ADDRESS PUSH0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 PUSH0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE0 0xC7 0xCE 0xD3 SWAP6 MULMOD PUSH11 0xABEF52A06882111151517B 0x2F LOG4 0xAC 0x4F PUSH1 0xE MSTORE8 0xBD 0xDF DUP15 EXTCODECOPY RETURNDATACOPY EQ RETURNDATACOPY PUSH5 0x736F6C6343 STOP ADDMOD SHR STOP CALLER ",
"sourceMap": "36544:5472:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220e0c7ced395096aabef52a06882111151517b2fa4ac4f600e53bddf8e3c3e143e64736f6c634300081c0033",
"opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 PUSH0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE0 0xC7 0xCE 0xD3 SWAP6 MULMOD PUSH11 0xABEF52A06882111151517B 0x2F LOG4 0xAC 0x4F PUSH1 0xE MSTORE8 0xBD 0xDF DUP15 EXTCODECOPY RETURNDATACOPY EQ RETURNDATACOPY PUSH5 0x736F6C6343 STOP ADDMOD SHR STOP CALLER ",
"sourceMap": "36544:5472:1:-:0;;;;;;;;"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "17000",
"executionCost": "92",
"totalCost": "17092"
},
"internal": {
"excessivelySafeCall(address,uint256,uint16,bytes memory)": "infinite",
"excessivelySafeStaticCall(address,uint256,uint16,bytes memory)": "infinite",
"swapSelector(bytes4,bytes memory)": "infinite"
}
},
"methodIdentifiers": {}
},
"abi": []
}
{
"compiler": {
"version": "0.8.28+commit.7893614a"
},
"language": "Solidity",
"output": {
"abi": [],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/access/Ownable.sol": "ExcessivelySafeCall"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"/contracts/utils/Context.sol": {
"keccak256": "0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de",
"license": "MIT",
"urls": [
"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc",
"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6"
]
},
"contracts/access/Ownable.sol": {
"keccak256": "0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982",
"license": "MIT",
"urls": [
"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887",
"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"estimateFees(uint16,address,bytes,bool,bytes)": "40a7bb10",
"forceResumeReceive(uint16,bytes)": "42d65a8d",
"getChainId()": "3408e470",
"getConfig(uint16,uint16,address,uint256)": "f5ecbdbc",
"getInboundNonce(uint16,bytes)": "fdc07c70",
"getOutboundNonce(uint16,address)": "7a145748",
"getReceiveLibraryAddress(address)": "71ba2fd6",
"getReceiveVersion(address)": "da1a7c9a",
"getSendLibraryAddress(address)": "9c729da1",
"getSendVersion(address)": "096568f6",
"hasStoredPayload(uint16,bytes)": "0eaf6ea6",
"isReceivingPayload()": "ca066b35",
"isSendingPayload()": "e97a448a",
"receivePayload(uint16,bytes,address,uint64,uint256,bytes)": "c2fa4813",
"retryPayload(uint16,bytes,bytes)": "aaff5f16",
"send(uint16,bytes,bytes,address,address,bytes)": "c5803100",
"setConfig(uint16,uint16,uint256,bytes)": "cbed8b9c",
"setReceiveVersion(uint16)": "10ddb137",
"setSendVersion(uint16)": "07e0db17"
}
},
"abi": [
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"internalType": "bool",
"name": "_payInZRO",
"type": "bool"
},
{
"internalType": "bytes",
"name": "_adapterParam",
"type": "bytes"
}
],
"name": "estimateFees",
"outputs": [
{
"internalType": "uint256",
"name": "nativeFee",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "zroFee",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getChainId",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "getInboundNonce",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "_srcAddress",
"type": "address"
}
],
"name": "getOutboundNonce",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getReceiveLibraryAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getReceiveVersion",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getSendLibraryAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getSendVersion",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "hasStoredPayload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isReceivingPayload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isSendingPayload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "address",
"name": "_dstAddress",
"type": "address"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "uint256",
"name": "_gasLimit",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "receivePayload",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "retryPayload",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_destination",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"internalType": "address payable",
"name": "_refundAddress",
"type": "address"
},
{
"internalType": "address",
"name": "_zroPaymentAddress",
"type": "address"
},
{
"internalType": "bytes",
"name": "_adapterParams",
"type": "bytes"
}
],
"name": "send",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.28+commit.7893614a"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"internalType": "bool",
"name": "_payInZRO",
"type": "bool"
},
{
"internalType": "bytes",
"name": "_adapterParam",
"type": "bytes"
}
],
"name": "estimateFees",
"outputs": [
{
"internalType": "uint256",
"name": "nativeFee",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "zroFee",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getChainId",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "getInboundNonce",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "_srcAddress",
"type": "address"
}
],
"name": "getOutboundNonce",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getReceiveLibraryAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getReceiveVersion",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getSendLibraryAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getSendVersion",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "hasStoredPayload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isReceivingPayload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isSendingPayload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "address",
"name": "_dstAddress",
"type": "address"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "uint256",
"name": "_gasLimit",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "receivePayload",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "retryPayload",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_destination",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"internalType": "address payable",
"name": "_refundAddress",
"type": "address"
},
{
"internalType": "address",
"name": "_zroPaymentAddress",
"type": "address"
},
{
"internalType": "bytes",
"name": "_adapterParams",
"type": "bytes"
}
],
"name": "send",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/access/Ownable.sol": "ILayerZeroEndpoint"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"/contracts/utils/Context.sol": {
"keccak256": "0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de",
"license": "MIT",
"urls": [
"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc",
"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6"
]
},
"contracts/access/Ownable.sol": {
"keccak256": "0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982",
"license": "MIT",
"urls": [
"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887",
"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"lzReceive(uint16,bytes,uint64,bytes)": "001d3567"
}
},
"abi": [
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "lzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.28+commit.7893614a"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "lzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/access/Ownable.sol": "ILayerZeroReceiver"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"/contracts/utils/Context.sol": {
"keccak256": "0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de",
"license": "MIT",
"urls": [
"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc",
"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6"
]
},
"contracts/access/Ownable.sol": {
"keccak256": "0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982",
"license": "MIT",
"urls": [
"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887",
"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"forceResumeReceive(uint16,bytes)": "42d65a8d",
"setConfig(uint16,uint16,uint256,bytes)": "cbed8b9c",
"setReceiveVersion(uint16)": "10ddb137",
"setSendVersion(uint16)": "07e0db17"
}
},
"abi": [
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.28+commit.7893614a"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/access/Ownable.sol": "ILayerZeroUserApplicationConfig"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"/contracts/utils/Context.sol": {
"keccak256": "0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de",
"license": "MIT",
"urls": [
"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc",
"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6"
]
},
"contracts/access/Ownable.sol": {
"keccak256": "0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982",
"license": "MIT",
"urls": [
"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887",
"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"DEFAULT_PAYLOAD_SIZE_LIMIT()": "c4461834",
"forceResumeReceive(uint16,bytes)": "42d65a8d",
"getConfig(uint16,uint16,address,uint256)": "f5ecbdbc",
"getTrustedRemoteAddress(uint16)": "9f38369a",
"isTrustedRemote(uint16,bytes)": "3d8b38f6",
"lzEndpoint()": "b353aaa7",
"lzReceive(uint16,bytes,uint64,bytes)": "001d3567",
"minDstGasLookup(uint16,uint16)": "8cfd8f5c",
"owner()": "8da5cb5b",
"payloadSizeLimitLookup(uint16)": "3f1f4fa4",
"precrime()": "950c8a74",
"renounceOwnership()": "715018a6",
"setConfig(uint16,uint16,uint256,bytes)": "cbed8b9c",
"setMinDstGas(uint16,uint16,uint256)": "df2a5b3b",
"setPayloadSizeLimit(uint16,uint256)": "0df37483",
"setPrecrime(address)": "baf3292d",
"setReceiveVersion(uint16)": "10ddb137",
"setSendVersion(uint16)": "07e0db17",
"setTrustedRemote(uint16,bytes)": "eb8d72b7",
"setTrustedRemoteAddress(uint16,bytes)": "a6c3d165",
"transferOwnership(address)": "f2fde38b",
"trustedRemoteLookup(uint16)": "7533d788"
}
},
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint16",
"name": "_type",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_minDstGas",
"type": "uint256"
}
],
"name": "SetMinDstGas",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "precrime",
"type": "address"
}
],
"name": "SetPrecrime",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "SetTrustedRemote",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "SetTrustedRemoteAddress",
"type": "event"
},
{
"inputs": [],
"name": "DEFAULT_PAYLOAD_SIZE_LIMIT",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
}
],
"name": "getTrustedRemoteAddress",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "isTrustedRemote",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "lzEndpoint",
"outputs": [
{
"internalType": "contract ILayerZeroEndpoint",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "lzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "minDstGasLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "payloadSizeLimitLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "precrime",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_packetType",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_minGas",
"type": "uint256"
}
],
"name": "setMinDstGas",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_size",
"type": "uint256"
}
],
"name": "setPayloadSizeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_precrime",
"type": "address"
}
],
"name": "setPrecrime",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "setTrustedRemote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "setTrustedRemoteAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "trustedRemoteLookup",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.28+commit.7893614a"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint16",
"name": "_type",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_minDstGas",
"type": "uint256"
}
],
"name": "SetMinDstGas",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "precrime",
"type": "address"
}
],
"name": "SetPrecrime",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "SetTrustedRemote",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "SetTrustedRemoteAddress",
"type": "event"
},
{
"inputs": [],
"name": "DEFAULT_PAYLOAD_SIZE_LIMIT",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
}
],
"name": "getTrustedRemoteAddress",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "isTrustedRemote",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "lzEndpoint",
"outputs": [
{
"internalType": "contract ILayerZeroEndpoint",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "lzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "minDstGasLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "payloadSizeLimitLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "precrime",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_packetType",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_minGas",
"type": "uint256"
}
],
"name": "setMinDstGas",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_size",
"type": "uint256"
}
],
"name": "setPayloadSizeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_precrime",
"type": "address"
}
],
"name": "setPrecrime",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "setTrustedRemote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "setTrustedRemoteAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "trustedRemoteLookup",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/access/Ownable.sol": "LzApp"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"/contracts/utils/Context.sol": {
"keccak256": "0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de",
"license": "MIT",
"urls": [
"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc",
"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6"
]
},
"contracts/access/Ownable.sol": {
"keccak256": "0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982",
"license": "MIT",
"urls": [
"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887",
"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"DEFAULT_PAYLOAD_SIZE_LIMIT()": "c4461834",
"failedMessages(uint16,bytes,uint64)": "5b8c41e6",
"forceResumeReceive(uint16,bytes)": "42d65a8d",
"getConfig(uint16,uint16,address,uint256)": "f5ecbdbc",
"getTrustedRemoteAddress(uint16)": "9f38369a",
"isTrustedRemote(uint16,bytes)": "3d8b38f6",
"lzEndpoint()": "b353aaa7",
"lzReceive(uint16,bytes,uint64,bytes)": "001d3567",
"minDstGasLookup(uint16,uint16)": "8cfd8f5c",
"nonblockingLzReceive(uint16,bytes,uint64,bytes)": "66ad5c8a",
"owner()": "8da5cb5b",
"payloadSizeLimitLookup(uint16)": "3f1f4fa4",
"precrime()": "950c8a74",
"renounceOwnership()": "715018a6",
"retryMessage(uint16,bytes,uint64,bytes)": "d1deba1f",
"setConfig(uint16,uint16,uint256,bytes)": "cbed8b9c",
"setMinDstGas(uint16,uint16,uint256)": "df2a5b3b",
"setPayloadSizeLimit(uint16,uint256)": "0df37483",
"setPrecrime(address)": "baf3292d",
"setReceiveVersion(uint16)": "10ddb137",
"setSendVersion(uint16)": "07e0db17",
"setTrustedRemote(uint16,bytes)": "eb8d72b7",
"setTrustedRemoteAddress(uint16,bytes)": "a6c3d165",
"transferOwnership(address)": "f2fde38b",
"trustedRemoteLookup(uint16)": "7533d788"
}
},
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_reason",
"type": "bytes"
}
],
"name": "MessageFailed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "_payloadHash",
"type": "bytes32"
}
],
"name": "RetryMessageSuccess",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint16",
"name": "_type",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_minDstGas",
"type": "uint256"
}
],
"name": "SetMinDstGas",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "precrime",
"type": "address"
}
],
"name": "SetPrecrime",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "SetTrustedRemote",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "SetTrustedRemoteAddress",
"type": "event"
},
{
"inputs": [],
"name": "DEFAULT_PAYLOAD_SIZE_LIMIT",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"name": "failedMessages",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
}
],
"name": "getTrustedRemoteAddress",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "isTrustedRemote",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "lzEndpoint",
"outputs": [
{
"internalType": "contract ILayerZeroEndpoint",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "lzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "minDstGasLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "nonblockingLzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "payloadSizeLimitLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "precrime",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "retryMessage",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_packetType",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_minGas",
"type": "uint256"
}
],
"name": "setMinDstGas",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_size",
"type": "uint256"
}
],
"name": "setPayloadSizeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_precrime",
"type": "address"
}
],
"name": "setPrecrime",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "setTrustedRemote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "setTrustedRemoteAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "trustedRemoteLookup",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.28+commit.7893614a"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_reason",
"type": "bytes"
}
],
"name": "MessageFailed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "_payloadHash",
"type": "bytes32"
}
],
"name": "RetryMessageSuccess",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint16",
"name": "_type",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_minDstGas",
"type": "uint256"
}
],
"name": "SetMinDstGas",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "precrime",
"type": "address"
}
],
"name": "SetPrecrime",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "SetTrustedRemote",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "SetTrustedRemoteAddress",
"type": "event"
},
{
"inputs": [],
"name": "DEFAULT_PAYLOAD_SIZE_LIMIT",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"name": "failedMessages",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
}
],
"name": "getTrustedRemoteAddress",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "isTrustedRemote",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "lzEndpoint",
"outputs": [
{
"internalType": "contract ILayerZeroEndpoint",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "lzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "minDstGasLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "nonblockingLzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "payloadSizeLimitLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "precrime",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "retryMessage",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_packetType",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_minGas",
"type": "uint256"
}
],
"name": "setMinDstGas",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_size",
"type": "uint256"
}
],
"name": "setPayloadSizeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_precrime",
"type": "address"
}
],
"name": "setPrecrime",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "setTrustedRemote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "setTrustedRemoteAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "trustedRemoteLookup",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/access/Ownable.sol": "NonblockingLzApp"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"/contracts/utils/Context.sol": {
"keccak256": "0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de",
"license": "MIT",
"urls": [
"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc",
"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6"
]
},
"contracts/access/Ownable.sol": {
"keccak256": "0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982",
"license": "MIT",
"urls": [
"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887",
"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG"
]
}
},
"version": 1
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"owner()": "8da5cb5b",
"renounceOwnership()": "715018a6",
"transferOwnership(address)": "f2fde38b"
}
},
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.28+commit.7893614a"
},
"language": "Solidity",
"output": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. By default, the owner account will be the one that deploys the contract. This can later be changed with {transferOwnership}. This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.",
"kind": "dev",
"methods": {
"constructor": {
"details": "Initializes the contract setting the deployer as the initial owner."
},
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/access/Ownable.sol": "Ownable"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"/contracts/utils/Context.sol": {
"keccak256": "0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de",
"license": "MIT",
"urls": [
"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc",
"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6"
]
},
"contracts/access/Ownable.sol": {
"keccak256": "0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982",
"license": "MIT",
"urls": [
"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887",
"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG"
]
}
},
"version": 1
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
import "/contracts/utils/Context.sol";
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
_checkOwner();
_;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if the sender is not the owner.
*/
function _checkOwner() internal view virtual {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface ILayerZeroReceiver {
// @notice LayerZero endpoint will invoke this function to deliver the message on the destination
// @param _srcChainId - the source endpoint identifier
// @param _srcAddress - the source sending contract address from the source chain
// @param _nonce - the ordered message nonce
// @param _payload - the signed payload is the UA bytes has encoded to be sent
function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;
}
interface ILayerZeroUserApplicationConfig {
// @notice set the configuration of the LayerZero messaging library of the specified version
// @param _version - messaging library version
// @param _chainId - the chainId for the pending config change
// @param _configType - type of configuration. every messaging library has its own convention.
// @param _config - configuration in the bytes. can encode arbitrary content.
function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;
// @notice set the send() LayerZero messaging library version to _version
// @param _version - new messaging library version
function setSendVersion(uint16 _version) external;
// @notice set the lzReceive() LayerZero messaging library version to _version
// @param _version - new messaging library version
function setReceiveVersion(uint16 _version) external;
// @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload
// @param _srcChainId - the chainId of the source chain
// @param _srcAddress - the contract address of the source contract at the source chain
function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;
}
interface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {
// @notice send a LayerZero message to the specified address at a LayerZero endpoint.
// @param _dstChainId - the destination chain identifier
// @param _destination - the address on destination chain (in bytes). address length/format may vary by chains
// @param _payload - a custom bytes payload to send to the destination contract
// @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address
// @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction
// @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination
function send(
uint16 _dstChainId,
bytes calldata _destination,
bytes calldata _payload,
address payable _refundAddress,
address _zroPaymentAddress,
bytes calldata _adapterParams
) external payable;
// @notice used by the messaging library to publish verified payload
// @param _srcChainId - the source chain identifier
// @param _srcAddress - the source contract (as bytes) at the source chain
// @param _dstAddress - the address on destination chain
// @param _nonce - the unbound message ordering nonce
// @param _gasLimit - the gas limit for external contract execution
// @param _payload - verified payload to send to the destination contract
function receivePayload(
uint16 _srcChainId,
bytes calldata _srcAddress,
address _dstAddress,
uint64 _nonce,
uint _gasLimit,
bytes calldata _payload
) external;
// @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain
// @param _srcChainId - the source chain identifier
// @param _srcAddress - the source chain contract address
function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);
// @notice get the outboundNonce from this source chain which, consequently, is always an EVM
// @param _srcAddress - the source chain contract address
function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);
// @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery
// @param _dstChainId - the destination chain identifier
// @param _userApplication - the user app address on this EVM chain
// @param _payload - the custom message to send over LayerZero
// @param _payInZRO - if false, user app pays the protocol fee in native token
// @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain
function estimateFees(
uint16 _dstChainId,
address _userApplication,
bytes calldata _payload,
bool _payInZRO,
bytes calldata _adapterParam
) external view returns (uint nativeFee, uint zroFee);
// @notice get this Endpoint's immutable source identifier
function getChainId() external view returns (uint16);
// @notice the interface to retry failed message on this Endpoint destination
// @param _srcChainId - the source chain identifier
// @param _srcAddress - the source chain contract address
// @param _payload - the payload to be retried
function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;
// @notice query if any STORED payload (message blocking) at the endpoint.
// @param _srcChainId - the source chain identifier
// @param _srcAddress - the source chain contract address
function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);
// @notice query if the _libraryAddress is valid for sending msgs.
// @param _userApplication - the user app address on this EVM chain
function getSendLibraryAddress(address _userApplication) external view returns (address);
// @notice query if the _libraryAddress is valid for receiving msgs.
// @param _userApplication - the user app address on this EVM chain
function getReceiveLibraryAddress(address _userApplication) external view returns (address);
// @notice query if the non-reentrancy guard for send() is on
// @return true if the guard is on. false otherwise
function isSendingPayload() external view returns (bool);
// @notice query if the non-reentrancy guard for receive() is on
// @return true if the guard is on. false otherwise
function isReceivingPayload() external view returns (bool);
// @notice get the configuration of the LayerZero messaging library of the specified version
// @param _version - messaging library version
// @param _chainId - the chainId for the pending config change
// @param _userApplication - the contract address of the user application
// @param _configType - type of configuration. every messaging library has its own convention.
function getConfig(uint16 _version, uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory);
// @notice get the send() LayerZero messaging library version
// @param _userApplication - the contract address of the user application
function getSendVersion(address _userApplication) external view returns (uint16);
// @notice get the lzReceive() LayerZero messaging library version
// @param _userApplication - the contract address of the user application
function getReceiveVersion(address _userApplication) external view returns (uint16);
}
/*
* @title Solidity Bytes Arrays Utils
* @author Gonçalo Sá <goncalo.sa@consensys.net>
*
* @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.
* The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.
*/
library BytesLib {
function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {
bytes memory tempBytes;
assembly {
// Get a location of some free memory and store it in tempBytes as
// Solidity does for memory variables.
tempBytes := mload(0x40)
// Store the length of the first bytes array at the beginning of
// the memory for tempBytes.
let length := mload(_preBytes)
mstore(tempBytes, length)
// Maintain a memory counter for the current write location in the
// temp bytes array by adding the 32 bytes for the array length to
// the starting location.
let mc := add(tempBytes, 0x20)
// Stop copying when the memory counter reaches the length of the
// first bytes array.
let end := add(mc, length)
for {
// Initialize a copy counter to the start of the _preBytes data,
// 32 bytes into its memory.
let cc := add(_preBytes, 0x20)
} lt(mc, end) {
// Increase both counters by 32 bytes each iteration.
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} {
// Write the _preBytes data into the tempBytes memory 32 bytes
// at a time.
mstore(mc, mload(cc))
}
// Add the length of _postBytes to the current length of tempBytes
// and store it as the new length in the first 32 bytes of the
// tempBytes memory.
length := mload(_postBytes)
mstore(tempBytes, add(length, mload(tempBytes)))
// Move the memory counter back from a multiple of 0x20 to the
// actual end of the _preBytes data.
mc := end
// Stop copying when the memory counter reaches the new combined
// length of the arrays.
end := add(mc, length)
for {
let cc := add(_postBytes, 0x20)
} lt(mc, end) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} {
mstore(mc, mload(cc))
}
// Update the free-memory pointer by padding our last write location
// to 32 bytes: add 31 bytes to the end of tempBytes to move to the
// next 32 byte block, then round down to the nearest multiple of
// 32. If the sum of the length of the two arrays is zero then add
// one before rounding down to leave a blank 32 bytes (the length block with 0).
mstore(
0x40,
and(
add(add(end, iszero(add(length, mload(_preBytes)))), 31),
not(31) // Round down to the nearest 32 bytes.
)
)
}
return tempBytes;
}
function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {
assembly {
// Read the first 32 bytes of _preBytes storage, which is the length
// of the array. (We don't need to use the offset into the slot
// because arrays use the entire slot.)
let fslot := sload(_preBytes.slot)
// Arrays of 31 bytes or less have an even value in their slot,
// while longer arrays have an odd value. The actual length is
// the slot divided by two for odd values, and the lowest order
// byte divided by two for even values.
// If the slot is even, bitwise and the slot with 255 and divide by
// two to get the length. If the slot is odd, bitwise and the slot
// with -1 and divide by two.
let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
let mlength := mload(_postBytes)
let newlength := add(slength, mlength)
// slength can contain both the length and contents of the array
// if length < 32 bytes so let's prepare for that
// v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
switch add(lt(slength, 32), lt(newlength, 32))
case 2 {
// Since the new array still fits in the slot, we just need to
// update the contents of the slot.
// uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length
sstore(
_preBytes.slot,
// all the modifications to the slot are inside this
// next block
add(
// we can just add to the slot contents because the
// bytes we want to change are the LSBs
fslot,
add(
mul(
div(
// load the bytes from memory
mload(add(_postBytes, 0x20)),
// zero all bytes to the right
exp(0x100, sub(32, mlength))
),
// and now shift left the number of bytes to
// leave space for the length in the slot
exp(0x100, sub(32, newlength))
),
// increase length by the double of the memory
// bytes length
mul(mlength, 2)
)
)
)
}
case 1 {
// The stored value fits in the slot, but the combined value
// will exceed it.
// get the keccak hash to get the contents of the array
mstore(0x0, _preBytes.slot)
let sc := add(keccak256(0x0, 0x20), div(slength, 32))
// save new length
sstore(_preBytes.slot, add(mul(newlength, 2), 1))
// The contents of the _postBytes array start 32 bytes into
// the structure. Our first read should obtain the `submod`
// bytes that can fit into the unused space in the last word
// of the stored array. To get this, we read 32 bytes starting
// from `submod`, so the data we read overlaps with the array
// contents by `submod` bytes. Masking the lowest-order
// `submod` bytes allows us to add that value directly to the
// stored value.
let submod := sub(32, slength)
let mc := add(_postBytes, submod)
let end := add(_postBytes, mlength)
let mask := sub(exp(0x100, submod), 1)
sstore(sc, add(and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00), and(mload(mc), mask)))
for {
mc := add(mc, 0x20)
sc := add(sc, 1)
} lt(mc, end) {
sc := add(sc, 1)
mc := add(mc, 0x20)
} {
sstore(sc, mload(mc))
}
mask := exp(0x100, sub(mc, end))
sstore(sc, mul(div(mload(mc), mask), mask))
}
default {
// get the keccak hash to get the contents of the array
mstore(0x0, _preBytes.slot)
// Start copying to the last used word of the stored array.
let sc := add(keccak256(0x0, 0x20), div(slength, 32))
// save new length
sstore(_preBytes.slot, add(mul(newlength, 2), 1))
// Copy over the first `submod` bytes of the new data as in
// case 1 above.
let slengthmod := mod(slength, 32)
let mlengthmod := mod(mlength, 32)
let submod := sub(32, slengthmod)
let mc := add(_postBytes, submod)
let end := add(_postBytes, mlength)
let mask := sub(exp(0x100, submod), 1)
sstore(sc, add(sload(sc), and(mload(mc), mask)))
for {
sc := add(sc, 1)
mc := add(mc, 0x20)
} lt(mc, end) {
sc := add(sc, 1)
mc := add(mc, 0x20)
} {
sstore(sc, mload(mc))
}
mask := exp(0x100, sub(mc, end))
sstore(sc, mul(div(mload(mc), mask), mask))
}
}
}
function slice(bytes memory _bytes, uint _start, uint _length) internal pure returns (bytes memory) {
require(_length + 31 >= _length, "slice_overflow");
require(_bytes.length >= _start + _length, "slice_outOfBounds");
bytes memory tempBytes;
assembly {
switch iszero(_length)
case 0 {
// Get a location of some free memory and store it in tempBytes as
// Solidity does for memory variables.
tempBytes := mload(0x40)
// The first word of the slice result is potentially a partial
// word read from the original array. To read it, we calculate
// the length of that partial word and start copying that many
// bytes into the array. The first word we copy will start with
// data we don't care about, but the last `lengthmod` bytes will
// land at the beginning of the contents of the new array. When
// we're done copying, we overwrite the full first word with
// the actual length of the slice.
let lengthmod := and(_length, 31)
// The multiplication in the next line is necessary
// because when slicing multiples of 32 bytes (lengthmod == 0)
// the following copy loop was copying the origin's length
// and then ending prematurely not copying everything it should.
let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
let end := add(mc, _length)
for {
// The multiplication in the next line has the same exact purpose
// as the one above.
let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)
} lt(mc, end) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} {
mstore(mc, mload(cc))
}
mstore(tempBytes, _length)
//update free-memory pointer
//allocating the array padded to 32 bytes like the compiler does now
mstore(0x40, and(add(mc, 31), not(31)))
}
//if we want a zero-length slice let's just return a zero-length array
default {
tempBytes := mload(0x40)
//zero out the 32 bytes slice we are about to return
//we need to do it because Solidity does not garbage collect
mstore(tempBytes, 0)
mstore(0x40, add(tempBytes, 0x20))
}
}
return tempBytes;
}
function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {
require(_bytes.length >= _start + 20, "toAddress_outOfBounds");
address tempAddress;
assembly {
tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)
}
return tempAddress;
}
function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {
require(_bytes.length >= _start + 1, "toUint8_outOfBounds");
uint8 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x1), _start))
}
return tempUint;
}
function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {
require(_bytes.length >= _start + 2, "toUint16_outOfBounds");
uint16 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x2), _start))
}
return tempUint;
}
function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {
require(_bytes.length >= _start + 4, "toUint32_outOfBounds");
uint32 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x4), _start))
}
return tempUint;
}
function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {
require(_bytes.length >= _start + 8, "toUint64_outOfBounds");
uint64 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x8), _start))
}
return tempUint;
}
function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {
require(_bytes.length >= _start + 12, "toUint96_outOfBounds");
uint96 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0xc), _start))
}
return tempUint;
}
function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {
require(_bytes.length >= _start + 16, "toUint128_outOfBounds");
uint128 tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x10), _start))
}
return tempUint;
}
function toUint256(bytes memory _bytes, uint _start) internal pure returns (uint) {
require(_bytes.length >= _start + 32, "toUint256_outOfBounds");
uint tempUint;
assembly {
tempUint := mload(add(add(_bytes, 0x20), _start))
}
return tempUint;
}
function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {
require(_bytes.length >= _start + 32, "toBytes32_outOfBounds");
bytes32 tempBytes32;
assembly {
tempBytes32 := mload(add(add(_bytes, 0x20), _start))
}
return tempBytes32;
}
function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {
bool success = true;
assembly {
let length := mload(_preBytes)
// if lengths don't match the arrays are not equal
switch eq(length, mload(_postBytes))
case 1 {
// cb is a circuit breaker in the for loop since there's
// no said feature for inline assembly loops
// cb = 1 - don't breaker
// cb = 0 - break
let cb := 1
let mc := add(_preBytes, 0x20)
let end := add(mc, length)
for {
let cc := add(_postBytes, 0x20)
// the next line is the loop condition:
// while(uint256(mc < end) + cb == 2)
} eq(add(lt(mc, end), cb), 2) {
mc := add(mc, 0x20)
cc := add(cc, 0x20)
} {
// if any of these checks fails then arrays are not equal
if iszero(eq(mload(mc), mload(cc))) {
// unsuccess:
success := 0
cb := 0
}
}
}
default {
// unsuccess:
success := 0
}
}
return success;
}
function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {
bool success = true;
assembly {
// we know _preBytes_offset is 0
let fslot := sload(_preBytes.slot)
// Decode the length of the stored array like in concatStorage().
let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)
let mlength := mload(_postBytes)
// if lengths don't match the arrays are not equal
switch eq(slength, mlength)
case 1 {
// slength can contain both the length and contents of the array
// if length < 32 bytes so let's prepare for that
// v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage
if iszero(iszero(slength)) {
switch lt(slength, 32)
case 1 {
// blank the last byte which is the length
fslot := mul(div(fslot, 0x100), 0x100)
if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {
// unsuccess:
success := 0
}
}
default {
// cb is a circuit breaker in the for loop since there's
// no said feature for inline assembly loops
// cb = 1 - don't breaker
// cb = 0 - break
let cb := 1
// get the keccak hash to get the contents of the array
mstore(0x0, _preBytes.slot)
let sc := keccak256(0x0, 0x20)
let mc := add(_postBytes, 0x20)
let end := add(mc, mlength)
// the next line is the loop condition:
// while(uint256(mc < end) + cb == 2)
for {
} eq(add(lt(mc, end), cb), 2) {
sc := add(sc, 1)
mc := add(mc, 0x20)
} {
if iszero(eq(sload(sc), mload(mc))) {
// unsuccess:
success := 0
cb := 0
}
}
}
}
}
default {
// unsuccess:
success := 0
}
}
return success;
}
}
/*
* a generic LzReceiver implementation
*/
abstract contract LzApp is Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig {
using BytesLib for bytes;
// ua can not send payload larger than this by default, but it can be changed by the ua owner
uint public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10000;
ILayerZeroEndpoint public immutable lzEndpoint;
mapping(uint16 => bytes) public trustedRemoteLookup;
mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup;
mapping(uint16 => uint) public payloadSizeLimitLookup;
address public precrime;
event SetPrecrime(address precrime);
event SetTrustedRemote(uint16 _remoteChainId, bytes _path);
event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);
event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas);
constructor(address _endpoint) {
lzEndpoint = ILayerZeroEndpoint(_endpoint);
}
function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual override {
// lzReceive must be called by the endpoint for security
require(_msgSender() == address(lzEndpoint), "LzApp: invalid endpoint caller");
bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];
// if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote.
require(
_srcAddress.length == trustedRemote.length && trustedRemote.length > 0 && keccak256(_srcAddress) == keccak256(trustedRemote),
"LzApp: invalid source sending contract"
);
_blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
}
// abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging
function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual;
function _lzSend(
uint16 _dstChainId,
bytes memory _payload,
address payable _refundAddress,
address _zroPaymentAddress,
bytes memory _adapterParams,
uint _nativeFee
) internal virtual {
bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];
require(trustedRemote.length != 0, "LzApp: destination chain is not a trusted source");
_checkPayloadSize(_dstChainId, _payload.length);
lzEndpoint.send{value: _nativeFee}(_dstChainId, trustedRemote, _payload, _refundAddress, _zroPaymentAddress, _adapterParams);
}
function _checkGasLimit(uint16 _dstChainId, uint16 _type, bytes memory _adapterParams, uint _extraGas) internal view virtual {
uint providedGasLimit = _getGasLimit(_adapterParams);
uint minGasLimit = minDstGasLookup[_dstChainId][_type];
require(minGasLimit > 0, "LzApp: minGasLimit not set");
require(providedGasLimit >= minGasLimit + _extraGas, "LzApp: gas limit is too low");
}
function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint gasLimit) {
require(_adapterParams.length >= 34, "LzApp: invalid adapterParams");
assembly {
gasLimit := mload(add(_adapterParams, 34))
}
}
function _checkPayloadSize(uint16 _dstChainId, uint _payloadSize) internal view virtual {
uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId];
if (payloadSizeLimit == 0) {
// use default if not set
payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT;
}
require(_payloadSize <= payloadSizeLimit, "LzApp: payload size is too large");
}
//---------------------------UserApplication config----------------------------------------
function getConfig(uint16 _version, uint16 _chainId, address, uint _configType) external view returns (bytes memory) {
return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);
}
// generic config for LayerZero user Application
function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external override onlyOwner {
lzEndpoint.setConfig(_version, _chainId, _configType, _config);
}
function setSendVersion(uint16 _version) external override onlyOwner {
lzEndpoint.setSendVersion(_version);
}
function setReceiveVersion(uint16 _version) external override onlyOwner {
lzEndpoint.setReceiveVersion(_version);
}
function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner {
lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);
}
// _path = abi.encodePacked(remoteAddress, localAddress)
// this function set the trusted path for the cross-chain communication
function setTrustedRemote(uint16 _remoteChainId, bytes calldata _path) external onlyOwner {
trustedRemoteLookup[_remoteChainId] = _path;
emit SetTrustedRemote(_remoteChainId, _path);
}
function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner {
trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));
emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);
}
function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) {
bytes memory path = trustedRemoteLookup[_remoteChainId];
require(path.length != 0, "LzApp: no trusted path record");
return path.slice(0, path.length - 20); // the last 20 bytes should be address(this)
}
function setPrecrime(address _precrime) external onlyOwner {
precrime = _precrime;
emit SetPrecrime(_precrime);
}
function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint _minGas) external onlyOwner {
minDstGasLookup[_dstChainId][_packetType] = _minGas;
emit SetMinDstGas(_dstChainId, _packetType, _minGas);
}
// if the size is 0, it means default size limit
function setPayloadSizeLimit(uint16 _dstChainId, uint _size) external onlyOwner {
payloadSizeLimitLookup[_dstChainId] = _size;
}
//--------------------------- VIEW FUNCTION ----------------------------------------
function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) {
bytes memory trustedSource = trustedRemoteLookup[_srcChainId];
return keccak256(trustedSource) == keccak256(_srcAddress);
}
}
library ExcessivelySafeCall {
uint constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
/// @notice Use when you _really_ really _really_ don't trust the called
/// contract. This prevents the called contract from causing reversion of
/// the caller in as many ways as we can.
/// @dev The main difference between this and a solidity low-level call is
/// that we limit the number of bytes that the callee can cause to be
/// copied to caller memory. This prevents stupid things like malicious
/// contracts returning 10,000,000 bytes causing a local OOG when copying
/// to memory.
/// @param _target The address to call
/// @param _gas The amount of gas to forward to the remote contract
/// @param _maxCopy The maximum number of bytes of returndata to copy
/// to memory.
/// @param _calldata The data to send to the remote contract
/// @return success and returndata, as `.call()`. Returndata is capped to
/// `_maxCopy` bytes.
function excessivelySafeCall(address _target, uint _gas, uint16 _maxCopy, bytes memory _calldata) internal returns (bool, bytes memory) {
// set up for assembly call
uint _toCopy;
bool _success;
bytes memory _returnData = new bytes(_maxCopy);
// dispatch message to recipient
// by assembly calling "handle" function
// we call via assembly to avoid memcopying a very large returndata
// returned by a malicious contract
assembly {
_success := call(
_gas, // gas
_target, // recipient
0, // ether value
add(_calldata, 0x20), // inloc
mload(_calldata), // inlen
0, // outloc
0 // outlen
)
// limit our copy to 256 bytes
_toCopy := returndatasize()
if gt(_toCopy, _maxCopy) {
_toCopy := _maxCopy
}
// Store the length of the copied bytes
mstore(_returnData, _toCopy)
// copy the bytes from returndata[0:_toCopy]
returndatacopy(add(_returnData, 0x20), 0, _toCopy)
}
return (_success, _returnData);
}
/// @notice Use when you _really_ really _really_ don't trust the called
/// contract. This prevents the called contract from causing reversion of
/// the caller in as many ways as we can.
/// @dev The main difference between this and a solidity low-level call is
/// that we limit the number of bytes that the callee can cause to be
/// copied to caller memory. This prevents stupid things like malicious
/// contracts returning 10,000,000 bytes causing a local OOG when copying
/// to memory.
/// @param _target The address to call
/// @param _gas The amount of gas to forward to the remote contract
/// @param _maxCopy The maximum number of bytes of returndata to copy
/// to memory.
/// @param _calldata The data to send to the remote contract
/// @return success and returndata, as `.call()`. Returndata is capped to
/// `_maxCopy` bytes.
function excessivelySafeStaticCall(
address _target,
uint _gas,
uint16 _maxCopy,
bytes memory _calldata
) internal view returns (bool, bytes memory) {
// set up for assembly call
uint _toCopy;
bool _success;
bytes memory _returnData = new bytes(_maxCopy);
// dispatch message to recipient
// by assembly calling "handle" function
// we call via assembly to avoid memcopying a very large returndata
// returned by a malicious contract
assembly {
_success := staticcall(
_gas, // gas
_target, // recipient
add(_calldata, 0x20), // inloc
mload(_calldata), // inlen
0, // outloc
0 // outlen
)
// limit our copy to 256 bytes
_toCopy := returndatasize()
if gt(_toCopy, _maxCopy) {
_toCopy := _maxCopy
}
// Store the length of the copied bytes
mstore(_returnData, _toCopy)
// copy the bytes from returndata[0:_toCopy]
returndatacopy(add(_returnData, 0x20), 0, _toCopy)
}
return (_success, _returnData);
}
/**
* @notice Swaps function selectors in encoded contract calls
* @dev Allows reuse of encoded calldata for functions with identical
* argument types but different names. It simply swaps out the first 4 bytes
* for the new selector. This function modifies memory in place, and should
* only be used with caution.
* @param _newSelector The new 4-byte selector
* @param _buf The encoded contract args
*/
function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure {
require(_buf.length >= 4);
uint _mask = LOW_28_MASK;
assembly {
// load the first word of
let _word := mload(add(_buf, 0x20))
// mask out the top 4 bytes
// /x
_word := and(_word, _mask)
_word := or(_newSelector, _word)
mstore(add(_buf, 0x20), _word)
}
}
}
/*
* the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel
* this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking
* NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress)
*/
abstract contract NonblockingLzApp is LzApp {
using ExcessivelySafeCall for address;
constructor(address _endpoint) LzApp(_endpoint) {}
mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages;
event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason);
event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash);
// overriding the virtual function in LzReceiver
function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual override {
(bool success, bytes memory reason) = address(this).excessivelySafeCall(
gasleft(),
150,
abi.encodeWithSelector(this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload)
);
if (!success) {
_storeFailedMessage(_srcChainId, _srcAddress, _nonce, _payload, reason);
}
}
function _storeFailedMessage(
uint16 _srcChainId,
bytes memory _srcAddress,
uint64 _nonce,
bytes memory _payload,
bytes memory _reason
) internal virtual {
failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload);
emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason);
}
function nonblockingLzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual {
// only internal transaction
require(_msgSender() == address(this), "NonblockingLzApp: caller must be LzApp");
_nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
}
//@notice override this function
function _nonblockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual;
function retryMessage(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public payable virtual {
// assert there is message to retry
bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];
require(payloadHash != bytes32(0), "NonblockingLzApp: no stored message");
require(keccak256(_payload) == payloadHash, "NonblockingLzApp: invalid payload");
// clear the stored message
failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0);
// execute the message. revert if it fails again
_nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);
emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash);
}
}
// Sources flattened with hardhat v2.8.0 https://hardhat.org
// File @openzeppelin/contracts/utils/math/SafeMath.sol@v4.4.2
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
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 substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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.
*
* _Available since v3.4._
*/
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 addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// File @openzeppelin/contracts/token/ERC20/IERC20.sol@v4.4.2
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) 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 `amount` 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 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @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);
}
// File @openzeppelin/contracts/utils/Context.sol@v4.4.2
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File @openzeppelin/contracts/access/Ownable.sol@v4.4.2
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Internal function without access restriction.
*/
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
// File contracts/OwnerWithdrawable.sol
pragma solidity ^0.8.0;
contract OwnerWithdrawable is Ownable {
using SafeMath for uint256;
receive() external payable {}
fallback() external payable {}
function withdraw(address token, uint256 amt) public onlyOwner {
IERC20(token).transfer(msg.sender, amt);
}
function withdrawAll(address token) public onlyOwner {
uint256 amt = IERC20(token).balanceOf(address(this));
withdraw(token, amt);
}
function withdrawCurrency(uint256 amt) public onlyOwner {
payable(msg.sender).transfer(amt);
}
// function deposit(address token, uint256 amt) public onlyOwner {
// uint256 allowance = IERC20(token).allowance(msg.sender, address(this));
// require(allowance >= amt, "Check the token allowance");
// IERC20(token).transferFrom(owner(), address(this), amt);
// }
}
// File @openzeppelin/contracts/utils/Address.sol@v4.4.2
// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)
pragma solidity ^0.8.0;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
assembly {
size := extcodesize(account)
}
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol@v4.4.2
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol@v4.4.2
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
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);
}
// File contracts/IRouter.sol
pragma solidity ^0.8.0;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint256 amountADesired,
uint256 amountBDesired,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
)
external
returns (
uint256 amountA,
uint256 amountB,
uint256 liquidity
);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
function removeLiquidity(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETH(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountToken, uint256 amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint256 liquidity,
uint256 amountAMin,
uint256 amountBMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountA, uint256 amountB);
function removeLiquidityETHWithPermit(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountToken, uint256 amountETH);
function swapExactTokensForTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapTokensForExactTokens(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactETHForTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function swapTokensForExactETH(
uint256 amountOut,
uint256 amountInMax,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapExactTokensForETH(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external returns (uint256[] memory amounts);
function swapETHForExactTokens(
uint256 amountOut,
address[] calldata path,
address to,
uint256 deadline
) external payable returns (uint256[] memory amounts);
function quote(
uint256 amountA,
uint256 reserveA,
uint256 reserveB
) external pure returns (uint256 amountB);
function getAmountOut(
uint256 amountIn,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountOut);
function getAmountIn(
uint256 amountOut,
uint256 reserveIn,
uint256 reserveOut
) external pure returns (uint256 amountIn);
function getAmountsOut(uint256 amountIn, address[] calldata path)
external
view
returns (uint256[] memory amounts);
function getAmountsIn(uint256 amountOut, address[] calldata path)
external
view
returns (uint256[] memory amounts);
}
// pragma solidity >=0.6.2;
interface IRouter is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external returns (uint256 amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint256 liquidity,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline,
bool approveMax,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256 amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
// File contracts/Airdrop.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract BittexAirdrop is OwnerWithdrawable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
// Time when Airdrop starts
uint256 public startTime;
// Time when Airdrop ends
uint256 public endTime;
// list of users address
address[] public users;
// List of users who claimed their prize
mapping(address => bool) public claimed;
// List of users who already registered
mapping(address => bool) public registered;
// prize token
address public prizeToken;
// prize amount
uint256 public prizeAmount;
// total prize amount
uint256 public totalPrizeAmount;
constructor() {
totalPrizeAmount = 0;
}
// modifier to check if the airdrop is active or not
modifier airdropDuration(){
require(block.timestamp > startTime, "Airdrop: Sale hasn't started");
require(block.timestamp < endTime, "Airdrop: Sale has already ended");
_;
}
// function to set Airdrop duration and locking periods
function setAirdropPeriodParams(
uint256 _startTime,
uint256 _endTime
) external onlyOwner {
startTime = _startTime;
endTime = _endTime;
}
// Stop the Sale
function stopSale() external onlyOwner {
require(block.timestamp > startTime, "Airdrop: Sale hasn't started yet!");
if(block.timestamp < endTime){
endTime = block.timestamp;
}
}
// Add user address to the list
function register() public airdropDuration {
require(!claimed[msg.sender], "Airdrop: You have already claimed your prize!");
require(!registered[msg.sender], "Airdrop: You have already registered your prize!");
users.push(msg.sender);
registered[msg.sender] = true;
}
function setPrizeAmount(uint256 _prize) external onlyOwner {
prizeAmount = _prize;
}
function setPrizeToken(address _token) external onlyOwner {
prizeToken = _token;
}
function airdropPrizes() external onlyOwner {
// loop over the users array and send the prize to each user
for(uint i = 0; i < users.length; i++) {
// check if the user has already claimed the prize
if(!claimed[users[i]]) {
// send the prize to the user
IERC20(prizeToken).safeTransfer(users[i], prizeAmount);
// set the user as claimed
claimed[users[i]] = true;
// add the prize amount to the total prize amount
totalPrizeAmount = totalPrizeAmount.add(prizeAmount);
}
}
}
function withdrawTokens(IERC20 _token, uint _tokenAmount) external onlyOwner {
_token.safeTransfer(owner(), _tokenAmount);
}
}
{
"id": "80a7fdd8082f43fd29f75677b7340340",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.8.28",
"solcLongVersion": "0.8.28+commit.7893614a",
"input": {
"language": "Solidity",
"sources": {
"contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.28;\r\n\r\nimport \"/contracts/token/ERC20/IERC20.sol\";\r\n\r\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\r\n/**\r\n * @dev Interface for the optional metadata functions from the ERC20 standard.\r\n *\r\n * _Available since v4.1._\r\n */\r\ninterface IERC20Metadata is IERC20 {\r\n /**\r\n * @dev Returns the name of the token.\r\n */\r\n function name() external view returns (string memory);\r\n\r\n /**\r\n * @dev Returns the symbol of the token.\r\n */\r\n function symbol() external view returns (string memory);\r\n\r\n /**\r\n * @dev Returns the decimals places of the token.\r\n */\r\n function decimals() external view returns (uint8);\r\n}"
},
"/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.28;\r\n\r\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\r\n/**\r\n * @dev Interface of the ERC20 standard as defined in the EIP.\r\n */\r\ninterface IERC20 {\r\n /**\r\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\r\n * another (`to`).\r\n *\r\n * Note that `value` may be zero.\r\n */\r\n event Transfer(address indexed from, address indexed to, uint256 value);\r\n\r\n /**\r\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\r\n * a call to {approve}. `value` is the new allowance.\r\n */\r\n event Approval(address indexed owner, address indexed spender, uint256 value);\r\n\r\n /**\r\n * @dev Returns the amount of tokens in existence.\r\n */\r\n function totalSupply() external view returns (uint256);\r\n\r\n /**\r\n * @dev Returns the amount of tokens owned by `account`.\r\n */\r\n function balanceOf(address account) external view returns (uint256);\r\n\r\n /**\r\n * @dev Moves `amount` tokens from the caller's account to `to`.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * Emits a {Transfer} event.\r\n */\r\n function transfer(address to, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Returns the remaining number of tokens that `spender` will be\r\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\r\n * zero by default.\r\n *\r\n * This value changes when {approve} or {transferFrom} are called.\r\n */\r\n function allowance(address owner, address spender) external view returns (uint256);\r\n\r\n /**\r\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\r\n * that someone may use both the old and the new allowance by unfortunate\r\n * transaction ordering. One possible solution to mitigate this race\r\n * condition is to first reduce the spender's allowance to 0 and set the\r\n * desired value afterwards:\r\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r\n *\r\n * Emits an {Approval} event.\r\n */\r\n function approve(address spender, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Moves `amount` tokens from `from` to `to` using the\r\n * allowance mechanism. `amount` is then deducted from the caller's\r\n * allowance.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * Emits a {Transfer} event.\r\n */\r\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\r\n}"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"": [
"ast"
],
"*": [
"abi",
"metadata",
"devdoc",
"userdoc",
"storageLayout",
"evm.legacyAssembly",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"evm.gasEstimates",
"evm.assembly"
]
}
},
"remappings": []
}
},
"output": {
"contracts": {
"/contracts/token/ERC20/IERC20.sol": {
"IERC20": {
"abi": [
{
"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": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"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": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"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": "amount",
"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": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Interface of the ERC20 standard as defined in the EIP.",
"events": {
"Approval(address,address,uint256)": {
"details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."
},
"Transfer(address,address,uint256)": {
"details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."
}
},
"kind": "dev",
"methods": {
"allowance(address,address)": {
"details": "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."
},
"approve(address,uint256)": {
"details": "Sets `amount` 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."
},
"balanceOf(address)": {
"details": "Returns the amount of tokens owned by `account`."
},
"totalSupply()": {
"details": "Returns the amount of tokens in existence."
},
"transfer(address,uint256)": {
"details": "Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
},
"transferFrom(address,address,uint256)": {
"details": "Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
}
},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {
"allowance(address,address)": "dd62ed3e",
"approve(address,uint256)": "095ea7b3",
"balanceOf(address)": "70a08231",
"totalSupply()": "18160ddd",
"transfer(address,uint256)": "a9059cbb",
"transferFrom(address,address,uint256)": "23b872dd"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"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\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"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\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":\"amount\",\"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\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface of the ERC20 standard as defined in the EIP.\",\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"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.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` 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.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/contracts/token/ERC20/IERC20.sol\":\"IERC20\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x798ce89b0f680daac5e1683c5540f1ef74edb181e2b647b17e2b71b9740e79b0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9af0ce7a14f6de7a90e7f43e6b5d0aa2f558071f27114dc78852c918ffb92b5c\",\"dweb:/ipfs/QmSdaBf6EKV8RBEjrAWaPxY33g35BaZjb9cjaKWgaHtv8F\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}
},
"contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"IERC20Metadata": {
"abi": [
{
"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": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"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": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"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": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"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": "amount",
"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": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._",
"events": {
"Approval(address,address,uint256)": {
"details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."
},
"Transfer(address,address,uint256)": {
"details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."
}
},
"kind": "dev",
"methods": {
"allowance(address,address)": {
"details": "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."
},
"approve(address,uint256)": {
"details": "Sets `amount` 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."
},
"balanceOf(address)": {
"details": "Returns the amount of tokens owned by `account`."
},
"decimals()": {
"details": "Returns the decimals places of the token."
},
"name()": {
"details": "Returns the name of the token."
},
"symbol()": {
"details": "Returns the symbol of the token."
},
"totalSupply()": {
"details": "Returns the amount of tokens in existence."
},
"transfer(address,uint256)": {
"details": "Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
},
"transferFrom(address,address,uint256)": {
"details": "Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
}
},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {
"allowance(address,address)": "dd62ed3e",
"approve(address,uint256)": "095ea7b3",
"balanceOf(address)": "70a08231",
"decimals()": "313ce567",
"name()": "06fdde03",
"symbol()": "95d89b41",
"totalSupply()": "18160ddd",
"transfer(address,uint256)": "a9059cbb",
"transferFrom(address,address,uint256)": "23b872dd"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"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\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"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\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"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\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"amount\",\"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\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._\",\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"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.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` 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.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"decimals()\":{\"details\":\"Returns the decimals places of the token.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/token/ERC20/extensions/IERC20Metadata.sol\":\"IERC20Metadata\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x798ce89b0f680daac5e1683c5540f1ef74edb181e2b647b17e2b71b9740e79b0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9af0ce7a14f6de7a90e7f43e6b5d0aa2f558071f27114dc78852c918ffb92b5c\",\"dweb:/ipfs/QmSdaBf6EKV8RBEjrAWaPxY33g35BaZjb9cjaKWgaHtv8F\"]},\"contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"keccak256\":\"0x4660b6728f73b964ca0385fe553f6814ca7be82ed1adc5b65bc59cc335c4b301\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6b188edc2ec64947c08bcf1502b33ce41900362a2f6859ce45b23d58dd8e1cd6\",\"dweb:/ipfs/QmTgt4NNZ5wKeCfhA2hJ33aTWLB3eLZ6A4AEYJweogrXRe\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}
}
},
"sources": {
"/contracts/token/ERC20/IERC20.sol": {
"ast": {
"absolutePath": "/contracts/token/ERC20/IERC20.sol",
"exportedSymbols": {
"IERC20": [
77
]
},
"id": 78,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.8",
".28"
],
"nodeType": "PragmaDirective",
"src": "33:24:0"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "IERC20",
"contractDependencies": [],
"contractKind": "interface",
"documentation": {
"id": 2,
"nodeType": "StructuredDocumentation",
"src": "135:72:0",
"text": " @dev Interface of the ERC20 standard as defined in the EIP."
},
"fullyImplemented": false,
"id": 77,
"linearizedBaseContracts": [
77
],
"name": "IERC20",
"nameLocation": "219:6:0",
"nodeType": "ContractDefinition",
"nodes": [
{
"anonymous": false,
"documentation": {
"id": 3,
"nodeType": "StructuredDocumentation",
"src": "233:163:0",
"text": " @dev Emitted when `value` tokens are moved from one account (`from`) to\n another (`to`).\n Note that `value` may be zero."
},
"eventSelector": "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"id": 11,
"name": "Transfer",
"nameLocation": "408:8:0",
"nodeType": "EventDefinition",
"parameters": {
"id": 10,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5,
"indexed": true,
"mutability": "mutable",
"name": "from",
"nameLocation": "433:4:0",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "417:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "417:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 7,
"indexed": true,
"mutability": "mutable",
"name": "to",
"nameLocation": "455:2:0",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "439:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "439:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 9,
"indexed": false,
"mutability": "mutable",
"name": "value",
"nameLocation": "467:5:0",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "459:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "459:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "416:57:0"
},
"src": "402:72:0"
},
{
"anonymous": false,
"documentation": {
"id": 12,
"nodeType": "StructuredDocumentation",
"src": "482:151:0",
"text": " @dev Emitted when the allowance of a `spender` for an `owner` is set by\n a call to {approve}. `value` is the new allowance."
},
"eventSelector": "8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"id": 20,
"name": "Approval",
"nameLocation": "645:8:0",
"nodeType": "EventDefinition",
"parameters": {
"id": 19,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"indexed": true,
"mutability": "mutable",
"name": "owner",
"nameLocation": "670:5:0",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "654:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 13,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "654:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"indexed": true,
"mutability": "mutable",
"name": "spender",
"nameLocation": "693:7:0",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "677:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 15,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "677:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 18,
"indexed": false,
"mutability": "mutable",
"name": "value",
"nameLocation": "710:5:0",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "702:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 17,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "702:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "653:63:0"
},
"src": "639:78:0"
},
{
"documentation": {
"id": 21,
"nodeType": "StructuredDocumentation",
"src": "725:68:0",
"text": " @dev Returns the amount of tokens in existence."
},
"functionSelector": "18160ddd",
"id": 26,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "totalSupply",
"nameLocation": "808:11:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 22,
"nodeType": "ParameterList",
"parameters": [],
"src": "819:2:0"
},
"returnParameters": {
"id": 25,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 24,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 26,
"src": "845:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 23,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "845:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "844:9:0"
},
"scope": 77,
"src": "799:55:0",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 27,
"nodeType": "StructuredDocumentation",
"src": "862:74:0",
"text": " @dev Returns the amount of tokens owned by `account`."
},
"functionSelector": "70a08231",
"id": 34,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "balanceOf",
"nameLocation": "951:9:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 30,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29,
"mutability": "mutable",
"name": "account",
"nameLocation": "969:7:0",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "961:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 28,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "961:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "960:17:0"
},
"returnParameters": {
"id": 33,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 32,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1001:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 31,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1001:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "1000:9:0"
},
"scope": 77,
"src": "942:68:0",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 35,
"nodeType": "StructuredDocumentation",
"src": "1018:208:0",
"text": " @dev Moves `amount` tokens from the caller's account to `to`.\n Returns a boolean value indicating whether the operation succeeded.\n Emits a {Transfer} event."
},
"functionSelector": "a9059cbb",
"id": 44,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "transfer",
"nameLocation": "1241:8:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 40,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 37,
"mutability": "mutable",
"name": "to",
"nameLocation": "1258:2:0",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "1250:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 36,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1250:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 39,
"mutability": "mutable",
"name": "amount",
"nameLocation": "1270:6:0",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "1262:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 38,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1262:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "1249:28:0"
},
"returnParameters": {
"id": 43,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 42,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "1296:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 41,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1296:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "1295:6:0"
},
"scope": 77,
"src": "1232:70:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 45,
"nodeType": "StructuredDocumentation",
"src": "1310:270:0",
"text": " @dev Returns the remaining number of tokens that `spender` will be\n allowed to spend on behalf of `owner` through {transferFrom}. This is\n zero by default.\n This value changes when {approve} or {transferFrom} are called."
},
"functionSelector": "dd62ed3e",
"id": 54,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "allowance",
"nameLocation": "1595:9:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 50,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 47,
"mutability": "mutable",
"name": "owner",
"nameLocation": "1613:5:0",
"nodeType": "VariableDeclaration",
"scope": 54,
"src": "1605:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 46,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1605:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 49,
"mutability": "mutable",
"name": "spender",
"nameLocation": "1628:7:0",
"nodeType": "VariableDeclaration",
"scope": 54,
"src": "1620:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 48,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1620:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "1604:32:0"
},
"returnParameters": {
"id": 53,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 52,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 54,
"src": "1660:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 51,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1660:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "1659:9:0"
},
"scope": 77,
"src": "1586:83:0",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 55,
"nodeType": "StructuredDocumentation",
"src": "1677:655:0",
"text": " @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n Returns a boolean value indicating whether the operation succeeded.\n IMPORTANT: Beware that changing an allowance with this method brings the risk\n that someone may use both the old and the new allowance by unfortunate\n transaction ordering. One possible solution to mitigate this race\n condition is to first reduce the spender's allowance to 0 and set the\n desired value afterwards:\n https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n Emits an {Approval} event."
},
"functionSelector": "095ea7b3",
"id": 64,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "approve",
"nameLocation": "2347:7:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 60,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 57,
"mutability": "mutable",
"name": "spender",
"nameLocation": "2363:7:0",
"nodeType": "VariableDeclaration",
"scope": 64,
"src": "2355:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 56,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2355:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 59,
"mutability": "mutable",
"name": "amount",
"nameLocation": "2380:6:0",
"nodeType": "VariableDeclaration",
"scope": 64,
"src": "2372:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 58,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2372:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "2354:33:0"
},
"returnParameters": {
"id": 63,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 62,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 64,
"src": "2406:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 61,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2406:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "2405:6:0"
},
"scope": 77,
"src": "2338:74:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 65,
"nodeType": "StructuredDocumentation",
"src": "2420:295:0",
"text": " @dev Moves `amount` tokens from `from` to `to` using the\n allowance mechanism. `amount` is then deducted from the caller's\n allowance.\n Returns a boolean value indicating whether the operation succeeded.\n Emits a {Transfer} event."
},
"functionSelector": "23b872dd",
"id": 76,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "transferFrom",
"nameLocation": "2730:12:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 72,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 67,
"mutability": "mutable",
"name": "from",
"nameLocation": "2751:4:0",
"nodeType": "VariableDeclaration",
"scope": 76,
"src": "2743:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 66,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2743:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 69,
"mutability": "mutable",
"name": "to",
"nameLocation": "2765:2:0",
"nodeType": "VariableDeclaration",
"scope": 76,
"src": "2757:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 68,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2757:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 71,
"mutability": "mutable",
"name": "amount",
"nameLocation": "2777:6:0",
"nodeType": "VariableDeclaration",
"scope": 76,
"src": "2769:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 70,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2769:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "2742:42:0"
},
"returnParameters": {
"id": 75,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 74,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 76,
"src": "2803:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 73,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2803:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "2802:6:0"
},
"scope": 77,
"src": "2721:88:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"scope": 78,
"src": "209:2603:0",
"usedErrors": [],
"usedEvents": [
11,
20
]
}
],
"src": "33:2779:0"
},
"id": 0
},
"contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"ast": {
"absolutePath": "contracts/token/ERC20/extensions/IERC20Metadata.sol",
"exportedSymbols": {
"IERC20": [
77
],
"IERC20Metadata": [
102
]
},
"id": 103,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 79,
"literals": [
"solidity",
"^",
"0.8",
".28"
],
"nodeType": "PragmaDirective",
"src": "33:24:1"
},
{
"absolutePath": "/contracts/token/ERC20/IERC20.sol",
"file": "/contracts/token/ERC20/IERC20.sol",
"id": 80,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 103,
"sourceUnit": 78,
"src": "61:43:1",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"baseName": {
"id": 82,
"name": "IERC20",
"nameLocations": [
"336:6:1"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 77,
"src": "336:6:1"
},
"id": 83,
"nodeType": "InheritanceSpecifier",
"src": "336:6:1"
}
],
"canonicalName": "IERC20Metadata",
"contractDependencies": [],
"contractKind": "interface",
"documentation": {
"id": 81,
"nodeType": "StructuredDocumentation",
"src": "186:120:1",
"text": " @dev Interface for the optional metadata functions from the ERC20 standard.\n _Available since v4.1._"
},
"fullyImplemented": false,
"id": 102,
"linearizedBaseContracts": [
102,
77
],
"name": "IERC20Metadata",
"nameLocation": "318:14:1",
"nodeType": "ContractDefinition",
"nodes": [
{
"documentation": {
"id": 84,
"nodeType": "StructuredDocumentation",
"src": "350:56:1",
"text": " @dev Returns the name of the token."
},
"functionSelector": "06fdde03",
"id": 89,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "name",
"nameLocation": "421:4:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 85,
"nodeType": "ParameterList",
"parameters": [],
"src": "425:2:1"
},
"returnParameters": {
"id": 88,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 87,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 89,
"src": "451:13:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 86,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "451:6:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"visibility": "internal"
}
],
"src": "450:15:1"
},
"scope": 102,
"src": "412:54:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 90,
"nodeType": "StructuredDocumentation",
"src": "474:58:1",
"text": " @dev Returns the symbol of the token."
},
"functionSelector": "95d89b41",
"id": 95,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "symbol",
"nameLocation": "547:6:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 91,
"nodeType": "ParameterList",
"parameters": [],
"src": "553:2:1"
},
"returnParameters": {
"id": 94,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 93,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 95,
"src": "579:13:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 92,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "579:6:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"visibility": "internal"
}
],
"src": "578:15:1"
},
"scope": 102,
"src": "538:56:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 96,
"nodeType": "StructuredDocumentation",
"src": "602:67:1",
"text": " @dev Returns the decimals places of the token."
},
"functionSelector": "313ce567",
"id": 101,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "decimals",
"nameLocation": "684:8:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 97,
"nodeType": "ParameterList",
"parameters": [],
"src": "692:2:1"
},
"returnParameters": {
"id": 100,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 99,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 101,
"src": "718:5:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 98,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "718:5:1",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"visibility": "internal"
}
],
"src": "717:7:1"
},
"scope": 102,
"src": "675:50:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 103,
"src": "308:420:1",
"usedErrors": [],
"usedEvents": [
11,
20
]
}
],
"src": "33:695:1"
},
"id": 1
}
}
}
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"allowance(address,address)": "dd62ed3e",
"approve(address,uint256)": "095ea7b3",
"balanceOf(address)": "70a08231",
"decimals()": "313ce567",
"name()": "06fdde03",
"symbol()": "95d89b41",
"totalSupply()": "18160ddd",
"transfer(address,uint256)": "a9059cbb",
"transferFrom(address,address,uint256)": "23b872dd"
}
},
"abi": [
{
"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": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"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": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"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": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"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": "amount",
"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": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.28+commit.7893614a"
},
"language": "Solidity",
"output": {
"abi": [
{
"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": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"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": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"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": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"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": "amount",
"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": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._",
"events": {
"Approval(address,address,uint256)": {
"details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."
},
"Transfer(address,address,uint256)": {
"details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."
}
},
"kind": "dev",
"methods": {
"allowance(address,address)": {
"details": "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."
},
"approve(address,uint256)": {
"details": "Sets `amount` 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."
},
"balanceOf(address)": {
"details": "Returns the amount of tokens owned by `account`."
},
"decimals()": {
"details": "Returns the decimals places of the token."
},
"name()": {
"details": "Returns the name of the token."
},
"symbol()": {
"details": "Returns the symbol of the token."
},
"totalSupply()": {
"details": "Returns the amount of tokens in existence."
},
"transfer(address,uint256)": {
"details": "Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
},
"transferFrom(address,address,uint256)": {
"details": "Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/token/ERC20/extensions/IERC20Metadata.sol": "IERC20Metadata"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"/contracts/token/ERC20/IERC20.sol": {
"keccak256": "0x798ce89b0f680daac5e1683c5540f1ef74edb181e2b647b17e2b71b9740e79b0",
"license": "MIT",
"urls": [
"bzz-raw://9af0ce7a14f6de7a90e7f43e6b5d0aa2f558071f27114dc78852c918ffb92b5c",
"dweb:/ipfs/QmSdaBf6EKV8RBEjrAWaPxY33g35BaZjb9cjaKWgaHtv8F"
]
},
"contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"keccak256": "0x4660b6728f73b964ca0385fe553f6814ca7be82ed1adc5b65bc59cc335c4b301",
"license": "MIT",
"urls": [
"bzz-raw://6b188edc2ec64947c08bcf1502b33ce41900362a2f6859ce45b23d58dd8e1cd6",
"dweb:/ipfs/QmTgt4NNZ5wKeCfhA2hJ33aTWLB3eLZ6A4AEYJweogrXRe"
]
}
},
"version": 1
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
import "/contracts/token/ERC20/IERC20.sol";
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
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);
}
{
"id": "80a7fdd8082f43fd29f75677b7340340",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.8.28",
"solcLongVersion": "0.8.28+commit.7893614a",
"input": {
"language": "Solidity",
"sources": {
"contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.28;\r\n\r\nimport \"/contracts/token/ERC20/IERC20.sol\";\r\n\r\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)\r\n/**\r\n * @dev Interface for the optional metadata functions from the ERC20 standard.\r\n *\r\n * _Available since v4.1._\r\n */\r\ninterface IERC20Metadata is IERC20 {\r\n /**\r\n * @dev Returns the name of the token.\r\n */\r\n function name() external view returns (string memory);\r\n\r\n /**\r\n * @dev Returns the symbol of the token.\r\n */\r\n function symbol() external view returns (string memory);\r\n\r\n /**\r\n * @dev Returns the decimals places of the token.\r\n */\r\n function decimals() external view returns (uint8);\r\n}"
},
"/contracts/token/ERC20/IERC20.sol": {
"content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.28;\r\n\r\n// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)\r\n/**\r\n * @dev Interface of the ERC20 standard as defined in the EIP.\r\n */\r\ninterface IERC20 {\r\n /**\r\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\r\n * another (`to`).\r\n *\r\n * Note that `value` may be zero.\r\n */\r\n event Transfer(address indexed from, address indexed to, uint256 value);\r\n\r\n /**\r\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\r\n * a call to {approve}. `value` is the new allowance.\r\n */\r\n event Approval(address indexed owner, address indexed spender, uint256 value);\r\n\r\n /**\r\n * @dev Returns the amount of tokens in existence.\r\n */\r\n function totalSupply() external view returns (uint256);\r\n\r\n /**\r\n * @dev Returns the amount of tokens owned by `account`.\r\n */\r\n function balanceOf(address account) external view returns (uint256);\r\n\r\n /**\r\n * @dev Moves `amount` tokens from the caller's account to `to`.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * Emits a {Transfer} event.\r\n */\r\n function transfer(address to, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Returns the remaining number of tokens that `spender` will be\r\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\r\n * zero by default.\r\n *\r\n * This value changes when {approve} or {transferFrom} are called.\r\n */\r\n function allowance(address owner, address spender) external view returns (uint256);\r\n\r\n /**\r\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\r\n * that someone may use both the old and the new allowance by unfortunate\r\n * transaction ordering. One possible solution to mitigate this race\r\n * condition is to first reduce the spender's allowance to 0 and set the\r\n * desired value afterwards:\r\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\r\n *\r\n * Emits an {Approval} event.\r\n */\r\n function approve(address spender, uint256 amount) external returns (bool);\r\n\r\n /**\r\n * @dev Moves `amount` tokens from `from` to `to` using the\r\n * allowance mechanism. `amount` is then deducted from the caller's\r\n * allowance.\r\n *\r\n * Returns a boolean value indicating whether the operation succeeded.\r\n *\r\n * Emits a {Transfer} event.\r\n */\r\n function transferFrom(address from, address to, uint256 amount) external returns (bool);\r\n}"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"": [
"ast"
],
"*": [
"abi",
"metadata",
"devdoc",
"userdoc",
"storageLayout",
"evm.legacyAssembly",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"evm.gasEstimates",
"evm.assembly"
]
}
},
"remappings": []
}
},
"output": {
"contracts": {
"/contracts/token/ERC20/IERC20.sol": {
"IERC20": {
"abi": [
{
"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": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"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": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"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": "amount",
"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": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Interface of the ERC20 standard as defined in the EIP.",
"events": {
"Approval(address,address,uint256)": {
"details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."
},
"Transfer(address,address,uint256)": {
"details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."
}
},
"kind": "dev",
"methods": {
"allowance(address,address)": {
"details": "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."
},
"approve(address,uint256)": {
"details": "Sets `amount` 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."
},
"balanceOf(address)": {
"details": "Returns the amount of tokens owned by `account`."
},
"totalSupply()": {
"details": "Returns the amount of tokens in existence."
},
"transfer(address,uint256)": {
"details": "Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
},
"transferFrom(address,address,uint256)": {
"details": "Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
}
},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {
"allowance(address,address)": "dd62ed3e",
"approve(address,uint256)": "095ea7b3",
"balanceOf(address)": "70a08231",
"totalSupply()": "18160ddd",
"transfer(address,uint256)": "a9059cbb",
"transferFrom(address,address,uint256)": "23b872dd"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"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\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"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\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"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\":\"amount\",\"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\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface of the ERC20 standard as defined in the EIP.\",\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"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.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` 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.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/contracts/token/ERC20/IERC20.sol\":\"IERC20\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x798ce89b0f680daac5e1683c5540f1ef74edb181e2b647b17e2b71b9740e79b0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9af0ce7a14f6de7a90e7f43e6b5d0aa2f558071f27114dc78852c918ffb92b5c\",\"dweb:/ipfs/QmSdaBf6EKV8RBEjrAWaPxY33g35BaZjb9cjaKWgaHtv8F\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}
},
"contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"IERC20Metadata": {
"abi": [
{
"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": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"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": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"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": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"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": "amount",
"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": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._",
"events": {
"Approval(address,address,uint256)": {
"details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."
},
"Transfer(address,address,uint256)": {
"details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."
}
},
"kind": "dev",
"methods": {
"allowance(address,address)": {
"details": "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."
},
"approve(address,uint256)": {
"details": "Sets `amount` 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."
},
"balanceOf(address)": {
"details": "Returns the amount of tokens owned by `account`."
},
"decimals()": {
"details": "Returns the decimals places of the token."
},
"name()": {
"details": "Returns the name of the token."
},
"symbol()": {
"details": "Returns the symbol of the token."
},
"totalSupply()": {
"details": "Returns the amount of tokens in existence."
},
"transfer(address,uint256)": {
"details": "Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
},
"transferFrom(address,address,uint256)": {
"details": "Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
}
},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {
"allowance(address,address)": "dd62ed3e",
"approve(address,uint256)": "095ea7b3",
"balanceOf(address)": "70a08231",
"decimals()": "313ce567",
"name()": "06fdde03",
"symbol()": "95d89b41",
"totalSupply()": "18160ddd",
"transfer(address,uint256)": "a9059cbb",
"transferFrom(address,address,uint256)": "23b872dd"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"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\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Transfer\",\"type\":\"event\"},{\"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\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"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\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"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\":\"amount\",\"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\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._\",\"events\":{\"Approval(address,address,uint256)\":{\"details\":\"Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance.\"},\"Transfer(address,address,uint256)\":{\"details\":\"Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero.\"}},\"kind\":\"dev\",\"methods\":{\"allowance(address,address)\":{\"details\":\"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.\"},\"approve(address,uint256)\":{\"details\":\"Sets `amount` 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.\"},\"balanceOf(address)\":{\"details\":\"Returns the amount of tokens owned by `account`.\"},\"decimals()\":{\"details\":\"Returns the decimals places of the token.\"},\"name()\":{\"details\":\"Returns the name of the token.\"},\"symbol()\":{\"details\":\"Returns the symbol of the token.\"},\"totalSupply()\":{\"details\":\"Returns the amount of tokens in existence.\"},\"transfer(address,uint256)\":{\"details\":\"Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"},\"transferFrom(address,address,uint256)\":{\"details\":\"Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/token/ERC20/extensions/IERC20Metadata.sol\":\"IERC20Metadata\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/token/ERC20/IERC20.sol\":{\"keccak256\":\"0x798ce89b0f680daac5e1683c5540f1ef74edb181e2b647b17e2b71b9740e79b0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://9af0ce7a14f6de7a90e7f43e6b5d0aa2f558071f27114dc78852c918ffb92b5c\",\"dweb:/ipfs/QmSdaBf6EKV8RBEjrAWaPxY33g35BaZjb9cjaKWgaHtv8F\"]},\"contracts/token/ERC20/extensions/IERC20Metadata.sol\":{\"keccak256\":\"0x4660b6728f73b964ca0385fe553f6814ca7be82ed1adc5b65bc59cc335c4b301\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6b188edc2ec64947c08bcf1502b33ce41900362a2f6859ce45b23d58dd8e1cd6\",\"dweb:/ipfs/QmTgt4NNZ5wKeCfhA2hJ33aTWLB3eLZ6A4AEYJweogrXRe\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}
}
},
"sources": {
"/contracts/token/ERC20/IERC20.sol": {
"ast": {
"absolutePath": "/contracts/token/ERC20/IERC20.sol",
"exportedSymbols": {
"IERC20": [
77
]
},
"id": 78,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.8",
".28"
],
"nodeType": "PragmaDirective",
"src": "33:24:0"
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "IERC20",
"contractDependencies": [],
"contractKind": "interface",
"documentation": {
"id": 2,
"nodeType": "StructuredDocumentation",
"src": "135:72:0",
"text": " @dev Interface of the ERC20 standard as defined in the EIP."
},
"fullyImplemented": false,
"id": 77,
"linearizedBaseContracts": [
77
],
"name": "IERC20",
"nameLocation": "219:6:0",
"nodeType": "ContractDefinition",
"nodes": [
{
"anonymous": false,
"documentation": {
"id": 3,
"nodeType": "StructuredDocumentation",
"src": "233:163:0",
"text": " @dev Emitted when `value` tokens are moved from one account (`from`) to\n another (`to`).\n Note that `value` may be zero."
},
"eventSelector": "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"id": 11,
"name": "Transfer",
"nameLocation": "408:8:0",
"nodeType": "EventDefinition",
"parameters": {
"id": 10,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5,
"indexed": true,
"mutability": "mutable",
"name": "from",
"nameLocation": "433:4:0",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "417:20:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "417:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 7,
"indexed": true,
"mutability": "mutable",
"name": "to",
"nameLocation": "455:2:0",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "439:18:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "439:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 9,
"indexed": false,
"mutability": "mutable",
"name": "value",
"nameLocation": "467:5:0",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "459:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 8,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "459:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "416:57:0"
},
"src": "402:72:0"
},
{
"anonymous": false,
"documentation": {
"id": 12,
"nodeType": "StructuredDocumentation",
"src": "482:151:0",
"text": " @dev Emitted when the allowance of a `spender` for an `owner` is set by\n a call to {approve}. `value` is the new allowance."
},
"eventSelector": "8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",
"id": 20,
"name": "Approval",
"nameLocation": "645:8:0",
"nodeType": "EventDefinition",
"parameters": {
"id": 19,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"indexed": true,
"mutability": "mutable",
"name": "owner",
"nameLocation": "670:5:0",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "654:21:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 13,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "654:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 16,
"indexed": true,
"mutability": "mutable",
"name": "spender",
"nameLocation": "693:7:0",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "677:23:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 15,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "677:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 18,
"indexed": false,
"mutability": "mutable",
"name": "value",
"nameLocation": "710:5:0",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "702:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 17,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "702:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "653:63:0"
},
"src": "639:78:0"
},
{
"documentation": {
"id": 21,
"nodeType": "StructuredDocumentation",
"src": "725:68:0",
"text": " @dev Returns the amount of tokens in existence."
},
"functionSelector": "18160ddd",
"id": 26,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "totalSupply",
"nameLocation": "808:11:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 22,
"nodeType": "ParameterList",
"parameters": [],
"src": "819:2:0"
},
"returnParameters": {
"id": 25,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 24,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 26,
"src": "845:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 23,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "845:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "844:9:0"
},
"scope": 77,
"src": "799:55:0",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 27,
"nodeType": "StructuredDocumentation",
"src": "862:74:0",
"text": " @dev Returns the amount of tokens owned by `account`."
},
"functionSelector": "70a08231",
"id": 34,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "balanceOf",
"nameLocation": "951:9:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 30,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 29,
"mutability": "mutable",
"name": "account",
"nameLocation": "969:7:0",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "961:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 28,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "961:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "960:17:0"
},
"returnParameters": {
"id": 33,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 32,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 34,
"src": "1001:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 31,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1001:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "1000:9:0"
},
"scope": 77,
"src": "942:68:0",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 35,
"nodeType": "StructuredDocumentation",
"src": "1018:208:0",
"text": " @dev Moves `amount` tokens from the caller's account to `to`.\n Returns a boolean value indicating whether the operation succeeded.\n Emits a {Transfer} event."
},
"functionSelector": "a9059cbb",
"id": 44,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "transfer",
"nameLocation": "1241:8:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 40,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 37,
"mutability": "mutable",
"name": "to",
"nameLocation": "1258:2:0",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "1250:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 36,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1250:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 39,
"mutability": "mutable",
"name": "amount",
"nameLocation": "1270:6:0",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "1262:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 38,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1262:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "1249:28:0"
},
"returnParameters": {
"id": 43,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 42,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 44,
"src": "1296:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 41,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1296:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "1295:6:0"
},
"scope": 77,
"src": "1232:70:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 45,
"nodeType": "StructuredDocumentation",
"src": "1310:270:0",
"text": " @dev Returns the remaining number of tokens that `spender` will be\n allowed to spend on behalf of `owner` through {transferFrom}. This is\n zero by default.\n This value changes when {approve} or {transferFrom} are called."
},
"functionSelector": "dd62ed3e",
"id": 54,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "allowance",
"nameLocation": "1595:9:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 50,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 47,
"mutability": "mutable",
"name": "owner",
"nameLocation": "1613:5:0",
"nodeType": "VariableDeclaration",
"scope": 54,
"src": "1605:13:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 46,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1605:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 49,
"mutability": "mutable",
"name": "spender",
"nameLocation": "1628:7:0",
"nodeType": "VariableDeclaration",
"scope": 54,
"src": "1620:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 48,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1620:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "1604:32:0"
},
"returnParameters": {
"id": 53,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 52,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 54,
"src": "1660:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 51,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "1660:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "1659:9:0"
},
"scope": 77,
"src": "1586:83:0",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 55,
"nodeType": "StructuredDocumentation",
"src": "1677:655:0",
"text": " @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\n Returns a boolean value indicating whether the operation succeeded.\n IMPORTANT: Beware that changing an allowance with this method brings the risk\n that someone may use both the old and the new allowance by unfortunate\n transaction ordering. One possible solution to mitigate this race\n condition is to first reduce the spender's allowance to 0 and set the\n desired value afterwards:\n https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\n Emits an {Approval} event."
},
"functionSelector": "095ea7b3",
"id": 64,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "approve",
"nameLocation": "2347:7:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 60,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 57,
"mutability": "mutable",
"name": "spender",
"nameLocation": "2363:7:0",
"nodeType": "VariableDeclaration",
"scope": 64,
"src": "2355:15:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 56,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2355:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 59,
"mutability": "mutable",
"name": "amount",
"nameLocation": "2380:6:0",
"nodeType": "VariableDeclaration",
"scope": 64,
"src": "2372:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 58,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2372:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "2354:33:0"
},
"returnParameters": {
"id": 63,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 62,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 64,
"src": "2406:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 61,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2406:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "2405:6:0"
},
"scope": 77,
"src": "2338:74:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 65,
"nodeType": "StructuredDocumentation",
"src": "2420:295:0",
"text": " @dev Moves `amount` tokens from `from` to `to` using the\n allowance mechanism. `amount` is then deducted from the caller's\n allowance.\n Returns a boolean value indicating whether the operation succeeded.\n Emits a {Transfer} event."
},
"functionSelector": "23b872dd",
"id": 76,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "transferFrom",
"nameLocation": "2730:12:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 72,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 67,
"mutability": "mutable",
"name": "from",
"nameLocation": "2751:4:0",
"nodeType": "VariableDeclaration",
"scope": 76,
"src": "2743:12:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 66,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2743:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 69,
"mutability": "mutable",
"name": "to",
"nameLocation": "2765:2:0",
"nodeType": "VariableDeclaration",
"scope": 76,
"src": "2757:10:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 68,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2757:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 71,
"mutability": "mutable",
"name": "amount",
"nameLocation": "2777:6:0",
"nodeType": "VariableDeclaration",
"scope": 76,
"src": "2769:14:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 70,
"name": "uint256",
"nodeType": "ElementaryTypeName",
"src": "2769:7:0",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "2742:42:0"
},
"returnParameters": {
"id": 75,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 74,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 76,
"src": "2803:4:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 73,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "2803:4:0",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "2802:6:0"
},
"scope": 77,
"src": "2721:88:0",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"scope": 78,
"src": "209:2603:0",
"usedErrors": [],
"usedEvents": [
11,
20
]
}
],
"src": "33:2779:0"
},
"id": 0
},
"contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"ast": {
"absolutePath": "contracts/token/ERC20/extensions/IERC20Metadata.sol",
"exportedSymbols": {
"IERC20": [
77
],
"IERC20Metadata": [
102
]
},
"id": 103,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 79,
"literals": [
"solidity",
"^",
"0.8",
".28"
],
"nodeType": "PragmaDirective",
"src": "33:24:1"
},
{
"absolutePath": "/contracts/token/ERC20/IERC20.sol",
"file": "/contracts/token/ERC20/IERC20.sol",
"id": 80,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 103,
"sourceUnit": 78,
"src": "61:43:1",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": false,
"baseContracts": [
{
"baseName": {
"id": 82,
"name": "IERC20",
"nameLocations": [
"336:6:1"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 77,
"src": "336:6:1"
},
"id": 83,
"nodeType": "InheritanceSpecifier",
"src": "336:6:1"
}
],
"canonicalName": "IERC20Metadata",
"contractDependencies": [],
"contractKind": "interface",
"documentation": {
"id": 81,
"nodeType": "StructuredDocumentation",
"src": "186:120:1",
"text": " @dev Interface for the optional metadata functions from the ERC20 standard.\n _Available since v4.1._"
},
"fullyImplemented": false,
"id": 102,
"linearizedBaseContracts": [
102,
77
],
"name": "IERC20Metadata",
"nameLocation": "318:14:1",
"nodeType": "ContractDefinition",
"nodes": [
{
"documentation": {
"id": 84,
"nodeType": "StructuredDocumentation",
"src": "350:56:1",
"text": " @dev Returns the name of the token."
},
"functionSelector": "06fdde03",
"id": 89,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "name",
"nameLocation": "421:4:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 85,
"nodeType": "ParameterList",
"parameters": [],
"src": "425:2:1"
},
"returnParameters": {
"id": 88,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 87,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 89,
"src": "451:13:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 86,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "451:6:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"visibility": "internal"
}
],
"src": "450:15:1"
},
"scope": 102,
"src": "412:54:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 90,
"nodeType": "StructuredDocumentation",
"src": "474:58:1",
"text": " @dev Returns the symbol of the token."
},
"functionSelector": "95d89b41",
"id": 95,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "symbol",
"nameLocation": "547:6:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 91,
"nodeType": "ParameterList",
"parameters": [],
"src": "553:2:1"
},
"returnParameters": {
"id": 94,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 93,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 95,
"src": "579:13:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 92,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "579:6:1",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"visibility": "internal"
}
],
"src": "578:15:1"
},
"scope": 102,
"src": "538:56:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"documentation": {
"id": 96,
"nodeType": "StructuredDocumentation",
"src": "602:67:1",
"text": " @dev Returns the decimals places of the token."
},
"functionSelector": "313ce567",
"id": 101,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "decimals",
"nameLocation": "684:8:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 97,
"nodeType": "ParameterList",
"parameters": [],
"src": "692:2:1"
},
"returnParameters": {
"id": 100,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 99,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 101,
"src": "718:5:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
},
"typeName": {
"id": 98,
"name": "uint8",
"nodeType": "ElementaryTypeName",
"src": "718:5:1",
"typeDescriptions": {
"typeIdentifier": "t_uint8",
"typeString": "uint8"
}
},
"visibility": "internal"
}
],
"src": "717:7:1"
},
"scope": 102,
"src": "675:50:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 103,
"src": "308:420:1",
"usedErrors": [],
"usedEvents": [
11,
20
]
}
],
"src": "33:695:1"
},
"id": 1
}
}
}
}
{
"deploy": {
"VM:-": {
"linkReferences": {},
"autoDeployLib": true
},
"main:1": {
"linkReferences": {},
"autoDeployLib": true
},
"ropsten:3": {
"linkReferences": {},
"autoDeployLib": true
},
"rinkeby:4": {
"linkReferences": {},
"autoDeployLib": true
},
"kovan:42": {
"linkReferences": {},
"autoDeployLib": true
},
"goerli:5": {
"linkReferences": {},
"autoDeployLib": true
},
"Custom": {
"linkReferences": {},
"autoDeployLib": true
}
},
"data": {
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"methodIdentifiers": {
"allowance(address,address)": "dd62ed3e",
"approve(address,uint256)": "095ea7b3",
"balanceOf(address)": "70a08231",
"decimals()": "313ce567",
"name()": "06fdde03",
"symbol()": "95d89b41",
"totalSupply()": "18160ddd",
"transfer(address,uint256)": "a9059cbb",
"transferFrom(address,address,uint256)": "23b872dd"
}
},
"abi": [
{
"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": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"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": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"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": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"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": "amount",
"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": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
]
}
{
"compiler": {
"version": "0.8.28+commit.7893614a"
},
"language": "Solidity",
"output": {
"abi": [
{
"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": "from",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "to",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"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": "amount",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "balanceOf",
"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": "name",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"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": "amount",
"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": "amount",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Interface for the optional metadata functions from the ERC20 standard. _Available since v4.1._",
"events": {
"Approval(address,address,uint256)": {
"details": "Emitted when the allowance of a `spender` for an `owner` is set by a call to {approve}. `value` is the new allowance."
},
"Transfer(address,address,uint256)": {
"details": "Emitted when `value` tokens are moved from one account (`from`) to another (`to`). Note that `value` may be zero."
}
},
"kind": "dev",
"methods": {
"allowance(address,address)": {
"details": "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."
},
"approve(address,uint256)": {
"details": "Sets `amount` 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."
},
"balanceOf(address)": {
"details": "Returns the amount of tokens owned by `account`."
},
"decimals()": {
"details": "Returns the decimals places of the token."
},
"name()": {
"details": "Returns the name of the token."
},
"symbol()": {
"details": "Returns the symbol of the token."
},
"totalSupply()": {
"details": "Returns the amount of tokens in existence."
},
"transfer(address,uint256)": {
"details": "Moves `amount` tokens from the caller's account to `to`. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
},
"transferFrom(address,address,uint256)": {
"details": "Moves `amount` tokens from `from` to `to` using the allowance mechanism. `amount` is then deducted from the caller's allowance. Returns a boolean value indicating whether the operation succeeded. Emits a {Transfer} event."
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/token/ERC20/extensions/IERC20Metadata.sol": "IERC20Metadata"
},
"evmVersion": "cancun",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": false,
"runs": 200
},
"remappings": []
},
"sources": {
"/contracts/token/ERC20/IERC20.sol": {
"keccak256": "0x798ce89b0f680daac5e1683c5540f1ef74edb181e2b647b17e2b71b9740e79b0",
"license": "MIT",
"urls": [
"bzz-raw://9af0ce7a14f6de7a90e7f43e6b5d0aa2f558071f27114dc78852c918ffb92b5c",
"dweb:/ipfs/QmSdaBf6EKV8RBEjrAWaPxY33g35BaZjb9cjaKWgaHtv8F"
]
},
"contracts/token/ERC20/extensions/IERC20Metadata.sol": {
"keccak256": "0x4660b6728f73b964ca0385fe553f6814ca7be82ed1adc5b65bc59cc335c4b301",
"license": "MIT",
"urls": [
"bzz-raw://6b188edc2ec64947c08bcf1502b33ce41900362a2f6859ce45b23d58dd8e1cd6",
"dweb:/ipfs/QmTgt4NNZ5wKeCfhA2hJ33aTWLB3eLZ6A4AEYJweogrXRe"
]
}
},
"version": 1
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
import "/contracts/token/ERC20/IERC20.sol";
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
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
pragma solidity ^0.8.20;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
//import "/contracts/external/ERC20/CustomMintableERC20.sol";
import "contracts/lib/SafeMath.sol";
contract DeepSeek is ERC20, Ownable(0x0F63eD4c72Dc378e65c594EAa7C2B2ddc471e10B), Pausable, ERC20Burnable {
using SafeMath for uint256;
address public _OWNER_;
address public _NEW_OWNER_;
bool internal _INITIALIZED_;
uint256 public taxFee = 2; // 2% transaction fee
address public taxWallet;
string public _name = "DeepSeek";
string public _symbol ="DSS";
uint256 public _initSupply = 1000000000;
uint256 public _totalSupply = 1000000000;
uint8 public _decimals = 18;
uint256 public tradeBurnRatio;
uint256 public tradeFeeRatio;
address public team;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) internal allowed;
// ============ Events ============
event Mint(address indexed user, uint256 value);
event Burn(address indexed user, uint256 value);
event ChangeTeam(address oldTeam, address newTeam);
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event TaxWalletUpdated(address indexed newTaxWallet);
event TaxFeeUpdated(uint256 newTaxFee);
event Staked(address indexed user, uint256 amount);
event Unstaked(address indexed user, uint256 amount);
event AirdropDistributed(address indexed user, uint256 amount);
event LiquidityAdded(address indexed provider, uint256 tokenAmount, uint256 ethAmount);
event YieldFarmed(address indexed user, uint256 amount, uint256 reward);
event AutoLiquidityProvided(address indexed provider, uint256 tokenAmount, uint256 ethAmount);
event CustomizationUpdated(string parameter, uint256 newValue);
mapping(address => uint256) public stakingBalance;
mapping(address => uint256) public stakingTimestamp;
uint256 public stakingRewardRate = 10; // 10% annual reward
mapping(address => uint256) public farmingBalance;
uint256 public farmingRewardRate = 15; // 15% annual reward
// ============ Constructor ============
constructor(address _taxWallet) ERC20(_name, _symbol) {
require(_taxWallet != address(0), "Invalid tax wallet");
taxWallet = _taxWallet;
_mint(msg.sender, _totalSupply * 10 ** _decimals); // Initial supply: 1,000M DSS
//_mint(msg.sender, 1000000000 * 10 ** decimals()); // Initial supply: 1,000M DSS
}
// ============ Modifiers ============
modifier notInitialized() {
require(!_INITIALIZED_, "SKY_INITIALIZED");
_;
}
// ============ Functions ============
function init(
address _creator,
uint256 _tradeBurnRatio,
uint256 _tradeFeeRatio,
address _team
) public {
initOwner(_creator);
balances[_creator] = _initSupply;
require(_tradeBurnRatio >= 0 && _tradeBurnRatio <= 5000, "TRADE_BURN_RATIO_INVALID");
require(_tradeFeeRatio >= 0 && _tradeFeeRatio <= 5000, "TRADE_FEE_RATIO_INVALID");
tradeBurnRatio = _tradeBurnRatio;
tradeFeeRatio = _tradeFeeRatio;
team = _team;
emit Transfer(address(0), _creator, _initSupply);
}
//=================== Ownable ======================
function changeTeamAccount(address newTeam) external onlyOwner {
require(tradeFeeRatio > 0, "NOT_TRADE_FEE_TOKEN");
emit ChangeTeam(team,newTeam);
team = newTeam;
}
function abandonOwnership(address zeroAddress) external onlyOwner {
require(zeroAddress == address(0), "NOT_ZERO_ADDRESS");
emit OwnershipTransferred(_OWNER_, address(0));
_OWNER_ = address(0);
}
//--------------------------
function initOwner(address newOwner) public notInitialized {
_INITIALIZED_ = true;
_OWNER_ = newOwner;
}
function claimOwnership() public {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
function setTaxWallet(address _taxWallet) external onlyOwner {
require(_taxWallet != address(0), "Invalid tax wallet");
taxWallet = _taxWallet;
emit TaxWalletUpdated(_taxWallet);
}
function setTaxFee(uint256 _taxFee) external onlyOwner {
require(_taxFee <= 10, "Tax fee too high");
taxFee = _taxFee;
emit TaxFeeUpdated(_taxFee);
}
function setStakingRewardRate(uint256 _stakingRewardRate) external onlyOwner {
stakingRewardRate = _stakingRewardRate;
emit CustomizationUpdated("StakingRewardRate", _stakingRewardRate);
}
function setFarmingRewardRate(uint256 _farmingRewardRate) external onlyOwner {
farmingRewardRate = _farmingRewardRate;
emit CustomizationUpdated("FarmingRewardRate", _farmingRewardRate);
}
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
function mint(address to, uint256 amount) external onlyOwner {
_mint(to, amount);
}
function stake(uint256 amount) external whenNotPaused {
require(amount > 0, "Cannot stake zero tokens");
require(balanceOf(msg.sender) >= amount, "Insufficient balance");
_transfer(msg.sender, address(this), amount);
stakingBalance[msg.sender] += amount;
stakingTimestamp[msg.sender] = block.timestamp;
emit Staked(msg.sender, amount);
}
function unstake(uint256 amount) external whenNotPaused {
require(amount > 0, "Cannot unstake zero tokens");
require(stakingBalance[msg.sender] >= amount, "Insufficient staked balance");
uint256 stakingDuration = block.timestamp - stakingTimestamp[msg.sender];
uint256 reward = (amount * stakingRewardRate * stakingDuration) / (365 days * 100);
stakingBalance[msg.sender] -= amount;
_mint(msg.sender, reward);
_transfer(address(this), msg.sender, amount);
emit Unstaked(msg.sender, amount);
}
function yieldFarm(uint256 amount) external whenNotPaused {
require(amount > 0, "Cannot farm zero tokens");
require(balanceOf(msg.sender) >= amount, "Insufficient balance");
_transfer(msg.sender, address(this), amount);
farmingBalance[msg.sender] += amount;
uint256 reward = (amount * farmingRewardRate) / 100;
_mint(msg.sender, reward);
emit YieldFarmed(msg.sender, amount, reward);
}
function airdrop(address[] calldata recipients, uint256 amount) external onlyOwner {
require(amount > 0, "Airdrop amount must be greater than zero");
for (uint256 i = 0; i < recipients.length; i++) {
_transfer(msg.sender, recipients[i], amount);
emit AirdropDistributed(recipients[i], amount);
}
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) external onlyOwner payable {
require(ethAmount == msg.value, "Mismatched ETH amount");
_transfer(msg.sender, address(this), tokenAmount);
emit LiquidityAdded(msg.sender, tokenAmount, ethAmount);
}
function autoProvideLiquidity(uint256 tokenAmount, uint256 ethAmount) external onlyOwner payable {
require(ethAmount == msg.value, "Mismatched ETH amount");
_transfer(msg.sender, address(this), tokenAmount);
emit AutoLiquidityProvided(msg.sender, tokenAmount, ethAmount);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.28;
import "/contracts/utils/introspection/ERC165.sol";
contract OFTWithFee is BaseOFTWithFee, ERC20 {
uint256 internal immutable ld2sdRate;
constructor(
string memory _name,
string memory _symbol,
uint8 _sharedDecimals,
address _lzEndpoint
) ERC20(_name, _symbol) BaseOFTWithFee(_sharedDecimals, _lzEndpoint) {
uint8 decimals = decimals();
require(
_sharedDecimals <= decimals,
"OFTWithFee: sharedDecimals must be <= decimals"
);
ld2sdRate = 10**(decimals - _sharedDecimals);
}
/************************************************************************
* public functions
************************************************************************/
function circulatingSupply()
public
view
virtual
override
returns (uint256)
{
return totalSupply();
}
function token() public view virtual override returns (address) {
return address(this);
}
/************************************************************************
* internal functions
************************************************************************/
function _debitFrom(
address _from,
uint16,
bytes32,
uint256 _amount
) internal virtual override returns (uint256) {
address spender = _msgSender();
if (_from != spender) _spendAllowance(_from, spender, _amount);
_burn(_from, _amount);
return _amount;
}
function _creditTo(
uint16,
address _toAddress,
uint256 _amount
) internal virtual override returns (uint256) {
_mint(_toAddress, _amount);
return _amount;
}
function _transferFrom(
address _from,
address _to,
uint256 _amount
) internal virtual override returns (uint256) {
address spender = _msgSender();
// if transfer from this contract, no need to check allowance
if (_from != address(this) && _from != spender)
_spendAllowance(_from, spender, _amount);
_transfer(_from, _to, _amount);
return _amount;
}
function _ld2sdRate() internal view virtual override returns (uint256) {
return ld2sdRate;
}
}
This file has been truncated, but you can view the full file.
{
"id": "b0828831aed961a33849700d8c1fea89",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.8.28",
"solcLongVersion": "0.8.28+commit.7893614a",
"input": {
"language": "Solidity",
"sources": {
"contracts/access/Ownable.sol": {
"content": "// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.28;\r\n\r\nimport \"/contracts/utils/Context.sol\";\r\n\r\n// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)\r\n/**\r\n * @dev Contract module which provides a basic access control mechanism, where\r\n * there is an account (an owner) that can be granted exclusive access to\r\n * specific functions.\r\n *\r\n * By default, the owner account will be the one that deploys the contract. This\r\n * can later be changed with {transferOwnership}.\r\n *\r\n * This module is used through inheritance. It will make available the modifier\r\n * `onlyOwner`, which can be applied to your functions to restrict their use to\r\n * the owner.\r\n */\r\nabstract contract Ownable is Context {\r\n address private _owner;\r\n\r\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\r\n\r\n /**\r\n * @dev Initializes the contract setting the deployer as the initial owner.\r\n */\r\n constructor() {\r\n _transferOwnership(_msgSender());\r\n }\r\n\r\n /**\r\n * @dev Throws if called by any account other than the owner.\r\n */\r\n modifier onlyOwner() {\r\n _checkOwner();\r\n _;\r\n }\r\n\r\n /**\r\n * @dev Returns the address of the current owner.\r\n */\r\n function owner() public view virtual returns (address) {\r\n return _owner;\r\n }\r\n\r\n /**\r\n * @dev Throws if the sender is not the owner.\r\n */\r\n function _checkOwner() internal view virtual {\r\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\r\n }\r\n\r\n /**\r\n * @dev Leaves the contract without owner. It will not be possible to call\r\n * `onlyOwner` functions. Can only be called by the current owner.\r\n *\r\n * NOTE: Renouncing ownership will leave the contract without an owner,\r\n * thereby disabling any functionality that is only available to the owner.\r\n */\r\n function renounceOwnership() public virtual onlyOwner {\r\n _transferOwnership(address(0));\r\n }\r\n\r\n /**\r\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\r\n * Can only be called by the current owner.\r\n */\r\n function transferOwnership(address newOwner) public virtual onlyOwner {\r\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\r\n _transferOwnership(newOwner);\r\n }\r\n\r\n /**\r\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\r\n * Internal function without access restriction.\r\n */\r\n function _transferOwnership(address newOwner) internal virtual {\r\n address oldOwner = _owner;\r\n _owner = newOwner;\r\n emit OwnershipTransferred(oldOwner, newOwner);\r\n }\r\n}\r\n\r\ninterface ILayerZeroReceiver {\r\n // @notice LayerZero endpoint will invoke this function to deliver the message on the destination\r\n // @param _srcChainId - the source endpoint identifier\r\n // @param _srcAddress - the source sending contract address from the source chain\r\n // @param _nonce - the ordered message nonce\r\n // @param _payload - the signed payload is the UA bytes has encoded to be sent\r\n function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) external;\r\n}\r\n\r\ninterface ILayerZeroUserApplicationConfig {\r\n // @notice set the configuration of the LayerZero messaging library of the specified version\r\n // @param _version - messaging library version\r\n // @param _chainId - the chainId for the pending config change\r\n // @param _configType - type of configuration. every messaging library has its own convention.\r\n // @param _config - configuration in the bytes. can encode arbitrary content.\r\n function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external;\r\n\r\n // @notice set the send() LayerZero messaging library version to _version\r\n // @param _version - new messaging library version\r\n function setSendVersion(uint16 _version) external;\r\n\r\n // @notice set the lzReceive() LayerZero messaging library version to _version\r\n // @param _version - new messaging library version\r\n function setReceiveVersion(uint16 _version) external;\r\n\r\n // @notice Only when the UA needs to resume the message flow in blocking mode and clear the stored payload\r\n // @param _srcChainId - the chainId of the source chain\r\n // @param _srcAddress - the contract address of the source contract at the source chain\r\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external;\r\n}\r\n\r\ninterface ILayerZeroEndpoint is ILayerZeroUserApplicationConfig {\r\n // @notice send a LayerZero message to the specified address at a LayerZero endpoint.\r\n // @param _dstChainId - the destination chain identifier\r\n // @param _destination - the address on destination chain (in bytes). address length/format may vary by chains\r\n // @param _payload - a custom bytes payload to send to the destination contract\r\n // @param _refundAddress - if the source transaction is cheaper than the amount of value passed, refund the additional amount to this address\r\n // @param _zroPaymentAddress - the address of the ZRO token holder who would pay for the transaction\r\n // @param _adapterParams - parameters for custom functionality. e.g. receive airdropped native gas from the relayer on destination\r\n function send(\r\n uint16 _dstChainId,\r\n bytes calldata _destination,\r\n bytes calldata _payload,\r\n address payable _refundAddress,\r\n address _zroPaymentAddress,\r\n bytes calldata _adapterParams\r\n ) external payable;\r\n\r\n // @notice used by the messaging library to publish verified payload\r\n // @param _srcChainId - the source chain identifier\r\n // @param _srcAddress - the source contract (as bytes) at the source chain\r\n // @param _dstAddress - the address on destination chain\r\n // @param _nonce - the unbound message ordering nonce\r\n // @param _gasLimit - the gas limit for external contract execution\r\n // @param _payload - verified payload to send to the destination contract\r\n function receivePayload(\r\n uint16 _srcChainId,\r\n bytes calldata _srcAddress,\r\n address _dstAddress,\r\n uint64 _nonce,\r\n uint _gasLimit,\r\n bytes calldata _payload\r\n ) external;\r\n\r\n // @notice get the inboundNonce of a lzApp from a source chain which could be EVM or non-EVM chain\r\n // @param _srcChainId - the source chain identifier\r\n // @param _srcAddress - the source chain contract address\r\n function getInboundNonce(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (uint64);\r\n\r\n // @notice get the outboundNonce from this source chain which, consequently, is always an EVM\r\n // @param _srcAddress - the source chain contract address\r\n function getOutboundNonce(uint16 _dstChainId, address _srcAddress) external view returns (uint64);\r\n\r\n // @notice gets a quote in source native gas, for the amount that send() requires to pay for message delivery\r\n // @param _dstChainId - the destination chain identifier\r\n // @param _userApplication - the user app address on this EVM chain\r\n // @param _payload - the custom message to send over LayerZero\r\n // @param _payInZRO - if false, user app pays the protocol fee in native token\r\n // @param _adapterParam - parameters for the adapter service, e.g. send some dust native token to dstChain\r\n function estimateFees(\r\n uint16 _dstChainId,\r\n address _userApplication,\r\n bytes calldata _payload,\r\n bool _payInZRO,\r\n bytes calldata _adapterParam\r\n ) external view returns (uint nativeFee, uint zroFee);\r\n\r\n // @notice get this Endpoint's immutable source identifier\r\n function getChainId() external view returns (uint16);\r\n\r\n // @notice the interface to retry failed message on this Endpoint destination\r\n // @param _srcChainId - the source chain identifier\r\n // @param _srcAddress - the source chain contract address\r\n // @param _payload - the payload to be retried\r\n function retryPayload(uint16 _srcChainId, bytes calldata _srcAddress, bytes calldata _payload) external;\r\n\r\n // @notice query if any STORED payload (message blocking) at the endpoint.\r\n // @param _srcChainId - the source chain identifier\r\n // @param _srcAddress - the source chain contract address\r\n function hasStoredPayload(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool);\r\n\r\n // @notice query if the _libraryAddress is valid for sending msgs.\r\n // @param _userApplication - the user app address on this EVM chain\r\n function getSendLibraryAddress(address _userApplication) external view returns (address);\r\n\r\n // @notice query if the _libraryAddress is valid for receiving msgs.\r\n // @param _userApplication - the user app address on this EVM chain\r\n function getReceiveLibraryAddress(address _userApplication) external view returns (address);\r\n\r\n // @notice query if the non-reentrancy guard for send() is on\r\n // @return true if the guard is on. false otherwise\r\n function isSendingPayload() external view returns (bool);\r\n\r\n // @notice query if the non-reentrancy guard for receive() is on\r\n // @return true if the guard is on. false otherwise\r\n function isReceivingPayload() external view returns (bool);\r\n\r\n // @notice get the configuration of the LayerZero messaging library of the specified version\r\n // @param _version - messaging library version\r\n // @param _chainId - the chainId for the pending config change\r\n // @param _userApplication - the contract address of the user application\r\n // @param _configType - type of configuration. every messaging library has its own convention.\r\n function getConfig(uint16 _version, uint16 _chainId, address _userApplication, uint _configType) external view returns (bytes memory);\r\n\r\n // @notice get the send() LayerZero messaging library version\r\n // @param _userApplication - the contract address of the user application\r\n function getSendVersion(address _userApplication) external view returns (uint16);\r\n\r\n // @notice get the lzReceive() LayerZero messaging library version\r\n // @param _userApplication - the contract address of the user application\r\n function getReceiveVersion(address _userApplication) external view returns (uint16);\r\n}\r\n\r\n/*\r\n * @title Solidity Bytes Arrays Utils\r\n * @author Gonçalo Sá <goncalo.sa@consensys.net>\r\n *\r\n * @dev Bytes tightly packed arrays utility library for ethereum contracts written in Solidity.\r\n * The library lets you concatenate, slice and type cast bytes arrays both in memory and storage.\r\n */\r\nlibrary BytesLib {\r\n function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {\r\n bytes memory tempBytes;\r\n\r\n assembly {\r\n // Get a location of some free memory and store it in tempBytes as\r\n // Solidity does for memory variables.\r\n tempBytes := mload(0x40)\r\n\r\n // Store the length of the first bytes array at the beginning of\r\n // the memory for tempBytes.\r\n let length := mload(_preBytes)\r\n mstore(tempBytes, length)\r\n\r\n // Maintain a memory counter for the current write location in the\r\n // temp bytes array by adding the 32 bytes for the array length to\r\n // the starting location.\r\n let mc := add(tempBytes, 0x20)\r\n // Stop copying when the memory counter reaches the length of the\r\n // first bytes array.\r\n let end := add(mc, length)\r\n\r\n for {\r\n // Initialize a copy counter to the start of the _preBytes data,\r\n // 32 bytes into its memory.\r\n let cc := add(_preBytes, 0x20)\r\n } lt(mc, end) {\r\n // Increase both counters by 32 bytes each iteration.\r\n mc := add(mc, 0x20)\r\n cc := add(cc, 0x20)\r\n } {\r\n // Write the _preBytes data into the tempBytes memory 32 bytes\r\n // at a time.\r\n mstore(mc, mload(cc))\r\n }\r\n\r\n // Add the length of _postBytes to the current length of tempBytes\r\n // and store it as the new length in the first 32 bytes of the\r\n // tempBytes memory.\r\n length := mload(_postBytes)\r\n mstore(tempBytes, add(length, mload(tempBytes)))\r\n\r\n // Move the memory counter back from a multiple of 0x20 to the\r\n // actual end of the _preBytes data.\r\n mc := end\r\n // Stop copying when the memory counter reaches the new combined\r\n // length of the arrays.\r\n end := add(mc, length)\r\n\r\n for {\r\n let cc := add(_postBytes, 0x20)\r\n } lt(mc, end) {\r\n mc := add(mc, 0x20)\r\n cc := add(cc, 0x20)\r\n } {\r\n mstore(mc, mload(cc))\r\n }\r\n\r\n // Update the free-memory pointer by padding our last write location\r\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\r\n // next 32 byte block, then round down to the nearest multiple of\r\n // 32. If the sum of the length of the two arrays is zero then add\r\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\r\n mstore(\r\n 0x40,\r\n and(\r\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\r\n not(31) // Round down to the nearest 32 bytes.\r\n )\r\n )\r\n }\r\n\r\n return tempBytes;\r\n }\r\n\r\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\r\n assembly {\r\n // Read the first 32 bytes of _preBytes storage, which is the length\r\n // of the array. (We don't need to use the offset into the slot\r\n // because arrays use the entire slot.)\r\n let fslot := sload(_preBytes.slot)\r\n // Arrays of 31 bytes or less have an even value in their slot,\r\n // while longer arrays have an odd value. The actual length is\r\n // the slot divided by two for odd values, and the lowest order\r\n // byte divided by two for even values.\r\n // If the slot is even, bitwise and the slot with 255 and divide by\r\n // two to get the length. If the slot is odd, bitwise and the slot\r\n // with -1 and divide by two.\r\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\r\n let mlength := mload(_postBytes)\r\n let newlength := add(slength, mlength)\r\n // slength can contain both the length and contents of the array\r\n // if length < 32 bytes so let's prepare for that\r\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\r\n switch add(lt(slength, 32), lt(newlength, 32))\r\n case 2 {\r\n // Since the new array still fits in the slot, we just need to\r\n // update the contents of the slot.\r\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\r\n sstore(\r\n _preBytes.slot,\r\n // all the modifications to the slot are inside this\r\n // next block\r\n add(\r\n // we can just add to the slot contents because the\r\n // bytes we want to change are the LSBs\r\n fslot,\r\n add(\r\n mul(\r\n div(\r\n // load the bytes from memory\r\n mload(add(_postBytes, 0x20)),\r\n // zero all bytes to the right\r\n exp(0x100, sub(32, mlength))\r\n ),\r\n // and now shift left the number of bytes to\r\n // leave space for the length in the slot\r\n exp(0x100, sub(32, newlength))\r\n ),\r\n // increase length by the double of the memory\r\n // bytes length\r\n mul(mlength, 2)\r\n )\r\n )\r\n )\r\n }\r\n case 1 {\r\n // The stored value fits in the slot, but the combined value\r\n // will exceed it.\r\n // get the keccak hash to get the contents of the array\r\n mstore(0x0, _preBytes.slot)\r\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\r\n\r\n // save new length\r\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\r\n\r\n // The contents of the _postBytes array start 32 bytes into\r\n // the structure. Our first read should obtain the `submod`\r\n // bytes that can fit into the unused space in the last word\r\n // of the stored array. To get this, we read 32 bytes starting\r\n // from `submod`, so the data we read overlaps with the array\r\n // contents by `submod` bytes. Masking the lowest-order\r\n // `submod` bytes allows us to add that value directly to the\r\n // stored value.\r\n\r\n let submod := sub(32, slength)\r\n let mc := add(_postBytes, submod)\r\n let end := add(_postBytes, mlength)\r\n let mask := sub(exp(0x100, submod), 1)\r\n\r\n sstore(sc, add(and(fslot, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00), and(mload(mc), mask)))\r\n\r\n for {\r\n mc := add(mc, 0x20)\r\n sc := add(sc, 1)\r\n } lt(mc, end) {\r\n sc := add(sc, 1)\r\n mc := add(mc, 0x20)\r\n } {\r\n sstore(sc, mload(mc))\r\n }\r\n\r\n mask := exp(0x100, sub(mc, end))\r\n\r\n sstore(sc, mul(div(mload(mc), mask), mask))\r\n }\r\n default {\r\n // get the keccak hash to get the contents of the array\r\n mstore(0x0, _preBytes.slot)\r\n // Start copying to the last used word of the stored array.\r\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\r\n\r\n // save new length\r\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\r\n\r\n // Copy over the first `submod` bytes of the new data as in\r\n // case 1 above.\r\n let slengthmod := mod(slength, 32)\r\n let mlengthmod := mod(mlength, 32)\r\n let submod := sub(32, slengthmod)\r\n let mc := add(_postBytes, submod)\r\n let end := add(_postBytes, mlength)\r\n let mask := sub(exp(0x100, submod), 1)\r\n\r\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\r\n\r\n for {\r\n sc := add(sc, 1)\r\n mc := add(mc, 0x20)\r\n } lt(mc, end) {\r\n sc := add(sc, 1)\r\n mc := add(mc, 0x20)\r\n } {\r\n sstore(sc, mload(mc))\r\n }\r\n\r\n mask := exp(0x100, sub(mc, end))\r\n\r\n sstore(sc, mul(div(mload(mc), mask), mask))\r\n }\r\n }\r\n }\r\n\r\n function slice(bytes memory _bytes, uint _start, uint _length) internal pure returns (bytes memory) {\r\n require(_length + 31 >= _length, \"slice_overflow\");\r\n require(_bytes.length >= _start + _length, \"slice_outOfBounds\");\r\n\r\n bytes memory tempBytes;\r\n\r\n assembly {\r\n switch iszero(_length)\r\n case 0 {\r\n // Get a location of some free memory and store it in tempBytes as\r\n // Solidity does for memory variables.\r\n tempBytes := mload(0x40)\r\n\r\n // The first word of the slice result is potentially a partial\r\n // word read from the original array. To read it, we calculate\r\n // the length of that partial word and start copying that many\r\n // bytes into the array. The first word we copy will start with\r\n // data we don't care about, but the last `lengthmod` bytes will\r\n // land at the beginning of the contents of the new array. When\r\n // we're done copying, we overwrite the full first word with\r\n // the actual length of the slice.\r\n let lengthmod := and(_length, 31)\r\n\r\n // The multiplication in the next line is necessary\r\n // because when slicing multiples of 32 bytes (lengthmod == 0)\r\n // the following copy loop was copying the origin's length\r\n // and then ending prematurely not copying everything it should.\r\n let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))\r\n let end := add(mc, _length)\r\n\r\n for {\r\n // The multiplication in the next line has the same exact purpose\r\n // as the one above.\r\n let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), _start)\r\n } lt(mc, end) {\r\n mc := add(mc, 0x20)\r\n cc := add(cc, 0x20)\r\n } {\r\n mstore(mc, mload(cc))\r\n }\r\n\r\n mstore(tempBytes, _length)\r\n\r\n //update free-memory pointer\r\n //allocating the array padded to 32 bytes like the compiler does now\r\n mstore(0x40, and(add(mc, 31), not(31)))\r\n }\r\n //if we want a zero-length slice let's just return a zero-length array\r\n default {\r\n tempBytes := mload(0x40)\r\n //zero out the 32 bytes slice we are about to return\r\n //we need to do it because Solidity does not garbage collect\r\n mstore(tempBytes, 0)\r\n\r\n mstore(0x40, add(tempBytes, 0x20))\r\n }\r\n }\r\n\r\n return tempBytes;\r\n }\r\n\r\n function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {\r\n require(_bytes.length >= _start + 20, \"toAddress_outOfBounds\");\r\n address tempAddress;\r\n\r\n assembly {\r\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\r\n }\r\n\r\n return tempAddress;\r\n }\r\n\r\n function toUint8(bytes memory _bytes, uint _start) internal pure returns (uint8) {\r\n require(_bytes.length >= _start + 1, \"toUint8_outOfBounds\");\r\n uint8 tempUint;\r\n\r\n assembly {\r\n tempUint := mload(add(add(_bytes, 0x1), _start))\r\n }\r\n\r\n return tempUint;\r\n }\r\n\r\n function toUint16(bytes memory _bytes, uint _start) internal pure returns (uint16) {\r\n require(_bytes.length >= _start + 2, \"toUint16_outOfBounds\");\r\n uint16 tempUint;\r\n\r\n assembly {\r\n tempUint := mload(add(add(_bytes, 0x2), _start))\r\n }\r\n\r\n return tempUint;\r\n }\r\n\r\n function toUint32(bytes memory _bytes, uint _start) internal pure returns (uint32) {\r\n require(_bytes.length >= _start + 4, \"toUint32_outOfBounds\");\r\n uint32 tempUint;\r\n\r\n assembly {\r\n tempUint := mload(add(add(_bytes, 0x4), _start))\r\n }\r\n\r\n return tempUint;\r\n }\r\n\r\n function toUint64(bytes memory _bytes, uint _start) internal pure returns (uint64) {\r\n require(_bytes.length >= _start + 8, \"toUint64_outOfBounds\");\r\n uint64 tempUint;\r\n\r\n assembly {\r\n tempUint := mload(add(add(_bytes, 0x8), _start))\r\n }\r\n\r\n return tempUint;\r\n }\r\n\r\n function toUint96(bytes memory _bytes, uint _start) internal pure returns (uint96) {\r\n require(_bytes.length >= _start + 12, \"toUint96_outOfBounds\");\r\n uint96 tempUint;\r\n\r\n assembly {\r\n tempUint := mload(add(add(_bytes, 0xc), _start))\r\n }\r\n\r\n return tempUint;\r\n }\r\n\r\n function toUint128(bytes memory _bytes, uint _start) internal pure returns (uint128) {\r\n require(_bytes.length >= _start + 16, \"toUint128_outOfBounds\");\r\n uint128 tempUint;\r\n\r\n assembly {\r\n tempUint := mload(add(add(_bytes, 0x10), _start))\r\n }\r\n\r\n return tempUint;\r\n }\r\n\r\n function toUint256(bytes memory _bytes, uint _start) internal pure returns (uint) {\r\n require(_bytes.length >= _start + 32, \"toUint256_outOfBounds\");\r\n uint tempUint;\r\n\r\n assembly {\r\n tempUint := mload(add(add(_bytes, 0x20), _start))\r\n }\r\n\r\n return tempUint;\r\n }\r\n\r\n function toBytes32(bytes memory _bytes, uint _start) internal pure returns (bytes32) {\r\n require(_bytes.length >= _start + 32, \"toBytes32_outOfBounds\");\r\n bytes32 tempBytes32;\r\n\r\n assembly {\r\n tempBytes32 := mload(add(add(_bytes, 0x20), _start))\r\n }\r\n\r\n return tempBytes32;\r\n }\r\n\r\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\r\n bool success = true;\r\n\r\n assembly {\r\n let length := mload(_preBytes)\r\n\r\n // if lengths don't match the arrays are not equal\r\n switch eq(length, mload(_postBytes))\r\n case 1 {\r\n // cb is a circuit breaker in the for loop since there's\r\n // no said feature for inline assembly loops\r\n // cb = 1 - don't breaker\r\n // cb = 0 - break\r\n let cb := 1\r\n\r\n let mc := add(_preBytes, 0x20)\r\n let end := add(mc, length)\r\n\r\n for {\r\n let cc := add(_postBytes, 0x20)\r\n // the next line is the loop condition:\r\n // while(uint256(mc < end) + cb == 2)\r\n } eq(add(lt(mc, end), cb), 2) {\r\n mc := add(mc, 0x20)\r\n cc := add(cc, 0x20)\r\n } {\r\n // if any of these checks fails then arrays are not equal\r\n if iszero(eq(mload(mc), mload(cc))) {\r\n // unsuccess:\r\n success := 0\r\n cb := 0\r\n }\r\n }\r\n }\r\n default {\r\n // unsuccess:\r\n success := 0\r\n }\r\n }\r\n\r\n return success;\r\n }\r\n\r\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {\r\n bool success = true;\r\n\r\n assembly {\r\n // we know _preBytes_offset is 0\r\n let fslot := sload(_preBytes.slot)\r\n // Decode the length of the stored array like in concatStorage().\r\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\r\n let mlength := mload(_postBytes)\r\n\r\n // if lengths don't match the arrays are not equal\r\n switch eq(slength, mlength)\r\n case 1 {\r\n // slength can contain both the length and contents of the array\r\n // if length < 32 bytes so let's prepare for that\r\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\r\n if iszero(iszero(slength)) {\r\n switch lt(slength, 32)\r\n case 1 {\r\n // blank the last byte which is the length\r\n fslot := mul(div(fslot, 0x100), 0x100)\r\n\r\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\r\n // unsuccess:\r\n success := 0\r\n }\r\n }\r\n default {\r\n // cb is a circuit breaker in the for loop since there's\r\n // no said feature for inline assembly loops\r\n // cb = 1 - don't breaker\r\n // cb = 0 - break\r\n let cb := 1\r\n\r\n // get the keccak hash to get the contents of the array\r\n mstore(0x0, _preBytes.slot)\r\n let sc := keccak256(0x0, 0x20)\r\n\r\n let mc := add(_postBytes, 0x20)\r\n let end := add(mc, mlength)\r\n\r\n // the next line is the loop condition:\r\n // while(uint256(mc < end) + cb == 2)\r\n for {\r\n\r\n } eq(add(lt(mc, end), cb), 2) {\r\n sc := add(sc, 1)\r\n mc := add(mc, 0x20)\r\n } {\r\n if iszero(eq(sload(sc), mload(mc))) {\r\n // unsuccess:\r\n success := 0\r\n cb := 0\r\n }\r\n }\r\n }\r\n }\r\n }\r\n default {\r\n // unsuccess:\r\n success := 0\r\n }\r\n }\r\n\r\n return success;\r\n }\r\n}\r\n\r\n/*\r\n * a generic LzReceiver implementation\r\n */\r\nabstract contract LzApp is Ownable, ILayerZeroReceiver, ILayerZeroUserApplicationConfig {\r\n using BytesLib for bytes;\r\n\r\n // ua can not send payload larger than this by default, but it can be changed by the ua owner\r\n uint public constant DEFAULT_PAYLOAD_SIZE_LIMIT = 10000;\r\n\r\n ILayerZeroEndpoint public immutable lzEndpoint;\r\n mapping(uint16 => bytes) public trustedRemoteLookup;\r\n mapping(uint16 => mapping(uint16 => uint)) public minDstGasLookup;\r\n mapping(uint16 => uint) public payloadSizeLimitLookup;\r\n address public precrime;\r\n\r\n event SetPrecrime(address precrime);\r\n event SetTrustedRemote(uint16 _remoteChainId, bytes _path);\r\n event SetTrustedRemoteAddress(uint16 _remoteChainId, bytes _remoteAddress);\r\n event SetMinDstGas(uint16 _dstChainId, uint16 _type, uint _minDstGas);\r\n\r\n constructor(address _endpoint) {\r\n lzEndpoint = ILayerZeroEndpoint(_endpoint);\r\n }\r\n\r\n function lzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual override {\r\n // lzReceive must be called by the endpoint for security\r\n require(_msgSender() == address(lzEndpoint), \"LzApp: invalid endpoint caller\");\r\n\r\n bytes memory trustedRemote = trustedRemoteLookup[_srcChainId];\r\n // if will still block the message pathway from (srcChainId, srcAddress). should not receive message from untrusted remote.\r\n require(\r\n _srcAddress.length == trustedRemote.length && trustedRemote.length > 0 && keccak256(_srcAddress) == keccak256(trustedRemote),\r\n \"LzApp: invalid source sending contract\"\r\n );\r\n\r\n _blockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\r\n }\r\n\r\n // abstract function - the default behaviour of LayerZero is blocking. See: NonblockingLzApp if you dont need to enforce ordered messaging\r\n function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual;\r\n\r\n function _lzSend(\r\n uint16 _dstChainId,\r\n bytes memory _payload,\r\n address payable _refundAddress,\r\n address _zroPaymentAddress,\r\n bytes memory _adapterParams,\r\n uint _nativeFee\r\n ) internal virtual {\r\n bytes memory trustedRemote = trustedRemoteLookup[_dstChainId];\r\n require(trustedRemote.length != 0, \"LzApp: destination chain is not a trusted source\");\r\n _checkPayloadSize(_dstChainId, _payload.length);\r\n lzEndpoint.send{value: _nativeFee}(_dstChainId, trustedRemote, _payload, _refundAddress, _zroPaymentAddress, _adapterParams);\r\n }\r\n\r\n function _checkGasLimit(uint16 _dstChainId, uint16 _type, bytes memory _adapterParams, uint _extraGas) internal view virtual {\r\n uint providedGasLimit = _getGasLimit(_adapterParams);\r\n uint minGasLimit = minDstGasLookup[_dstChainId][_type];\r\n require(minGasLimit > 0, \"LzApp: minGasLimit not set\");\r\n require(providedGasLimit >= minGasLimit + _extraGas, \"LzApp: gas limit is too low\");\r\n }\r\n\r\n function _getGasLimit(bytes memory _adapterParams) internal pure virtual returns (uint gasLimit) {\r\n require(_adapterParams.length >= 34, \"LzApp: invalid adapterParams\");\r\n assembly {\r\n gasLimit := mload(add(_adapterParams, 34))\r\n }\r\n }\r\n\r\n function _checkPayloadSize(uint16 _dstChainId, uint _payloadSize) internal view virtual {\r\n uint payloadSizeLimit = payloadSizeLimitLookup[_dstChainId];\r\n if (payloadSizeLimit == 0) {\r\n // use default if not set\r\n payloadSizeLimit = DEFAULT_PAYLOAD_SIZE_LIMIT;\r\n }\r\n require(_payloadSize <= payloadSizeLimit, \"LzApp: payload size is too large\");\r\n }\r\n\r\n //---------------------------UserApplication config----------------------------------------\r\n function getConfig(uint16 _version, uint16 _chainId, address, uint _configType) external view returns (bytes memory) {\r\n return lzEndpoint.getConfig(_version, _chainId, address(this), _configType);\r\n }\r\n\r\n // generic config for LayerZero user Application\r\n function setConfig(uint16 _version, uint16 _chainId, uint _configType, bytes calldata _config) external override onlyOwner {\r\n lzEndpoint.setConfig(_version, _chainId, _configType, _config);\r\n }\r\n\r\n function setSendVersion(uint16 _version) external override onlyOwner {\r\n lzEndpoint.setSendVersion(_version);\r\n }\r\n\r\n function setReceiveVersion(uint16 _version) external override onlyOwner {\r\n lzEndpoint.setReceiveVersion(_version);\r\n }\r\n\r\n function forceResumeReceive(uint16 _srcChainId, bytes calldata _srcAddress) external override onlyOwner {\r\n lzEndpoint.forceResumeReceive(_srcChainId, _srcAddress);\r\n }\r\n\r\n // _path = abi.encodePacked(remoteAddress, localAddress)\r\n // this function set the trusted path for the cross-chain communication\r\n function setTrustedRemote(uint16 _remoteChainId, bytes calldata _path) external onlyOwner {\r\n trustedRemoteLookup[_remoteChainId] = _path;\r\n emit SetTrustedRemote(_remoteChainId, _path);\r\n }\r\n\r\n function setTrustedRemoteAddress(uint16 _remoteChainId, bytes calldata _remoteAddress) external onlyOwner {\r\n trustedRemoteLookup[_remoteChainId] = abi.encodePacked(_remoteAddress, address(this));\r\n emit SetTrustedRemoteAddress(_remoteChainId, _remoteAddress);\r\n }\r\n\r\n function getTrustedRemoteAddress(uint16 _remoteChainId) external view returns (bytes memory) {\r\n bytes memory path = trustedRemoteLookup[_remoteChainId];\r\n require(path.length != 0, \"LzApp: no trusted path record\");\r\n return path.slice(0, path.length - 20); // the last 20 bytes should be address(this)\r\n }\r\n\r\n function setPrecrime(address _precrime) external onlyOwner {\r\n precrime = _precrime;\r\n emit SetPrecrime(_precrime);\r\n }\r\n\r\n function setMinDstGas(uint16 _dstChainId, uint16 _packetType, uint _minGas) external onlyOwner {\r\n minDstGasLookup[_dstChainId][_packetType] = _minGas;\r\n emit SetMinDstGas(_dstChainId, _packetType, _minGas);\r\n }\r\n\r\n // if the size is 0, it means default size limit\r\n function setPayloadSizeLimit(uint16 _dstChainId, uint _size) external onlyOwner {\r\n payloadSizeLimitLookup[_dstChainId] = _size;\r\n }\r\n\r\n //--------------------------- VIEW FUNCTION ----------------------------------------\r\n function isTrustedRemote(uint16 _srcChainId, bytes calldata _srcAddress) external view returns (bool) {\r\n bytes memory trustedSource = trustedRemoteLookup[_srcChainId];\r\n return keccak256(trustedSource) == keccak256(_srcAddress);\r\n }\r\n}\r\n\r\nlibrary ExcessivelySafeCall {\r\n uint constant LOW_28_MASK = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff;\r\n\r\n /// @notice Use when you _really_ really _really_ don't trust the called\r\n /// contract. This prevents the called contract from causing reversion of\r\n /// the caller in as many ways as we can.\r\n /// @dev The main difference between this and a solidity low-level call is\r\n /// that we limit the number of bytes that the callee can cause to be\r\n /// copied to caller memory. This prevents stupid things like malicious\r\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\r\n /// to memory.\r\n /// @param _target The address to call\r\n /// @param _gas The amount of gas to forward to the remote contract\r\n /// @param _maxCopy The maximum number of bytes of returndata to copy\r\n /// to memory.\r\n /// @param _calldata The data to send to the remote contract\r\n /// @return success and returndata, as `.call()`. Returndata is capped to\r\n /// `_maxCopy` bytes.\r\n function excessivelySafeCall(address _target, uint _gas, uint16 _maxCopy, bytes memory _calldata) internal returns (bool, bytes memory) {\r\n // set up for assembly call\r\n uint _toCopy;\r\n bool _success;\r\n bytes memory _returnData = new bytes(_maxCopy);\r\n // dispatch message to recipient\r\n // by assembly calling \"handle\" function\r\n // we call via assembly to avoid memcopying a very large returndata\r\n // returned by a malicious contract\r\n assembly {\r\n _success := call(\r\n _gas, // gas\r\n _target, // recipient\r\n 0, // ether value\r\n add(_calldata, 0x20), // inloc\r\n mload(_calldata), // inlen\r\n 0, // outloc\r\n 0 // outlen\r\n )\r\n // limit our copy to 256 bytes\r\n _toCopy := returndatasize()\r\n if gt(_toCopy, _maxCopy) {\r\n _toCopy := _maxCopy\r\n }\r\n // Store the length of the copied bytes\r\n mstore(_returnData, _toCopy)\r\n // copy the bytes from returndata[0:_toCopy]\r\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\r\n }\r\n return (_success, _returnData);\r\n }\r\n\r\n /// @notice Use when you _really_ really _really_ don't trust the called\r\n /// contract. This prevents the called contract from causing reversion of\r\n /// the caller in as many ways as we can.\r\n /// @dev The main difference between this and a solidity low-level call is\r\n /// that we limit the number of bytes that the callee can cause to be\r\n /// copied to caller memory. This prevents stupid things like malicious\r\n /// contracts returning 10,000,000 bytes causing a local OOG when copying\r\n /// to memory.\r\n /// @param _target The address to call\r\n /// @param _gas The amount of gas to forward to the remote contract\r\n /// @param _maxCopy The maximum number of bytes of returndata to copy\r\n /// to memory.\r\n /// @param _calldata The data to send to the remote contract\r\n /// @return success and returndata, as `.call()`. Returndata is capped to\r\n /// `_maxCopy` bytes.\r\n function excessivelySafeStaticCall(\r\n address _target,\r\n uint _gas,\r\n uint16 _maxCopy,\r\n bytes memory _calldata\r\n ) internal view returns (bool, bytes memory) {\r\n // set up for assembly call\r\n uint _toCopy;\r\n bool _success;\r\n bytes memory _returnData = new bytes(_maxCopy);\r\n // dispatch message to recipient\r\n // by assembly calling \"handle\" function\r\n // we call via assembly to avoid memcopying a very large returndata\r\n // returned by a malicious contract\r\n assembly {\r\n _success := staticcall(\r\n _gas, // gas\r\n _target, // recipient\r\n add(_calldata, 0x20), // inloc\r\n mload(_calldata), // inlen\r\n 0, // outloc\r\n 0 // outlen\r\n )\r\n // limit our copy to 256 bytes\r\n _toCopy := returndatasize()\r\n if gt(_toCopy, _maxCopy) {\r\n _toCopy := _maxCopy\r\n }\r\n // Store the length of the copied bytes\r\n mstore(_returnData, _toCopy)\r\n // copy the bytes from returndata[0:_toCopy]\r\n returndatacopy(add(_returnData, 0x20), 0, _toCopy)\r\n }\r\n return (_success, _returnData);\r\n }\r\n\r\n /**\r\n * @notice Swaps function selectors in encoded contract calls\r\n * @dev Allows reuse of encoded calldata for functions with identical\r\n * argument types but different names. It simply swaps out the first 4 bytes\r\n * for the new selector. This function modifies memory in place, and should\r\n * only be used with caution.\r\n * @param _newSelector The new 4-byte selector\r\n * @param _buf The encoded contract args\r\n */\r\n function swapSelector(bytes4 _newSelector, bytes memory _buf) internal pure {\r\n require(_buf.length >= 4);\r\n uint _mask = LOW_28_MASK;\r\n assembly {\r\n // load the first word of\r\n let _word := mload(add(_buf, 0x20))\r\n // mask out the top 4 bytes\r\n // /x\r\n _word := and(_word, _mask)\r\n _word := or(_newSelector, _word)\r\n mstore(add(_buf, 0x20), _word)\r\n }\r\n }\r\n}\r\n\r\n/*\r\n * the default LayerZero messaging behaviour is blocking, i.e. any failed message will block the channel\r\n * this abstract class try-catch all fail messages and store locally for future retry. hence, non-blocking\r\n * NOTE: if the srcAddress is not configured properly, it will still block the message pathway from (srcChainId, srcAddress)\r\n */\r\nabstract contract NonblockingLzApp is LzApp {\r\n using ExcessivelySafeCall for address;\r\n\r\n constructor(address _endpoint) LzApp(_endpoint) {}\r\n\r\n mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32))) public failedMessages;\r\n\r\n event MessageFailed(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes _payload, bytes _reason);\r\n event RetryMessageSuccess(uint16 _srcChainId, bytes _srcAddress, uint64 _nonce, bytes32 _payloadHash);\r\n\r\n // overriding the virtual function in LzReceiver\r\n function _blockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual override {\r\n (bool success, bytes memory reason) = address(this).excessivelySafeCall(\r\n gasleft(),\r\n 150,\r\n abi.encodeWithSelector(this.nonblockingLzReceive.selector, _srcChainId, _srcAddress, _nonce, _payload)\r\n );\r\n if (!success) {\r\n _storeFailedMessage(_srcChainId, _srcAddress, _nonce, _payload, reason);\r\n }\r\n }\r\n\r\n function _storeFailedMessage(\r\n uint16 _srcChainId,\r\n bytes memory _srcAddress,\r\n uint64 _nonce,\r\n bytes memory _payload,\r\n bytes memory _reason\r\n ) internal virtual {\r\n failedMessages[_srcChainId][_srcAddress][_nonce] = keccak256(_payload);\r\n emit MessageFailed(_srcChainId, _srcAddress, _nonce, _payload, _reason);\r\n }\r\n\r\n function nonblockingLzReceive(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public virtual {\r\n // only internal transaction\r\n require(_msgSender() == address(this), \"NonblockingLzApp: caller must be LzApp\");\r\n _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\r\n }\r\n\r\n //@notice override this function\r\n function _nonblockingLzReceive(uint16 _srcChainId, bytes memory _srcAddress, uint64 _nonce, bytes memory _payload) internal virtual;\r\n\r\n function retryMessage(uint16 _srcChainId, bytes calldata _srcAddress, uint64 _nonce, bytes calldata _payload) public payable virtual {\r\n // assert there is message to retry\r\n bytes32 payloadHash = failedMessages[_srcChainId][_srcAddress][_nonce];\r\n require(payloadHash != bytes32(0), \"NonblockingLzApp: no stored message\");\r\n require(keccak256(_payload) == payloadHash, \"NonblockingLzApp: invalid payload\");\r\n // clear the stored message\r\n failedMessages[_srcChainId][_srcAddress][_nonce] = bytes32(0);\r\n // execute the message. revert if it fails again\r\n _nonblockingLzReceive(_srcChainId, _srcAddress, _nonce, _payload);\r\n emit RetryMessageSuccess(_srcChainId, _srcAddress, _nonce, payloadHash);\r\n }\r\n}\r\n\r\n\r\n"
},
"/contracts/utils/Context.sol": {
"content": "\r\n// SPDX-License-Identifier: MIT\r\npragma solidity ^0.8.28;\r\n\r\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\r\n/**\r\n * @dev Provides information about the current execution context, including the\r\n * sender of the transaction and its data. While these are generally available\r\n * via msg.sender and msg.data, they should not be accessed in such a direct\r\n * manner, since when dealing with meta-transactions the account sending and\r\n * paying for execution may not be the actual sender (as far as an application\r\n * is concerned).\r\n *\r\n * This contract is only required for intermediate, library-like contracts.\r\n */\r\nabstract contract Context {\r\n function _msgSender() internal view virtual returns (address) {\r\n return msg.sender;\r\n }\r\n\r\n function _msgData() internal view virtual returns (bytes calldata) {\r\n return msg.data;\r\n }\r\n}"
}
},
"settings": {
"optimizer": {
"enabled": false,
"runs": 200
},
"outputSelection": {
"*": {
"": [
"ast"
],
"*": [
"abi",
"metadata",
"devdoc",
"userdoc",
"storageLayout",
"evm.legacyAssembly",
"evm.bytecode",
"evm.deployedBytecode",
"evm.methodIdentifiers",
"evm.gasEstimates",
"evm.assembly"
]
}
},
"remappings": []
}
},
"output": {
"contracts": {
"/contracts/utils/Context.sol": {
"Context": {
"abi": [],
"devdoc": {
"details": "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.",
"kind": "dev",
"methods": {},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"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.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/contracts/utils/Context.sol\":\"Context\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/utils/Context.sol\":{\"keccak256\":\"0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc\",\"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}
},
"contracts/access/Ownable.sol": {
"BytesLib": {
"abi": [],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"evm": {
"assembly": " /* \"contracts/access/Ownable.sol\":10720:29784 library BytesLib {... */\n dataSize(sub_0)\n dataOffset(sub_0)\n 0x0b\n dup3\n dup3\n dup3\n codecopy\n dup1\n mload\n 0x00\n byte\n 0x73\n eq\n tag_1\n jumpi\n mstore(0x00, 0x4e487b7100000000000000000000000000000000000000000000000000000000)\n mstore(0x04, 0x00)\n revert(0x00, 0x24)\ntag_1:\n mstore(0x00, address)\n 0x73\n dup2\n mstore8\n dup3\n dup2\n return\nstop\n\nsub_0: assembly {\n /* \"contracts/access/Ownable.sol\":10720:29784 library BytesLib {... */\n eq(address, deployTimeAddress())\n mstore(0x40, 0x80)\n revert(0x00, 0x00)\n\n auxdata: 0xa264697066735822122050a50ea457725d1bb833ad764c623758be96809144ebf3b2c264da011f69e70e64736f6c634300081c0033\n}\n",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "6055604b600b8282823980515f1a607314603f577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea264697066735822122050a50ea457725d1bb833ad764c623758be96809144ebf3b2c264da011f69e70e64736f6c634300081c0033",
"opcodes": "PUSH1 0x55 PUSH1 0x4B PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH0 BYTE PUSH1 0x73 EQ PUSH1 0x3F JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH0 MSTORE PUSH0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH0 REVERT JUMPDEST ADDRESS PUSH0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 PUSH0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 POP 0xA5 0xE LOG4 JUMPI PUSH19 0x5D1BB833AD764C623758BE96809144EBF3B2C2 PUSH5 0xDA011F69E7 0xE PUSH5 0x736F6C6343 STOP ADDMOD SHR STOP CALLER ",
"sourceMap": "10720:19064:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "730000000000000000000000000000000000000000301460806040525f5ffdfea264697066735822122050a50ea457725d1bb833ad764c623758be96809144ebf3b2c264da011f69e70e64736f6c634300081c0033",
"opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 PUSH0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 POP 0xA5 0xE LOG4 JUMPI PUSH19 0x5D1BB833AD764C623758BE96809144EBF3B2C2 PUSH5 0xDA011F69E7 0xE PUSH5 0x736F6C6343 STOP ADDMOD SHR STOP CALLER ",
"sourceMap": "10720:19064:1:-:0;;;;;;;;"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "17000",
"executionCost": "92",
"totalCost": "17092"
},
"internal": {
"concat(bytes memory,bytes memory)": "infinite",
"concatStorage(bytes storage pointer,bytes memory)": "infinite",
"equal(bytes memory,bytes memory)": "infinite",
"equalStorage(bytes storage pointer,bytes memory)": "infinite",
"slice(bytes memory,uint256,uint256)": "infinite",
"toAddress(bytes memory,uint256)": "infinite",
"toBytes32(bytes memory,uint256)": "infinite",
"toUint128(bytes memory,uint256)": "infinite",
"toUint16(bytes memory,uint256)": "infinite",
"toUint256(bytes memory,uint256)": "infinite",
"toUint32(bytes memory,uint256)": "infinite",
"toUint64(bytes memory,uint256)": "infinite",
"toUint8(bytes memory,uint256)": "infinite",
"toUint96(bytes memory,uint256)": "infinite"
}
},
"legacyAssembly": {
".code": [
{
"begin": 10720,
"end": 29784,
"name": "PUSH #[$]",
"source": 1,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH [$]",
"source": 1,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "B"
},
{
"begin": 10720,
"end": 29784,
"name": "DUP3",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "DUP3",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "DUP3",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "CODECOPY",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "DUP1",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "MLOAD",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 10720,
"end": 29784,
"name": "BYTE",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "73"
},
{
"begin": 10720,
"end": 29784,
"name": "EQ",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH [tag]",
"source": 1,
"value": "1"
},
{
"begin": 10720,
"end": 29784,
"name": "JUMPI",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "4E487B7100000000000000000000000000000000000000000000000000000000"
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 10720,
"end": 29784,
"name": "MSTORE",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "4"
},
{
"begin": 10720,
"end": 29784,
"name": "MSTORE",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "24"
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 10720,
"end": 29784,
"name": "REVERT",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "tag",
"source": 1,
"value": "1"
},
{
"begin": 10720,
"end": 29784,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "ADDRESS",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 10720,
"end": 29784,
"name": "MSTORE",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "73"
},
{
"begin": 10720,
"end": 29784,
"name": "DUP2",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "MSTORE8",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "DUP3",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "DUP2",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "RETURN",
"source": 1
}
],
".data": {
"0": {
".auxdata": "a264697066735822122050a50ea457725d1bb833ad764c623758be96809144ebf3b2c264da011f69e70e64736f6c634300081c0033",
".code": [
{
"begin": 10720,
"end": 29784,
"name": "PUSHDEPLOYADDRESS",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "ADDRESS",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "EQ",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "80"
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "40"
},
{
"begin": 10720,
"end": 29784,
"name": "MSTORE",
"source": 1
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 10720,
"end": 29784,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 10720,
"end": 29784,
"name": "REVERT",
"source": 1
}
]
}
},
"sourceList": [
"/contracts/utils/Context.sol",
"contracts/access/Ownable.sol",
"#utility.yul"
]
},
"methodIdentifiers": {}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access/Ownable.sol\":\"BytesLib\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/utils/Context.sol\":{\"keccak256\":\"0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc\",\"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6\"]},\"contracts/access/Ownable.sol\":{\"keccak256\":\"0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887\",\"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"ExcessivelySafeCall": {
"abi": [],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"evm": {
"assembly": " /* \"contracts/access/Ownable.sol\":36544:42016 library ExcessivelySafeCall {... */\n dataSize(sub_0)\n dataOffset(sub_0)\n 0x0b\n dup3\n dup3\n dup3\n codecopy\n dup1\n mload\n 0x00\n byte\n 0x73\n eq\n tag_1\n jumpi\n mstore(0x00, 0x4e487b7100000000000000000000000000000000000000000000000000000000)\n mstore(0x04, 0x00)\n revert(0x00, 0x24)\ntag_1:\n mstore(0x00, address)\n 0x73\n dup2\n mstore8\n dup3\n dup2\n return\nstop\n\nsub_0: assembly {\n /* \"contracts/access/Ownable.sol\":36544:42016 library ExcessivelySafeCall {... */\n eq(address, deployTimeAddress())\n mstore(0x40, 0x80)\n revert(0x00, 0x00)\n\n auxdata: 0xa2646970667358221220e0c7ced395096aabef52a06882111151517b2fa4ac4f600e53bddf8e3c3e143e64736f6c634300081c0033\n}\n",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "6055604b600b8282823980515f1a607314603f577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220e0c7ced395096aabef52a06882111151517b2fa4ac4f600e53bddf8e3c3e143e64736f6c634300081c0033",
"opcodes": "PUSH1 0x55 PUSH1 0x4B PUSH1 0xB DUP3 DUP3 DUP3 CODECOPY DUP1 MLOAD PUSH0 BYTE PUSH1 0x73 EQ PUSH1 0x3F JUMPI PUSH32 0x4E487B7100000000000000000000000000000000000000000000000000000000 PUSH0 MSTORE PUSH0 PUSH1 0x4 MSTORE PUSH1 0x24 PUSH0 REVERT JUMPDEST ADDRESS PUSH0 MSTORE PUSH1 0x73 DUP2 MSTORE8 DUP3 DUP2 RETURN INVALID PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 PUSH0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE0 0xC7 0xCE 0xD3 SWAP6 MULMOD PUSH11 0xABEF52A06882111151517B 0x2F LOG4 0xAC 0x4F PUSH1 0xE MSTORE8 0xBD 0xDF DUP15 EXTCODECOPY RETURNDATACOPY EQ RETURNDATACOPY PUSH5 0x736F6C6343 STOP ADDMOD SHR STOP CALLER ",
"sourceMap": "36544:5472:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "730000000000000000000000000000000000000000301460806040525f5ffdfea2646970667358221220e0c7ced395096aabef52a06882111151517b2fa4ac4f600e53bddf8e3c3e143e64736f6c634300081c0033",
"opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH0 PUSH0 REVERT INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0xE0 0xC7 0xCE 0xD3 SWAP6 MULMOD PUSH11 0xABEF52A06882111151517B 0x2F LOG4 0xAC 0x4F PUSH1 0xE MSTORE8 0xBD 0xDF DUP15 EXTCODECOPY RETURNDATACOPY EQ RETURNDATACOPY PUSH5 0x736F6C6343 STOP ADDMOD SHR STOP CALLER ",
"sourceMap": "36544:5472:1:-:0;;;;;;;;"
},
"gasEstimates": {
"creation": {
"codeDepositCost": "17000",
"executionCost": "92",
"totalCost": "17092"
},
"internal": {
"excessivelySafeCall(address,uint256,uint16,bytes memory)": "infinite",
"excessivelySafeStaticCall(address,uint256,uint16,bytes memory)": "infinite",
"swapSelector(bytes4,bytes memory)": "infinite"
}
},
"legacyAssembly": {
".code": [
{
"begin": 36544,
"end": 42016,
"name": "PUSH #[$]",
"source": 1,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH [$]",
"source": 1,
"value": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "B"
},
{
"begin": 36544,
"end": 42016,
"name": "DUP3",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "DUP3",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "DUP3",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "CODECOPY",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "DUP1",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "MLOAD",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 36544,
"end": 42016,
"name": "BYTE",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "73"
},
{
"begin": 36544,
"end": 42016,
"name": "EQ",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH [tag]",
"source": 1,
"value": "1"
},
{
"begin": 36544,
"end": 42016,
"name": "JUMPI",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "4E487B7100000000000000000000000000000000000000000000000000000000"
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 36544,
"end": 42016,
"name": "MSTORE",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "4"
},
{
"begin": 36544,
"end": 42016,
"name": "MSTORE",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "24"
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 36544,
"end": 42016,
"name": "REVERT",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "tag",
"source": 1,
"value": "1"
},
{
"begin": 36544,
"end": 42016,
"name": "JUMPDEST",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "ADDRESS",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 36544,
"end": 42016,
"name": "MSTORE",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "73"
},
{
"begin": 36544,
"end": 42016,
"name": "DUP2",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "MSTORE8",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "DUP3",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "DUP2",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "RETURN",
"source": 1
}
],
".data": {
"0": {
".auxdata": "a2646970667358221220e0c7ced395096aabef52a06882111151517b2fa4ac4f600e53bddf8e3c3e143e64736f6c634300081c0033",
".code": [
{
"begin": 36544,
"end": 42016,
"name": "PUSHDEPLOYADDRESS",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "ADDRESS",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "EQ",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "80"
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "40"
},
{
"begin": 36544,
"end": 42016,
"name": "MSTORE",
"source": 1
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 36544,
"end": 42016,
"name": "PUSH",
"source": 1,
"value": "0"
},
{
"begin": 36544,
"end": 42016,
"name": "REVERT",
"source": 1
}
]
}
},
"sourceList": [
"/contracts/utils/Context.sol",
"contracts/access/Ownable.sol",
"#utility.yul"
]
},
"methodIdentifiers": {}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access/Ownable.sol\":\"ExcessivelySafeCall\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/utils/Context.sol\":{\"keccak256\":\"0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc\",\"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6\"]},\"contracts/access/Ownable.sol\":{\"keccak256\":\"0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887\",\"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"ILayerZeroEndpoint": {
"abi": [
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"internalType": "bool",
"name": "_payInZRO",
"type": "bool"
},
{
"internalType": "bytes",
"name": "_adapterParam",
"type": "bytes"
}
],
"name": "estimateFees",
"outputs": [
{
"internalType": "uint256",
"name": "nativeFee",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "zroFee",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "getChainId",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "getInboundNonce",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "_srcAddress",
"type": "address"
}
],
"name": "getOutboundNonce",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getReceiveLibraryAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getReceiveVersion",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getSendLibraryAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_userApplication",
"type": "address"
}
],
"name": "getSendVersion",
"outputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "hasStoredPayload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isReceivingPayload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "isSendingPayload",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "address",
"name": "_dstAddress",
"type": "address"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "uint256",
"name": "_gasLimit",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "receivePayload",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "retryPayload",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_destination",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"internalType": "address payable",
"name": "_refundAddress",
"type": "address"
},
{
"internalType": "address",
"name": "_zroPaymentAddress",
"type": "address"
},
{
"internalType": "bytes",
"name": "_adapterParams",
"type": "bytes"
}
],
"name": "send",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {
"estimateFees(uint16,address,bytes,bool,bytes)": "40a7bb10",
"forceResumeReceive(uint16,bytes)": "42d65a8d",
"getChainId()": "3408e470",
"getConfig(uint16,uint16,address,uint256)": "f5ecbdbc",
"getInboundNonce(uint16,bytes)": "fdc07c70",
"getOutboundNonce(uint16,address)": "7a145748",
"getReceiveLibraryAddress(address)": "71ba2fd6",
"getReceiveVersion(address)": "da1a7c9a",
"getSendLibraryAddress(address)": "9c729da1",
"getSendVersion(address)": "096568f6",
"hasStoredPayload(uint16,bytes)": "0eaf6ea6",
"isReceivingPayload()": "ca066b35",
"isSendingPayload()": "e97a448a",
"receivePayload(uint16,bytes,address,uint64,uint256,bytes)": "c2fa4813",
"retryPayload(uint16,bytes,bytes)": "aaff5f16",
"send(uint16,bytes,bytes,address,address,bytes)": "c5803100",
"setConfig(uint16,uint16,uint256,bytes)": "cbed8b9c",
"setReceiveVersion(uint16)": "10ddb137",
"setSendVersion(uint16)": "07e0db17"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"_userApplication\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"_payInZRO\",\"type\":\"bool\"},{\"internalType\":\"bytes\",\"name\":\"_adapterParam\",\"type\":\"bytes\"}],\"name\":\"estimateFees\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"nativeFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zroFee\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"forceResumeReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getChainId\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"_userApplication\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"}],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"getInboundNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"_srcAddress\",\"type\":\"address\"}],\"name\":\"getOutboundNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_userApplication\",\"type\":\"address\"}],\"name\":\"getReceiveLibraryAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_userApplication\",\"type\":\"address\"}],\"name\":\"getReceiveVersion\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_userApplication\",\"type\":\"address\"}],\"name\":\"getSendLibraryAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_userApplication\",\"type\":\"address\"}],\"name\":\"getSendVersion\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"hasStoredPayload\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isReceivingPayload\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isSendingPayload\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"_dstAddress\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"_gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"receivePayload\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"retryPayload\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_destination\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"},{\"internalType\":\"address payable\",\"name\":\"_refundAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_zroPaymentAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_adapterParams\",\"type\":\"bytes\"}],\"name\":\"send\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_config\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setReceiveVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setSendVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access/Ownable.sol\":\"ILayerZeroEndpoint\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/utils/Context.sol\":{\"keccak256\":\"0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc\",\"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6\"]},\"contracts/access/Ownable.sol\":{\"keccak256\":\"0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887\",\"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"ILayerZeroReceiver": {
"abi": [
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "lzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {
"lzReceive(uint16,bytes,uint64,bytes)": "001d3567"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"lzReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access/Ownable.sol\":\"ILayerZeroReceiver\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/utils/Context.sol\":{\"keccak256\":\"0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc\",\"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6\"]},\"contracts/access/Ownable.sol\":{\"keccak256\":\"0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887\",\"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"ILayerZeroUserApplicationConfig": {
"abi": [
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {
"forceResumeReceive(uint16,bytes)": "42d65a8d",
"setConfig(uint16,uint16,uint256,bytes)": "cbed8b9c",
"setReceiveVersion(uint16)": "10ddb137",
"setSendVersion(uint16)": "07e0db17"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"forceResumeReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_config\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setReceiveVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setSendVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access/Ownable.sol\":\"ILayerZeroUserApplicationConfig\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/utils/Context.sol\":{\"keccak256\":\"0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc\",\"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6\"]},\"contracts/access/Ownable.sol\":{\"keccak256\":\"0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887\",\"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG\"]}},\"version\":1}",
"storageLayout": {
"storage": [],
"types": null
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"LzApp": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint16",
"name": "_type",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_minDstGas",
"type": "uint256"
}
],
"name": "SetMinDstGas",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "precrime",
"type": "address"
}
],
"name": "SetPrecrime",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "SetTrustedRemote",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "SetTrustedRemoteAddress",
"type": "event"
},
{
"inputs": [],
"name": "DEFAULT_PAYLOAD_SIZE_LIMIT",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
}
],
"name": "getTrustedRemoteAddress",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "isTrustedRemote",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "lzEndpoint",
"outputs": [
{
"internalType": "contract ILayerZeroEndpoint",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "lzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "minDstGasLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "payloadSizeLimitLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "precrime",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_packetType",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_minGas",
"type": "uint256"
}
],
"name": "setMinDstGas",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_size",
"type": "uint256"
}
],
"name": "setPayloadSizeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_precrime",
"type": "address"
}
],
"name": "setPrecrime",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "setTrustedRemote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "setTrustedRemoteAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "trustedRemoteLookup",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
}
},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {
"DEFAULT_PAYLOAD_SIZE_LIMIT()": "c4461834",
"forceResumeReceive(uint16,bytes)": "42d65a8d",
"getConfig(uint16,uint16,address,uint256)": "f5ecbdbc",
"getTrustedRemoteAddress(uint16)": "9f38369a",
"isTrustedRemote(uint16,bytes)": "3d8b38f6",
"lzEndpoint()": "b353aaa7",
"lzReceive(uint16,bytes,uint64,bytes)": "001d3567",
"minDstGasLookup(uint16,uint16)": "8cfd8f5c",
"owner()": "8da5cb5b",
"payloadSizeLimitLookup(uint16)": "3f1f4fa4",
"precrime()": "950c8a74",
"renounceOwnership()": "715018a6",
"setConfig(uint16,uint16,uint256,bytes)": "cbed8b9c",
"setMinDstGas(uint16,uint16,uint256)": "df2a5b3b",
"setPayloadSizeLimit(uint16,uint256)": "0df37483",
"setPrecrime(address)": "baf3292d",
"setReceiveVersion(uint16)": "10ddb137",
"setSendVersion(uint16)": "07e0db17",
"setTrustedRemote(uint16,bytes)": "eb8d72b7",
"setTrustedRemoteAddress(uint16,bytes)": "a6c3d165",
"transferOwnership(address)": "f2fde38b",
"trustedRemoteLookup(uint16)": "7533d788"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_type\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minDstGas\",\"type\":\"uint256\"}],\"name\":\"SetMinDstGas\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"precrime\",\"type\":\"address\"}],\"name\":\"SetPrecrime\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_path\",\"type\":\"bytes\"}],\"name\":\"SetTrustedRemote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_remoteAddress\",\"type\":\"bytes\"}],\"name\":\"SetTrustedRemoteAddress\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_PAYLOAD_SIZE_LIMIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"forceResumeReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"}],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"}],\"name\":\"getTrustedRemoteAddress\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"isTrustedRemote\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lzEndpoint\",\"outputs\":[{\"internalType\":\"contract ILayerZeroEndpoint\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"lzReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"minDstGasLookup\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"payloadSizeLimitLookup\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"precrime\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_config\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_packetType\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_minGas\",\"type\":\"uint256\"}],\"name\":\"setMinDstGas\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_size\",\"type\":\"uint256\"}],\"name\":\"setPayloadSizeLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_precrime\",\"type\":\"address\"}],\"name\":\"setPrecrime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setReceiveVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setSendVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_path\",\"type\":\"bytes\"}],\"name\":\"setTrustedRemote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_remoteAddress\",\"type\":\"bytes\"}],\"name\":\"setTrustedRemoteAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"trustedRemoteLookup\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access/Ownable.sol\":\"LzApp\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/utils/Context.sol\":{\"keccak256\":\"0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc\",\"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6\"]},\"contracts/access/Ownable.sol\":{\"keccak256\":\"0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887\",\"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG\"]}},\"version\":1}",
"storageLayout": {
"storage": [
{
"astId": 29,
"contract": "contracts/access/Ownable.sol:LzApp",
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 667,
"contract": "contracts/access/Ownable.sol:LzApp",
"label": "trustedRemoteLookup",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_uint16,t_bytes_storage)"
},
{
"astId": 673,
"contract": "contracts/access/Ownable.sol:LzApp",
"label": "minDstGasLookup",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_uint16,t_mapping(t_uint16,t_uint256))"
},
{
"astId": 677,
"contract": "contracts/access/Ownable.sol:LzApp",
"label": "payloadSizeLimitLookup",
"offset": 0,
"slot": "3",
"type": "t_mapping(t_uint16,t_uint256)"
},
{
"astId": 679,
"contract": "contracts/access/Ownable.sol:LzApp",
"label": "precrime",
"offset": 0,
"slot": "4",
"type": "t_address"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bytes_storage": {
"encoding": "bytes",
"label": "bytes",
"numberOfBytes": "32"
},
"t_mapping(t_uint16,t_bytes_storage)": {
"encoding": "mapping",
"key": "t_uint16",
"label": "mapping(uint16 => bytes)",
"numberOfBytes": "32",
"value": "t_bytes_storage"
},
"t_mapping(t_uint16,t_mapping(t_uint16,t_uint256))": {
"encoding": "mapping",
"key": "t_uint16",
"label": "mapping(uint16 => mapping(uint16 => uint256))",
"numberOfBytes": "32",
"value": "t_mapping(t_uint16,t_uint256)"
},
"t_mapping(t_uint16,t_uint256)": {
"encoding": "mapping",
"key": "t_uint16",
"label": "mapping(uint16 => uint256)",
"numberOfBytes": "32",
"value": "t_uint256"
},
"t_uint16": {
"encoding": "inplace",
"label": "uint16",
"numberOfBytes": "2"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
}
}
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"NonblockingLzApp": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_reason",
"type": "bytes"
}
],
"name": "MessageFailed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"indexed": false,
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "_payloadHash",
"type": "bytes32"
}
],
"name": "RetryMessageSuccess",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint16",
"name": "_type",
"type": "uint16"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_minDstGas",
"type": "uint256"
}
],
"name": "SetMinDstGas",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "precrime",
"type": "address"
}
],
"name": "SetPrecrime",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "SetTrustedRemote",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"indexed": false,
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "SetTrustedRemoteAddress",
"type": "event"
},
{
"inputs": [],
"name": "DEFAULT_PAYLOAD_SIZE_LIMIT",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"name": "failedMessages",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "forceResumeReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
}
],
"name": "getConfig",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
}
],
"name": "getTrustedRemoteAddress",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
}
],
"name": "isTrustedRemote",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "lzEndpoint",
"outputs": [
{
"internalType": "contract ILayerZeroEndpoint",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "lzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "minDstGasLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "nonblockingLzReceive",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "payloadSizeLimitLookup",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "precrime",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_srcChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_srcAddress",
"type": "bytes"
},
{
"internalType": "uint64",
"name": "_nonce",
"type": "uint64"
},
{
"internalType": "bytes",
"name": "_payload",
"type": "bytes"
}
],
"name": "retryMessage",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_chainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_configType",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "_config",
"type": "bytes"
}
],
"name": "setConfig",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint16",
"name": "_packetType",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_minGas",
"type": "uint256"
}
],
"name": "setMinDstGas",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_dstChainId",
"type": "uint16"
},
{
"internalType": "uint256",
"name": "_size",
"type": "uint256"
}
],
"name": "setPayloadSizeLimit",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_precrime",
"type": "address"
}
],
"name": "setPrecrime",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setReceiveVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_version",
"type": "uint16"
}
],
"name": "setSendVersion",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_path",
"type": "bytes"
}
],
"name": "setTrustedRemote",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "_remoteChainId",
"type": "uint16"
},
{
"internalType": "bytes",
"name": "_remoteAddress",
"type": "bytes"
}
],
"name": "setTrustedRemoteAddress",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint16",
"name": "",
"type": "uint16"
}
],
"name": "trustedRemoteLookup",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"kind": "dev",
"methods": {
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
}
},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {
"DEFAULT_PAYLOAD_SIZE_LIMIT()": "c4461834",
"failedMessages(uint16,bytes,uint64)": "5b8c41e6",
"forceResumeReceive(uint16,bytes)": "42d65a8d",
"getConfig(uint16,uint16,address,uint256)": "f5ecbdbc",
"getTrustedRemoteAddress(uint16)": "9f38369a",
"isTrustedRemote(uint16,bytes)": "3d8b38f6",
"lzEndpoint()": "b353aaa7",
"lzReceive(uint16,bytes,uint64,bytes)": "001d3567",
"minDstGasLookup(uint16,uint16)": "8cfd8f5c",
"nonblockingLzReceive(uint16,bytes,uint64,bytes)": "66ad5c8a",
"owner()": "8da5cb5b",
"payloadSizeLimitLookup(uint16)": "3f1f4fa4",
"precrime()": "950c8a74",
"renounceOwnership()": "715018a6",
"retryMessage(uint16,bytes,uint64,bytes)": "d1deba1f",
"setConfig(uint16,uint16,uint256,bytes)": "cbed8b9c",
"setMinDstGas(uint16,uint16,uint256)": "df2a5b3b",
"setPayloadSizeLimit(uint16,uint256)": "0df37483",
"setPrecrime(address)": "baf3292d",
"setReceiveVersion(uint16)": "10ddb137",
"setSendVersion(uint16)": "07e0db17",
"setTrustedRemote(uint16,bytes)": "eb8d72b7",
"setTrustedRemoteAddress(uint16,bytes)": "a6c3d165",
"transferOwnership(address)": "f2fde38b",
"trustedRemoteLookup(uint16)": "7533d788"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_reason\",\"type\":\"bytes\"}],\"name\":\"MessageFailed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"_payloadHash\",\"type\":\"bytes32\"}],\"name\":\"RetryMessageSuccess\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_type\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"_minDstGas\",\"type\":\"uint256\"}],\"name\":\"SetMinDstGas\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"precrime\",\"type\":\"address\"}],\"name\":\"SetPrecrime\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_path\",\"type\":\"bytes\"}],\"name\":\"SetTrustedRemote\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"_remoteAddress\",\"type\":\"bytes\"}],\"name\":\"SetTrustedRemoteAddress\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_PAYLOAD_SIZE_LIMIT\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"failedMessages\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"forceResumeReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"}],\"name\":\"getConfig\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"}],\"name\":\"getTrustedRemoteAddress\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"}],\"name\":\"isTrustedRemote\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"lzEndpoint\",\"outputs\":[{\"internalType\":\"contract ILayerZeroEndpoint\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"lzReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"minDstGasLookup\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"nonblockingLzReceive\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"payloadSizeLimitLookup\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"precrime\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_srcChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_srcAddress\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"_payload\",\"type\":\"bytes\"}],\"name\":\"retryMessage\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_chainId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_configType\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"_config\",\"type\":\"bytes\"}],\"name\":\"setConfig\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"uint16\",\"name\":\"_packetType\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_minGas\",\"type\":\"uint256\"}],\"name\":\"setMinDstGas\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_dstChainId\",\"type\":\"uint16\"},{\"internalType\":\"uint256\",\"name\":\"_size\",\"type\":\"uint256\"}],\"name\":\"setPayloadSizeLimit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_precrime\",\"type\":\"address\"}],\"name\":\"setPrecrime\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setReceiveVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_version\",\"type\":\"uint16\"}],\"name\":\"setSendVersion\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_path\",\"type\":\"bytes\"}],\"name\":\"setTrustedRemote\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"_remoteChainId\",\"type\":\"uint16\"},{\"internalType\":\"bytes\",\"name\":\"_remoteAddress\",\"type\":\"bytes\"}],\"name\":\"setTrustedRemoteAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"name\":\"trustedRemoteLookup\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access/Ownable.sol\":\"NonblockingLzApp\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/utils/Context.sol\":{\"keccak256\":\"0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc\",\"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6\"]},\"contracts/access/Ownable.sol\":{\"keccak256\":\"0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887\",\"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG\"]}},\"version\":1}",
"storageLayout": {
"storage": [
{
"astId": 29,
"contract": "contracts/access/Ownable.sol:NonblockingLzApp",
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "t_address"
},
{
"astId": 667,
"contract": "contracts/access/Ownable.sol:NonblockingLzApp",
"label": "trustedRemoteLookup",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_uint16,t_bytes_storage)"
},
{
"astId": 673,
"contract": "contracts/access/Ownable.sol:NonblockingLzApp",
"label": "minDstGasLookup",
"offset": 0,
"slot": "2",
"type": "t_mapping(t_uint16,t_mapping(t_uint16,t_uint256))"
},
{
"astId": 677,
"contract": "contracts/access/Ownable.sol:NonblockingLzApp",
"label": "payloadSizeLimitLookup",
"offset": 0,
"slot": "3",
"type": "t_mapping(t_uint16,t_uint256)"
},
{
"astId": 679,
"contract": "contracts/access/Ownable.sol:NonblockingLzApp",
"label": "precrime",
"offset": 0,
"slot": "4",
"type": "t_address"
},
{
"astId": 1300,
"contract": "contracts/access/Ownable.sol:NonblockingLzApp",
"label": "failedMessages",
"offset": 0,
"slot": "5",
"type": "t_mapping(t_uint16,t_mapping(t_bytes_memory_ptr,t_mapping(t_uint64,t_bytes32)))"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
},
"t_bytes32": {
"encoding": "inplace",
"label": "bytes32",
"numberOfBytes": "32"
},
"t_bytes_memory_ptr": {
"encoding": "bytes",
"label": "bytes",
"numberOfBytes": "32"
},
"t_bytes_storage": {
"encoding": "bytes",
"label": "bytes",
"numberOfBytes": "32"
},
"t_mapping(t_bytes_memory_ptr,t_mapping(t_uint64,t_bytes32))": {
"encoding": "mapping",
"key": "t_bytes_memory_ptr",
"label": "mapping(bytes => mapping(uint64 => bytes32))",
"numberOfBytes": "32",
"value": "t_mapping(t_uint64,t_bytes32)"
},
"t_mapping(t_uint16,t_bytes_storage)": {
"encoding": "mapping",
"key": "t_uint16",
"label": "mapping(uint16 => bytes)",
"numberOfBytes": "32",
"value": "t_bytes_storage"
},
"t_mapping(t_uint16,t_mapping(t_bytes_memory_ptr,t_mapping(t_uint64,t_bytes32)))": {
"encoding": "mapping",
"key": "t_uint16",
"label": "mapping(uint16 => mapping(bytes => mapping(uint64 => bytes32)))",
"numberOfBytes": "32",
"value": "t_mapping(t_bytes_memory_ptr,t_mapping(t_uint64,t_bytes32))"
},
"t_mapping(t_uint16,t_mapping(t_uint16,t_uint256))": {
"encoding": "mapping",
"key": "t_uint16",
"label": "mapping(uint16 => mapping(uint16 => uint256))",
"numberOfBytes": "32",
"value": "t_mapping(t_uint16,t_uint256)"
},
"t_mapping(t_uint16,t_uint256)": {
"encoding": "mapping",
"key": "t_uint16",
"label": "mapping(uint16 => uint256)",
"numberOfBytes": "32",
"value": "t_uint256"
},
"t_mapping(t_uint64,t_bytes32)": {
"encoding": "mapping",
"key": "t_uint64",
"label": "mapping(uint64 => bytes32)",
"numberOfBytes": "32",
"value": "t_bytes32"
},
"t_uint16": {
"encoding": "inplace",
"label": "uint16",
"numberOfBytes": "2"
},
"t_uint256": {
"encoding": "inplace",
"label": "uint256",
"numberOfBytes": "32"
},
"t_uint64": {
"encoding": "inplace",
"label": "uint64",
"numberOfBytes": "8"
}
}
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"Ownable": {
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"devdoc": {
"details": "Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. By default, the owner account will be the one that deploys the contract. This can later be changed with {transferOwnership}. This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.",
"kind": "dev",
"methods": {
"constructor": {
"details": "Initializes the contract setting the deployer as the initial owner."
},
"owner()": {
"details": "Returns the address of the current owner."
},
"renounceOwnership()": {
"details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner."
},
"transferOwnership(address)": {
"details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
}
},
"version": 1
},
"evm": {
"assembly": "",
"bytecode": {
"functionDebugData": {},
"generatedSources": [],
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"deployedBytecode": {
"functionDebugData": {},
"generatedSources": [],
"immutableReferences": {},
"linkReferences": {},
"object": "",
"opcodes": "",
"sourceMap": ""
},
"gasEstimates": null,
"legacyAssembly": null,
"methodIdentifiers": {
"owner()": "8da5cb5b",
"renounceOwnership()": "715018a6",
"transferOwnership(address)": "f2fde38b"
}
},
"metadata": "{\"compiler\":{\"version\":\"0.8.28+commit.7893614a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Contract module which provides a basic access control mechanism, where there is an account (an owner) that can be granted exclusive access to specific functions. By default, the owner account will be the one that deploys the contract. This can later be changed with {transferOwnership}. This module is used through inheritance. It will make available the modifier `onlyOwner`, which can be applied to your functions to restrict their use to the owner.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Initializes the contract setting the deployer as the initial owner.\"},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/access/Ownable.sol\":\"Ownable\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"/contracts/utils/Context.sol\":{\"keccak256\":\"0x155adecde37bd0daffa853763cee2879c1e903cb884f54a913bef0ec410a41de\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://949941b2be31d8b1ffbe154ed19130f85d420d2ea35b4efe4b3734b1601a7acc\",\"dweb:/ipfs/QmQim2vCy1QGDGpHXdzdmCeytYgsqc6aAk4XGpxgZbHLd6\"]},\"contracts/access/Ownable.sol\":{\"keccak256\":\"0x89ccce8806809f84a856e0b6b3c3bca807d7c3f4393fbd3d08fff5cfb0205982\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://5b399095585582c3ba127c72153acc4361f33512c89debfa0d13082587b52887\",\"dweb:/ipfs/QmdNQDy2Uy8qbyNwzFfRhXd2TeWCKCxpLSNJ6YJv34YLWG\"]}},\"version\":1}",
"storageLayout": {
"storage": [
{
"astId": 29,
"contract": "contracts/access/Ownable.sol:Ownable",
"label": "_owner",
"offset": 0,
"slot": "0",
"type": "t_address"
}
],
"types": {
"t_address": {
"encoding": "inplace",
"label": "address",
"numberOfBytes": "20"
}
}
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
}
}
},
"sources": {
"/contracts/utils/Context.sol": {
"ast": {
"absolutePath": "/contracts/utils/Context.sol",
"exportedSymbols": {
"Context": [
21
]
},
"id": 22,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1,
"literals": [
"solidity",
"^",
"0.8",
".28"
],
"nodeType": "PragmaDirective",
"src": "35:24:0"
},
{
"abstract": true,
"baseContracts": [],
"canonicalName": "Context",
"contractDependencies": [],
"contractKind": "contract",
"documentation": {
"id": 2,
"nodeType": "StructuredDocumentation",
"src": "117:505:0",
"text": " @dev Provides information about the current execution context, including the\n sender of the transaction and its data. While these are generally available\n via msg.sender and msg.data, they should not be accessed in such a direct\n manner, since when dealing with meta-transactions the account sending and\n paying for execution may not be the actual sender (as far as an application\n is concerned).\n This contract is only required for intermediate, library-like contracts."
},
"fullyImplemented": true,
"id": 21,
"linearizedBaseContracts": [
21
],
"name": "Context",
"nameLocation": "642:7:0",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 10,
"nodeType": "Block",
"src": "719:36:0",
"statements": [
{
"expression": {
"expression": {
"id": 7,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967281,
"src": "737:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 8,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "741:6:0",
"memberName": "sender",
"nodeType": "MemberAccess",
"src": "737:10:0",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 6,
"id": 9,
"nodeType": "Return",
"src": "730:17:0"
}
]
},
"id": 11,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_msgSender",
"nameLocation": "666:10:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 3,
"nodeType": "ParameterList",
"parameters": [],
"src": "676:2:0"
},
"returnParameters": {
"id": 6,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 5,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 11,
"src": "710:7:0",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 4,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "710:7:0",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "709:9:0"
},
"scope": 21,
"src": "657:98:0",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
},
{
"body": {
"id": 19,
"nodeType": "Block",
"src": "830:34:0",
"statements": [
{
"expression": {
"expression": {
"id": 16,
"name": "msg",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 4294967281,
"src": "848:3:0",
"typeDescriptions": {
"typeIdentifier": "t_magic_message",
"typeString": "msg"
}
},
"id": 17,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"memberLocation": "852:4:0",
"memberName": "data",
"nodeType": "MemberAccess",
"src": "848:8:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes calldata"
}
},
"functionReturnParameters": 15,
"id": 18,
"nodeType": "Return",
"src": "841:15:0"
}
]
},
"id": 20,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_msgData",
"nameLocation": "772:8:0",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 12,
"nodeType": "ParameterList",
"parameters": [],
"src": "780:2:0"
},
"returnParameters": {
"id": 15,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 14,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 20,
"src": "814:14:0",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 13,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "814:5:0",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "813:16:0"
},
"scope": 21,
"src": "763:101:0",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
}
],
"scope": 22,
"src": "624:243:0",
"usedErrors": [],
"usedEvents": []
}
],
"src": "35:832:0"
},
"id": 0
},
"contracts/access/Ownable.sol": {
"ast": {
"absolutePath": "contracts/access/Ownable.sol",
"exportedSymbols": {
"BytesLib": [
648
],
"Context": [
21
],
"ExcessivelySafeCall": [
1278
],
"ILayerZeroEndpoint": [
317
],
"ILayerZeroReceiver": [
146
],
"ILayerZeroUserApplicationConfig": [
175
],
"LzApp": [
1183
],
"NonblockingLzApp": [
1515
],
"Ownable": [
134
]
},
"id": 1516,
"license": "MIT",
"nodeType": "SourceUnit",
"nodes": [
{
"id": 23,
"literals": [
"solidity",
"^",
"0.8",
".28"
],
"nodeType": "PragmaDirective",
"src": "33:24:1"
},
{
"absolutePath": "/contracts/utils/Context.sol",
"file": "/contracts/utils/Context.sol",
"id": 24,
"nameLocation": "-1:-1:-1",
"nodeType": "ImportDirective",
"scope": 1516,
"sourceUnit": 22,
"src": "61:38:1",
"symbolAliases": [],
"unitAlias": ""
},
{
"abstract": true,
"baseContracts": [
{
"baseName": {
"id": 26,
"name": "Context",
"nameLocations": [
"709:7:1"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 21,
"src": "709:7:1"
},
"id": 27,
"nodeType": "InheritanceSpecifier",
"src": "709:7:1"
}
],
"canonicalName": "Ownable",
"contractDependencies": [],
"contractKind": "contract",
"documentation": {
"id": 25,
"nodeType": "StructuredDocumentation",
"src": "173:505:1",
"text": " @dev Contract module which provides a basic access control mechanism, where\n there is an account (an owner) that can be granted exclusive access to\n specific functions.\n By default, the owner account will be the one that deploys the contract. This\n can later be changed with {transferOwnership}.\n This module is used through inheritance. It will make available the modifier\n `onlyOwner`, which can be applied to your functions to restrict their use to\n the owner."
},
"fullyImplemented": true,
"id": 134,
"linearizedBaseContracts": [
134,
21
],
"name": "Ownable",
"nameLocation": "698:7:1",
"nodeType": "ContractDefinition",
"nodes": [
{
"constant": false,
"id": 29,
"mutability": "mutable",
"name": "_owner",
"nameLocation": "740:6:1",
"nodeType": "VariableDeclaration",
"scope": 134,
"src": "724:22:1",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 28,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "724:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "private"
},
{
"anonymous": false,
"eventSelector": "8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0",
"id": 35,
"name": "OwnershipTransferred",
"nameLocation": "761:20:1",
"nodeType": "EventDefinition",
"parameters": {
"id": 34,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 31,
"indexed": true,
"mutability": "mutable",
"name": "previousOwner",
"nameLocation": "798:13:1",
"nodeType": "VariableDeclaration",
"scope": 35,
"src": "782:29:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 30,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "782:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 33,
"indexed": true,
"mutability": "mutable",
"name": "newOwner",
"nameLocation": "829:8:1",
"nodeType": "VariableDeclaration",
"scope": 35,
"src": "813:24:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 32,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "813:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "781:57:1"
},
"src": "755:84:1"
},
{
"body": {
"id": 44,
"nodeType": "Block",
"src": "960:51:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 40,
"name": "_msgSender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "990:10:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$",
"typeString": "function () view returns (address)"
}
},
"id": 41,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "990:12:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 39,
"name": "_transferOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 133,
"src": "971:18:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 42,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "971:32:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 43,
"nodeType": "ExpressionStatement",
"src": "971:32:1"
}
]
},
"documentation": {
"id": 36,
"nodeType": "StructuredDocumentation",
"src": "847:93:1",
"text": " @dev Initializes the contract setting the deployer as the initial owner."
},
"id": 45,
"implemented": true,
"kind": "constructor",
"modifiers": [],
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 37,
"nodeType": "ParameterList",
"parameters": [],
"src": "957:2:1"
},
"returnParameters": {
"id": 38,
"nodeType": "ParameterList",
"parameters": [],
"src": "960:0:1"
},
"scope": 134,
"src": "946:65:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 52,
"nodeType": "Block",
"src": "1125:44:1",
"statements": [
{
"expression": {
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 48,
"name": "_checkOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 76,
"src": "1136:11:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$__$",
"typeString": "function () view"
}
},
"id": 49,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1136:13:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 50,
"nodeType": "ExpressionStatement",
"src": "1136:13:1"
},
{
"id": 51,
"nodeType": "PlaceholderStatement",
"src": "1160:1:1"
}
]
},
"documentation": {
"id": 46,
"nodeType": "StructuredDocumentation",
"src": "1019:79:1",
"text": " @dev Throws if called by any account other than the owner."
},
"id": 53,
"name": "onlyOwner",
"nameLocation": "1113:9:1",
"nodeType": "ModifierDefinition",
"parameters": {
"id": 47,
"nodeType": "ParameterList",
"parameters": [],
"src": "1122:2:1"
},
"src": "1104:65:1",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 61,
"nodeType": "Block",
"src": "1305:32:1",
"statements": [
{
"expression": {
"id": 59,
"name": "_owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 29,
"src": "1323:6:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"functionReturnParameters": 58,
"id": 60,
"nodeType": "Return",
"src": "1316:13:1"
}
]
},
"documentation": {
"id": 54,
"nodeType": "StructuredDocumentation",
"src": "1177:67:1",
"text": " @dev Returns the address of the current owner."
},
"functionSelector": "8da5cb5b",
"id": 62,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "owner",
"nameLocation": "1259:5:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 55,
"nodeType": "ParameterList",
"parameters": [],
"src": "1264:2:1"
},
"returnParameters": {
"id": 58,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 57,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 62,
"src": "1296:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 56,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1296:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "1295:9:1"
},
"scope": 134,
"src": "1250:87:1",
"stateMutability": "view",
"virtual": true,
"visibility": "public"
},
{
"body": {
"id": 75,
"nodeType": "Block",
"src": "1460:87:1",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 71,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 67,
"name": "owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 62,
"src": "1479:5:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$",
"typeString": "function () view returns (address)"
}
},
"id": 68,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1479:7:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "==",
"rightExpression": {
"arguments": [],
"expression": {
"argumentTypes": [],
"id": 69,
"name": "_msgSender",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 11,
"src": "1490:10:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$__$returns$_t_address_$",
"typeString": "function () view returns (address)"
}
},
"id": 70,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1490:12:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "1479:23:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572",
"id": 72,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1504:34:1",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_9924ebdf1add33d25d4ef888e16131f0a5687b0580a36c21b5c301a6c462effe",
"typeString": "literal_string \"Ownable: caller is not the owner\""
},
"value": "Ownable: caller is not the owner"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_9924ebdf1add33d25d4ef888e16131f0a5687b0580a36c21b5c301a6c462effe",
"typeString": "literal_string \"Ownable: caller is not the owner\""
}
],
"id": 66,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "1471:7:1",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 73,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1471:68:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 74,
"nodeType": "ExpressionStatement",
"src": "1471:68:1"
}
]
},
"documentation": {
"id": 63,
"nodeType": "StructuredDocumentation",
"src": "1345:64:1",
"text": " @dev Throws if the sender is not the owner."
},
"id": 76,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_checkOwner",
"nameLocation": "1424:11:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 64,
"nodeType": "ParameterList",
"parameters": [],
"src": "1435:2:1"
},
"returnParameters": {
"id": 65,
"nodeType": "ParameterList",
"parameters": [],
"src": "1460:0:1"
},
"scope": 134,
"src": "1415:132:1",
"stateMutability": "view",
"virtual": true,
"visibility": "internal"
},
{
"body": {
"id": 89,
"nodeType": "Block",
"src": "1945:49:1",
"statements": [
{
"expression": {
"arguments": [
{
"arguments": [
{
"hexValue": "30",
"id": 85,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "1983:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 84,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "1975:7:1",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 83,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1975:7:1",
"typeDescriptions": {}
}
},
"id": 86,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1975:10:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 82,
"name": "_transferOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 133,
"src": "1956:18:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 87,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "1956:30:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 88,
"nodeType": "ExpressionStatement",
"src": "1956:30:1"
}
]
},
"documentation": {
"id": 77,
"nodeType": "StructuredDocumentation",
"src": "1555:330:1",
"text": " @dev Leaves the contract without owner. It will not be possible to call\n `onlyOwner` functions. Can only be called by the current owner.\n NOTE: Renouncing ownership will leave the contract without an owner,\n thereby disabling any functionality that is only available to the owner."
},
"functionSelector": "715018a6",
"id": 90,
"implemented": true,
"kind": "function",
"modifiers": [
{
"id": 80,
"kind": "modifierInvocation",
"modifierName": {
"id": 79,
"name": "onlyOwner",
"nameLocations": [
"1935:9:1"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 53,
"src": "1935:9:1"
},
"nodeType": "ModifierInvocation",
"src": "1935:9:1"
}
],
"name": "renounceOwnership",
"nameLocation": "1900:17:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 78,
"nodeType": "ParameterList",
"parameters": [],
"src": "1917:2:1"
},
"returnParameters": {
"id": 81,
"nodeType": "ParameterList",
"parameters": [],
"src": "1945:0:1"
},
"scope": 134,
"src": "1891:103:1",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "public"
},
{
"body": {
"id": 112,
"nodeType": "Block",
"src": "2219:131:1",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 104,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 99,
"name": "newOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 93,
"src": "2238:8:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"arguments": [
{
"hexValue": "30",
"id": 102,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2258:1:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 101,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "2250:7:1",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": {
"id": 100,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2250:7:1",
"typeDescriptions": {}
}
},
"id": 103,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2250:10:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2238:22:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373",
"id": 105,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "2262:40:1",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_245f15ff17f551913a7a18385165551503906a406f905ac1c2437281a7cd0cfe",
"typeString": "literal_string \"Ownable: new owner is the zero address\""
},
"value": "Ownable: new owner is the zero address"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_245f15ff17f551913a7a18385165551503906a406f905ac1c2437281a7cd0cfe",
"typeString": "literal_string \"Ownable: new owner is the zero address\""
}
],
"id": 98,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "2230:7:1",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (bool,string memory) pure"
}
},
"id": 106,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2230:73:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 107,
"nodeType": "ExpressionStatement",
"src": "2230:73:1"
},
{
"expression": {
"arguments": [
{
"id": 109,
"name": "newOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 93,
"src": "2333:8:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 108,
"name": "_transferOwnership",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 133,
"src": "2314:18:1",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
"typeString": "function (address)"
}
},
"id": 110,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2314:28:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 111,
"nodeType": "ExpressionStatement",
"src": "2314:28:1"
}
]
},
"documentation": {
"id": 91,
"nodeType": "StructuredDocumentation",
"src": "2002:141:1",
"text": " @dev Transfers ownership of the contract to a new account (`newOwner`).\n Can only be called by the current owner."
},
"functionSelector": "f2fde38b",
"id": 113,
"implemented": true,
"kind": "function",
"modifiers": [
{
"id": 96,
"kind": "modifierInvocation",
"modifierName": {
"id": 95,
"name": "onlyOwner",
"nameLocations": [
"2209:9:1"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 53,
"src": "2209:9:1"
},
"nodeType": "ModifierInvocation",
"src": "2209:9:1"
}
],
"name": "transferOwnership",
"nameLocation": "2158:17:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 94,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 93,
"mutability": "mutable",
"name": "newOwner",
"nameLocation": "2184:8:1",
"nodeType": "VariableDeclaration",
"scope": 113,
"src": "2176:16:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 92,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2176:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "2175:18:1"
},
"returnParameters": {
"id": 97,
"nodeType": "ParameterList",
"parameters": [],
"src": "2219:0:1"
},
"scope": 134,
"src": "2149:201:1",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "public"
},
{
"body": {
"id": 132,
"nodeType": "Block",
"src": "2573:128:1",
"statements": [
{
"assignments": [
120
],
"declarations": [
{
"constant": false,
"id": 120,
"mutability": "mutable",
"name": "oldOwner",
"nameLocation": "2592:8:1",
"nodeType": "VariableDeclaration",
"scope": 132,
"src": "2584:16:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 119,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2584:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"id": 122,
"initialValue": {
"id": 121,
"name": "_owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 29,
"src": "2603:6:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "VariableDeclarationStatement",
"src": "2584:25:1"
},
{
"expression": {
"id": 125,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"id": 123,
"name": "_owner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 29,
"src": "2620:6:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"id": 124,
"name": "newOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 116,
"src": "2629:8:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "2620:17:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"id": 126,
"nodeType": "ExpressionStatement",
"src": "2620:17:1"
},
{
"eventCall": {
"arguments": [
{
"id": 128,
"name": "oldOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 120,
"src": "2674:8:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"id": 129,
"name": "newOwner",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 116,
"src": "2684:8:1",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 127,
"name": "OwnershipTransferred",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 35,
"src": "2653:20:1",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_address_$returns$__$",
"typeString": "function (address,address)"
}
},
"id": 130,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"nameLocations": [],
"names": [],
"nodeType": "FunctionCall",
"src": "2653:40:1",
"tryCall": false,
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 131,
"nodeType": "EmitStatement",
"src": "2648:45:1"
}
]
},
"documentation": {
"id": 114,
"nodeType": "StructuredDocumentation",
"src": "2358:146:1",
"text": " @dev Transfers ownership of the contract to a new account (`newOwner`).\n Internal function without access restriction."
},
"id": 133,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "_transferOwnership",
"nameLocation": "2519:18:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 117,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 116,
"mutability": "mutable",
"name": "newOwner",
"nameLocation": "2546:8:1",
"nodeType": "VariableDeclaration",
"scope": 133,
"src": "2538:16:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 115,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "2538:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "2537:18:1"
},
"returnParameters": {
"id": 118,
"nodeType": "ParameterList",
"parameters": [],
"src": "2573:0:1"
},
"scope": 134,
"src": "2510:191:1",
"stateMutability": "nonpayable",
"virtual": true,
"visibility": "internal"
}
],
"scope": 1516,
"src": "680:2024:1",
"usedErrors": [],
"usedEvents": [
35
]
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "ILayerZeroReceiver",
"contractDependencies": [],
"contractKind": "interface",
"fullyImplemented": false,
"id": 146,
"linearizedBaseContracts": [
146
],
"name": "ILayerZeroReceiver",
"nameLocation": "2718:18:1",
"nodeType": "ContractDefinition",
"nodes": [
{
"functionSelector": "001d3567",
"id": 145,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "lzReceive",
"nameLocation": "3137:9:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 143,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 136,
"mutability": "mutable",
"name": "_srcChainId",
"nameLocation": "3154:11:1",
"nodeType": "VariableDeclaration",
"scope": 145,
"src": "3147:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 135,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "3147:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 138,
"mutability": "mutable",
"name": "_srcAddress",
"nameLocation": "3182:11:1",
"nodeType": "VariableDeclaration",
"scope": 145,
"src": "3167:26:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 137,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "3167:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 140,
"mutability": "mutable",
"name": "_nonce",
"nameLocation": "3202:6:1",
"nodeType": "VariableDeclaration",
"scope": 145,
"src": "3195:13:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 139,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "3195:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 142,
"mutability": "mutable",
"name": "_payload",
"nameLocation": "3225:8:1",
"nodeType": "VariableDeclaration",
"scope": 145,
"src": "3210:23:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 141,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "3210:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "3146:88:1"
},
"returnParameters": {
"id": 144,
"nodeType": "ParameterList",
"parameters": [],
"src": "3243:0:1"
},
"scope": 146,
"src": "3128:116:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"scope": 1516,
"src": "2708:539:1",
"usedErrors": [],
"usedEvents": []
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "ILayerZeroUserApplicationConfig",
"contractDependencies": [],
"contractKind": "interface",
"fullyImplemented": false,
"id": 175,
"linearizedBaseContracts": [
175
],
"name": "ILayerZeroUserApplicationConfig",
"nameLocation": "3261:31:1",
"nodeType": "ContractDefinition",
"nodes": [
{
"functionSelector": "cbed8b9c",
"id": 157,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "setConfig",
"nameLocation": "3710:9:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 155,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 148,
"mutability": "mutable",
"name": "_version",
"nameLocation": "3727:8:1",
"nodeType": "VariableDeclaration",
"scope": 157,
"src": "3720:15:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 147,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "3720:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 150,
"mutability": "mutable",
"name": "_chainId",
"nameLocation": "3744:8:1",
"nodeType": "VariableDeclaration",
"scope": 157,
"src": "3737:15:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 149,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "3737:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 152,
"mutability": "mutable",
"name": "_configType",
"nameLocation": "3759:11:1",
"nodeType": "VariableDeclaration",
"scope": 157,
"src": "3754:16:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 151,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "3754:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 154,
"mutability": "mutable",
"name": "_config",
"nameLocation": "3787:7:1",
"nodeType": "VariableDeclaration",
"scope": 157,
"src": "3772:22:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 153,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "3772:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "3719:76:1"
},
"returnParameters": {
"id": 156,
"nodeType": "ParameterList",
"parameters": [],
"src": "3804:0:1"
},
"scope": 175,
"src": "3701:104:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "07e0db17",
"id": 162,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "setSendVersion",
"nameLocation": "3957:14:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 160,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 159,
"mutability": "mutable",
"name": "_version",
"nameLocation": "3979:8:1",
"nodeType": "VariableDeclaration",
"scope": 162,
"src": "3972:15:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 158,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "3972:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "3971:17:1"
},
"returnParameters": {
"id": 161,
"nodeType": "ParameterList",
"parameters": [],
"src": "3997:0:1"
},
"scope": 175,
"src": "3948:50:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "10ddb137",
"id": 167,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "setReceiveVersion",
"nameLocation": "4155:17:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 165,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 164,
"mutability": "mutable",
"name": "_version",
"nameLocation": "4180:8:1",
"nodeType": "VariableDeclaration",
"scope": 167,
"src": "4173:15:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 163,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "4173:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "4172:17:1"
},
"returnParameters": {
"id": 166,
"nodeType": "ParameterList",
"parameters": [],
"src": "4198:0:1"
},
"scope": 175,
"src": "4146:53:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "42d65a8d",
"id": 174,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "forceResumeReceive",
"nameLocation": "4482:18:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 172,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 169,
"mutability": "mutable",
"name": "_srcChainId",
"nameLocation": "4508:11:1",
"nodeType": "VariableDeclaration",
"scope": 174,
"src": "4501:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 168,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "4501:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 171,
"mutability": "mutable",
"name": "_srcAddress",
"nameLocation": "4536:11:1",
"nodeType": "VariableDeclaration",
"scope": 174,
"src": "4521:26:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 170,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "4521:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "4500:48:1"
},
"returnParameters": {
"id": 173,
"nodeType": "ParameterList",
"parameters": [],
"src": "4557:0:1"
},
"scope": 175,
"src": "4473:85:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
}
],
"scope": 1516,
"src": "3251:1310:1",
"usedErrors": [],
"usedEvents": []
},
{
"abstract": false,
"baseContracts": [
{
"baseName": {
"id": 176,
"name": "ILayerZeroUserApplicationConfig",
"nameLocations": [
"4597:31:1"
],
"nodeType": "IdentifierPath",
"referencedDeclaration": 175,
"src": "4597:31:1"
},
"id": 177,
"nodeType": "InheritanceSpecifier",
"src": "4597:31:1"
}
],
"canonicalName": "ILayerZeroEndpoint",
"contractDependencies": [],
"contractKind": "interface",
"fullyImplemented": false,
"id": 317,
"linearizedBaseContracts": [
317,
175
],
"name": "ILayerZeroEndpoint",
"nameLocation": "4575:18:1",
"nodeType": "ContractDefinition",
"nodes": [
{
"functionSelector": "c5803100",
"id": 192,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "send",
"nameLocation": "5388:4:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 190,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 179,
"mutability": "mutable",
"name": "_dstChainId",
"nameLocation": "5410:11:1",
"nodeType": "VariableDeclaration",
"scope": 192,
"src": "5403:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 178,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "5403:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 181,
"mutability": "mutable",
"name": "_destination",
"nameLocation": "5447:12:1",
"nodeType": "VariableDeclaration",
"scope": 192,
"src": "5432:27:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 180,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "5432:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 183,
"mutability": "mutable",
"name": "_payload",
"nameLocation": "5485:8:1",
"nodeType": "VariableDeclaration",
"scope": 192,
"src": "5470:23:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 182,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "5470:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 185,
"mutability": "mutable",
"name": "_refundAddress",
"nameLocation": "5520:14:1",
"nodeType": "VariableDeclaration",
"scope": 192,
"src": "5504:30:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
},
"typeName": {
"id": 184,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5504:15:1",
"stateMutability": "payable",
"typeDescriptions": {
"typeIdentifier": "t_address_payable",
"typeString": "address payable"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 187,
"mutability": "mutable",
"name": "_zroPaymentAddress",
"nameLocation": "5553:18:1",
"nodeType": "VariableDeclaration",
"scope": 192,
"src": "5545:26:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 186,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "5545:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 189,
"mutability": "mutable",
"name": "_adapterParams",
"nameLocation": "5597:14:1",
"nodeType": "VariableDeclaration",
"scope": 192,
"src": "5582:29:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 188,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "5582:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "5392:226:1"
},
"returnParameters": {
"id": 191,
"nodeType": "ParameterList",
"parameters": [],
"src": "5635:0:1"
},
"scope": 317,
"src": "5379:257:1",
"stateMutability": "payable",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "c2fa4813",
"id": 207,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "receivePayload",
"nameLocation": "6137:14:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 205,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 194,
"mutability": "mutable",
"name": "_srcChainId",
"nameLocation": "6169:11:1",
"nodeType": "VariableDeclaration",
"scope": 207,
"src": "6162:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 193,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "6162:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 196,
"mutability": "mutable",
"name": "_srcAddress",
"nameLocation": "6206:11:1",
"nodeType": "VariableDeclaration",
"scope": 207,
"src": "6191:26:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 195,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "6191:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 198,
"mutability": "mutable",
"name": "_dstAddress",
"nameLocation": "6236:11:1",
"nodeType": "VariableDeclaration",
"scope": 207,
"src": "6228:19:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 197,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6228:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 200,
"mutability": "mutable",
"name": "_nonce",
"nameLocation": "6265:6:1",
"nodeType": "VariableDeclaration",
"scope": 207,
"src": "6258:13:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 199,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "6258:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 202,
"mutability": "mutable",
"name": "_gasLimit",
"nameLocation": "6287:9:1",
"nodeType": "VariableDeclaration",
"scope": 207,
"src": "6282:14:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 201,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "6282:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 204,
"mutability": "mutable",
"name": "_payload",
"nameLocation": "6322:8:1",
"nodeType": "VariableDeclaration",
"scope": 207,
"src": "6307:23:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 203,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "6307:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "6151:186:1"
},
"returnParameters": {
"id": 206,
"nodeType": "ParameterList",
"parameters": [],
"src": "6346:0:1"
},
"scope": 317,
"src": "6128:219:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "fdc07c70",
"id": 216,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getInboundNonce",
"nameLocation": "6588:15:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 212,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 209,
"mutability": "mutable",
"name": "_srcChainId",
"nameLocation": "6611:11:1",
"nodeType": "VariableDeclaration",
"scope": 216,
"src": "6604:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 208,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "6604:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 211,
"mutability": "mutable",
"name": "_srcAddress",
"nameLocation": "6639:11:1",
"nodeType": "VariableDeclaration",
"scope": 216,
"src": "6624:26:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 210,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "6624:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "6603:48:1"
},
"returnParameters": {
"id": 215,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 214,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 216,
"src": "6675:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 213,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "6675:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"visibility": "internal"
}
],
"src": "6674:8:1"
},
"scope": 317,
"src": "6579:104:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "7a145748",
"id": 225,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getOutboundNonce",
"nameLocation": "6862:16:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 221,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 218,
"mutability": "mutable",
"name": "_dstChainId",
"nameLocation": "6886:11:1",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "6879:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 217,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "6879:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 220,
"mutability": "mutable",
"name": "_srcAddress",
"nameLocation": "6907:11:1",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "6899:19:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 219,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "6899:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "6878:41:1"
},
"returnParameters": {
"id": 224,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 223,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 225,
"src": "6943:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
},
"typeName": {
"id": 222,
"name": "uint64",
"nodeType": "ElementaryTypeName",
"src": "6943:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint64",
"typeString": "uint64"
}
},
"visibility": "internal"
}
],
"src": "6942:8:1"
},
"scope": 317,
"src": "6853:98:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "40a7bb10",
"id": 242,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "estimateFees",
"nameLocation": "7482:12:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 236,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 227,
"mutability": "mutable",
"name": "_dstChainId",
"nameLocation": "7512:11:1",
"nodeType": "VariableDeclaration",
"scope": 242,
"src": "7505:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 226,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "7505:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 229,
"mutability": "mutable",
"name": "_userApplication",
"nameLocation": "7542:16:1",
"nodeType": "VariableDeclaration",
"scope": 242,
"src": "7534:24:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 228,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "7534:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 231,
"mutability": "mutable",
"name": "_payload",
"nameLocation": "7584:8:1",
"nodeType": "VariableDeclaration",
"scope": 242,
"src": "7569:23:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 230,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "7569:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 233,
"mutability": "mutable",
"name": "_payInZRO",
"nameLocation": "7608:9:1",
"nodeType": "VariableDeclaration",
"scope": 242,
"src": "7603:14:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 232,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "7603:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 235,
"mutability": "mutable",
"name": "_adapterParam",
"nameLocation": "7643:13:1",
"nodeType": "VariableDeclaration",
"scope": 242,
"src": "7628:28:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 234,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "7628:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "7494:169:1"
},
"returnParameters": {
"id": 241,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 238,
"mutability": "mutable",
"name": "nativeFee",
"nameLocation": "7692:9:1",
"nodeType": "VariableDeclaration",
"scope": 242,
"src": "7687:14:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 237,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "7687:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 240,
"mutability": "mutable",
"name": "zroFee",
"nameLocation": "7708:6:1",
"nodeType": "VariableDeclaration",
"scope": 242,
"src": "7703:11:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 239,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "7703:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "7686:29:1"
},
"scope": 317,
"src": "7473:243:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "3408e470",
"id": 247,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getChainId",
"nameLocation": "7797:10:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 243,
"nodeType": "ParameterList",
"parameters": [],
"src": "7807:2:1"
},
"returnParameters": {
"id": 246,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 245,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 247,
"src": "7833:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 244,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "7833:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "7832:8:1"
},
"scope": 317,
"src": "7788:53:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "aaff5f16",
"id": 256,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "retryPayload",
"nameLocation": "8113:12:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 254,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 249,
"mutability": "mutable",
"name": "_srcChainId",
"nameLocation": "8133:11:1",
"nodeType": "VariableDeclaration",
"scope": 256,
"src": "8126:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 248,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "8126:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 251,
"mutability": "mutable",
"name": "_srcAddress",
"nameLocation": "8161:11:1",
"nodeType": "VariableDeclaration",
"scope": 256,
"src": "8146:26:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 250,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "8146:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 253,
"mutability": "mutable",
"name": "_payload",
"nameLocation": "8189:8:1",
"nodeType": "VariableDeclaration",
"scope": 256,
"src": "8174:23:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 252,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "8174:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "8125:73:1"
},
"returnParameters": {
"id": 255,
"nodeType": "ParameterList",
"parameters": [],
"src": "8207:0:1"
},
"scope": 317,
"src": "8104:104:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "0eaf6ea6",
"id": 265,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "hasStoredPayload",
"nameLocation": "8425:16:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 261,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 258,
"mutability": "mutable",
"name": "_srcChainId",
"nameLocation": "8449:11:1",
"nodeType": "VariableDeclaration",
"scope": 265,
"src": "8442:18:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 257,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "8442:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 260,
"mutability": "mutable",
"name": "_srcAddress",
"nameLocation": "8477:11:1",
"nodeType": "VariableDeclaration",
"scope": 265,
"src": "8462:26:1",
"stateVariable": false,
"storageLocation": "calldata",
"typeDescriptions": {
"typeIdentifier": "t_bytes_calldata_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 259,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "8462:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "8441:48:1"
},
"returnParameters": {
"id": 264,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 263,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 265,
"src": "8513:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 262,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "8513:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "8512:6:1"
},
"scope": 317,
"src": "8416:103:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "9c729da1",
"id": 272,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getSendLibraryAddress",
"nameLocation": "8681:21:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 268,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 267,
"mutability": "mutable",
"name": "_userApplication",
"nameLocation": "8711:16:1",
"nodeType": "VariableDeclaration",
"scope": 272,
"src": "8703:24:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 266,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "8703:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "8702:26:1"
},
"returnParameters": {
"id": 271,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 270,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 272,
"src": "8752:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 269,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "8752:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "8751:9:1"
},
"scope": 317,
"src": "8672:89:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "71ba2fd6",
"id": 279,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getReceiveLibraryAddress",
"nameLocation": "8925:24:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 275,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 274,
"mutability": "mutable",
"name": "_userApplication",
"nameLocation": "8958:16:1",
"nodeType": "VariableDeclaration",
"scope": 279,
"src": "8950:24:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 273,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "8950:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "8949:26:1"
},
"returnParameters": {
"id": 278,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 277,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 279,
"src": "8999:7:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 276,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "8999:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "8998:9:1"
},
"scope": 317,
"src": "8916:92:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "e97a448a",
"id": 284,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "isSendingPayload",
"nameLocation": "9149:16:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 280,
"nodeType": "ParameterList",
"parameters": [],
"src": "9165:2:1"
},
"returnParameters": {
"id": 283,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 282,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 284,
"src": "9191:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 281,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "9191:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "9190:6:1"
},
"scope": 317,
"src": "9140:57:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "ca066b35",
"id": 289,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "isReceivingPayload",
"nameLocation": "9341:18:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 285,
"nodeType": "ParameterList",
"parameters": [],
"src": "9359:2:1"
},
"returnParameters": {
"id": 288,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 287,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 289,
"src": "9385:4:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 286,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "9385:4:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"visibility": "internal"
}
],
"src": "9384:6:1"
},
"scope": 317,
"src": "9332:59:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "f5ecbdbc",
"id": 302,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getConfig",
"nameLocation": "9805:9:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 298,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 291,
"mutability": "mutable",
"name": "_version",
"nameLocation": "9822:8:1",
"nodeType": "VariableDeclaration",
"scope": 302,
"src": "9815:15:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 290,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "9815:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 293,
"mutability": "mutable",
"name": "_chainId",
"nameLocation": "9839:8:1",
"nodeType": "VariableDeclaration",
"scope": 302,
"src": "9832:15:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 292,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "9832:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 295,
"mutability": "mutable",
"name": "_userApplication",
"nameLocation": "9857:16:1",
"nodeType": "VariableDeclaration",
"scope": 302,
"src": "9849:24:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 294,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "9849:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 297,
"mutability": "mutable",
"name": "_configType",
"nameLocation": "9880:11:1",
"nodeType": "VariableDeclaration",
"scope": 302,
"src": "9875:16:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"typeName": {
"id": 296,
"name": "uint",
"nodeType": "ElementaryTypeName",
"src": "9875:4:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"visibility": "internal"
}
],
"src": "9814:78:1"
},
"returnParameters": {
"id": 301,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 300,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 302,
"src": "9916:12:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 299,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "9916:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "9915:14:1"
},
"scope": 317,
"src": "9796:134:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "096568f6",
"id": 309,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getSendVersion",
"nameLocation": "10093:14:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 305,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 304,
"mutability": "mutable",
"name": "_userApplication",
"nameLocation": "10116:16:1",
"nodeType": "VariableDeclaration",
"scope": 309,
"src": "10108:24:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 303,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10108:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "10107:26:1"
},
"returnParameters": {
"id": 308,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 307,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 309,
"src": "10157:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 306,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "10157:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "10156:8:1"
},
"scope": 317,
"src": "10084:81:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
},
{
"functionSelector": "da1a7c9a",
"id": 316,
"implemented": false,
"kind": "function",
"modifiers": [],
"name": "getReceiveVersion",
"nameLocation": "10333:17:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 312,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 311,
"mutability": "mutable",
"name": "_userApplication",
"nameLocation": "10359:16:1",
"nodeType": "VariableDeclaration",
"scope": 316,
"src": "10351:24:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 310,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "10351:7:1",
"stateMutability": "nonpayable",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"visibility": "internal"
}
],
"src": "10350:26:1"
},
"returnParameters": {
"id": 315,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 314,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 316,
"src": "10400:6:1",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
},
"typeName": {
"id": 313,
"name": "uint16",
"nodeType": "ElementaryTypeName",
"src": "10400:6:1",
"typeDescriptions": {
"typeIdentifier": "t_uint16",
"typeString": "uint16"
}
},
"visibility": "internal"
}
],
"src": "10399:8:1"
},
"scope": 317,
"src": "10324:84:1",
"stateMutability": "view",
"virtual": false,
"visibility": "external"
}
],
"scope": 1516,
"src": "4565:5846:1",
"usedErrors": [],
"usedEvents": []
},
{
"abstract": false,
"baseContracts": [],
"canonicalName": "BytesLib",
"contractDependencies": [],
"contractKind": "library",
"fullyImplemented": true,
"id": 648,
"linearizedBaseContracts": [
648
],
"name": "BytesLib",
"nameLocation": "10728:8:1",
"nodeType": "ContractDefinition",
"nodes": [
{
"body": {
"id": 332,
"nodeType": "Block",
"src": "10846:2937:1",
"statements": [
{
"assignments": [
327
],
"declarations": [
{
"constant": false,
"id": 327,
"mutability": "mutable",
"name": "tempBytes",
"nameLocation": "10870:9:1",
"nodeType": "VariableDeclaration",
"scope": 332,
"src": "10857:22:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 326,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "10857:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"id": 328,
"nodeType": "VariableDeclarationStatement",
"src": "10857:22:1"
},
{
"AST": {
"nativeSrc": "10901:2846:1",
"nodeType": "YulBlock",
"src": "10901:2846:1",
"statements": [
{
"nativeSrc": "11048:24:1",
"nodeType": "YulAssignment",
"src": "11048:24:1",
"value": {
"arguments": [
{
"kind": "number",
"nativeSrc": "11067:4:1",
"nodeType": "YulLiteral",
"src": "11067:4:1",
"type": "",
"value": "0x40"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "11061:5:1",
"nodeType": "YulIdentifier",
"src": "11061:5:1"
},
"nativeSrc": "11061:11:1",
"nodeType": "YulFunctionCall",
"src": "11061:11:1"
},
"variableNames": [
{
"name": "tempBytes",
"nativeSrc": "11048:9:1",
"nodeType": "YulIdentifier",
"src": "11048:9:1"
}
]
},
{
"nativeSrc": "11208:30:1",
"nodeType": "YulVariableDeclaration",
"src": "11208:30:1",
"value": {
"arguments": [
{
"name": "_preBytes",
"nativeSrc": "11228:9:1",
"nodeType": "YulIdentifier",
"src": "11228:9:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "11222:5:1",
"nodeType": "YulIdentifier",
"src": "11222:5:1"
},
"nativeSrc": "11222:16:1",
"nodeType": "YulFunctionCall",
"src": "11222:16:1"
},
"variables": [
{
"name": "length",
"nativeSrc": "11212:6:1",
"nodeType": "YulTypedName",
"src": "11212:6:1",
"type": ""
}
]
},
{
"expression": {
"arguments": [
{
"name": "tempBytes",
"nativeSrc": "11259:9:1",
"nodeType": "YulIdentifier",
"src": "11259:9:1"
},
{
"name": "length",
"nativeSrc": "11270:6:1",
"nodeType": "YulIdentifier",
"src": "11270:6:1"
}
],
"functionName": {
"name": "mstore",
"nativeSrc": "11252:6:1",
"nodeType": "YulIdentifier",
"src": "11252:6:1"
},
"nativeSrc": "11252:25:1",
"nodeType": "YulFunctionCall",
"src": "11252:25:1"
},
"nativeSrc": "11252:25:1",
"nodeType": "YulExpressionStatement",
"src": "11252:25:1"
},
{
"nativeSrc": "11492:30:1",
"nodeType": "YulVariableDeclaration",
"src": "11492:30:1",
"value": {
"arguments": [
{
"name": "tempBytes",
"nativeSrc": "11506:9:1",
"nodeType": "YulIdentifier",
"src": "11506:9:1"
},
{
"kind": "number",
"nativeSrc": "11517:4:1",
"nodeType": "YulLiteral",
"src": "11517:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "11502:3:1",
"nodeType": "YulIdentifier",
"src": "11502:3:1"
},
"nativeSrc": "11502:20:1",
"nodeType": "YulFunctionCall",
"src": "11502:20:1"
},
"variables": [
{
"name": "mc",
"nativeSrc": "11496:2:1",
"nodeType": "YulTypedName",
"src": "11496:2:1",
"type": ""
}
]
},
{
"nativeSrc": "11650:26:1",
"nodeType": "YulVariableDeclaration",
"src": "11650:26:1",
"value": {
"arguments": [
{
"name": "mc",
"nativeSrc": "11665:2:1",
"nodeType": "YulIdentifier",
"src": "11665:2:1"
},
{
"name": "length",
"nativeSrc": "11669:6:1",
"nodeType": "YulIdentifier",
"src": "11669:6:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "11661:3:1",
"nodeType": "YulIdentifier",
"src": "11661:3:1"
},
"nativeSrc": "11661:15:1",
"nodeType": "YulFunctionCall",
"src": "11661:15:1"
},
"variables": [
{
"name": "end",
"nativeSrc": "11654:3:1",
"nodeType": "YulTypedName",
"src": "11654:3:1",
"type": ""
}
]
},
{
"body": {
"nativeSrc": "12063:166:1",
"nodeType": "YulBlock",
"src": "12063:166:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "mc",
"nativeSrc": "12200:2:1",
"nodeType": "YulIdentifier",
"src": "12200:2:1"
},
{
"arguments": [
{
"name": "cc",
"nativeSrc": "12210:2:1",
"nodeType": "YulIdentifier",
"src": "12210:2:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "12204:5:1",
"nodeType": "YulIdentifier",
"src": "12204:5:1"
},
"nativeSrc": "12204:9:1",
"nodeType": "YulFunctionCall",
"src": "12204:9:1"
}
],
"functionName": {
"name": "mstore",
"nativeSrc": "12193:6:1",
"nodeType": "YulIdentifier",
"src": "12193:6:1"
},
"nativeSrc": "12193:21:1",
"nodeType": "YulFunctionCall",
"src": "12193:21:1"
},
"nativeSrc": "12193:21:1",
"nodeType": "YulExpressionStatement",
"src": "12193:21:1"
}
]
},
"condition": {
"arguments": [
{
"name": "mc",
"nativeSrc": "11892:2:1",
"nodeType": "YulIdentifier",
"src": "11892:2:1"
},
{
"name": "end",
"nativeSrc": "11896:3:1",
"nodeType": "YulIdentifier",
"src": "11896:3:1"
}
],
"functionName": {
"name": "lt",
"nativeSrc": "11889:2:1",
"nodeType": "YulIdentifier",
"src": "11889:2:1"
},
"nativeSrc": "11889:11:1",
"nodeType": "YulFunctionCall",
"src": "11889:11:1"
},
"nativeSrc": "11692:537:1",
"nodeType": "YulForLoop",
"post": {
"nativeSrc": "11901:161:1",
"nodeType": "YulBlock",
"src": "11901:161:1",
"statements": [
{
"nativeSrc": "11991:19:1",
"nodeType": "YulAssignment",
"src": "11991:19:1",
"value": {
"arguments": [
{
"name": "mc",
"nativeSrc": "12001:2:1",
"nodeType": "YulIdentifier",
"src": "12001:2:1"
},
{
"kind": "number",
"nativeSrc": "12005:4:1",
"nodeType": "YulLiteral",
"src": "12005:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "11997:3:1",
"nodeType": "YulIdentifier",
"src": "11997:3:1"
},
"nativeSrc": "11997:13:1",
"nodeType": "YulFunctionCall",
"src": "11997:13:1"
},
"variableNames": [
{
"name": "mc",
"nativeSrc": "11991:2:1",
"nodeType": "YulIdentifier",
"src": "11991:2:1"
}
]
},
{
"nativeSrc": "12028:19:1",
"nodeType": "YulAssignment",
"src": "12028:19:1",
"value": {
"arguments": [
{
"name": "cc",
"nativeSrc": "12038:2:1",
"nodeType": "YulIdentifier",
"src": "12038:2:1"
},
{
"kind": "number",
"nativeSrc": "12042:4:1",
"nodeType": "YulLiteral",
"src": "12042:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "12034:3:1",
"nodeType": "YulIdentifier",
"src": "12034:3:1"
},
"nativeSrc": "12034:13:1",
"nodeType": "YulFunctionCall",
"src": "12034:13:1"
},
"variableNames": [
{
"name": "cc",
"nativeSrc": "12028:2:1",
"nodeType": "YulIdentifier",
"src": "12028:2:1"
}
]
}
]
},
"pre": {
"nativeSrc": "11696:192:1",
"nodeType": "YulBlock",
"src": "11696:192:1",
"statements": [
{
"nativeSrc": "11843:30:1",
"nodeType": "YulVariableDeclaration",
"src": "11843:30:1",
"value": {
"arguments": [
{
"name": "_preBytes",
"nativeSrc": "11857:9:1",
"nodeType": "YulIdentifier",
"src": "11857:9:1"
},
{
"kind": "number",
"nativeSrc": "11868:4:1",
"nodeType": "YulLiteral",
"src": "11868:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "11853:3:1",
"nodeType": "YulIdentifier",
"src": "11853:3:1"
},
"nativeSrc": "11853:20:1",
"nodeType": "YulFunctionCall",
"src": "11853:20:1"
},
"variables": [
{
"name": "cc",
"nativeSrc": "11847:2:1",
"nodeType": "YulTypedName",
"src": "11847:2:1",
"type": ""
}
]
}
]
},
"src": "11692:537:1"
},
{
"nativeSrc": "12435:27:1",
"nodeType": "YulAssignment",
"src": "12435:27:1",
"value": {
"arguments": [
{
"name": "_postBytes",
"nativeSrc": "12451:10:1",
"nodeType": "YulIdentifier",
"src": "12451:10:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "12445:5:1",
"nodeType": "YulIdentifier",
"src": "12445:5:1"
},
"nativeSrc": "12445:17:1",
"nodeType": "YulFunctionCall",
"src": "12445:17:1"
},
"variableNames": [
{
"name": "length",
"nativeSrc": "12435:6:1",
"nodeType": "YulIdentifier",
"src": "12435:6:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "tempBytes",
"nativeSrc": "12483:9:1",
"nodeType": "YulIdentifier",
"src": "12483:9:1"
},
{
"arguments": [
{
"name": "length",
"nativeSrc": "12498:6:1",
"nodeType": "YulIdentifier",
"src": "12498:6:1"
},
{
"arguments": [
{
"name": "tempBytes",
"nativeSrc": "12512:9:1",
"nodeType": "YulIdentifier",
"src": "12512:9:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "12506:5:1",
"nodeType": "YulIdentifier",
"src": "12506:5:1"
},
"nativeSrc": "12506:16:1",
"nodeType": "YulFunctionCall",
"src": "12506:16:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "12494:3:1",
"nodeType": "YulIdentifier",
"src": "12494:3:1"
},
"nativeSrc": "12494:29:1",
"nodeType": "YulFunctionCall",
"src": "12494:29:1"
}
],
"functionName": {
"name": "mstore",
"nativeSrc": "12476:6:1",
"nodeType": "YulIdentifier",
"src": "12476:6:1"
},
"nativeSrc": "12476:48:1",
"nodeType": "YulFunctionCall",
"src": "12476:48:1"
},
"nativeSrc": "12476:48:1",
"nodeType": "YulExpressionStatement",
"src": "12476:48:1"
},
{
"nativeSrc": "12666:9:1",
"nodeType": "YulAssignment",
"src": "12666:9:1",
"value": {
"name": "end",
"nativeSrc": "12672:3:1",
"nodeType": "YulIdentifier",
"src": "12672:3:1"
},
"variableNames": [
{
"name": "mc",
"nativeSrc": "12666:2:1",
"nodeType": "YulIdentifier",
"src": "12666:2:1"
}
]
},
{
"nativeSrc": "12805:22:1",
"nodeType": "YulAssignment",
"src": "12805:22:1",
"value": {
"arguments": [
{
"name": "mc",
"nativeSrc": "12816:2:1",
"nodeType": "YulIdentifier",
"src": "12816:2:1"
},
{
"name": "length",
"nativeSrc": "12820:6:1",
"nodeType": "YulIdentifier",
"src": "12820:6:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "12812:3:1",
"nodeType": "YulIdentifier",
"src": "12812:3:1"
},
"nativeSrc": "12812:15:1",
"nodeType": "YulFunctionCall",
"src": "12812:15:1"
},
"variableNames": [
{
"name": "end",
"nativeSrc": "12805:3:1",
"nodeType": "YulIdentifier",
"src": "12805:3:1"
}
]
},
{
"body": {
"nativeSrc": "13016:55:1",
"nodeType": "YulBlock",
"src": "13016:55:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "mc",
"nativeSrc": "13042:2:1",
"nodeType": "YulIdentifier",
"src": "13042:2:1"
},
{
"arguments": [
{
"name": "cc",
"nativeSrc": "13052:2:1",
"nodeType": "YulIdentifier",
"src": "13052:2:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "13046:5:1",
"nodeType": "YulIdentifier",
"src": "13046:5:1"
},
"nativeSrc": "13046:9:1",
"nodeType": "YulFunctionCall",
"src": "13046:9:1"
}
],
"functionName": {
"name": "mstore",
"nativeSrc": "13035:6:1",
"nodeType": "YulIdentifier",
"src": "13035:6:1"
},
"nativeSrc": "13035:21:1",
"nodeType": "YulFunctionCall",
"src": "13035:21:1"
},
"nativeSrc": "13035:21:1",
"nodeType": "YulExpressionStatement",
"src": "13035:21:1"
}
]
},
"condition": {
"arguments": [
{
"name": "mc",
"nativeSrc": "12916:2:1",
"nodeType": "YulIdentifier",
"src": "12916:2:1"
},
{
"name": "end",
"nativeSrc": "12920:3:1",
"nodeType": "YulIdentifier",
"src": "12920:3:1"
}
],
"functionName": {
"name": "lt",
"nativeSrc": "12913:2:1",
"nodeType": "YulIdentifier",
"src": "12913:2:1"
},
"nativeSrc": "12913:11:1",
"nodeType": "YulFunctionCall",
"src": "12913:11:1"
},
"nativeSrc": "12843:228:1",
"nodeType": "YulForLoop",
"post": {
"nativeSrc": "12925:90:1",
"nodeType": "YulBlock",
"src": "12925:90:1",
"statements": [
{
"nativeSrc": "12944:19:1",
"nodeType": "YulAssignment",
"src": "12944:19:1",
"value": {
"arguments": [
{
"name": "mc",
"nativeSrc": "12954:2:1",
"nodeType": "YulIdentifier",
"src": "12954:2:1"
},
{
"kind": "number",
"nativeSrc": "12958:4:1",
"nodeType": "YulLiteral",
"src": "12958:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "12950:3:1",
"nodeType": "YulIdentifier",
"src": "12950:3:1"
},
"nativeSrc": "12950:13:1",
"nodeType": "YulFunctionCall",
"src": "12950:13:1"
},
"variableNames": [
{
"name": "mc",
"nativeSrc": "12944:2:1",
"nodeType": "YulIdentifier",
"src": "12944:2:1"
}
]
},
{
"nativeSrc": "12981:19:1",
"nodeType": "YulAssignment",
"src": "12981:19:1",
"value": {
"arguments": [
{
"name": "cc",
"nativeSrc": "12991:2:1",
"nodeType": "YulIdentifier",
"src": "12991:2:1"
},
{
"kind": "number",
"nativeSrc": "12995:4:1",
"nodeType": "YulLiteral",
"src": "12995:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "12987:3:1",
"nodeType": "YulIdentifier",
"src": "12987:3:1"
},
"nativeSrc": "12987:13:1",
"nodeType": "YulFunctionCall",
"src": "12987:13:1"
},
"variableNames": [
{
"name": "cc",
"nativeSrc": "12981:2:1",
"nodeType": "YulIdentifier",
"src": "12981:2:1"
}
]
}
]
},
"pre": {
"nativeSrc": "12847:65:1",
"nodeType": "YulBlock",
"src": "12847:65:1",
"statements": [
{
"nativeSrc": "12866:31:1",
"nodeType": "YulVariableDeclaration",
"src": "12866:31:1",
"value": {
"arguments": [
{
"name": "_postBytes",
"nativeSrc": "12880:10:1",
"nodeType": "YulIdentifier",
"src": "12880:10:1"
},
{
"kind": "number",
"nativeSrc": "12892:4:1",
"nodeType": "YulLiteral",
"src": "12892:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "12876:3:1",
"nodeType": "YulIdentifier",
"src": "12876:3:1"
},
"nativeSrc": "12876:21:1",
"nodeType": "YulFunctionCall",
"src": "12876:21:1"
},
"variables": [
{
"name": "cc",
"nativeSrc": "12870:2:1",
"nodeType": "YulTypedName",
"src": "12870:2:1",
"type": ""
}
]
}
]
},
"src": "12843:228:1"
},
{
"expression": {
"arguments": [
{
"kind": "number",
"nativeSrc": "13528:4:1",
"nodeType": "YulLiteral",
"src": "13528:4:1",
"type": "",
"value": "0x40"
},
{
"arguments": [
{
"arguments": [
{
"arguments": [
{
"name": "end",
"nativeSrc": "13585:3:1",
"nodeType": "YulIdentifier",
"src": "13585:3:1"
},
{
"arguments": [
{
"arguments": [
{
"name": "length",
"nativeSrc": "13601:6:1",
"nodeType": "YulIdentifier",
"src": "13601:6:1"
},
{
"arguments": [
{
"name": "_preBytes",
"nativeSrc": "13615:9:1",
"nodeType": "YulIdentifier",
"src": "13615:9:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "13609:5:1",
"nodeType": "YulIdentifier",
"src": "13609:5:1"
},
"nativeSrc": "13609:16:1",
"nodeType": "YulFunctionCall",
"src": "13609:16:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "13597:3:1",
"nodeType": "YulIdentifier",
"src": "13597:3:1"
},
"nativeSrc": "13597:29:1",
"nodeType": "YulFunctionCall",
"src": "13597:29:1"
}
],
"functionName": {
"name": "iszero",
"nativeSrc": "13590:6:1",
"nodeType": "YulIdentifier",
"src": "13590:6:1"
},
"nativeSrc": "13590:37:1",
"nodeType": "YulFunctionCall",
"src": "13590:37:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "13581:3:1",
"nodeType": "YulIdentifier",
"src": "13581:3:1"
},
"nativeSrc": "13581:47:1",
"nodeType": "YulFunctionCall",
"src": "13581:47:1"
},
{
"kind": "number",
"nativeSrc": "13630:2:1",
"nodeType": "YulLiteral",
"src": "13630:2:1",
"type": "",
"value": "31"
}
],
"functionName": {
"name": "add",
"nativeSrc": "13577:3:1",
"nodeType": "YulIdentifier",
"src": "13577:3:1"
},
"nativeSrc": "13577:56:1",
"nodeType": "YulFunctionCall",
"src": "13577:56:1"
},
{
"arguments": [
{
"kind": "number",
"nativeSrc": "13660:2:1",
"nodeType": "YulLiteral",
"src": "13660:2:1",
"type": "",
"value": "31"
}
],
"functionName": {
"name": "not",
"nativeSrc": "13656:3:1",
"nodeType": "YulIdentifier",
"src": "13656:3:1"
},
"nativeSrc": "13656:7:1",
"nodeType": "YulFunctionCall",
"src": "13656:7:1"
}
],
"functionName": {
"name": "and",
"nativeSrc": "13551:3:1",
"nodeType": "YulIdentifier",
"src": "13551:3:1"
},
"nativeSrc": "13551:170:1",
"nodeType": "YulFunctionCall",
"src": "13551:170:1"
}
],
"functionName": {
"name": "mstore",
"nativeSrc": "13503:6:1",
"nodeType": "YulIdentifier",
"src": "13503:6:1"
},
"nativeSrc": "13503:233:1",
"nodeType": "YulFunctionCall",
"src": "13503:233:1"
},
"nativeSrc": "13503:233:1",
"nodeType": "YulExpressionStatement",
"src": "13503:233:1"
}
]
},
"evmVersion": "cancun",
"externalReferences": [
{
"declaration": 321,
"isOffset": false,
"isSlot": false,
"src": "12451:10:1",
"valueSize": 1
},
{
"declaration": 321,
"isOffset": false,
"isSlot": false,
"src": "12880:10:1",
"valueSize": 1
},
{
"declaration": 319,
"isOffset": false,
"isSlot": false,
"src": "11228:9:1",
"valueSize": 1
},
{
"declaration": 319,
"isOffset": false,
"isSlot": false,
"src": "11857:9:1",
"valueSize": 1
},
{
"declaration": 319,
"isOffset": false,
"isSlot": false,
"src": "13615:9:1",
"valueSize": 1
},
{
"declaration": 327,
"isOffset": false,
"isSlot": false,
"src": "11048:9:1",
"valueSize": 1
},
{
"declaration": 327,
"isOffset": false,
"isSlot": false,
"src": "11259:9:1",
"valueSize": 1
},
{
"declaration": 327,
"isOffset": false,
"isSlot": false,
"src": "11506:9:1",
"valueSize": 1
},
{
"declaration": 327,
"isOffset": false,
"isSlot": false,
"src": "12483:9:1",
"valueSize": 1
},
{
"declaration": 327,
"isOffset": false,
"isSlot": false,
"src": "12512:9:1",
"valueSize": 1
}
],
"id": 329,
"nodeType": "InlineAssembly",
"src": "10892:2855:1"
},
{
"expression": {
"id": 330,
"name": "tempBytes",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 327,
"src": "13766:9:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes memory"
}
},
"functionReturnParameters": 325,
"id": 331,
"nodeType": "Return",
"src": "13759:16:1"
}
]
},
"id": 333,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "concat",
"nameLocation": "10753:6:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 322,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 319,
"mutability": "mutable",
"name": "_preBytes",
"nameLocation": "10773:9:1",
"nodeType": "VariableDeclaration",
"scope": 333,
"src": "10760:22:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 318,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "10760:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 321,
"mutability": "mutable",
"name": "_postBytes",
"nameLocation": "10797:10:1",
"nodeType": "VariableDeclaration",
"scope": 333,
"src": "10784:23:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 320,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "10784:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "10759:49:1"
},
"returnParameters": {
"id": 325,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 324,
"mutability": "mutable",
"name": "",
"nameLocation": "-1:-1:-1",
"nodeType": "VariableDeclaration",
"scope": 333,
"src": "10832:12:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 323,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "10832:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "10831:14:1"
},
"scope": 648,
"src": "10744:3039:1",
"stateMutability": "pure",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 341,
"nodeType": "Block",
"src": "13873:5931:1",
"statements": [
{
"AST": {
"nativeSrc": "13893:5904:1",
"nodeType": "YulBlock",
"src": "13893:5904:1",
"statements": [
{
"nativeSrc": "14120:34:1",
"nodeType": "YulVariableDeclaration",
"src": "14120:34:1",
"value": {
"arguments": [
{
"name": "_preBytes.slot",
"nativeSrc": "14139:14:1",
"nodeType": "YulIdentifier",
"src": "14139:14:1"
}
],
"functionName": {
"name": "sload",
"nativeSrc": "14133:5:1",
"nodeType": "YulIdentifier",
"src": "14133:5:1"
},
"nativeSrc": "14133:21:1",
"nodeType": "YulFunctionCall",
"src": "14133:21:1"
},
"variables": [
{
"name": "fslot",
"nativeSrc": "14124:5:1",
"nodeType": "YulTypedName",
"src": "14124:5:1",
"type": ""
}
]
},
{
"nativeSrc": "14655:76:1",
"nodeType": "YulVariableDeclaration",
"src": "14655:76:1",
"value": {
"arguments": [
{
"arguments": [
{
"name": "fslot",
"nativeSrc": "14678:5:1",
"nodeType": "YulIdentifier",
"src": "14678:5:1"
},
{
"arguments": [
{
"arguments": [
{
"kind": "number",
"nativeSrc": "14693:5:1",
"nodeType": "YulLiteral",
"src": "14693:5:1",
"type": "",
"value": "0x100"
},
{
"arguments": [
{
"arguments": [
{
"name": "fslot",
"nativeSrc": "14711:5:1",
"nodeType": "YulIdentifier",
"src": "14711:5:1"
},
{
"kind": "number",
"nativeSrc": "14718:1:1",
"nodeType": "YulLiteral",
"src": "14718:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "and",
"nativeSrc": "14707:3:1",
"nodeType": "YulIdentifier",
"src": "14707:3:1"
},
"nativeSrc": "14707:13:1",
"nodeType": "YulFunctionCall",
"src": "14707:13:1"
}
],
"functionName": {
"name": "iszero",
"nativeSrc": "14700:6:1",
"nodeType": "YulIdentifier",
"src": "14700:6:1"
},
"nativeSrc": "14700:21:1",
"nodeType": "YulFunctionCall",
"src": "14700:21:1"
}
],
"functionName": {
"name": "mul",
"nativeSrc": "14689:3:1",
"nodeType": "YulIdentifier",
"src": "14689:3:1"
},
"nativeSrc": "14689:33:1",
"nodeType": "YulFunctionCall",
"src": "14689:33:1"
},
{
"kind": "number",
"nativeSrc": "14724:1:1",
"nodeType": "YulLiteral",
"src": "14724:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "sub",
"nativeSrc": "14685:3:1",
"nodeType": "YulIdentifier",
"src": "14685:3:1"
},
"nativeSrc": "14685:41:1",
"nodeType": "YulFunctionCall",
"src": "14685:41:1"
}
],
"functionName": {
"name": "and",
"nativeSrc": "14674:3:1",
"nodeType": "YulIdentifier",
"src": "14674:3:1"
},
"nativeSrc": "14674:53:1",
"nodeType": "YulFunctionCall",
"src": "14674:53:1"
},
{
"kind": "number",
"nativeSrc": "14729:1:1",
"nodeType": "YulLiteral",
"src": "14729:1:1",
"type": "",
"value": "2"
}
],
"functionName": {
"name": "div",
"nativeSrc": "14670:3:1",
"nodeType": "YulIdentifier",
"src": "14670:3:1"
},
"nativeSrc": "14670:61:1",
"nodeType": "YulFunctionCall",
"src": "14670:61:1"
},
"variables": [
{
"name": "slength",
"nativeSrc": "14659:7:1",
"nodeType": "YulTypedName",
"src": "14659:7:1",
"type": ""
}
]
},
{
"nativeSrc": "14745:32:1",
"nodeType": "YulVariableDeclaration",
"src": "14745:32:1",
"value": {
"arguments": [
{
"name": "_postBytes",
"nativeSrc": "14766:10:1",
"nodeType": "YulIdentifier",
"src": "14766:10:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "14760:5:1",
"nodeType": "YulIdentifier",
"src": "14760:5:1"
},
"nativeSrc": "14760:17:1",
"nodeType": "YulFunctionCall",
"src": "14760:17:1"
},
"variables": [
{
"name": "mlength",
"nativeSrc": "14749:7:1",
"nodeType": "YulTypedName",
"src": "14749:7:1",
"type": ""
}
]
},
{
"nativeSrc": "14791:38:1",
"nodeType": "YulVariableDeclaration",
"src": "14791:38:1",
"value": {
"arguments": [
{
"name": "slength",
"nativeSrc": "14812:7:1",
"nodeType": "YulIdentifier",
"src": "14812:7:1"
},
{
"name": "mlength",
"nativeSrc": "14821:7:1",
"nodeType": "YulIdentifier",
"src": "14821:7:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "14808:3:1",
"nodeType": "YulIdentifier",
"src": "14808:3:1"
},
"nativeSrc": "14808:21:1",
"nodeType": "YulFunctionCall",
"src": "14808:21:1"
},
"variables": [
{
"name": "newlength",
"nativeSrc": "14795:9:1",
"nodeType": "YulTypedName",
"src": "14795:9:1",
"type": ""
}
]
},
{
"cases": [
{
"body": {
"nativeSrc": "15167:1515:1",
"nodeType": "YulBlock",
"src": "15167:1515:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "_preBytes.slot",
"nativeSrc": "15453:14:1",
"nodeType": "YulIdentifier",
"src": "15453:14:1"
},
{
"arguments": [
{
"name": "fslot",
"nativeSrc": "15771:5:1",
"nodeType": "YulIdentifier",
"src": "15771:5:1"
},
{
"arguments": [
{
"arguments": [
{
"arguments": [
{
"arguments": [
{
"arguments": [
{
"name": "_postBytes",
"nativeSrc": "15994:10:1",
"nodeType": "YulIdentifier",
"src": "15994:10:1"
},
{
"kind": "number",
"nativeSrc": "16006:4:1",
"nodeType": "YulLiteral",
"src": "16006:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "15990:3:1",
"nodeType": "YulIdentifier",
"src": "15990:3:1"
},
"nativeSrc": "15990:21:1",
"nodeType": "YulFunctionCall",
"src": "15990:21:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "15984:5:1",
"nodeType": "YulIdentifier",
"src": "15984:5:1"
},
"nativeSrc": "15984:28:1",
"nodeType": "YulFunctionCall",
"src": "15984:28:1"
},
{
"arguments": [
{
"kind": "number",
"nativeSrc": "16123:5:1",
"nodeType": "YulLiteral",
"src": "16123:5:1",
"type": "",
"value": "0x100"
},
{
"arguments": [
{
"kind": "number",
"nativeSrc": "16134:2:1",
"nodeType": "YulLiteral",
"src": "16134:2:1",
"type": "",
"value": "32"
},
{
"name": "mlength",
"nativeSrc": "16138:7:1",
"nodeType": "YulIdentifier",
"src": "16138:7:1"
}
],
"functionName": {
"name": "sub",
"nativeSrc": "16130:3:1",
"nodeType": "YulIdentifier",
"src": "16130:3:1"
},
"nativeSrc": "16130:16:1",
"nodeType": "YulFunctionCall",
"src": "16130:16:1"
}
],
"functionName": {
"name": "exp",
"nativeSrc": "16119:3:1",
"nodeType": "YulIdentifier",
"src": "16119:3:1"
},
"nativeSrc": "16119:28:1",
"nodeType": "YulFunctionCall",
"src": "16119:28:1"
}
],
"functionName": {
"name": "div",
"nativeSrc": "15875:3:1",
"nodeType": "YulIdentifier",
"src": "15875:3:1"
},
"nativeSrc": "15875:307:1",
"nodeType": "YulFunctionCall",
"src": "15875:307:1"
},
{
"arguments": [
{
"kind": "number",
"nativeSrc": "16374:5:1",
"nodeType": "YulLiteral",
"src": "16374:5:1",
"type": "",
"value": "0x100"
},
{
"arguments": [
{
"kind": "number",
"nativeSrc": "16385:2:1",
"nodeType": "YulLiteral",
"src": "16385:2:1",
"type": "",
"value": "32"
},
{
"name": "newlength",
"nativeSrc": "16389:9:1",
"nodeType": "YulIdentifier",
"src": "16389:9:1"
}
],
"functionName": {
"name": "sub",
"nativeSrc": "16381:3:1",
"nodeType": "YulIdentifier",
"src": "16381:3:1"
},
"nativeSrc": "16381:18:1",
"nodeType": "YulFunctionCall",
"src": "16381:18:1"
}
],
"functionName": {
"name": "exp",
"nativeSrc": "16370:3:1",
"nodeType": "YulIdentifier",
"src": "16370:3:1"
},
"nativeSrc": "16370:30:1",
"nodeType": "YulFunctionCall",
"src": "16370:30:1"
}
],
"functionName": {
"name": "mul",
"nativeSrc": "15837:3:1",
"nodeType": "YulIdentifier",
"src": "15837:3:1"
},
"nativeSrc": "15837:594:1",
"nodeType": "YulFunctionCall",
"src": "15837:594:1"
},
{
"arguments": [
{
"name": "mlength",
"nativeSrc": "16587:7:1",
"nodeType": "YulIdentifier",
"src": "16587:7:1"
},
{
"kind": "number",
"nativeSrc": "16596:1:1",
"nodeType": "YulLiteral",
"src": "16596:1:1",
"type": "",
"value": "2"
}
],
"functionName": {
"name": "mul",
"nativeSrc": "16583:3:1",
"nodeType": "YulIdentifier",
"src": "16583:3:1"
},
"nativeSrc": "16583:15:1",
"nodeType": "YulFunctionCall",
"src": "16583:15:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "15803:3:1",
"nodeType": "YulIdentifier",
"src": "15803:3:1"
},
"nativeSrc": "15803:822:1",
"nodeType": "YulFunctionCall",
"src": "15803:822:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "15599:3:1",
"nodeType": "YulIdentifier",
"src": "15599:3:1"
},
"nativeSrc": "15599:1049:1",
"nodeType": "YulFunctionCall",
"src": "15599:1049:1"
}
],
"functionName": {
"name": "sstore",
"nativeSrc": "15424:6:1",
"nodeType": "YulIdentifier",
"src": "15424:6:1"
},
"nativeSrc": "15424:1243:1",
"nodeType": "YulFunctionCall",
"src": "15424:1243:1"
},
"nativeSrc": "15424:1243:1",
"nodeType": "YulExpressionStatement",
"src": "15424:1243:1"
}
]
},
"nativeSrc": "15160:1522:1",
"nodeType": "YulCase",
"src": "15160:1522:1",
"value": {
"kind": "number",
"nativeSrc": "15165:1:1",
"nodeType": "YulLiteral",
"src": "15165:1:1",
"type": "",
"value": "2"
}
},
{
"body": {
"nativeSrc": "16703:1764:1",
"nodeType": "YulBlock",
"src": "16703:1764:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nativeSrc": "16916:3:1",
"nodeType": "YulLiteral",
"src": "16916:3:1",
"type": "",
"value": "0x0"
},
{
"name": "_preBytes.slot",
"nativeSrc": "16921:14:1",
"nodeType": "YulIdentifier",
"src": "16921:14:1"
}
],
"functionName": {
"name": "mstore",
"nativeSrc": "16909:6:1",
"nodeType": "YulIdentifier",
"src": "16909:6:1"
},
"nativeSrc": "16909:27:1",
"nodeType": "YulFunctionCall",
"src": "16909:27:1"
},
"nativeSrc": "16909:27:1",
"nodeType": "YulExpressionStatement",
"src": "16909:27:1"
},
{
"nativeSrc": "16954:53:1",
"nodeType": "YulVariableDeclaration",
"src": "16954:53:1",
"value": {
"arguments": [
{
"arguments": [
{
"kind": "number",
"nativeSrc": "16978:3:1",
"nodeType": "YulLiteral",
"src": "16978:3:1",
"type": "",
"value": "0x0"
},
{
"kind": "number",
"nativeSrc": "16983:4:1",
"nodeType": "YulLiteral",
"src": "16983:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "keccak256",
"nativeSrc": "16968:9:1",
"nodeType": "YulIdentifier",
"src": "16968:9:1"
},
"nativeSrc": "16968:20:1",
"nodeType": "YulFunctionCall",
"src": "16968:20:1"
},
{
"arguments": [
{
"name": "slength",
"nativeSrc": "16994:7:1",
"nodeType": "YulIdentifier",
"src": "16994:7:1"
},
{
"kind": "number",
"nativeSrc": "17003:2:1",
"nodeType": "YulLiteral",
"src": "17003:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "div",
"nativeSrc": "16990:3:1",
"nodeType": "YulIdentifier",
"src": "16990:3:1"
},
"nativeSrc": "16990:16:1",
"nodeType": "YulFunctionCall",
"src": "16990:16:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "16964:3:1",
"nodeType": "YulIdentifier",
"src": "16964:3:1"
},
"nativeSrc": "16964:43:1",
"nodeType": "YulFunctionCall",
"src": "16964:43:1"
},
"variables": [
{
"name": "sc",
"nativeSrc": "16958:2:1",
"nodeType": "YulTypedName",
"src": "16958:2:1",
"type": ""
}
]
},
{
"expression": {
"arguments": [
{
"name": "_preBytes.slot",
"nativeSrc": "17070:14:1",
"nodeType": "YulIdentifier",
"src": "17070:14:1"
},
{
"arguments": [
{
"arguments": [
{
"name": "newlength",
"nativeSrc": "17094:9:1",
"nodeType": "YulIdentifier",
"src": "17094:9:1"
},
{
"kind": "number",
"nativeSrc": "17105:1:1",
"nodeType": "YulLiteral",
"src": "17105:1:1",
"type": "",
"value": "2"
}
],
"functionName": {
"name": "mul",
"nativeSrc": "17090:3:1",
"nodeType": "YulIdentifier",
"src": "17090:3:1"
},
"nativeSrc": "17090:17:1",
"nodeType": "YulFunctionCall",
"src": "17090:17:1"
},
{
"kind": "number",
"nativeSrc": "17109:1:1",
"nodeType": "YulLiteral",
"src": "17109:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "17086:3:1",
"nodeType": "YulIdentifier",
"src": "17086:3:1"
},
"nativeSrc": "17086:25:1",
"nodeType": "YulFunctionCall",
"src": "17086:25:1"
}
],
"functionName": {
"name": "sstore",
"nativeSrc": "17063:6:1",
"nodeType": "YulIdentifier",
"src": "17063:6:1"
},
"nativeSrc": "17063:49:1",
"nodeType": "YulFunctionCall",
"src": "17063:49:1"
},
"nativeSrc": "17063:49:1",
"nodeType": "YulExpressionStatement",
"src": "17063:49:1"
},
{
"nativeSrc": "17711:30:1",
"nodeType": "YulVariableDeclaration",
"src": "17711:30:1",
"value": {
"arguments": [
{
"kind": "number",
"nativeSrc": "17729:2:1",
"nodeType": "YulLiteral",
"src": "17729:2:1",
"type": "",
"value": "32"
},
{
"name": "slength",
"nativeSrc": "17733:7:1",
"nodeType": "YulIdentifier",
"src": "17733:7:1"
}
],
"functionName": {
"name": "sub",
"nativeSrc": "17725:3:1",
"nodeType": "YulIdentifier",
"src": "17725:3:1"
},
"nativeSrc": "17725:16:1",
"nodeType": "YulFunctionCall",
"src": "17725:16:1"
},
"variables": [
{
"name": "submod",
"nativeSrc": "17715:6:1",
"nodeType": "YulTypedName",
"src": "17715:6:1",
"type": ""
}
]
},
{
"nativeSrc": "17759:33:1",
"nodeType": "YulVariableDeclaration",
"src": "17759:33:1",
"value": {
"arguments": [
{
"name": "_postBytes",
"nativeSrc": "17773:10:1",
"nodeType": "YulIdentifier",
"src": "17773:10:1"
},
{
"name": "submod",
"nativeSrc": "17785:6:1",
"nodeType": "YulIdentifier",
"src": "17785:6:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "17769:3:1",
"nodeType": "YulIdentifier",
"src": "17769:3:1"
},
"nativeSrc": "17769:23:1",
"nodeType": "YulFunctionCall",
"src": "17769:23:1"
},
"variables": [
{
"name": "mc",
"nativeSrc": "17763:2:1",
"nodeType": "YulTypedName",
"src": "17763:2:1",
"type": ""
}
]
},
{
"nativeSrc": "17810:35:1",
"nodeType": "YulVariableDeclaration",
"src": "17810:35:1",
"value": {
"arguments": [
{
"name": "_postBytes",
"nativeSrc": "17825:10:1",
"nodeType": "YulIdentifier",
"src": "17825:10:1"
},
{
"name": "mlength",
"nativeSrc": "17837:7:1",
"nodeType": "YulIdentifier",
"src": "17837:7:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "17821:3:1",
"nodeType": "YulIdentifier",
"src": "17821:3:1"
},
"nativeSrc": "17821:24:1",
"nodeType": "YulFunctionCall",
"src": "17821:24:1"
},
"variables": [
{
"name": "end",
"nativeSrc": "17814:3:1",
"nodeType": "YulTypedName",
"src": "17814:3:1",
"type": ""
}
]
},
{
"nativeSrc": "17863:38:1",
"nodeType": "YulVariableDeclaration",
"src": "17863:38:1",
"value": {
"arguments": [
{
"arguments": [
{
"kind": "number",
"nativeSrc": "17883:5:1",
"nodeType": "YulLiteral",
"src": "17883:5:1",
"type": "",
"value": "0x100"
},
{
"name": "submod",
"nativeSrc": "17890:6:1",
"nodeType": "YulIdentifier",
"src": "17890:6:1"
}
],
"functionName": {
"name": "exp",
"nativeSrc": "17879:3:1",
"nodeType": "YulIdentifier",
"src": "17879:3:1"
},
"nativeSrc": "17879:18:1",
"nodeType": "YulFunctionCall",
"src": "17879:18:1"
},
{
"kind": "number",
"nativeSrc": "17899:1:1",
"nodeType": "YulLiteral",
"src": "17899:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "sub",
"nativeSrc": "17875:3:1",
"nodeType": "YulIdentifier",
"src": "17875:3:1"
},
"nativeSrc": "17875:26:1",
"nodeType": "YulFunctionCall",
"src": "17875:26:1"
},
"variables": [
{
"name": "mask",
"nativeSrc": "17867:4:1",
"nodeType": "YulTypedName",
"src": "17867:4:1",
"type": ""
}
]
},
{
"expression": {
"arguments": [
{
"name": "sc",
"nativeSrc": "17928:2:1",
"nodeType": "YulIdentifier",
"src": "17928:2:1"
},
{
"arguments": [
{
"arguments": [
{
"name": "fslot",
"nativeSrc": "17940:5:1",
"nodeType": "YulIdentifier",
"src": "17940:5:1"
},
{
"kind": "number",
"nativeSrc": "17947:66:1",
"nodeType": "YulLiteral",
"src": "17947:66:1",
"type": "",
"value": "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00"
}
],
"functionName": {
"name": "and",
"nativeSrc": "17936:3:1",
"nodeType": "YulIdentifier",
"src": "17936:3:1"
},
"nativeSrc": "17936:78:1",
"nodeType": "YulFunctionCall",
"src": "17936:78:1"
},
{
"arguments": [
{
"arguments": [
{
"name": "mc",
"nativeSrc": "18026:2:1",
"nodeType": "YulIdentifier",
"src": "18026:2:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "18020:5:1",
"nodeType": "YulIdentifier",
"src": "18020:5:1"
},
"nativeSrc": "18020:9:1",
"nodeType": "YulFunctionCall",
"src": "18020:9:1"
},
{
"name": "mask",
"nativeSrc": "18031:4:1",
"nodeType": "YulIdentifier",
"src": "18031:4:1"
}
],
"functionName": {
"name": "and",
"nativeSrc": "18016:3:1",
"nodeType": "YulIdentifier",
"src": "18016:3:1"
},
"nativeSrc": "18016:20:1",
"nodeType": "YulFunctionCall",
"src": "18016:20:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "17932:3:1",
"nodeType": "YulIdentifier",
"src": "17932:3:1"
},
"nativeSrc": "17932:105:1",
"nodeType": "YulFunctionCall",
"src": "17932:105:1"
}
],
"functionName": {
"name": "sstore",
"nativeSrc": "17921:6:1",
"nodeType": "YulIdentifier",
"src": "17921:6:1"
},
"nativeSrc": "17921:117:1",
"nodeType": "YulFunctionCall",
"src": "17921:117:1"
},
"nativeSrc": "17921:117:1",
"nodeType": "YulExpressionStatement",
"src": "17921:117:1"
},
{
"body": {
"nativeSrc": "18274:63:1",
"nodeType": "YulBlock",
"src": "18274:63:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "sc",
"nativeSrc": "18304:2:1",
"nodeType": "YulIdentifier",
"src": "18304:2:1"
},
{
"arguments": [
{
"name": "mc",
"nativeSrc": "18314:2:1",
"nodeType": "YulIdentifier",
"src": "18314:2:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "18308:5:1",
"nodeType": "YulIdentifier",
"src": "18308:5:1"
},
"nativeSrc": "18308:9:1",
"nodeType": "YulFunctionCall",
"src": "18308:9:1"
}
],
"functionName": {
"name": "sstore",
"nativeSrc": "18297:6:1",
"nodeType": "YulIdentifier",
"src": "18297:6:1"
},
"nativeSrc": "18297:21:1",
"nodeType": "YulFunctionCall",
"src": "18297:21:1"
},
"nativeSrc": "18297:21:1",
"nodeType": "YulExpressionStatement",
"src": "18297:21:1"
}
]
},
"condition": {
"arguments": [
{
"name": "mc",
"nativeSrc": "18165:2:1",
"nodeType": "YulIdentifier",
"src": "18165:2:1"
},
{
"name": "end",
"nativeSrc": "18169:3:1",
"nodeType": "YulIdentifier",
"src": "18169:3:1"
}
],
"functionName": {
"name": "lt",
"nativeSrc": "18162:2:1",
"nodeType": "YulIdentifier",
"src": "18162:2:1"
},
"nativeSrc": "18162:11:1",
"nodeType": "YulFunctionCall",
"src": "18162:11:1"
},
"nativeSrc": "18058:279:1",
"nodeType": "YulForLoop",
"post": {
"nativeSrc": "18174:99:1",
"nodeType": "YulBlock",
"src": "18174:99:1",
"statements": [
{
"nativeSrc": "18197:16:1",
"nodeType": "YulAssignment",
"src": "18197:16:1",
"value": {
"arguments": [
{
"name": "sc",
"nativeSrc": "18207:2:1",
"nodeType": "YulIdentifier",
"src": "18207:2:1"
},
{
"kind": "number",
"nativeSrc": "18211:1:1",
"nodeType": "YulLiteral",
"src": "18211:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "18203:3:1",
"nodeType": "YulIdentifier",
"src": "18203:3:1"
},
"nativeSrc": "18203:10:1",
"nodeType": "YulFunctionCall",
"src": "18203:10:1"
},
"variableNames": [
{
"name": "sc",
"nativeSrc": "18197:2:1",
"nodeType": "YulIdentifier",
"src": "18197:2:1"
}
]
},
{
"nativeSrc": "18235:19:1",
"nodeType": "YulAssignment",
"src": "18235:19:1",
"value": {
"arguments": [
{
"name": "mc",
"nativeSrc": "18245:2:1",
"nodeType": "YulIdentifier",
"src": "18245:2:1"
},
{
"kind": "number",
"nativeSrc": "18249:4:1",
"nodeType": "YulLiteral",
"src": "18249:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "18241:3:1",
"nodeType": "YulIdentifier",
"src": "18241:3:1"
},
"nativeSrc": "18241:13:1",
"nodeType": "YulFunctionCall",
"src": "18241:13:1"
},
"variableNames": [
{
"name": "mc",
"nativeSrc": "18235:2:1",
"nodeType": "YulIdentifier",
"src": "18235:2:1"
}
]
}
]
},
"pre": {
"nativeSrc": "18062:99:1",
"nodeType": "YulBlock",
"src": "18062:99:1",
"statements": [
{
"nativeSrc": "18085:19:1",
"nodeType": "YulAssignment",
"src": "18085:19:1",
"value": {
"arguments": [
{
"name": "mc",
"nativeSrc": "18095:2:1",
"nodeType": "YulIdentifier",
"src": "18095:2:1"
},
{
"kind": "number",
"nativeSrc": "18099:4:1",
"nodeType": "YulLiteral",
"src": "18099:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "18091:3:1",
"nodeType": "YulIdentifier",
"src": "18091:3:1"
},
"nativeSrc": "18091:13:1",
"nodeType": "YulFunctionCall",
"src": "18091:13:1"
},
"variableNames": [
{
"name": "mc",
"nativeSrc": "18085:2:1",
"nodeType": "YulIdentifier",
"src": "18085:2:1"
}
]
},
{
"nativeSrc": "18126:16:1",
"nodeType": "YulAssignment",
"src": "18126:16:1",
"value": {
"arguments": [
{
"name": "sc",
"nativeSrc": "18136:2:1",
"nodeType": "YulIdentifier",
"src": "18136:2:1"
},
{
"kind": "number",
"nativeSrc": "18140:1:1",
"nodeType": "YulLiteral",
"src": "18140:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "18132:3:1",
"nodeType": "YulIdentifier",
"src": "18132:3:1"
},
"nativeSrc": "18132:10:1",
"nodeType": "YulFunctionCall",
"src": "18132:10:1"
},
"variableNames": [
{
"name": "sc",
"nativeSrc": "18126:2:1",
"nodeType": "YulIdentifier",
"src": "18126:2:1"
}
]
}
]
},
"src": "18058:279:1"
},
{
"nativeSrc": "18357:32:1",
"nodeType": "YulAssignment",
"src": "18357:32:1",
"value": {
"arguments": [
{
"kind": "number",
"nativeSrc": "18369:5:1",
"nodeType": "YulLiteral",
"src": "18369:5:1",
"type": "",
"value": "0x100"
},
{
"arguments": [
{
"name": "mc",
"nativeSrc": "18380:2:1",
"nodeType": "YulIdentifier",
"src": "18380:2:1"
},
{
"name": "end",
"nativeSrc": "18384:3:1",
"nodeType": "YulIdentifier",
"src": "18384:3:1"
}
],
"functionName": {
"name": "sub",
"nativeSrc": "18376:3:1",
"nodeType": "YulIdentifier",
"src": "18376:3:1"
},
"nativeSrc": "18376:12:1",
"nodeType": "YulFunctionCall",
"src": "18376:12:1"
}
],
"functionName": {
"name": "exp",
"nativeSrc": "18365:3:1",
"nodeType": "YulIdentifier",
"src": "18365:3:1"
},
"nativeSrc": "18365:24:1",
"nodeType": "YulFunctionCall",
"src": "18365:24:1"
},
"variableNames": [
{
"name": "mask",
"nativeSrc": "18357:4:1",
"nodeType": "YulIdentifier",
"src": "18357:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "sc",
"nativeSrc": "18416:2:1",
"nodeType": "YulIdentifier",
"src": "18416:2:1"
},
{
"arguments": [
{
"arguments": [
{
"arguments": [
{
"name": "mc",
"nativeSrc": "18434:2:1",
"nodeType": "YulIdentifier",
"src": "18434:2:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "18428:5:1",
"nodeType": "YulIdentifier",
"src": "18428:5:1"
},
"nativeSrc": "18428:9:1",
"nodeType": "YulFunctionCall",
"src": "18428:9:1"
},
{
"name": "mask",
"nativeSrc": "18439:4:1",
"nodeType": "YulIdentifier",
"src": "18439:4:1"
}
],
"functionName": {
"name": "div",
"nativeSrc": "18424:3:1",
"nodeType": "YulIdentifier",
"src": "18424:3:1"
},
"nativeSrc": "18424:20:1",
"nodeType": "YulFunctionCall",
"src": "18424:20:1"
},
{
"name": "mask",
"nativeSrc": "18446:4:1",
"nodeType": "YulIdentifier",
"src": "18446:4:1"
}
],
"functionName": {
"name": "mul",
"nativeSrc": "18420:3:1",
"nodeType": "YulIdentifier",
"src": "18420:3:1"
},
"nativeSrc": "18420:31:1",
"nodeType": "YulFunctionCall",
"src": "18420:31:1"
}
],
"functionName": {
"name": "sstore",
"nativeSrc": "18409:6:1",
"nodeType": "YulIdentifier",
"src": "18409:6:1"
},
"nativeSrc": "18409:43:1",
"nodeType": "YulFunctionCall",
"src": "18409:43:1"
},
"nativeSrc": "18409:43:1",
"nodeType": "YulExpressionStatement",
"src": "18409:43:1"
}
]
},
"nativeSrc": "16696:1771:1",
"nodeType": "YulCase",
"src": "16696:1771:1",
"value": {
"kind": "number",
"nativeSrc": "16701:1:1",
"nodeType": "YulLiteral",
"src": "16701:1:1",
"type": "",
"value": "1"
}
},
{
"body": {
"nativeSrc": "18489:1297:1",
"nodeType": "YulBlock",
"src": "18489:1297:1",
"statements": [
{
"expression": {
"arguments": [
{
"kind": "number",
"nativeSrc": "18588:3:1",
"nodeType": "YulLiteral",
"src": "18588:3:1",
"type": "",
"value": "0x0"
},
{
"name": "_preBytes.slot",
"nativeSrc": "18593:14:1",
"nodeType": "YulIdentifier",
"src": "18593:14:1"
}
],
"functionName": {
"name": "mstore",
"nativeSrc": "18581:6:1",
"nodeType": "YulIdentifier",
"src": "18581:6:1"
},
"nativeSrc": "18581:27:1",
"nodeType": "YulFunctionCall",
"src": "18581:27:1"
},
"nativeSrc": "18581:27:1",
"nodeType": "YulExpressionStatement",
"src": "18581:27:1"
},
{
"nativeSrc": "18703:53:1",
"nodeType": "YulVariableDeclaration",
"src": "18703:53:1",
"value": {
"arguments": [
{
"arguments": [
{
"kind": "number",
"nativeSrc": "18727:3:1",
"nodeType": "YulLiteral",
"src": "18727:3:1",
"type": "",
"value": "0x0"
},
{
"kind": "number",
"nativeSrc": "18732:4:1",
"nodeType": "YulLiteral",
"src": "18732:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "keccak256",
"nativeSrc": "18717:9:1",
"nodeType": "YulIdentifier",
"src": "18717:9:1"
},
"nativeSrc": "18717:20:1",
"nodeType": "YulFunctionCall",
"src": "18717:20:1"
},
{
"arguments": [
{
"name": "slength",
"nativeSrc": "18743:7:1",
"nodeType": "YulIdentifier",
"src": "18743:7:1"
},
{
"kind": "number",
"nativeSrc": "18752:2:1",
"nodeType": "YulLiteral",
"src": "18752:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "div",
"nativeSrc": "18739:3:1",
"nodeType": "YulIdentifier",
"src": "18739:3:1"
},
"nativeSrc": "18739:16:1",
"nodeType": "YulFunctionCall",
"src": "18739:16:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "18713:3:1",
"nodeType": "YulIdentifier",
"src": "18713:3:1"
},
"nativeSrc": "18713:43:1",
"nodeType": "YulFunctionCall",
"src": "18713:43:1"
},
"variables": [
{
"name": "sc",
"nativeSrc": "18707:2:1",
"nodeType": "YulTypedName",
"src": "18707:2:1",
"type": ""
}
]
},
{
"expression": {
"arguments": [
{
"name": "_preBytes.slot",
"nativeSrc": "18819:14:1",
"nodeType": "YulIdentifier",
"src": "18819:14:1"
},
{
"arguments": [
{
"arguments": [
{
"name": "newlength",
"nativeSrc": "18843:9:1",
"nodeType": "YulIdentifier",
"src": "18843:9:1"
},
{
"kind": "number",
"nativeSrc": "18854:1:1",
"nodeType": "YulLiteral",
"src": "18854:1:1",
"type": "",
"value": "2"
}
],
"functionName": {
"name": "mul",
"nativeSrc": "18839:3:1",
"nodeType": "YulIdentifier",
"src": "18839:3:1"
},
"nativeSrc": "18839:17:1",
"nodeType": "YulFunctionCall",
"src": "18839:17:1"
},
{
"kind": "number",
"nativeSrc": "18858:1:1",
"nodeType": "YulLiteral",
"src": "18858:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "18835:3:1",
"nodeType": "YulIdentifier",
"src": "18835:3:1"
},
"nativeSrc": "18835:25:1",
"nodeType": "YulFunctionCall",
"src": "18835:25:1"
}
],
"functionName": {
"name": "sstore",
"nativeSrc": "18812:6:1",
"nodeType": "YulIdentifier",
"src": "18812:6:1"
},
"nativeSrc": "18812:49:1",
"nodeType": "YulFunctionCall",
"src": "18812:49:1"
},
"nativeSrc": "18812:49:1",
"nodeType": "YulExpressionStatement",
"src": "18812:49:1"
},
{
"nativeSrc": "18992:34:1",
"nodeType": "YulVariableDeclaration",
"src": "18992:34:1",
"value": {
"arguments": [
{
"name": "slength",
"nativeSrc": "19014:7:1",
"nodeType": "YulIdentifier",
"src": "19014:7:1"
},
{
"kind": "number",
"nativeSrc": "19023:2:1",
"nodeType": "YulLiteral",
"src": "19023:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "mod",
"nativeSrc": "19010:3:1",
"nodeType": "YulIdentifier",
"src": "19010:3:1"
},
"nativeSrc": "19010:16:1",
"nodeType": "YulFunctionCall",
"src": "19010:16:1"
},
"variables": [
{
"name": "slengthmod",
"nativeSrc": "18996:10:1",
"nodeType": "YulTypedName",
"src": "18996:10:1",
"type": ""
}
]
},
{
"nativeSrc": "19044:34:1",
"nodeType": "YulVariableDeclaration",
"src": "19044:34:1",
"value": {
"arguments": [
{
"name": "mlength",
"nativeSrc": "19066:7:1",
"nodeType": "YulIdentifier",
"src": "19066:7:1"
},
{
"kind": "number",
"nativeSrc": "19075:2:1",
"nodeType": "YulLiteral",
"src": "19075:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "mod",
"nativeSrc": "19062:3:1",
"nodeType": "YulIdentifier",
"src": "19062:3:1"
},
"nativeSrc": "19062:16:1",
"nodeType": "YulFunctionCall",
"src": "19062:16:1"
},
"variables": [
{
"name": "mlengthmod",
"nativeSrc": "19048:10:1",
"nodeType": "YulTypedName",
"src": "19048:10:1",
"type": ""
}
]
},
{
"nativeSrc": "19096:33:1",
"nodeType": "YulVariableDeclaration",
"src": "19096:33:1",
"value": {
"arguments": [
{
"kind": "number",
"nativeSrc": "19114:2:1",
"nodeType": "YulLiteral",
"src": "19114:2:1",
"type": "",
"value": "32"
},
{
"name": "slengthmod",
"nativeSrc": "19118:10:1",
"nodeType": "YulIdentifier",
"src": "19118:10:1"
}
],
"functionName": {
"name": "sub",
"nativeSrc": "19110:3:1",
"nodeType": "YulIdentifier",
"src": "19110:3:1"
},
"nativeSrc": "19110:19:1",
"nodeType": "YulFunctionCall",
"src": "19110:19:1"
},
"variables": [
{
"name": "submod",
"nativeSrc": "19100:6:1",
"nodeType": "YulTypedName",
"src": "19100:6:1",
"type": ""
}
]
},
{
"nativeSrc": "19147:33:1",
"nodeType": "YulVariableDeclaration",
"src": "19147:33:1",
"value": {
"arguments": [
{
"name": "_postBytes",
"nativeSrc": "19161:10:1",
"nodeType": "YulIdentifier",
"src": "19161:10:1"
},
{
"name": "submod",
"nativeSrc": "19173:6:1",
"nodeType": "YulIdentifier",
"src": "19173:6:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "19157:3:1",
"nodeType": "YulIdentifier",
"src": "19157:3:1"
},
"nativeSrc": "19157:23:1",
"nodeType": "YulFunctionCall",
"src": "19157:23:1"
},
"variables": [
{
"name": "mc",
"nativeSrc": "19151:2:1",
"nodeType": "YulTypedName",
"src": "19151:2:1",
"type": ""
}
]
},
{
"nativeSrc": "19198:35:1",
"nodeType": "YulVariableDeclaration",
"src": "19198:35:1",
"value": {
"arguments": [
{
"name": "_postBytes",
"nativeSrc": "19213:10:1",
"nodeType": "YulIdentifier",
"src": "19213:10:1"
},
{
"name": "mlength",
"nativeSrc": "19225:7:1",
"nodeType": "YulIdentifier",
"src": "19225:7:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "19209:3:1",
"nodeType": "YulIdentifier",
"src": "19209:3:1"
},
"nativeSrc": "19209:24:1",
"nodeType": "YulFunctionCall",
"src": "19209:24:1"
},
"variables": [
{
"name": "end",
"nativeSrc": "19202:3:1",
"nodeType": "YulTypedName",
"src": "19202:3:1",
"type": ""
}
]
},
{
"nativeSrc": "19251:38:1",
"nodeType": "YulVariableDeclaration",
"src": "19251:38:1",
"value": {
"arguments": [
{
"arguments": [
{
"kind": "number",
"nativeSrc": "19271:5:1",
"nodeType": "YulLiteral",
"src": "19271:5:1",
"type": "",
"value": "0x100"
},
{
"name": "submod",
"nativeSrc": "19278:6:1",
"nodeType": "YulIdentifier",
"src": "19278:6:1"
}
],
"functionName": {
"name": "exp",
"nativeSrc": "19267:3:1",
"nodeType": "YulIdentifier",
"src": "19267:3:1"
},
"nativeSrc": "19267:18:1",
"nodeType": "YulFunctionCall",
"src": "19267:18:1"
},
{
"kind": "number",
"nativeSrc": "19287:1:1",
"nodeType": "YulLiteral",
"src": "19287:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "sub",
"nativeSrc": "19263:3:1",
"nodeType": "YulIdentifier",
"src": "19263:3:1"
},
"nativeSrc": "19263:26:1",
"nodeType": "YulFunctionCall",
"src": "19263:26:1"
},
"variables": [
{
"name": "mask",
"nativeSrc": "19255:4:1",
"nodeType": "YulTypedName",
"src": "19255:4:1",
"type": ""
}
]
},
{
"expression": {
"arguments": [
{
"name": "sc",
"nativeSrc": "19316:2:1",
"nodeType": "YulIdentifier",
"src": "19316:2:1"
},
{
"arguments": [
{
"arguments": [
{
"name": "sc",
"nativeSrc": "19330:2:1",
"nodeType": "YulIdentifier",
"src": "19330:2:1"
}
],
"functionName": {
"name": "sload",
"nativeSrc": "19324:5:1",
"nodeType": "YulIdentifier",
"src": "19324:5:1"
},
"nativeSrc": "19324:9:1",
"nodeType": "YulFunctionCall",
"src": "19324:9:1"
},
{
"arguments": [
{
"arguments": [
{
"name": "mc",
"nativeSrc": "19345:2:1",
"nodeType": "YulIdentifier",
"src": "19345:2:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "19339:5:1",
"nodeType": "YulIdentifier",
"src": "19339:5:1"
},
"nativeSrc": "19339:9:1",
"nodeType": "YulFunctionCall",
"src": "19339:9:1"
},
{
"name": "mask",
"nativeSrc": "19350:4:1",
"nodeType": "YulIdentifier",
"src": "19350:4:1"
}
],
"functionName": {
"name": "and",
"nativeSrc": "19335:3:1",
"nodeType": "YulIdentifier",
"src": "19335:3:1"
},
"nativeSrc": "19335:20:1",
"nodeType": "YulFunctionCall",
"src": "19335:20:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "19320:3:1",
"nodeType": "YulIdentifier",
"src": "19320:3:1"
},
"nativeSrc": "19320:36:1",
"nodeType": "YulFunctionCall",
"src": "19320:36:1"
}
],
"functionName": {
"name": "sstore",
"nativeSrc": "19309:6:1",
"nodeType": "YulIdentifier",
"src": "19309:6:1"
},
"nativeSrc": "19309:48:1",
"nodeType": "YulFunctionCall",
"src": "19309:48:1"
},
"nativeSrc": "19309:48:1",
"nodeType": "YulExpressionStatement",
"src": "19309:48:1"
},
{
"body": {
"nativeSrc": "19593:63:1",
"nodeType": "YulBlock",
"src": "19593:63:1",
"statements": [
{
"expression": {
"arguments": [
{
"name": "sc",
"nativeSrc": "19623:2:1",
"nodeType": "YulIdentifier",
"src": "19623:2:1"
},
{
"arguments": [
{
"name": "mc",
"nativeSrc": "19633:2:1",
"nodeType": "YulIdentifier",
"src": "19633:2:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "19627:5:1",
"nodeType": "YulIdentifier",
"src": "19627:5:1"
},
"nativeSrc": "19627:9:1",
"nodeType": "YulFunctionCall",
"src": "19627:9:1"
}
],
"functionName": {
"name": "sstore",
"nativeSrc": "19616:6:1",
"nodeType": "YulIdentifier",
"src": "19616:6:1"
},
"nativeSrc": "19616:21:1",
"nodeType": "YulFunctionCall",
"src": "19616:21:1"
},
"nativeSrc": "19616:21:1",
"nodeType": "YulExpressionStatement",
"src": "19616:21:1"
}
]
},
"condition": {
"arguments": [
{
"name": "mc",
"nativeSrc": "19484:2:1",
"nodeType": "YulIdentifier",
"src": "19484:2:1"
},
{
"name": "end",
"nativeSrc": "19488:3:1",
"nodeType": "YulIdentifier",
"src": "19488:3:1"
}
],
"functionName": {
"name": "lt",
"nativeSrc": "19481:2:1",
"nodeType": "YulIdentifier",
"src": "19481:2:1"
},
"nativeSrc": "19481:11:1",
"nodeType": "YulFunctionCall",
"src": "19481:11:1"
},
"nativeSrc": "19377:279:1",
"nodeType": "YulForLoop",
"post": {
"nativeSrc": "19493:99:1",
"nodeType": "YulBlock",
"src": "19493:99:1",
"statements": [
{
"nativeSrc": "19516:16:1",
"nodeType": "YulAssignment",
"src": "19516:16:1",
"value": {
"arguments": [
{
"name": "sc",
"nativeSrc": "19526:2:1",
"nodeType": "YulIdentifier",
"src": "19526:2:1"
},
{
"kind": "number",
"nativeSrc": "19530:1:1",
"nodeType": "YulLiteral",
"src": "19530:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "19522:3:1",
"nodeType": "YulIdentifier",
"src": "19522:3:1"
},
"nativeSrc": "19522:10:1",
"nodeType": "YulFunctionCall",
"src": "19522:10:1"
},
"variableNames": [
{
"name": "sc",
"nativeSrc": "19516:2:1",
"nodeType": "YulIdentifier",
"src": "19516:2:1"
}
]
},
{
"nativeSrc": "19554:19:1",
"nodeType": "YulAssignment",
"src": "19554:19:1",
"value": {
"arguments": [
{
"name": "mc",
"nativeSrc": "19564:2:1",
"nodeType": "YulIdentifier",
"src": "19564:2:1"
},
{
"kind": "number",
"nativeSrc": "19568:4:1",
"nodeType": "YulLiteral",
"src": "19568:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "19560:3:1",
"nodeType": "YulIdentifier",
"src": "19560:3:1"
},
"nativeSrc": "19560:13:1",
"nodeType": "YulFunctionCall",
"src": "19560:13:1"
},
"variableNames": [
{
"name": "mc",
"nativeSrc": "19554:2:1",
"nodeType": "YulIdentifier",
"src": "19554:2:1"
}
]
}
]
},
"pre": {
"nativeSrc": "19381:99:1",
"nodeType": "YulBlock",
"src": "19381:99:1",
"statements": [
{
"nativeSrc": "19404:16:1",
"nodeType": "YulAssignment",
"src": "19404:16:1",
"value": {
"arguments": [
{
"name": "sc",
"nativeSrc": "19414:2:1",
"nodeType": "YulIdentifier",
"src": "19414:2:1"
},
{
"kind": "number",
"nativeSrc": "19418:1:1",
"nodeType": "YulLiteral",
"src": "19418:1:1",
"type": "",
"value": "1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "19410:3:1",
"nodeType": "YulIdentifier",
"src": "19410:3:1"
},
"nativeSrc": "19410:10:1",
"nodeType": "YulFunctionCall",
"src": "19410:10:1"
},
"variableNames": [
{
"name": "sc",
"nativeSrc": "19404:2:1",
"nodeType": "YulIdentifier",
"src": "19404:2:1"
}
]
},
{
"nativeSrc": "19442:19:1",
"nodeType": "YulAssignment",
"src": "19442:19:1",
"value": {
"arguments": [
{
"name": "mc",
"nativeSrc": "19452:2:1",
"nodeType": "YulIdentifier",
"src": "19452:2:1"
},
{
"kind": "number",
"nativeSrc": "19456:4:1",
"nodeType": "YulLiteral",
"src": "19456:4:1",
"type": "",
"value": "0x20"
}
],
"functionName": {
"name": "add",
"nativeSrc": "19448:3:1",
"nodeType": "YulIdentifier",
"src": "19448:3:1"
},
"nativeSrc": "19448:13:1",
"nodeType": "YulFunctionCall",
"src": "19448:13:1"
},
"variableNames": [
{
"name": "mc",
"nativeSrc": "19442:2:1",
"nodeType": "YulIdentifier",
"src": "19442:2:1"
}
]
}
]
},
"src": "19377:279:1"
},
{
"nativeSrc": "19676:32:1",
"nodeType": "YulAssignment",
"src": "19676:32:1",
"value": {
"arguments": [
{
"kind": "number",
"nativeSrc": "19688:5:1",
"nodeType": "YulLiteral",
"src": "19688:5:1",
"type": "",
"value": "0x100"
},
{
"arguments": [
{
"name": "mc",
"nativeSrc": "19699:2:1",
"nodeType": "YulIdentifier",
"src": "19699:2:1"
},
{
"name": "end",
"nativeSrc": "19703:3:1",
"nodeType": "YulIdentifier",
"src": "19703:3:1"
}
],
"functionName": {
"name": "sub",
"nativeSrc": "19695:3:1",
"nodeType": "YulIdentifier",
"src": "19695:3:1"
},
"nativeSrc": "19695:12:1",
"nodeType": "YulFunctionCall",
"src": "19695:12:1"
}
],
"functionName": {
"name": "exp",
"nativeSrc": "19684:3:1",
"nodeType": "YulIdentifier",
"src": "19684:3:1"
},
"nativeSrc": "19684:24:1",
"nodeType": "YulFunctionCall",
"src": "19684:24:1"
},
"variableNames": [
{
"name": "mask",
"nativeSrc": "19676:4:1",
"nodeType": "YulIdentifier",
"src": "19676:4:1"
}
]
},
{
"expression": {
"arguments": [
{
"name": "sc",
"nativeSrc": "19735:2:1",
"nodeType": "YulIdentifier",
"src": "19735:2:1"
},
{
"arguments": [
{
"arguments": [
{
"arguments": [
{
"name": "mc",
"nativeSrc": "19753:2:1",
"nodeType": "YulIdentifier",
"src": "19753:2:1"
}
],
"functionName": {
"name": "mload",
"nativeSrc": "19747:5:1",
"nodeType": "YulIdentifier",
"src": "19747:5:1"
},
"nativeSrc": "19747:9:1",
"nodeType": "YulFunctionCall",
"src": "19747:9:1"
},
{
"name": "mask",
"nativeSrc": "19758:4:1",
"nodeType": "YulIdentifier",
"src": "19758:4:1"
}
],
"functionName": {
"name": "div",
"nativeSrc": "19743:3:1",
"nodeType": "YulIdentifier",
"src": "19743:3:1"
},
"nativeSrc": "19743:20:1",
"nodeType": "YulFunctionCall",
"src": "19743:20:1"
},
{
"name": "mask",
"nativeSrc": "19765:4:1",
"nodeType": "YulIdentifier",
"src": "19765:4:1"
}
],
"functionName": {
"name": "mul",
"nativeSrc": "19739:3:1",
"nodeType": "YulIdentifier",
"src": "19739:3:1"
},
"nativeSrc": "19739:31:1",
"nodeType": "YulFunctionCall",
"src": "19739:31:1"
}
],
"functionName": {
"name": "sstore",
"nativeSrc": "19728:6:1",
"nodeType": "YulIdentifier",
"src": "19728:6:1"
},
"nativeSrc": "19728:43:1",
"nodeType": "YulFunctionCall",
"src": "19728:43:1"
},
"nativeSrc": "19728:43:1",
"nodeType": "YulExpressionStatement",
"src": "19728:43:1"
}
]
},
"nativeSrc": "18481:1305:1",
"nodeType": "YulCase",
"src": "18481:1305:1",
"value": "default"
}
],
"expression": {
"arguments": [
{
"arguments": [
{
"name": "slength",
"nativeSrc": "15114:7:1",
"nodeType": "YulIdentifier",
"src": "15114:7:1"
},
{
"kind": "number",
"nativeSrc": "15123:2:1",
"nodeType": "YulLiteral",
"src": "15123:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "lt",
"nativeSrc": "15111:2:1",
"nodeType": "YulIdentifier",
"src": "15111:2:1"
},
"nativeSrc": "15111:15:1",
"nodeType": "YulFunctionCall",
"src": "15111:15:1"
},
{
"arguments": [
{
"name": "newlength",
"nativeSrc": "15131:9:1",
"nodeType": "YulIdentifier",
"src": "15131:9:1"
},
{
"kind": "number",
"nativeSrc": "15142:2:1",
"nodeType": "YulLiteral",
"src": "15142:2:1",
"type": "",
"value": "32"
}
],
"functionName": {
"name": "lt",
"nativeSrc": "15128:2:1",
"nodeType": "YulIdentifier",
"src": "15128:2:1"
},
"nativeSrc": "15128:17:1",
"nodeType": "YulFunctionCall",
"src": "15128:17:1"
}
],
"functionName": {
"name": "add",
"nativeSrc": "15107:3:1",
"nodeType": "YulIdentifier",
"src": "15107:3:1"
},
"nativeSrc": "15107:39:1",
"nodeType": "YulFunctionCall",
"src": "15107:39:1"
},
"nativeSrc": "15100:4686:1",
"nodeType": "YulSwitch",
"src": "15100:4686:1"
}
]
},
"evmVersion": "cancun",
"externalReferences": [
{
"declaration": 337,
"isOffset": false,
"isSlot": false,
"src": "14766:10:1",
"valueSize": 1
},
{
"declaration": 337,
"isOffset": false,
"isSlot": false,
"src": "15994:10:1",
"valueSize": 1
},
{
"declaration": 337,
"isOffset": false,
"isSlot": false,
"src": "17773:10:1",
"valueSize": 1
},
{
"declaration": 337,
"isOffset": false,
"isSlot": false,
"src": "17825:10:1",
"valueSize": 1
},
{
"declaration": 337,
"isOffset": false,
"isSlot": false,
"src": "19161:10:1",
"valueSize": 1
},
{
"declaration": 337,
"isOffset": false,
"isSlot": false,
"src": "19213:10:1",
"valueSize": 1
},
{
"declaration": 335,
"isOffset": false,
"isSlot": true,
"src": "14139:14:1",
"suffix": "slot",
"valueSize": 1
},
{
"declaration": 335,
"isOffset": false,
"isSlot": true,
"src": "15453:14:1",
"suffix": "slot",
"valueSize": 1
},
{
"declaration": 335,
"isOffset": false,
"isSlot": true,
"src": "16921:14:1",
"suffix": "slot",
"valueSize": 1
},
{
"declaration": 335,
"isOffset": false,
"isSlot": true,
"src": "17070:14:1",
"suffix": "slot",
"valueSize": 1
},
{
"declaration": 335,
"isOffset": false,
"isSlot": true,
"src": "18593:14:1",
"suffix": "slot",
"valueSize": 1
},
{
"declaration": 335,
"isOffset": false,
"isSlot": true,
"src": "18819:14:1",
"suffix": "slot",
"valueSize": 1
}
],
"id": 340,
"nodeType": "InlineAssembly",
"src": "13884:5913:1"
}
]
},
"id": 342,
"implemented": true,
"kind": "function",
"modifiers": [],
"name": "concatStorage",
"nameLocation": "13800:13:1",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 338,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 335,
"mutability": "mutable",
"name": "_preBytes",
"nameLocation": "13828:9:1",
"nodeType": "VariableDeclaration",
"scope": 342,
"src": "13814:23:1",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 334,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "13814:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
},
{
"constant": false,
"id": 337,
"mutability": "mutable",
"name": "_postBytes",
"nameLocation": "13852:10:1",
"nodeType": "VariableDeclaration",
"scope": 342,
"src": "13839:23:1",
"stateVariable": false,
"storageLocation": "memory",
"typeDescriptions": {
"typeIdentifier": "t_bytes_memory_ptr",
"typeString": "bytes"
},
"typeName": {
"id": 336,
"name": "bytes",
"nodeType": "ElementaryTypeName",
"src": "13839:5:1",
"typeDescriptions": {
"typeIdentifier": "t_bytes_storage_ptr",
"typeString": "bytes"
}
},
"visibility": "internal"
}
],
"src": "13813:50:1"
},
"returnParameters": {
"id": 339,
"nodeType": "ParameterList",
"parameters": [],
"src": "13873:0:1"
},
"scope": 648,
"src": "13791:6013:1",
"stateMutability": "nonpayable",
"virtual": false,
"visibility": "internal"
},
{
"body": {
"id": 378,
"nodeType": "Block",
"src": "19912:2699:1",
"statements": [
{
"expression": {
"arguments": [
{
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 358,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"commonType": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
},
"id": 356,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"id": 354,
"name": "_length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 348,
"src": "19931:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": "+",
"rightExpression": {
"hexValue": "3331",
"id": 355,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "19941:2:1",
"typeDescriptions": {
"typeIdentifier": "t_rational_31_by_1",
"typeString": "int_const 31"
},
"value": "31"
},
"src": "19931:12:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"nodeType": "BinaryOperation",
"operator": ">=",
"rightExpression": {
"id": 357,
"name": "_length",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 348,
"src": "19947:7:1",
"typeDescriptions": {
"typeIdentifier": "t_uint256",
"typeString": "uint256"
}
},
"src": "19931:23:1",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
{
"hexValue": "736c6963655f6f766572666c6f77",
"id": 359,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "string",
"lValueRequested": false,
"nodeType": "Literal",
"src": "19956:16:1",
"typeDescriptions": {
"typeIdentifier": "t_stringliteral_5d3d629f76473d94377d221b1f1c8f2161f7b65cab69e095662ec5d0e026c17e",
"typeString": "literal_string \"slice_overflow\""
},
"value": "slice_overflow"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
},
{
"typeIdentifier": "t_stringliteral_5d3d629f76473d94377d221b1f1c8f2161f7b65cab69e095662ec5d0e026c17e",
"typeString": "literal_string \"slice_overflow\""
}
],
"id": 353,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4294967278,
4294967278,
4294967278
],
"referencedDeclaration": 4294967278,
"src": "19923:7:1",
"typeDescriptions": {
"typ
View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

View raw

(Sorry about that, but we can’t show files that are this big right now.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment