Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00
Cross-Chain Transactions
Loading...
Loading
Contract Name:
AgTokenSideChainMultiBridgeNameable
Compiler Version
v0.8.17+commit.8df45f5f
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;
import "../AgTokenSideChainMultiBridge.sol";
/// @title AgTokenSideChainMultiBridgeNameable
/// @author Angle Labs, Inc.
contract AgTokenSideChainMultiBridgeNameable is AgTokenSideChainMultiBridge {
string internal __name;
string internal __symbol;
uint256[48] private __gapNameable;
/// @inheritdoc ERC20Upgradeable
function name() public view override returns (string memory) {
return __name;
}
/// @inheritdoc ERC20Upgradeable
function symbol() public view override returns (string memory) {
return __symbol;
}
/// @notice Updates the name and symbol of the token
function setNameAndSymbol(string memory newName, string memory newSymbol) external onlyGovernor {
__name = newName;
__symbol = newSymbol;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.2;
import "../../utils/AddressUpgradeable.sol";
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
* @custom:oz-retyped-from bool
*/
uint8 private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint8 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
*/
modifier initializer() {
bool isTopLevelCall = !_initializing;
require(
(isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1),
"Initializable: contract is already initialized"
);
_initialized = 1;
if (isTopLevelCall) {
_initializing = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
* initialization step. This is essential to configure modules that are added through upgrades and that require
* initialization.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*/
modifier reinitializer(uint8 version) {
require(!_initializing && _initialized < version, "Initializable: contract is already initialized");
_initialized = version;
_initializing = true;
_;
_initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*/
function _disableInitializers() internal virtual {
require(!_initializing, "Initializable: contract is initializing");
if (_initialized < type(uint8).max) {
_initialized = type(uint8).max;
emit Initialized(type(uint8).max);
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20Upgradeable.sol";
import "./extensions/IERC20MetadataUpgradeable.sol";
import "../../utils/ContextUpgradeable.sol";
import "../../proxy/utils/Initializable.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}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC20
* applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable, IERC20MetadataUpgradeable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
function __ERC20_init(string memory name_, string memory symbol_) internal onlyInitializing {
__ERC20_init_unchained(name_, symbol_);
}
function __ERC20_init_unchained(string memory name_, string memory symbol_) internal onlyInitializing {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override 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 value {ERC20} uses, unless this function is
* 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 override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override 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 `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` 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 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `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.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
}
_balances[to] += amount;
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` 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.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[45] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20Upgradeable {
/**
* @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 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `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.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @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 v4.6.0) (token/ERC20/extensions/draft-ERC20Permit.sol)
pragma solidity ^0.8.0;
import "./draft-IERC20PermitUpgradeable.sol";
import "../ERC20Upgradeable.sol";
import "../../../utils/cryptography/draft-EIP712Upgradeable.sol";
import "../../../utils/cryptography/ECDSAUpgradeable.sol";
import "../../../utils/CountersUpgradeable.sol";
import "../../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*
* _Available since v3.4._
*
* @custom:storage-size 51
*/
abstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {
using CountersUpgradeable for CountersUpgradeable.Counter;
mapping(address => CountersUpgradeable.Counter) private _nonces;
// solhint-disable-next-line var-name-mixedcase
bytes32 private constant _PERMIT_TYPEHASH =
keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
/**
* @dev In previous versions `_PERMIT_TYPEHASH` was declared as `immutable`.
* However, to ensure consistency with the upgradeable transpiler, we will continue
* to reserve a slot.
* @custom:oz-renamed-from _PERMIT_TYPEHASH
*/
// solhint-disable-next-line var-name-mixedcase
bytes32 private _PERMIT_TYPEHASH_DEPRECATED_SLOT;
/**
* @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `"1"`.
*
* It's a good idea to use the same `name` that is defined as the ERC20 token name.
*/
function __ERC20Permit_init(string memory name) internal onlyInitializing {
__EIP712_init_unchained(name, "1");
}
function __ERC20Permit_init_unchained(string memory) internal onlyInitializing {}
/**
* @dev See {IERC20Permit-permit}.
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) public virtual override {
require(block.timestamp <= deadline, "ERC20Permit: expired deadline");
bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline));
bytes32 hash = _hashTypedDataV4(structHash);
address signer = ECDSAUpgradeable.recover(hash, v, r, s);
require(signer == owner, "ERC20Permit: invalid signature");
_approve(owner, spender, value);
}
/**
* @dev See {IERC20Permit-nonces}.
*/
function nonces(address owner) public view virtual override returns (uint256) {
return _nonces[owner].current();
}
/**
* @dev See {IERC20Permit-DOMAIN_SEPARATOR}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view override returns (bytes32) {
return _domainSeparatorV4();
}
/**
* @dev "Consume a nonce": return the current value and increment.
*
* _Available since v4.1._
*/
function _useNonce(address owner) internal virtual returns (uint256 current) {
CountersUpgradeable.Counter storage nonce = _nonces[owner];
current = nonce.current();
nonce.increment();
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20PermitUpgradeable {
/**
* @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].
*/
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 v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev 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
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)
pragma solidity ^0.8.0;
/**
* @title Counters
* @author Matt Condon (@shrugs)
* @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
* of elements in a mapping, issuing ERC721 ids, or counting request ids.
*
* Include with `using Counters for Counters.Counter;`
*/
library CountersUpgradeable {
struct Counter {
// This variable should never be directly accessed by users of the library: interactions must be restricted to
// the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
// this feature: see https://github.com/ethereum/solidity/issues/4637
uint256 _value; // default: 0
}
function current(Counter storage counter) internal view returns (uint256) {
return counter._value;
}
function increment(Counter storage counter) internal {
unchecked {
counter._value += 1;
}
}
function decrement(Counter storage counter) internal {
uint256 value = counter._value;
require(value > 0, "Counter: decrement overflow");
unchecked {
counter._value = value - 1;
}
}
function reset(Counter storage counter) internal {
counter._value = 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
uint8 private constant _ADDRESS_LENGTH = 20;
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
/**
* @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
*/
function toHexString(address addr) internal pure returns (string memory) {
return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/cryptography/ECDSA.sol)
pragma solidity ^0.8.0;
import "../StringsUpgradeable.sol";
/**
* @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSAUpgradeable {
enum RecoverError {
NoError,
InvalidSignature,
InvalidSignatureLength,
InvalidSignatureS,
InvalidSignatureV
}
function _throwError(RecoverError error) private pure {
if (error == RecoverError.NoError) {
return; // no error: do nothing
} else if (error == RecoverError.InvalidSignature) {
revert("ECDSA: invalid signature");
} else if (error == RecoverError.InvalidSignatureLength) {
revert("ECDSA: invalid signature length");
} else if (error == RecoverError.InvalidSignatureS) {
revert("ECDSA: invalid signature 's' value");
} else if (error == RecoverError.InvalidSignatureV) {
revert("ECDSA: invalid signature 'v' value");
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature` or error string. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*
* Documentation for signature generation:
* - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
* - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
*
* _Available since v4.3._
*/
function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
// Check the signature length
// - case 65: r,s,v signature (standard)
// - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
if (signature.length == 65) {
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return tryRecover(hash, v, r, s);
} else if (signature.length == 64) {
bytes32 r;
bytes32 vs;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
/// @solidity memory-safe-assembly
assembly {
r := mload(add(signature, 0x20))
vs := mload(add(signature, 0x40))
}
return tryRecover(hash, r, vs);
} else {
return (address(0), RecoverError.InvalidSignatureLength);
}
}
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, signature);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
*
* See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address, RecoverError) {
bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);
uint8 v = uint8((uint256(vs) >> 255) + 27);
return tryRecover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
*
* _Available since v4.2._
*/
function recover(
bytes32 hash,
bytes32 r,
bytes32 vs
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, r, vs);
_throwError(error);
return recovered;
}
/**
* @dev Overload of {ECDSA-tryRecover} that receives the `v`,
* `r` and `s` signature fields separately.
*
* _Available since v4.3._
*/
function tryRecover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address, RecoverError) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {
return (address(0), RecoverError.InvalidSignatureS);
}
if (v != 27 && v != 28) {
return (address(0), RecoverError.InvalidSignatureV);
}
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
if (signer == address(0)) {
return (address(0), RecoverError.InvalidSignature);
}
return (signer, RecoverError.NoError);
}
/**
* @dev Overload of {ECDSA-recover} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s
) internal pure returns (address) {
(address recovered, RecoverError error) = tryRecover(hash, v, r, s);
_throwError(error);
return recovered;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
}
/**
* @dev Returns an Ethereum Signed Message, created from `s`. This
* produces hash corresponding to the one signed with the
* https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
* JSON-RPC method as part of EIP-191.
*
* See {recover}.
*/
function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", StringsUpgradeable.toString(s.length), s));
}
/**
* @dev Returns an Ethereum Signed Typed Data, created from a
* `domainSeparator` and a `structHash`. This produces hash corresponding
* to the one signed with the
* https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
* JSON-RPC method as part of EIP-712.
*
* See {recover}.
*/
function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)
pragma solidity ^0.8.0;
import "./ECDSAUpgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.
*
* The encoding specified in the EIP is very generic, and such a generic 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 their contracts 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].
*
* _Available since v3.4._
*
* @custom:storage-size 52
*/
abstract contract EIP712Upgradeable is Initializable {
/* solhint-disable var-name-mixedcase */
bytes32 private _HASHED_NAME;
bytes32 private _HASHED_VERSION;
bytes32 private constant _TYPE_HASH = keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)");
/* solhint-enable var-name-mixedcase */
/**
* @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].
*/
function __EIP712_init(string memory name, string memory version) internal onlyInitializing {
__EIP712_init_unchained(name, version);
}
function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {
bytes32 hashedName = keccak256(bytes(name));
bytes32 hashedVersion = keccak256(bytes(version));
_HASHED_NAME = hashedName;
_HASHED_VERSION = hashedVersion;
}
/**
* @dev Returns the domain separator for the current chain.
*/
function _domainSeparatorV4() internal view returns (bytes32) {
return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());
}
function _buildDomainSeparator(
bytes32 typeHash,
bytes32 nameHash,
bytes32 versionHash
) private view returns (bytes32) {
return keccak256(abi.encode(typeHash, nameHash, versionHash, 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 ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);
}
/**
* @dev The hash of the name parameter for the EIP712 domain.
*
* NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
* are a concern.
*/
function _EIP712NameHash() internal virtual view returns (bytes32) {
return _HASHED_NAME;
}
/**
* @dev The hash of the version parameter for the EIP712 domain.
*
* NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs
* are a concern.
*/
function _EIP712VersionHash() internal virtual view returns (bytes32) {
return _HASHED_VERSION;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the 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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `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.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
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].
*/
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 v4.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";
/**
* @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));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @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");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;
/*
* █
***** ▓▓▓
* ▓▓▓▓▓▓▓
* ///. ▓▓▓▓▓▓▓▓▓▓▓▓▓
***** //////// ▓▓▓▓▓▓▓
* ///////////// ▓▓▓
▓▓ ////////////////// █ ▓▓
▓▓ ▓▓ /////////////////////// ▓▓ ▓▓
▓▓ ▓▓ //////////////////////////// ▓▓ ▓▓
▓▓ ▓▓ /////////▓▓▓///////▓▓▓///////// ▓▓ ▓▓
▓▓ ,////////////////////////////////////// ▓▓ ▓▓
▓▓ ////////////////////////////////////////// ▓▓
▓▓ //////////////////////▓▓▓▓/////////////////////
,////////////////////////////////////////////////////
.//////////////////////////////////////////////////////////
.//////////////////////////██.,//////////////////////////█
.//////////////////////████..,./////////////////////██
...////////////////███████.....,.////////////////███
,.,////////////████████ ........,///////////████
.,.,//////█████████ ,.......///////████
,..//████████ ........./████
..,██████ .....,███
.██ ,.,█
▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓ ▓▓▓▓▓▓▓▓▓▓
▓▓▓▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓ ▓▓ ▓▓▓▓
▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓ ▓▓▓▓▓
▓▓▓ ▓▓ ▓▓▓ ▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓▓▓▓
*/
import "../interfaces/IAgToken.sol";
import "../interfaces/ITreasury.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/draft-ERC20PermitUpgradeable.sol";
/// @title AgToken
/// @author Angle Labs, Inc.
/// @notice Base contract for Angle agTokens on Ethereum and on other chains
/// @dev By default, agTokens are ERC-20 tokens with 18 decimals
contract AgToken is IAgToken, ERC20PermitUpgradeable {
// =========================== PARAMETERS / VARIABLES ==========================
/// @inheritdoc IAgToken
mapping(address => bool) public isMinter;
/// @notice Reference to the treasury contract which can grant minting rights
address public treasury;
// =================================== EVENTS ==================================
event TreasuryUpdated(address indexed _treasury);
event MinterToggled(address indexed minter);
// =================================== ERRORS ==================================
error BurnAmountExceedsAllowance();
error InvalidSender();
error InvalidTreasury();
error NotMinter();
error NotTreasury();
// ================================ CONSTRUCTOR ================================
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() initializer {}
/// @notice Initializes the `AgToken` contract
function initialize(string memory name_, string memory symbol_, address _treasury) external {
_initialize(name_, symbol_, _treasury);
}
/// @notice Initializes the contract
function _initialize(string memory name_, string memory symbol_, address _treasury) internal virtual initializer {
if (address(ITreasury(_treasury).stablecoin()) != address(this)) revert InvalidTreasury();
__ERC20Permit_init(name_);
__ERC20_init(name_, symbol_);
treasury = _treasury;
emit TreasuryUpdated(_treasury);
}
// ================================= MODIFIERS =================================
/// @notice Checks to see if it is the `Treasury` calling this contract
modifier onlyTreasury() {
if (msg.sender != treasury) revert NotTreasury();
_;
}
/// @notice Checks whether the sender has the minting right
modifier onlyMinter() {
if (!isMinter[msg.sender]) revert NotMinter();
_;
}
// ============================= EXTERNAL FUNCTION =============================
/// @notice Allows anyone to burn stablecoins
/// @param amount Amount of stablecoins to burn
/// @dev This function can typically be called if there is a settlement mechanism to burn stablecoins
function burnStablecoin(uint256 amount) external {
_burn(msg.sender, amount);
}
// ========================= MINTER ROLE ONLY FUNCTIONS ========================
/// @inheritdoc IAgToken
function burnSelf(uint256 amount, address burner) external onlyMinter {
_burn(burner, amount);
}
/// @inheritdoc IAgToken
function burnFrom(uint256 amount, address burner, address sender) external onlyMinter {
if (burner != sender) {
uint256 currentAllowance = allowance(burner, sender);
if (currentAllowance < amount) revert BurnAmountExceedsAllowance();
_approve(burner, sender, currentAllowance - amount);
}
_burn(burner, amount);
}
/// @inheritdoc IAgToken
function mint(address account, uint256 amount) external onlyMinter {
_mint(account, amount);
}
// ========================== GOVERNANCE ONLY FUNCTIONS ==========================
/// @inheritdoc IAgToken
function addMinter(address minter) external onlyTreasury {
isMinter[minter] = true;
emit MinterToggled(minter);
}
/// @inheritdoc IAgToken
function removeMinter(address minter) external {
if (msg.sender != address(treasury) && msg.sender != minter) revert InvalidSender();
isMinter[minter] = false;
emit MinterToggled(minter);
}
/// @inheritdoc IAgToken
function setTreasury(address _treasury) external virtual onlyTreasury {
treasury = _treasury;
emit TreasuryUpdated(_treasury);
}
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;
import "./AgToken.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
/// @title AgTokenSideChainMultiBridge
/// @author Angle Labs, Inc.
/// @notice Contract for Angle agTokens on other chains than Ethereum mainnet
/// @dev This contract supports bridge tokens having a minting right on the stablecoin (also referred to as the canonical
/// or the native token)
contract AgTokenSideChainMultiBridge is AgToken {
using SafeERC20 for IERC20;
/// @notice Base used for fee computation
uint256 public constant BASE_PARAMS = 1e9;
// =============================== BRIDGING DATA ===============================
/// @notice Struct with some data about a specific bridge token
struct BridgeDetails {
// Limit on the balance of bridge token held by the contract: it is designed
// to reduce the exposure of the system to hacks
uint256 limit;
// Limit on the hourly volume of token minted through this bridge
// Technically the limit over a rolling hour is hourlyLimit x2 as hourly limit
// is enforced only between x:00 and x+1:00
uint256 hourlyLimit;
// Fee taken for swapping in and out the token
uint64 fee;
// Whether the associated token is allowed or not
bool allowed;
// Whether swapping in and out from the associated token is paused or not
bool paused;
}
/// @notice Maps a bridge token to data
mapping(address => BridgeDetails) public bridges;
/// @notice List of all bridge tokens
address[] public bridgeTokensList;
/// @notice Maps a bridge token to the associated hourly volume
mapping(address => mapping(uint256 => uint256)) public usage;
/// @notice Maps an address to whether it is exempt of fees for when it comes to swapping in and out
mapping(address => uint256) public isFeeExempt;
/// @notice Limit to the amount of tokens that can be sent from that chain to another chain
uint256 public chainTotalHourlyLimit;
/// @notice Usage per hour on that chain. Maps an hourly timestamp to the total volume swapped out on the chain
mapping(uint256 => uint256) public chainTotalUsage;
uint256[44] private __gapMultiBridge;
// =================================== EVENTS ==================================
event BridgeTokenAdded(address indexed bridgeToken, uint256 limit, uint256 hourlyLimit, uint64 fee, bool paused);
event BridgeTokenToggled(address indexed bridgeToken, bool toggleStatus);
event BridgeTokenRemoved(address indexed bridgeToken);
event BridgeTokenFeeUpdated(address indexed bridgeToken, uint64 fee);
event BridgeTokenLimitUpdated(address indexed bridgeToken, uint256 limit);
event BridgeTokenHourlyLimitUpdated(address indexed bridgeToken, uint256 hourlyLimit);
event HourlyLimitUpdated(uint256 hourlyLimit);
event Recovered(address indexed token, address indexed to, uint256 amount);
event FeeToggled(address indexed theAddress, uint256 toggleStatus);
// =================================== ERRORS ==================================
error AssetStillControlledInReserves();
error HourlyLimitExceeded();
error InvalidToken();
error NotGovernor();
error NotGovernorOrGuardian();
error TooBigAmount();
error TooHighParameterValue();
error ZeroAddress();
// ================================= MODIFIERS =================================
/// @notice Checks whether the `msg.sender` has the governor role or not
modifier onlyGovernor() {
if (!ITreasury(treasury).isGovernor(msg.sender)) revert NotGovernor();
_;
}
/// @notice Checks whether the `msg.sender` has the governor role or the guardian role
modifier onlyGovernorOrGuardian() {
if (!ITreasury(treasury).isGovernorOrGuardian(msg.sender)) revert NotGovernorOrGuardian();
_;
}
// ===================== EXTERNAL PERMISSIONLESS FUNCTIONS =====================
/// @notice Returns the list of all supported bridge tokens
/// @dev Helpful for UIs
function allBridgeTokens() external view returns (address[] memory) {
return bridgeTokensList;
}
/// @notice Returns the current volume for a bridge, for the current hour
/// @param bridgeToken Bridge used to mint
/// @dev Helpful for UIs
function currentUsage(address bridgeToken) external view returns (uint256) {
return usage[bridgeToken][block.timestamp / 3600];
}
/// @notice Returns the current total volume on the chain for the current hour
/// @dev Helpful for UIs
function currentTotalUsage() external view returns (uint256) {
return chainTotalUsage[block.timestamp / 3600];
}
/// @notice Mints the canonical token from a supported bridge token
/// @param bridgeToken Bridge token to use to mint
/// @param amount Amount of bridge tokens to send
/// @param to Address to which the stablecoin should be sent
/// @return Amount of the canonical stablecoin actually minted
/// @dev Some fees may be taken by the protocol depending on the token used and on the address calling
function swapIn(address bridgeToken, uint256 amount, address to) external returns (uint256) {
BridgeDetails memory bridgeDetails = bridges[bridgeToken];
if (!bridgeDetails.allowed || bridgeDetails.paused) revert InvalidToken();
uint256 balance = IERC20(bridgeToken).balanceOf(address(this));
if (balance + amount > bridgeDetails.limit) {
// In case someone maliciously sends tokens to this contract
// Or the limit changes
if (bridgeDetails.limit > balance) amount = bridgeDetails.limit - balance;
else {
amount = 0;
}
}
// Checking requirement on the hourly volume
uint256 hour = block.timestamp / 3600;
uint256 hourlyUsage = usage[bridgeToken][hour];
if (hourlyUsage + amount > bridgeDetails.hourlyLimit) {
// Edge case when the hourly limit changes
amount = bridgeDetails.hourlyLimit > hourlyUsage ? bridgeDetails.hourlyLimit - hourlyUsage : 0;
}
usage[bridgeToken][hour] = hourlyUsage + amount;
IERC20(bridgeToken).safeTransferFrom(msg.sender, address(this), amount);
uint256 canonicalOut = amount;
// Computing fees
if (isFeeExempt[msg.sender] == 0) {
canonicalOut -= (canonicalOut * bridgeDetails.fee) / BASE_PARAMS;
}
_mint(to, canonicalOut);
return canonicalOut;
}
/// @notice Burns the canonical token in exchange for a bridge token
/// @param bridgeToken Bridge token required
/// @param amount Amount of canonical tokens to burn
/// @param to Address to which the bridge token should be sent
/// @return Amount of bridge tokens actually sent back
/// @dev Some fees may be taken by the protocol depending on the token used and on the address calling
function swapOut(address bridgeToken, uint256 amount, address to) external returns (uint256) {
BridgeDetails memory bridgeDetails = bridges[bridgeToken];
if (!bridgeDetails.allowed || bridgeDetails.paused) revert InvalidToken();
uint256 hour = block.timestamp / 3600;
uint256 hourlyUsage = chainTotalUsage[hour] + amount;
// If the amount being swapped out exceeds the limit, we revert
// We don't want to change the amount being swapped out.
// The user can decide to send another tx with the correct amount to reach the limit
if (hourlyUsage > chainTotalHourlyLimit) revert HourlyLimitExceeded();
chainTotalUsage[hour] = hourlyUsage;
_burn(msg.sender, amount);
uint256 bridgeOut = amount;
if (isFeeExempt[msg.sender] == 0) {
bridgeOut -= (bridgeOut * bridgeDetails.fee) / BASE_PARAMS;
}
IERC20(bridgeToken).safeTransfer(to, bridgeOut);
return bridgeOut;
}
// ============================ GOVERNANCE FUNCTIONS ===========================
/// @notice Adds support for a bridge token
/// @param bridgeToken Bridge token to add: it should be a version of the stablecoin from another bridge
/// @param limit Limit on the balance of bridge token this contract could hold
/// @param hourlyLimit Limit on the hourly volume for this bridge
/// @param paused Whether swapping for this token should be paused or not
/// @param fee Fee taken upon swapping for or against this token
function addBridgeToken(
address bridgeToken,
uint256 limit,
uint256 hourlyLimit,
uint64 fee,
bool paused
) external onlyGovernor {
if (bridges[bridgeToken].allowed || bridgeToken == address(0)) revert InvalidToken();
if (fee > BASE_PARAMS) revert TooHighParameterValue();
BridgeDetails memory _bridge;
_bridge.limit = limit;
_bridge.hourlyLimit = hourlyLimit;
_bridge.paused = paused;
_bridge.fee = fee;
_bridge.allowed = true;
bridges[bridgeToken] = _bridge;
bridgeTokensList.push(bridgeToken);
emit BridgeTokenAdded(bridgeToken, limit, hourlyLimit, fee, paused);
}
/// @notice Removes support for a token
/// @param bridgeToken Address of the bridge token to remove support for
function removeBridgeToken(address bridgeToken) external onlyGovernor {
if (IERC20(bridgeToken).balanceOf(address(this)) != 0) revert AssetStillControlledInReserves();
delete bridges[bridgeToken];
// Deletion from `bridgeTokensList` loop
uint256 bridgeTokensListLength = bridgeTokensList.length;
for (uint256 i; i < bridgeTokensListLength - 1; ++i) {
if (bridgeTokensList[i] == bridgeToken) {
// Replace the `bridgeToken` to remove with the last of the list
bridgeTokensList[i] = bridgeTokensList[bridgeTokensListLength - 1];
break;
}
}
// Remove last element in array
bridgeTokensList.pop();
emit BridgeTokenRemoved(bridgeToken);
}
/// @notice Recovers any ERC20 token
/// @dev Can be used to withdraw bridge tokens for them to be de-bridged on mainnet
function recoverERC20(address tokenAddress, address to, uint256 amountToRecover) external onlyGovernor {
IERC20(tokenAddress).safeTransfer(to, amountToRecover);
emit Recovered(tokenAddress, to, amountToRecover);
}
/// @notice Updates the `limit` amount for `bridgeToken`
function setLimit(address bridgeToken, uint256 limit) external onlyGovernorOrGuardian {
if (!bridges[bridgeToken].allowed) revert InvalidToken();
bridges[bridgeToken].limit = limit;
emit BridgeTokenLimitUpdated(bridgeToken, limit);
}
/// @notice Updates the `hourlyLimit` amount for `bridgeToken`
function setHourlyLimit(address bridgeToken, uint256 hourlyLimit) external onlyGovernorOrGuardian {
if (!bridges[bridgeToken].allowed) revert InvalidToken();
bridges[bridgeToken].hourlyLimit = hourlyLimit;
emit BridgeTokenHourlyLimitUpdated(bridgeToken, hourlyLimit);
}
/// @notice Updates the `chainTotalHourlyLimit` amount
function setChainTotalHourlyLimit(uint256 hourlyLimit) external onlyGovernorOrGuardian {
chainTotalHourlyLimit = hourlyLimit;
emit HourlyLimitUpdated(hourlyLimit);
}
/// @notice Updates the `fee` value for `bridgeToken`
function setSwapFee(address bridgeToken, uint64 fee) external onlyGovernorOrGuardian {
if (!bridges[bridgeToken].allowed) revert InvalidToken();
if (fee > BASE_PARAMS) revert TooHighParameterValue();
bridges[bridgeToken].fee = fee;
emit BridgeTokenFeeUpdated(bridgeToken, fee);
}
/// @notice Pauses or unpauses swapping in and out for a token
function toggleBridge(address bridgeToken) external onlyGovernorOrGuardian {
if (!bridges[bridgeToken].allowed) revert InvalidToken();
bool pausedStatus = bridges[bridgeToken].paused;
bridges[bridgeToken].paused = !pausedStatus;
emit BridgeTokenToggled(bridgeToken, !pausedStatus);
}
/// @notice Toggles fees for the address `theAddress`
function toggleFeesForAddress(address theAddress) external onlyGovernorOrGuardian {
uint256 feeExemptStatus = 1 - isFeeExempt[theAddress];
isFeeExempt[theAddress] = feeExemptStatus;
emit FeeToggled(theAddress, feeExemptStatus);
}
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;
import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol";
/// @title IAgToken
/// @author Angle Labs, Inc.
/// @notice Interface for the stablecoins `AgToken` contracts
/// @dev This interface only contains functions of the `AgToken` contract which are called by other contracts
/// of this module or of the first module of the Angle Protocol
interface IAgToken is IERC20Upgradeable {
// ======================= Minter Role Only Functions ===========================
/// @notice Lets the `StableMaster` contract or another whitelisted contract mint agTokens
/// @param account Address to mint to
/// @param amount Amount to mint
/// @dev The contracts allowed to issue agTokens are the `StableMaster` contract, `VaultManager` contracts
/// associated to this stablecoin as well as the flash loan module (if activated) and potentially contracts
/// whitelisted by governance
function mint(address account, uint256 amount) external;
/// @notice Burns `amount` tokens from a `burner` address after being asked to by `sender`
/// @param amount Amount of tokens to burn
/// @param burner Address to burn from
/// @param sender Address which requested the burn from `burner`
/// @dev This method is to be called by a contract with the minter right after being requested
/// to do so by a `sender` address willing to burn tokens from another `burner` address
/// @dev The method checks the allowance between the `sender` and the `burner`
function burnFrom(uint256 amount, address burner, address sender) external;
/// @notice Burns `amount` tokens from a `burner` address
/// @param amount Amount of tokens to burn
/// @param burner Address to burn from
/// @dev This method is to be called by a contract with a minter right on the AgToken after being
/// requested to do so by an address willing to burn tokens from its address
function burnSelf(uint256 amount, address burner) external;
// ========================= Treasury Only Functions ===========================
/// @notice Adds a minter in the contract
/// @param minter Minter address to add
/// @dev Zero address checks are performed directly in the `Treasury` contract
function addMinter(address minter) external;
/// @notice Removes a minter from the contract
/// @param minter Minter address to remove
/// @dev This function can also be called by a minter wishing to revoke itself
function removeMinter(address minter) external;
/// @notice Sets a new treasury contract
/// @param _treasury New treasury address
function setTreasury(address _treasury) external;
// ========================= External functions ================================
/// @notice Checks whether an address has the right to mint agTokens
/// @param minter Address for which the minting right should be checked
/// @return Whether the address has the right to mint agTokens or not
function isMinter(address minter) external view returns (bool);
/// @notice Get the associated treasury
function treasury() external view returns (address);
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;
/// @title ICoreBorrow
/// @author Angle Labs, Inc.
/// @notice Interface for the `CoreBorrow` contract
/// @dev This interface only contains functions of the `CoreBorrow` contract which are called by other contracts
/// of this module
interface ICoreBorrow {
/// @notice Checks if an address corresponds to a treasury of a stablecoin with a flash loan
/// module initialized on it
/// @param treasury Address to check
/// @return Whether the address has the `FLASHLOANER_TREASURY_ROLE` or not
function isFlashLoanerTreasury(address treasury) external view returns (bool);
/// @notice Checks whether an address is governor of the Angle Protocol or not
/// @param admin Address to check
/// @return Whether the address has the `GOVERNOR_ROLE` or not
function isGovernor(address admin) external view returns (bool);
/// @notice Checks whether an address is governor or a guardian of the Angle Protocol or not
/// @param admin Address to check
/// @return Whether the address has the `GUARDIAN_ROLE` or not
/// @dev Governance should make sure when adding a governor to also give this governor the guardian
/// role by calling the `addGovernor` function
function isGovernorOrGuardian(address admin) external view returns (bool);
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;
import "./IAgToken.sol";
import "./ICoreBorrow.sol";
/// @title IFlashAngle
/// @author Angle Labs, Inc.
/// @notice Interface for the `FlashAngle` contract
/// @dev This interface only contains functions of the contract which are called by other contracts
/// of this module
interface IFlashAngle {
/// @notice Reference to the `CoreBorrow` contract managing the FlashLoan module
function core() external view returns (ICoreBorrow);
/// @notice Sends the fees taken from flash loans to the treasury contract associated to the stablecoin
/// @param stablecoin Stablecoin from which profits should be sent
/// @return balance Amount of profits sent
/// @dev This function can only be called by the treasury contract
function accrueInterestToTreasury(IAgToken stablecoin) external returns (uint256 balance);
/// @notice Adds support for a stablecoin
/// @param _treasury Treasury associated to the stablecoin to add support for
/// @dev This function can only be called by the `CoreBorrow` contract
function addStablecoinSupport(address _treasury) external;
/// @notice Removes support for a stablecoin
/// @param _treasury Treasury associated to the stablecoin to remove support for
/// @dev This function can only be called by the `CoreBorrow` contract
function removeStablecoinSupport(address _treasury) external;
/// @notice Sets a new core contract
/// @param _core Core contract address to set
/// @dev This function can only be called by the `CoreBorrow` contract
function setCore(address _core) external;
}// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.12;
import "./IAgToken.sol";
import "./ICoreBorrow.sol";
import "./IFlashAngle.sol";
/// @title ITreasury
/// @author Angle Labs, Inc.
/// @notice Interface for the `Treasury` contract
/// @dev This interface only contains functions of the `Treasury` which are called by other contracts
/// of this module
interface ITreasury {
/// @notice Stablecoin handled by this `treasury` contract
function stablecoin() external view returns (IAgToken);
/// @notice Checks whether a given address has the governor role
/// @param admin Address to check
/// @return Whether the address has the governor role
/// @dev Access control is only kept in the `CoreBorrow` contract
function isGovernor(address admin) external view returns (bool);
/// @notice Checks whether a given address has the guardian or the governor role
/// @param admin Address to check
/// @return Whether the address has the guardian or the governor role
/// @dev Access control is only kept in the `CoreBorrow` contract which means that this function
/// queries the `CoreBorrow` contract
function isGovernorOrGuardian(address admin) external view returns (bool);
/// @notice Checks whether a given address has well been initialized in this contract
/// as a `VaultManager`
/// @param _vaultManager Address to check
/// @return Whether the address has been initialized or not
function isVaultManager(address _vaultManager) external view returns (bool);
/// @notice Sets a new flash loan module for this stablecoin
/// @param _flashLoanModule Reference to the new flash loan module
/// @dev This function removes the minting right to the old flash loan module and grants
/// it to the new module
function setFlashLoanModule(address _flashLoanModule) external;
/// @notice Gets the vault manager list
function vaultManagerList(uint256 i) external returns (address);
}{
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs",
"useLiteralContent": true
},
"optimizer": {
"enabled": true,
"runs": 1000000
},
"remappings": [],
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"name":"AssetStillControlledInReserves","type":"error"},{"inputs":[],"name":"BurnAmountExceedsAllowance","type":"error"},{"inputs":[],"name":"HourlyLimitExceeded","type":"error"},{"inputs":[],"name":"InvalidSender","type":"error"},{"inputs":[],"name":"InvalidToken","type":"error"},{"inputs":[],"name":"InvalidTreasury","type":"error"},{"inputs":[],"name":"NotGovernor","type":"error"},{"inputs":[],"name":"NotGovernorOrGuardian","type":"error"},{"inputs":[],"name":"NotMinter","type":"error"},{"inputs":[],"name":"NotTreasury","type":"error"},{"inputs":[],"name":"TooBigAmount","type":"error"},{"inputs":[],"name":"TooHighParameterValue","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bridgeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"limit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"hourlyLimit","type":"uint256"},{"indexed":false,"internalType":"uint64","name":"fee","type":"uint64"},{"indexed":false,"internalType":"bool","name":"paused","type":"bool"}],"name":"BridgeTokenAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bridgeToken","type":"address"},{"indexed":false,"internalType":"uint64","name":"fee","type":"uint64"}],"name":"BridgeTokenFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bridgeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"hourlyLimit","type":"uint256"}],"name":"BridgeTokenHourlyLimitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bridgeToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"limit","type":"uint256"}],"name":"BridgeTokenLimitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bridgeToken","type":"address"}],"name":"BridgeTokenRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"bridgeToken","type":"address"},{"indexed":false,"internalType":"bool","name":"toggleStatus","type":"bool"}],"name":"BridgeTokenToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"theAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"toggleStatus","type":"uint256"}],"name":"FeeToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"hourlyLimit","type":"uint256"}],"name":"HourlyLimitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"minter","type":"address"}],"name":"MinterToggled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Recovered","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"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_treasury","type":"address"}],"name":"TreasuryUpdated","type":"event"},{"inputs":[],"name":"BASE_PARAMS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"bridgeToken","type":"address"},{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint256","name":"hourlyLimit","type":"uint256"},{"internalType":"uint64","name":"fee","type":"uint64"},{"internalType":"bool","name":"paused","type":"bool"}],"name":"addBridgeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"addMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"allBridgeTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"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":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"bridgeTokensList","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"bridges","outputs":[{"internalType":"uint256","name":"limit","type":"uint256"},{"internalType":"uint256","name":"hourlyLimit","type":"uint256"},{"internalType":"uint64","name":"fee","type":"uint64"},{"internalType":"bool","name":"allowed","type":"bool"},{"internalType":"bool","name":"paused","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"burner","type":"address"},{"internalType":"address","name":"sender","type":"address"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"burner","type":"address"}],"name":"burnSelf","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnStablecoin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"chainTotalHourlyLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"chainTotalUsage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"currentTotalUsage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"bridgeToken","type":"address"}],"name":"currentUsage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"name_","type":"string"},{"internalType":"string","name":"symbol_","type":"string"},{"internalType":"address","name":"_treasury","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isFeeExempt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"isMinter","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amountToRecover","type":"uint256"}],"name":"recoverERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bridgeToken","type":"address"}],"name":"removeBridgeToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"minter","type":"address"}],"name":"removeMinter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"hourlyLimit","type":"uint256"}],"name":"setChainTotalHourlyLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bridgeToken","type":"address"},{"internalType":"uint256","name":"hourlyLimit","type":"uint256"}],"name":"setHourlyLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bridgeToken","type":"address"},{"internalType":"uint256","name":"limit","type":"uint256"}],"name":"setLimit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newName","type":"string"},{"internalType":"string","name":"newSymbol","type":"string"}],"name":"setNameAndSymbol","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bridgeToken","type":"address"},{"internalType":"uint64","name":"fee","type":"uint64"}],"name":"setSwapFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_treasury","type":"address"}],"name":"setTreasury","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bridgeToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"swapIn","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"bridgeToken","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"name":"swapOut","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"bridgeToken","type":"address"}],"name":"toggleBridge","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"theAddress","type":"address"}],"name":"toggleFeesForAddress","outputs":[],"stateMutability":"nonpayable","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"},{"inputs":[],"name":"treasury","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"usage","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b50600054610100900460ff1615808015620000335750600054600160ff909116105b8062000063575062000050306200013d60201b6200283d1760201c565b15801562000063575060005460ff166001145b620000cb5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805460ff191660011790558015620000ef576000805461ff0019166101001790555b801562000136576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b506200014c565b6001600160a01b03163b151590565b614837806200015c6000396000f3fe608060405234801561001057600080fd5b506004361061030a5760003560e01c806361d027b31161019c5780639f48118f116100ee578063ced67f0c11610097578063dd62ed3e11610071578063dd62ed3e14610742578063e3e2865514610788578063f0f442601461079b57600080fd5b8063ced67f0c14610689578063d44ad63f1461071c578063d505accf1461072f57600080fd5b8063aa271e1a116100c8578063aa271e1a1461063e578063ba330bd714610661578063cd4839ca1461067457600080fd5b80639f48118f1461060d578063a457c2d714610618578063a9059cbb1461062b57600080fd5b80637ecebe001161015057806395d89b411161012a57806395d89b41146105df578063983b2d56146105e75780639e4e0dae146105fa57600080fd5b80637ecebe001461058e5780638933fb79146105a157806390218cff146105cc57600080fd5b80637334d020116101815780637334d020146105605780637d4c9c2d146105735780637d74e25f1461058657600080fd5b806361d027b3146104e557806370a082311461052a57600080fd5b80633092afd5116102605780633a55f89d116102095780634dc32fcc116101e35780634dc32fcc1461049f5780635a446215146104b25780635bfbec96146104c557600080fd5b80633a55f89d146104595780633f4218e01461046c57806340c10f191461048c57600080fd5b80633644e5151161023a5780633644e5151461042b57806336db43b514610433578063395093511461044657600080fd5b80633092afd5146103f6578063313ce56714610409578063350ebe041461041857600080fd5b8063151dd755116102c257806323b872dd1161029c57806323b872dd146103bd5780632b471d8e146103d05780632e403e14146103e357600080fd5b8063151dd7551461038b57806318160ddd146103ac5780632342fb0e146103b457600080fd5b80630919a951116102f35780630919a95114610342578063095ea7b3146103555780631171bda91461037857600080fd5b806306fdde031461030f578063077f224a1461032d575b600080fd5b6103176107ae565b6040516103249190613f4b565b60405180910390f35b61034061033b366004614098565b610841565b005b610340610350366004614110565b610851565b61036861036336600461412d565b6109b4565b6040519015158152602001610324565b610340610386366004614159565b6109ce565b61039e61039936600461419a565b610b23565b604051908152602001610324565b60355461039e565b61039e60d25481565b6103686103cb366004614159565b610ddd565b6103406103de3660046141d1565b610e01565b6103406103f1366004614110565b610e58565b610340610404366004614110565b611207565b60405160128152602001610324565b610340610426366004614201565b6112f0565b61039e6113f9565b61034061044136600461412d565b611408565b61036861045436600461412d565b611598565b610340610467366004614238565b6115df565b61039e61047a366004614110565b60d16020526000908152604090205481565b61034061049a36600461412d565b6116e2565b61039e6104ad366004614110565b611735565b6103406104c0366004614251565b61177d565b61039e6104d3366004614238565b60d36020526000908152604090205481565b60cd546105059073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610324565b61039e610538366004614110565b73ffffffffffffffffffffffffffffffffffffffff1660009081526033602052604090205490565b61034061056e36600461412d565b611860565b6103406105813660046142e0565b6119f3565b61039e611d5b565b61039e61059c366004614110565b611d80565b61039e6105af36600461412d565b60d060209081526000928352604080842090915290825290205481565b6103406105da366004614238565b611dab565b610317611db8565b6103406105f5366004614110565b611dc8565b61034061060836600461433d565b611e90565b61039e633b9aca0081565b61036861062636600461412d565b61209c565b61036861063936600461412d565b612172565b61036861064c366004614110565b60cc6020526000908152604090205460ff1681565b61050561066f366004614238565b612180565b61067c6121b7565b6040516103249190614372565b6106e3610697366004614110565b60ce6020526000908152604090208054600182015460029092015490919067ffffffffffffffff81169060ff680100000000000000008204811691690100000000000000000090041685565b60408051958652602086019490945267ffffffffffffffff9092169284019290925290151560608301521515608082015260a001610324565b61039e61072a36600461419a565b612225565b61034061073d3660046143cc565b6123ea565b61039e610750366004614443565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b610340610796366004614110565b6125a9565b6103406107a9366004614110565b61277d565b606061010080546107be90614471565b80601f01602080910402602001604051908101604052809291908181526020018280546107ea90614471565b80156108375780601f1061080c57610100808354040283529160200191610837565b820191906000526020600020905b81548152906001019060200180831161081a57829003601f168201915b5050505050905090565b61084c838383612859565b505050565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156108bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e391906144be565b610919576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260d1602052604081205461094a90600161450a565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260d160205260409081902083905551919250907f979ef83e7e7a87cb48064e296dd7e997870d50f43acf8d7ad221313526c8ca0f906109a89084815260200190565b60405180910390a25050565b6000336109c2818585612b38565b60019150505b92915050565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015610a3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6091906144be565b610a96576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ab773ffffffffffffffffffffffffffffffffffffffff84168383612ce3565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167ffff3b3844276f57024e0b42afec1a37f75db36511e43819a4f2a63ab7862b64883604051610b1691815260200190565b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260ce60209081526040808320815160a081018352815481526001820154938101939093526002015467ffffffffffffffff81169183019190915260ff680100000000000000008204811615801560608501526901000000000000000000909204161515608083015280610bb3575080608001515b15610bea576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b919061451d565b8251909150610c8a8683614536565b1115610cb2578151811015610cad578151610ca690829061450a565b9450610cb2565b600094505b6000610cc0610e1042614549565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260d0602090815260408083208484528252909120549085015191925090610d038883614536565b1115610d2e5780846020015111610d1b576000610d2b565b808460200151610d2b919061450a565b96505b610d388782614536565b73ffffffffffffffffffffffffffffffffffffffff8916600081815260d060209081526040808320878452909152902091909155610d789033308a612db7565b33600090815260d16020526040812054889103610dc557633b9aca00856040015167ffffffffffffffff1682610dae9190614584565b610db89190614549565b610dc2908261450a565b90505b610dcf8782612e15565b9450505050505b9392505050565b600033610deb858285612f35565b610df6858585613006565b506001949350505050565b33600090815260cc602052604090205460ff16610e4a576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e5481836132b9565b5050565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015610ec6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eea91906144be565b610f20576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8216906370a0823190602401602060405180830381865afa158015610f8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fae919061451d565b15610fe5576040517f2ef630ec00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260ce602052604081208181556001810182905560020180547fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000016905560cf54905b61104d60018361450a565b811015611158578273ffffffffffffffffffffffffffffffffffffffff1660cf828154811061107e5761107e61459b565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16036111485760cf6110b260018461450a565b815481106110c2576110c261459b565b60009182526020909120015460cf805473ffffffffffffffffffffffffffffffffffffffff90921691839081106110fb576110fb61459b565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611158565b611151816145ca565b9050611042565b5060cf80548061116a5761116a614602565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590910190915560405173ffffffffffffffffffffffffffffffffffffffff8416917f5c95b49c4d59d97a2f044167723f29c74b30f99702e3fd406c3830160aa9ccb891a25050565b60cd5473ffffffffffffffffffffffffffffffffffffffff16331480159061124557503373ffffffffffffffffffffffffffffffffffffffff821614155b1561127c576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260cc602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517f98c15241d6c02bc5ee0b780e11b3ea737a2defd9d04877edbe9f9497065bd02f9190a250565b33600090815260cc602052604090205460ff16611339576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146113ef5773ffffffffffffffffffffffffffffffffffffffff828116600090815260346020908152604080832093851683529290522054838110156113d9576040517f715ec26c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113ed83836113e8878561450a565b612b38565b505b61084c82846132b9565b60006114036134a6565b905090565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611476573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149a91906144be565b6114d0576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff1661153e576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602052604090819020839055517fe7b113fba37131b6396680a0c55790a697ec975e198ff8cfd89dac90a6379e61906109a89084815260200190565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906109c290829086906113e8908790614536565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa15801561164d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167191906144be565b6116a7576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60d28190556040518181527fc3b69829afe2345596a02c8b587d41f796ba0094481d899e1b2e07b7532a1e219060200160405180910390a150565b33600090815260cc602052604090205460ff1661172b576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e548282612e15565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260d06020526040812081611767610e1042614549565b8152602001908152602001600020549050919050565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa1580156117eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061180f91906144be565b611845576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610100611852838261467f565b5061010161084c828261467f565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156118ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f291906144be565b611928576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff16611996576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602052604090819020600101839055517fe13ac9338b2ee623233f83c1b3ceab16490fa3e3737fac7f0970d0830a9f4871906109a89084815260200190565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015611a61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8591906144be565b611abb576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516600090815260ce602052604090206002015468010000000000000000900460ff1680611b12575073ffffffffffffffffffffffffffffffffffffffff8516155b15611b49576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b633b9aca008267ffffffffffffffff161115611b91576040517feca1d2c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915284815260208082018581528315156080840190815267ffffffffffffffff808716604080870191825260016060880181815273ffffffffffffffffffffffffffffffffffffffff8e16600081815260ce9099528389208a5181559751888401559351600290970180549151965115156901000000000000000000027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff97151568010000000000000000027fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000909316989096169790971717949094169290921790935560cf805492830181559093527facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf290180547fffffffffffffffffffffffff0000000000000000000000000000000000000000168217905590517f53087ff85d80a7671594bd2e86b92af22e0b3c2c441c8033bba7399b7b5cbe2390611d4b908890889088908890938452602084019290925267ffffffffffffffff1660408301521515606082015260800190565b60405180910390a2505050505050565b600060d381611d6c610e1042614549565b815260200190815260200160002054905090565b73ffffffffffffffffffffffffffffffffffffffff81166000908152609960205260408120546109c8565b611db533826132b9565b50565b606061010180546107be90614471565b60cd5473ffffffffffffffffffffffffffffffffffffffff163314611e19576040517fb90cdbb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260cc602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f98c15241d6c02bc5ee0b780e11b3ea737a2defd9d04877edbe9f9497065bd02f9190a250565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611efe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2291906144be565b611f58576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff16611fc6576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b633b9aca008167ffffffffffffffff16111561200e576040517feca1d2c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602090815260409182902060020180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff861690811790915591519182527f901f9de19b475adc8da4110434b8df940dce085afd05e2281c86807f3a899d2991016109a8565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015612165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610df68286868403612b38565b6000336109c2818585613006565b60cf818154811061219057600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b606060cf80548060200260200160405190810160405280929190818152602001828054801561083757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116121f1575050505050905090565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260ce60209081526040808320815160a081018352815481526001820154938101939093526002015467ffffffffffffffff81169183019190915260ff6801000000000000000082048116158015606085015269010000000000000000009092041615156080830152806122b5575080608001515b156122ec576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006122fa610e1042614549565b600081815260d3602052604081205491925090612318908790614536565b905060d254811115612356576040517f6d43d1ac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260d36020526040902081905561237133876132b9565b33600090815260d160205260408120548791036123be57633b9aca00846040015167ffffffffffffffff16826123a79190614584565b6123b19190614549565b6123bb908261450a565b90505b6123df73ffffffffffffffffffffffffffffffffffffffff89168783612ce3565b979650505050505050565b83421115612454576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015260640161215c565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886124838c613521565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006124eb82613556565b905060006124fb828787876135bf565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612592576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015260640161215c565b61259d8a8a8a612b38565b50505050505050505050565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015612617573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061263b91906144be565b612671576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260ce602052604090206002015468010000000000000000900460ff166126df576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260ce602090815260409182902060020180547fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff811669010000000000000000009182900460ff16801592830291909117909255925192835292917ff7c93079dcbf699749d66345a351afab7d24219bb1d915c9f4fc4cf03f00d39791016109a8565b60cd5473ffffffffffffffffffffffffffffffffffffffff1633146127ce576040517fb90cdbb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60cd80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d190600090a250565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b600054610100900460ff16158080156128795750600054600160ff909116105b806128935750303b158015612893575060005460ff166001145b61291f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161215c565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561297d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1663e9cbd8226040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129df573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a039190614799565b73ffffffffffffffffffffffffffffffffffffffff1614612a50576040517f14bcf5c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a59846135e7565b612a6384846136bd565b60cd80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d190600090a28015612b3257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316612bda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff8216612c7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259101610b16565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261084c9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261375e565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052612b329085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612d35565b73ffffffffffffffffffffffffffffffffffffffff8216612e92576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161215c565b8060356000828254612ea49190614536565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604081208054839290612ede908490614536565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152603460209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114612b325781811015612ff9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161215c565b612b328484848403612b38565b73ffffffffffffffffffffffffffffffffffffffff83166130a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff821661314c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015613202576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260336020526040808220858503905591851681529081208054849290613246908490614536565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516132ac91815260200190565b60405180910390a3612b32565b73ffffffffffffffffffffffffffffffffffffffff821661335c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604090205481811015613412576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260336020526040812083830390556035805484929061344e90849061450a565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60006114037f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6134d560655490565b6066546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526099602052604090208054600181018255905b50919050565b60006109c86135636134a6565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006135d08787878761386a565b915091506135dd81613982565b5095945050505050565b600054610100900460ff1661367e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161215c565b611db5816040518060400160405280600181526020017f3100000000000000000000000000000000000000000000000000000000000000815250613bd6565b600054610100900460ff16613754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161215c565b610e548282613c87565b60006137c0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613d379092919063ffffffff16565b80519091501561084c57808060200190518101906137de91906144be565b61084c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161215c565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156138a15750600090506003613979565b8460ff16601b141580156138b957508460ff16601c14155b156138ca5750600090506004613979565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561391e573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661397257600060019250925050613979565b9150600090505b94509492505050565b6000816004811115613996576139966147b6565b0361399e5750565b60018160048111156139b2576139b26147b6565b03613a19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161215c565b6002816004811115613a2d57613a2d6147b6565b03613a94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161215c565b6003816004811115613aa857613aa86147b6565b03613b35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161215c565b6004816004811115613b4957613b496147b6565b03611db5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161215c565b600054610100900460ff16613c6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161215c565b815160209283012081519190920120606591909155606655565b600054610100900460ff16613d1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161215c565b6036613d2a838261467f565b50603761084c828261467f565b6060613d468484600085613d4e565b949350505050565b606082471015613de0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff85163b613e5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161215c565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613e8791906147e5565b60006040518083038185875af1925050503d8060008114613ec4576040519150601f19603f3d011682016040523d82523d6000602084013e613ec9565b606091505b50915091506123df82828660608315613ee3575081610dd6565b825115613ef35782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215c9190613f4b565b60005b83811015613f42578181015183820152602001613f2a565b50506000910152565b6020815260008251806020840152613f6a816040850160208701613f27565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112613fdc57600080fd5b813567ffffffffffffffff80821115613ff757613ff7613f9c565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561403d5761403d613f9c565b8160405283815286602085880101111561405657600080fd5b836020870160208301376000602085830101528094505050505092915050565b73ffffffffffffffffffffffffffffffffffffffff81168114611db557600080fd5b6000806000606084860312156140ad57600080fd5b833567ffffffffffffffff808211156140c557600080fd5b6140d187838801613fcb565b945060208601359150808211156140e757600080fd5b506140f486828701613fcb565b925050604084013561410581614076565b809150509250925092565b60006020828403121561412257600080fd5b8135610dd681614076565b6000806040838503121561414057600080fd5b823561414b81614076565b946020939093013593505050565b60008060006060848603121561416e57600080fd5b833561417981614076565b9250602084013561418981614076565b929592945050506040919091013590565b6000806000606084860312156141af57600080fd5b83356141ba81614076565b925060208401359150604084013561410581614076565b600080604083850312156141e457600080fd5b8235915060208301356141f681614076565b809150509250929050565b60008060006060848603121561421657600080fd5b83359250602084013561422881614076565b9150604084013561410581614076565b60006020828403121561424a57600080fd5b5035919050565b6000806040838503121561426457600080fd5b823567ffffffffffffffff8082111561427c57600080fd5b61428886838701613fcb565b9350602085013591508082111561429e57600080fd5b506142ab85828601613fcb565b9150509250929050565b803567ffffffffffffffff811681146142cd57600080fd5b919050565b8015158114611db557600080fd5b600080600080600060a086880312156142f857600080fd5b853561430381614076565b9450602086013593506040860135925061431f606087016142b5565b9150608086013561432f816142d2565b809150509295509295909350565b6000806040838503121561435057600080fd5b823561435b81614076565b9150614369602084016142b5565b90509250929050565b6020808252825182820181905260009190848201906040850190845b818110156143c057835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161438e565b50909695505050505050565b600080600080600080600060e0888a0312156143e757600080fd5b87356143f281614076565b9650602088013561440281614076565b95506040880135945060608801359350608088013560ff8116811461442657600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561445657600080fd5b823561446181614076565b915060208301356141f681614076565b600181811c9082168061448557607f821691505b602082108103613550577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000602082840312156144d057600080fd5b8151610dd6816142d2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156109c8576109c86144db565b60006020828403121561452f57600080fd5b5051919050565b808201808211156109c8576109c86144db565b60008261457f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b80820281158282048414176109c8576109c86144db565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036145fb576145fb6144db565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b601f82111561084c57600081815260208120601f850160051c810160208610156146585750805b601f850160051c820191505b8181101561467757828155600101614664565b505050505050565b815167ffffffffffffffff81111561469957614699613f9c565b6146ad816146a78454614471565b84614631565b602080601f83116001811461470057600084156146ca5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555614677565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561474d5788860151825594840194600190910190840161472e565b508582101561478957878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156147ab57600080fd5b8151610dd681614076565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600082516147f7818460208701613f27565b919091019291505056fea264697066735822122025207107911e66a77d8c95629245083ef3e18fe6e1762c95b27b6a8aea6c52d764736f6c63430008110033
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061030a5760003560e01c806361d027b31161019c5780639f48118f116100ee578063ced67f0c11610097578063dd62ed3e11610071578063dd62ed3e14610742578063e3e2865514610788578063f0f442601461079b57600080fd5b8063ced67f0c14610689578063d44ad63f1461071c578063d505accf1461072f57600080fd5b8063aa271e1a116100c8578063aa271e1a1461063e578063ba330bd714610661578063cd4839ca1461067457600080fd5b80639f48118f1461060d578063a457c2d714610618578063a9059cbb1461062b57600080fd5b80637ecebe001161015057806395d89b411161012a57806395d89b41146105df578063983b2d56146105e75780639e4e0dae146105fa57600080fd5b80637ecebe001461058e5780638933fb79146105a157806390218cff146105cc57600080fd5b80637334d020116101815780637334d020146105605780637d4c9c2d146105735780637d74e25f1461058657600080fd5b806361d027b3146104e557806370a082311461052a57600080fd5b80633092afd5116102605780633a55f89d116102095780634dc32fcc116101e35780634dc32fcc1461049f5780635a446215146104b25780635bfbec96146104c557600080fd5b80633a55f89d146104595780633f4218e01461046c57806340c10f191461048c57600080fd5b80633644e5151161023a5780633644e5151461042b57806336db43b514610433578063395093511461044657600080fd5b80633092afd5146103f6578063313ce56714610409578063350ebe041461041857600080fd5b8063151dd755116102c257806323b872dd1161029c57806323b872dd146103bd5780632b471d8e146103d05780632e403e14146103e357600080fd5b8063151dd7551461038b57806318160ddd146103ac5780632342fb0e146103b457600080fd5b80630919a951116102f35780630919a95114610342578063095ea7b3146103555780631171bda91461037857600080fd5b806306fdde031461030f578063077f224a1461032d575b600080fd5b6103176107ae565b6040516103249190613f4b565b60405180910390f35b61034061033b366004614098565b610841565b005b610340610350366004614110565b610851565b61036861036336600461412d565b6109b4565b6040519015158152602001610324565b610340610386366004614159565b6109ce565b61039e61039936600461419a565b610b23565b604051908152602001610324565b60355461039e565b61039e60d25481565b6103686103cb366004614159565b610ddd565b6103406103de3660046141d1565b610e01565b6103406103f1366004614110565b610e58565b610340610404366004614110565b611207565b60405160128152602001610324565b610340610426366004614201565b6112f0565b61039e6113f9565b61034061044136600461412d565b611408565b61036861045436600461412d565b611598565b610340610467366004614238565b6115df565b61039e61047a366004614110565b60d16020526000908152604090205481565b61034061049a36600461412d565b6116e2565b61039e6104ad366004614110565b611735565b6103406104c0366004614251565b61177d565b61039e6104d3366004614238565b60d36020526000908152604090205481565b60cd546105059073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610324565b61039e610538366004614110565b73ffffffffffffffffffffffffffffffffffffffff1660009081526033602052604090205490565b61034061056e36600461412d565b611860565b6103406105813660046142e0565b6119f3565b61039e611d5b565b61039e61059c366004614110565b611d80565b61039e6105af36600461412d565b60d060209081526000928352604080842090915290825290205481565b6103406105da366004614238565b611dab565b610317611db8565b6103406105f5366004614110565b611dc8565b61034061060836600461433d565b611e90565b61039e633b9aca0081565b61036861062636600461412d565b61209c565b61036861063936600461412d565b612172565b61036861064c366004614110565b60cc6020526000908152604090205460ff1681565b61050561066f366004614238565b612180565b61067c6121b7565b6040516103249190614372565b6106e3610697366004614110565b60ce6020526000908152604090208054600182015460029092015490919067ffffffffffffffff81169060ff680100000000000000008204811691690100000000000000000090041685565b60408051958652602086019490945267ffffffffffffffff9092169284019290925290151560608301521515608082015260a001610324565b61039e61072a36600461419a565b612225565b61034061073d3660046143cc565b6123ea565b61039e610750366004614443565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b610340610796366004614110565b6125a9565b6103406107a9366004614110565b61277d565b606061010080546107be90614471565b80601f01602080910402602001604051908101604052809291908181526020018280546107ea90614471565b80156108375780601f1061080c57610100808354040283529160200191610837565b820191906000526020600020905b81548152906001019060200180831161081a57829003601f168201915b5050505050905090565b61084c838383612859565b505050565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156108bf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e391906144be565b610919576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260d1602052604081205461094a90600161450a565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260d160205260409081902083905551919250907f979ef83e7e7a87cb48064e296dd7e997870d50f43acf8d7ad221313526c8ca0f906109a89084815260200190565b60405180910390a25050565b6000336109c2818585612b38565b60019150505b92915050565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015610a3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6091906144be565b610a96576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ab773ffffffffffffffffffffffffffffffffffffffff84168383612ce3565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167ffff3b3844276f57024e0b42afec1a37f75db36511e43819a4f2a63ab7862b64883604051610b1691815260200190565b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260ce60209081526040808320815160a081018352815481526001820154938101939093526002015467ffffffffffffffff81169183019190915260ff680100000000000000008204811615801560608501526901000000000000000000909204161515608083015280610bb3575080608001515b15610bea576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b919061451d565b8251909150610c8a8683614536565b1115610cb2578151811015610cad578151610ca690829061450a565b9450610cb2565b600094505b6000610cc0610e1042614549565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260d0602090815260408083208484528252909120549085015191925090610d038883614536565b1115610d2e5780846020015111610d1b576000610d2b565b808460200151610d2b919061450a565b96505b610d388782614536565b73ffffffffffffffffffffffffffffffffffffffff8916600081815260d060209081526040808320878452909152902091909155610d789033308a612db7565b33600090815260d16020526040812054889103610dc557633b9aca00856040015167ffffffffffffffff1682610dae9190614584565b610db89190614549565b610dc2908261450a565b90505b610dcf8782612e15565b9450505050505b9392505050565b600033610deb858285612f35565b610df6858585613006565b506001949350505050565b33600090815260cc602052604090205460ff16610e4a576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e5481836132b9565b5050565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015610ec6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eea91906144be565b610f20576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8216906370a0823190602401602060405180830381865afa158015610f8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fae919061451d565b15610fe5576040517f2ef630ec00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260ce602052604081208181556001810182905560020180547fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000016905560cf54905b61104d60018361450a565b811015611158578273ffffffffffffffffffffffffffffffffffffffff1660cf828154811061107e5761107e61459b565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16036111485760cf6110b260018461450a565b815481106110c2576110c261459b565b60009182526020909120015460cf805473ffffffffffffffffffffffffffffffffffffffff90921691839081106110fb576110fb61459b565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611158565b611151816145ca565b9050611042565b5060cf80548061116a5761116a614602565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590910190915560405173ffffffffffffffffffffffffffffffffffffffff8416917f5c95b49c4d59d97a2f044167723f29c74b30f99702e3fd406c3830160aa9ccb891a25050565b60cd5473ffffffffffffffffffffffffffffffffffffffff16331480159061124557503373ffffffffffffffffffffffffffffffffffffffff821614155b1561127c576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260cc602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517f98c15241d6c02bc5ee0b780e11b3ea737a2defd9d04877edbe9f9497065bd02f9190a250565b33600090815260cc602052604090205460ff16611339576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146113ef5773ffffffffffffffffffffffffffffffffffffffff828116600090815260346020908152604080832093851683529290522054838110156113d9576040517f715ec26c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6113ed83836113e8878561450a565b612b38565b505b61084c82846132b9565b60006114036134a6565b905090565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611476573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061149a91906144be565b6114d0576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff1661153e576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602052604090819020839055517fe7b113fba37131b6396680a0c55790a697ec975e198ff8cfd89dac90a6379e61906109a89084815260200190565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff871684529091528120549091906109c290829086906113e8908790614536565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa15801561164d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061167191906144be565b6116a7576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60d28190556040518181527fc3b69829afe2345596a02c8b587d41f796ba0094481d899e1b2e07b7532a1e219060200160405180910390a150565b33600090815260cc602052604090205460ff1661172b576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610e548282612e15565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260d06020526040812081611767610e1042614549565b8152602001908152602001600020549050919050565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa1580156117eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061180f91906144be565b611845576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610100611852838261467f565b5061010161084c828261467f565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156118ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f291906144be565b611928576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff16611996576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602052604090819020600101839055517fe13ac9338b2ee623233f83c1b3ceab16490fa3e3737fac7f0970d0830a9f4871906109a89084815260200190565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015611a61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a8591906144be565b611abb576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516600090815260ce602052604090206002015468010000000000000000900460ff1680611b12575073ffffffffffffffffffffffffffffffffffffffff8516155b15611b49576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b633b9aca008267ffffffffffffffff161115611b91576040517feca1d2c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915284815260208082018581528315156080840190815267ffffffffffffffff808716604080870191825260016060880181815273ffffffffffffffffffffffffffffffffffffffff8e16600081815260ce9099528389208a5181559751888401559351600290970180549151965115156901000000000000000000027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff97151568010000000000000000027fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000909316989096169790971717949094169290921790935560cf805492830181559093527facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf290180547fffffffffffffffffffffffff0000000000000000000000000000000000000000168217905590517f53087ff85d80a7671594bd2e86b92af22e0b3c2c441c8033bba7399b7b5cbe2390611d4b908890889088908890938452602084019290925267ffffffffffffffff1660408301521515606082015260800190565b60405180910390a2505050505050565b600060d381611d6c610e1042614549565b815260200190815260200160002054905090565b73ffffffffffffffffffffffffffffffffffffffff81166000908152609960205260408120546109c8565b611db533826132b9565b50565b606061010180546107be90614471565b60cd5473ffffffffffffffffffffffffffffffffffffffff163314611e19576040517fb90cdbb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260cc602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f98c15241d6c02bc5ee0b780e11b3ea737a2defd9d04877edbe9f9497065bd02f9190a250565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611efe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2291906144be565b611f58576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff16611fc6576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b633b9aca008167ffffffffffffffff16111561200e576040517feca1d2c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602090815260409182902060020180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff861690811790915591519182527f901f9de19b475adc8da4110434b8df940dce085afd05e2281c86807f3a899d2991016109a8565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490919083811015612165576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610df68286868403612b38565b6000336109c2818585613006565b60cf818154811061219057600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b606060cf80548060200260200160405190810160405280929190818152602001828054801561083757602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff1681526001909101906020018083116121f1575050505050905090565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260ce60209081526040808320815160a081018352815481526001820154938101939093526002015467ffffffffffffffff81169183019190915260ff6801000000000000000082048116158015606085015269010000000000000000009092041615156080830152806122b5575080608001515b156122ec576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006122fa610e1042614549565b600081815260d3602052604081205491925090612318908790614536565b905060d254811115612356576040517f6d43d1ac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260d36020526040902081905561237133876132b9565b33600090815260d160205260408120548791036123be57633b9aca00846040015167ffffffffffffffff16826123a79190614584565b6123b19190614549565b6123bb908261450a565b90505b6123df73ffffffffffffffffffffffffffffffffffffffff89168783612ce3565b979650505050505050565b83421115612454576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015260640161215c565b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886124838c613521565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e00160405160208183030381529060405280519060200120905060006124eb82613556565b905060006124fb828787876135bf565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612592576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015260640161215c565b61259d8a8a8a612b38565b50505050505050505050565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015612617573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061263b91906144be565b612671576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260ce602052604090206002015468010000000000000000900460ff166126df576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260ce602090815260409182902060020180547fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff811669010000000000000000009182900460ff16801592830291909117909255925192835292917ff7c93079dcbf699749d66345a351afab7d24219bb1d915c9f4fc4cf03f00d39791016109a8565b60cd5473ffffffffffffffffffffffffffffffffffffffff1633146127ce576040517fb90cdbb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60cd80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d190600090a250565b73ffffffffffffffffffffffffffffffffffffffff163b151590565b600054610100900460ff16158080156128795750600054600160ff909116105b806128935750303b158015612893575060005460ff166001145b61291f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a6564000000000000000000000000000000000000606482015260840161215c565b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055801561297d57600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff166101001790555b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1663e9cbd8226040518163ffffffff1660e01b8152600401602060405180830381865afa1580156129df573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a039190614799565b73ffffffffffffffffffffffffffffffffffffffff1614612a50576040517f14bcf5c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b612a59846135e7565b612a6384846136bd565b60cd80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d190600090a28015612b3257600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316612bda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff8216612c7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259101610b16565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261084c9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff000000000000000000000000000000000000000000000000000000009093169290921790915261375e565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052612b329085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612d35565b73ffffffffffffffffffffffffffffffffffffffff8216612e92576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161215c565b8060356000828254612ea49190614536565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604081208054839290612ede908490614536565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8381166000908152603460209081526040808320938616835292905220547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114612b325781811015612ff9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161215c565b612b328484848403612b38565b73ffffffffffffffffffffffffffffffffffffffff83166130a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f6472657373000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff821661314c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f6573730000000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015613202576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260336020526040808220858503905591851681529081208054849290613246908490614536565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516132ac91815260200190565b60405180910390a3612b32565b73ffffffffffffffffffffffffffffffffffffffff821661335c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604090205481811015613412576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260336020526040812083830390556035805484929061344e90849061450a565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b60006114037f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6134d560655490565b6066546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526099602052604090208054600181018255905b50919050565b60006109c86135636134a6565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006135d08787878761386a565b915091506135dd81613982565b5095945050505050565b600054610100900460ff1661367e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161215c565b611db5816040518060400160405280600181526020017f3100000000000000000000000000000000000000000000000000000000000000815250613bd6565b600054610100900460ff16613754576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161215c565b610e548282613c87565b60006137c0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613d379092919063ffffffff16565b80519091501561084c57808060200190518101906137de91906144be565b61084c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f74207375636365656400000000000000000000000000000000000000000000606482015260840161215c565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156138a15750600090506003613979565b8460ff16601b141580156138b957508460ff16601c14155b156138ca5750600090506004613979565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa15801561391e573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661397257600060019250925050613979565b9150600090505b94509492505050565b6000816004811115613996576139966147b6565b0361399e5750565b60018160048111156139b2576139b26147b6565b03613a19576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161215c565b6002816004811115613a2d57613a2d6147b6565b03613a94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161215c565b6003816004811115613aa857613aa86147b6565b03613b35576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161215c565b6004816004811115613b4957613b496147b6565b03611db5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f7565000000000000000000000000000000000000000000000000000000000000606482015260840161215c565b600054610100900460ff16613c6d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161215c565b815160209283012081519190920120606591909155606655565b600054610100900460ff16613d1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e67000000000000000000000000000000000000000000606482015260840161215c565b6036613d2a838261467f565b50603761084c828261467f565b6060613d468484600085613d4e565b949350505050565b606082471015613de0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c0000000000000000000000000000000000000000000000000000606482015260840161215c565b73ffffffffffffffffffffffffffffffffffffffff85163b613e5e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161215c565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613e8791906147e5565b60006040518083038185875af1925050503d8060008114613ec4576040519150601f19603f3d011682016040523d82523d6000602084013e613ec9565b606091505b50915091506123df82828660608315613ee3575081610dd6565b825115613ef35782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215c9190613f4b565b60005b83811015613f42578181015183820152602001613f2a565b50506000910152565b6020815260008251806020840152613f6a816040850160208701613f27565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112613fdc57600080fd5b813567ffffffffffffffff80821115613ff757613ff7613f9c565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561403d5761403d613f9c565b8160405283815286602085880101111561405657600080fd5b836020870160208301376000602085830101528094505050505092915050565b73ffffffffffffffffffffffffffffffffffffffff81168114611db557600080fd5b6000806000606084860312156140ad57600080fd5b833567ffffffffffffffff808211156140c557600080fd5b6140d187838801613fcb565b945060208601359150808211156140e757600080fd5b506140f486828701613fcb565b925050604084013561410581614076565b809150509250925092565b60006020828403121561412257600080fd5b8135610dd681614076565b6000806040838503121561414057600080fd5b823561414b81614076565b946020939093013593505050565b60008060006060848603121561416e57600080fd5b833561417981614076565b9250602084013561418981614076565b929592945050506040919091013590565b6000806000606084860312156141af57600080fd5b83356141ba81614076565b925060208401359150604084013561410581614076565b600080604083850312156141e457600080fd5b8235915060208301356141f681614076565b809150509250929050565b60008060006060848603121561421657600080fd5b83359250602084013561422881614076565b9150604084013561410581614076565b60006020828403121561424a57600080fd5b5035919050565b6000806040838503121561426457600080fd5b823567ffffffffffffffff8082111561427c57600080fd5b61428886838701613fcb565b9350602085013591508082111561429e57600080fd5b506142ab85828601613fcb565b9150509250929050565b803567ffffffffffffffff811681146142cd57600080fd5b919050565b8015158114611db557600080fd5b600080600080600060a086880312156142f857600080fd5b853561430381614076565b9450602086013593506040860135925061431f606087016142b5565b9150608086013561432f816142d2565b809150509295509295909350565b6000806040838503121561435057600080fd5b823561435b81614076565b9150614369602084016142b5565b90509250929050565b6020808252825182820181905260009190848201906040850190845b818110156143c057835173ffffffffffffffffffffffffffffffffffffffff168352928401929184019160010161438e565b50909695505050505050565b600080600080600080600060e0888a0312156143e757600080fd5b87356143f281614076565b9650602088013561440281614076565b95506040880135945060608801359350608088013560ff8116811461442657600080fd5b9699959850939692959460a0840135945060c09093013592915050565b6000806040838503121561445657600080fd5b823561446181614076565b915060208301356141f681614076565b600181811c9082168061448557607f821691505b602082108103613550577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000602082840312156144d057600080fd5b8151610dd6816142d2565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b818103818111156109c8576109c86144db565b60006020828403121561452f57600080fd5b5051919050565b808201808211156109c8576109c86144db565b60008261457f577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b80820281158282048414176109c8576109c86144db565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036145fb576145fb6144db565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b601f82111561084c57600081815260208120601f850160051c810160208610156146585750805b601f850160051c820191505b8181101561467757828155600101614664565b505050505050565b815167ffffffffffffffff81111561469957614699613f9c565b6146ad816146a78454614471565b84614631565b602080601f83116001811461470057600084156146ca5750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b178555614677565b6000858152602081207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08616915b8281101561474d5788860151825594840194600190910190840161472e565b508582101561478957878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156147ab57600080fd5b8151610dd681614076565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600082516147f7818460208701613f27565b919091019291505056fea264697066735822122025207107911e66a77d8c95629245083ef3e18fe6e1762c95b27b6a8aea6c52d764736f6c63430008110033
Loading...
Loading
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 35 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.