Overview
AVAX Balance
AVAX Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Name:
AgTokenSideChainMultiBridge
Compiler Version
v0.8.12+commit.f00d7308
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.12; import "./BaseAgTokenSideChain.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /// @title AgTokenSideChainMultiBridge /// @author Angle Core Team /// @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) /// @dev References: /// - FRAX implementation: https://polygonscan.com/address/0x45c32fA6DF82ead1e2EF74d17b76547EDdFaFF89#code /// - QiDAO implementation: https://snowtrace.io/address/0x5c49b268c9841AFF1Cc3B0a418ff5c3442eE3F3b#code contract AgTokenSideChainMultiBridge is BaseAgTokenSideChain { using SafeERC20 for IERC20; /// @notice Base used for fee computation uint256 public constant BASE_PARAMS = 10**9; // =============================== 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; // ================================== 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(); // ============================= Constructor =================================== /// @notice Initializes the `AgToken` contract /// @param name_ Name of the token /// @param symbol_ Symbol of the token /// @param _treasury Reference to the `Treasury` contract associated to this agToken /// @dev By default, agTokens are ERC-20 tokens with 18 decimals function initialize( string memory name_, string memory symbol_, address _treasury ) external { _initialize(name_, symbol_, _treasury); } // =============================== 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] + amount; if (hourlyUsage > bridgeDetails.hourlyLimit) { // Edge case when the hourly limit changes if (bridgeDetails.hourlyLimit > usage[bridgeToken][hour]) amount = bridgeDetails.hourlyLimit - usage[bridgeToken][hour]; else { amount = 0; } } usage[bridgeToken][hour] = usage[bridgeToken][hour] + 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 = 0; 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: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; 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 a proxied contract can't have 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. * * 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 initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 { __Context_init_unchained(); __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: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, 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}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), 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}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - 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) { _approve(_msgSender(), spender, _allowances[_msgSender()][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) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); unchecked { _approve(_msgSender(), spender, currentAllowance - subtractedValue); } return true; } /** * @dev Moves `amount` of tokens from `sender` to `recipient`. * * 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: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; emit Transfer(sender, recipient, amount); _afterTokenTransfer(sender, recipient, 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 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 {} uint256[45] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// 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 v4.4.1 (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._ */ 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 _PERMIT_TYPEHASH; /** * @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 { __Context_init_unchained(); __EIP712_init_unchained(name, "1"); __ERC20Permit_init_unchained(name); } function __ERC20Permit_init_unchained(string memory name) internal onlyInitializing { _PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");} /** * @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(); } 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 v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @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 * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// 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 { __Context_init_unchained(); } 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; } 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 v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library StringsUpgradeable { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/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. 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. 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; uint8 v; assembly { s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) v := add(shr(255, vs), 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._ */ 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; } uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.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)); } } /** * @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 v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// 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 BaseAgTokenSideChain /// @author Angle Core Team /// @notice Base Contract for Angle agTokens on other chains than Ethereum mainnet /// @dev This type of contract can be used to create and handle the stablecoins of Angle protocol in different chains than Ethereum contract BaseAgTokenSideChain is IAgToken, ERC20PermitUpgradeable { // ======================= Parameters and 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 =================================== /// @notice Initializes the contract /// @param name_ Name of the token /// @param symbol_ Symbol of the token /// @param _treasury Reference to the `Treasury` contract associated to this agToken implementation /// @dev By default, agTokens are ERC-20 tokens with 18 decimals function _initialize( string memory name_, string memory symbol_, address _treasury ) internal initializer { __ERC20Permit_init(name_); __ERC20_init(name_, symbol_); if (address(ITreasury(_treasury).stablecoin()) != address(this)) revert InvalidTreasury(); treasury = _treasury; emit TreasuryUpdated(address(_treasury)); } /// @custom:oz-upgrades-unsafe-allow constructor constructor() initializer {} // =============================== Modifiers =================================== /// @notice Checks to see if it is the `Treasury` calling this contract /// @dev There is no Access Control here, because it can be handled cheaply through this modifier modifier onlyTreasury() { if (msg.sender != address(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 agToken without redeeming collateral back /// @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 { _burnFromNoRedeem(amount, burner, sender); } /// @inheritdoc IAgToken function mint(address account, uint256 amount) external onlyMinter { _mint(account, amount); } // ======================= Treasury 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 onlyTreasury { treasury = _treasury; emit TreasuryUpdated(_treasury); } // ============================ Internal Function ============================== /// @notice Internal version of the function `burnFromNoRedeem` /// @param amount Amount to burn /// @dev It is at the level of this function that allowance checks are performed function _burnFromNoRedeem( uint256 amount, address burner, address sender ) internal { if (burner != sender) { uint256 currentAllowance = allowance(burner, sender); if (currentAllowance < amount) revert BurnAmountExceedsAllowance(); _approve(burner, sender, currentAllowance - amount); } _burn(burner, amount); } }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.12; import "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; /// @title IAgToken /// @author Angle Core Team /// @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); }
// SPDX-License-Identifier: GPL-3.0 pragma solidity 0.8.12; /// @title ICoreBorrow /// @author Angle Core Team /// @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 Core Team /// @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 Core Team /// @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; }
{ "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
[{"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":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":"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":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","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
60806040523480156200001157600080fd5b50600054610100900460ff166200002f5760005460ff161562000039565b62000039620000de565b620000a15760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff16158015620000c4576000805461ffff19166101011790555b8015620000d7576000805461ff00191690555b5062000102565b6000620000f630620000fc60201b620027c81760201c565b15905090565b3b151590565b61479b80620001126000396000f3fe608060405234801561001057600080fd5b50600436106102ff5760003560e01c806361d027b31161019c5780639f48118f116100ee578063ced67f0c11610097578063dd62ed3e11610071578063dd62ed3e14610724578063e3e286551461076a578063f0f442601461077d57600080fd5b8063ced67f0c1461066b578063d44ad63f146106fe578063d505accf1461071157600080fd5b8063aa271e1a116100c8578063aa271e1a14610620578063ba330bd714610643578063cd4839ca1461065657600080fd5b80639f48118f146105ef578063a457c2d7146105fa578063a9059cbb1461060d57600080fd5b80637ecebe001161015057806395d89b411161012a57806395d89b41146105c1578063983b2d56146105c95780639e4e0dae146105dc57600080fd5b80637ecebe00146105705780638933fb791461058357806390218cff146105ae57600080fd5b80637334d020116101815780637334d020146105425780637d4c9c2d146105555780637d74e25f1461056857600080fd5b806361d027b3146104c757806370a082311461050c57600080fd5b80633092afd511610255578063395093511161020957806340c10f19116101e357806340c10f19146104815780634dc32fcc146104945780635bfbec96146104a757600080fd5b8063395093511461043b5780633a55f89d1461044e5780633f4218e01461046157600080fd5b8063350ebe041161023a578063350ebe041461040d5780633644e5151461042057806336db43b51461042857600080fd5b80633092afd5146103eb578063313ce567146103fe57600080fd5b8063151dd755116102b757806323b872dd1161029157806323b872dd146103b25780632b471d8e146103c55780632e403e14146103d857600080fd5b8063151dd7551461038057806318160ddd146103a15780632342fb0e146103a957600080fd5b80630919a951116102e85780630919a95114610337578063095ea7b31461034a5780631171bda91461036d57600080fd5b806306fdde0314610304578063077f224a14610322575b600080fd5b61030c610790565b604051610319919061404a565b60405180910390f35b610335610330366004614197565b610822565b005b61033561034536600461420f565b610832565b61035d61035836600461422c565b610995565b6040519015158152602001610319565b61033561037b366004614258565b6109ab565b61039361038e366004614299565b610b00565b604051908152602001610319565b603554610393565b61039360d25481565b61035d6103c0366004614258565b610e51565b6103356103d33660046142d0565b610f3c565b6103356103e636600461420f565b610f93565b6103356103f936600461420f565b611345565b60405160128152602001610319565b61033561041b366004614300565b61142e565b610393611482565b61033561043636600461422c565b611491565b61035d61044936600461422c565b611621565b61033561045c366004614337565b61166a565b61039361046f36600461420f565b60d16020526000908152604090205481565b61033561048f36600461422c565b61176d565b6103936104a236600461420f565b6117c0565b6103936104b5366004614337565b60d36020526000908152604090205481565b60cd546104e79073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610319565b61039361051a36600461420f565b73ffffffffffffffffffffffffffffffffffffffff1660009081526033602052604090205490565b61033561055036600461422c565b611808565b61033561056336600461437b565b61199b565b610393611d03565b61039361057e36600461420f565b611d28565b61039361059136600461422c565b60d060209081526000928352604080842090915290825290205481565b6103356105bc366004614337565b611d55565b61030c611d62565b6103356105d736600461420f565b611d71565b6103356105ea3660046143d8565b611e39565b610393633b9aca0081565b61035d61060836600461422c565b612045565b61035d61061b36600461422c565b61211d565b61035d61062e36600461420f565b60cc6020526000908152604090205460ff1681565b6104e7610651366004614337565b61212a565b61065e612161565b604051610319919061440d565b6106c561067936600461420f565b60ce6020526000908152604090208054600182015460029092015490919067ffffffffffffffff81169060ff680100000000000000008204811691690100000000000000000090041685565b60408051958652602086019490945267ffffffffffffffff9092169284019290925290151560608301521515608082015260a001610319565b61039361070c366004614299565b6121cf565b61033561071f366004614467565b612393565b6103936107323660046144de565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b61033561077836600461420f565b612534565b61033561078b36600461420f565b612708565b60606036805461079f9061450c565b80601f01602080910402602001604051908101604052809291908181526020018280546107cb9061450c565b80156108185780601f106107ed57610100808354040283529160200191610818565b820191906000526020600020905b8154815290600101906020018083116107fb57829003601f168201915b5050505050905090565b61082d8383836127ce565b505050565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156108a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c4919061455a565b6108fa576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260d1602052604081205461092b9060016145a6565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260d160205260409081902083905551919250907f979ef83e7e7a87cb48064e296dd7e997870d50f43acf8d7ad221313526c8ca0f906109899084815260200190565b60405180910390a25050565b60006109a2338484612a3f565b50600192915050565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d919061455a565b610a73576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a9473ffffffffffffffffffffffffffffffffffffffff84168383612bea565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167ffff3b3844276f57024e0b42afec1a37f75db36511e43819a4f2a63ab7862b64883604051610af391815260200190565b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260ce60209081526040808320815160a081018352815481526001820154938101939093526002015467ffffffffffffffff81169183019190915260ff680100000000000000008204811615801560608501526901000000000000000000909204161515608083015280610b90575080608001515b15610bc7576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa158015610c34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5891906145bd565b8251909150610c6786836145d6565b1115610c8f578151811015610c8a578151610c839082906145a6565b9450610c8f565b600094505b6000610c9d610e10426145ee565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260d06020908152604080832084845290915281205491925090610cdd9088906145d6565b90508360200151811115610d715773ffffffffffffffffffffffffffffffffffffffff8816600090815260d060209081526040808320858452825290912054908501511115610d6c5773ffffffffffffffffffffffffffffffffffffffff8816600090815260d06020908152604080832085845282529091205490850151610d6591906145a6565b9650610d71565b600096505b73ffffffffffffffffffffffffffffffffffffffff8816600090815260d060209081526040808320858452909152902054610dad9088906145d6565b73ffffffffffffffffffffffffffffffffffffffff8916600081815260d060209081526040808320878452909152902091909155610ded9033308a612cbe565b33600090815260d160205260409020548790610e3957633b9aca00856040015167ffffffffffffffff1682610e229190614629565b610e2c91906145ee565b610e3690826145a6565b90505b610e438782612d1c565b9450505050505b9392505050565b6000610e5e848484612e3c565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260346020908152604080832033845290915290205482811015610f24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610f318533858403612a3f565b506001949350505050565b33600090815260cc602052604090205460ff16610f85576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f8f81836130ef565b5050565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015611001573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611025919061455a565b61105b576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8216906370a0823190602401602060405180830381865afa1580156110c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e991906145bd565b15611120576040517f2ef630ec00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260ce602052604081208181556001810182905560020180547fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000016905560cf54905b6111886001836145a6565b811015611296578273ffffffffffffffffffffffffffffffffffffffff1660cf82815481106111b9576111b9614666565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614156112845760cf6111ee6001846145a6565b815481106111fe576111fe614666565b60009182526020909120015460cf805473ffffffffffffffffffffffffffffffffffffffff909216918390811061123757611237614666565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611296565b8061128e81614695565b91505061117d565b5060cf8054806112a8576112a86146ce565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590910190915560405173ffffffffffffffffffffffffffffffffffffffff8416917f5c95b49c4d59d97a2f044167723f29c74b30f99702e3fd406c3830160aa9ccb891a25050565b60cd5473ffffffffffffffffffffffffffffffffffffffff16331480159061138357503373ffffffffffffffffffffffffffffffffffffffff821614155b156113ba576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260cc602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517f98c15241d6c02bc5ee0b780e11b3ea737a2defd9d04877edbe9f9497065bd02f9190a250565b33600090815260cc602052604090205460ff16611477576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61082d8383836132dc565b600061148c613397565b905090565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156114ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611523919061455a565b611559576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff166115c7576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602052604090819020839055517fe7b113fba37131b6396680a0c55790a697ec975e198ff8cfd89dac90a6379e61906109899084815260200190565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490916109a29185906116659086906145d6565b612a3f565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156116d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116fc919061455a565b611732576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60d28190556040518181527fc3b69829afe2345596a02c8b587d41f796ba0094481d899e1b2e07b7532a1e219060200160405180910390a150565b33600090815260cc602052604090205460ff166117b6576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f8f8282612d1c565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260d060205260408120816117f2610e10426145ee565b8152602001908152602001600020549050919050565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611876573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189a919061455a565b6118d0576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff1661193e576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602052604090819020600101839055517fe13ac9338b2ee623233f83c1b3ceab16490fa3e3737fac7f0970d0830a9f4871906109899084815260200190565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015611a09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2d919061455a565b611a63576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516600090815260ce602052604090206002015468010000000000000000900460ff1680611aba575073ffffffffffffffffffffffffffffffffffffffff8516155b15611af1576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b633b9aca008267ffffffffffffffff161115611b39576040517feca1d2c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915284815260208082018581528315156080840190815267ffffffffffffffff808716604080870191825260016060880181815273ffffffffffffffffffffffffffffffffffffffff8e16600081815260ce9099528389208a5181559751888401559351600290970180549151965115156901000000000000000000027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff97151568010000000000000000027fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000909316989096169790971717949094169290921790935560cf805492830181559093527facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf290180547fffffffffffffffffffffffff0000000000000000000000000000000000000000168217905590517f53087ff85d80a7671594bd2e86b92af22e0b3c2c441c8033bba7399b7b5cbe2390611cf3908890889088908890938452602084019290925267ffffffffffffffff1660408301521515606082015260800190565b60405180910390a2505050505050565b600060d381611d14610e10426145ee565b815260200190815260200160002054905090565b73ffffffffffffffffffffffffffffffffffffffff81166000908152609960205260408120545b92915050565b611d5f33826130ef565b50565b60606037805461079f9061450c565b60cd5473ffffffffffffffffffffffffffffffffffffffff163314611dc2576040517fb90cdbb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260cc602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f98c15241d6c02bc5ee0b780e11b3ea737a2defd9d04877edbe9f9497065bd02f9190a250565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ecb919061455a565b611f01576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff16611f6f576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b633b9aca008167ffffffffffffffff161115611fb7576040517feca1d2c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602090815260409182902060020180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff861690811790915591519182527f901f9de19b475adc8da4110434b8df940dce085afd05e2281c86807f3a899d299101610989565b33600090815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915281205482811015612106576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610f1b565b6121133385858403612a3f565b5060019392505050565b60006109a2338484612e3c565b60cf818154811061213a57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b606060cf80548060200260200160405190810160405280929190818152602001828054801561081857602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161219b575050505050905090565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260ce60209081526040808320815160a081018352815481526001820154938101939093526002015467ffffffffffffffff81169183019190915260ff68010000000000000000820481161580156060850152690100000000000000000090920416151560808301528061225f575080608001515b15612296576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006122a4610e10426145ee565b600081815260d36020526040812054919250906122c29087906145d6565b905060d254811115612300576040517f6d43d1ac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260d36020526040902081905561231b33876130ef565b33600090815260d16020526040902054869061236757633b9aca00846040015167ffffffffffffffff16826123509190614629565b61235a91906145ee565b61236490826145a6565b90505b61238873ffffffffffffffffffffffffffffffffffffffff89168783612bea565b979650505050505050565b834211156123fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610f1b565b6000609a5488888861240e8c613412565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061247682613447565b90506000612486828787876134b0565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461251d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610f1b565b6125288a8a8a612a3f565b50505050505050505050565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156125a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c6919061455a565b6125fc576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260ce602052604090206002015468010000000000000000900460ff1661266a576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260ce602090815260409182902060020180547fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff811669010000000000000000009182900460ff16801592830291909117909255925192835292917ff7c93079dcbf699749d66345a351afab7d24219bb1d915c9f4fc4cf03f00d3979101610989565b60cd5473ffffffffffffffffffffffffffffffffffffffff163314612759576040517fb90cdbb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60cd80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d190600090a250565b3b151590565b600054610100900460ff166127e95760005460ff16156127ed565b303b155b612879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610f1b565b600054610100900460ff161580156128b857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b6128c1846134d8565b6128cb84846135bf565b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1663e9cbd8226040518163ffffffff1660e01b8152600401602060405180830381865afa15801561292d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061295191906146fd565b73ffffffffffffffffffffffffffffffffffffffff161461299e576040517f14bcf5c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60cd80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d190600090a28015612a3957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316612ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff8216612b84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259101610af3565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261082d9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613668565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052612a399085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612c3c565b73ffffffffffffffffffffffffffffffffffffffff8216612d99576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610f1b565b8060356000828254612dab91906145d6565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604081208054839290612de59084906145d6565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8316612edf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff8216612f82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015613038576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526033602052604080822085850390559185168152908120805484929061307c9084906145d6565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516130e291815260200190565b60405180910390a3612a39565b73ffffffffffffffffffffffffffffffffffffffff8216613192576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604090205481811015613248576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604081208383039055603580548492906132849084906145a6565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461338d5773ffffffffffffffffffffffffffffffffffffffff8281166000908152603460209081526040808320938516835292905220548381101561337c576040517f715ec26c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61338b838361166587856145a6565b505b61082d82846130ef565b600061148c7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6133c660655490565b6066546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526099602052604090208054600181018255905b50919050565b6000611d4f613454613397565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006134c187878787613774565b915091506134ce8161388c565b5095945050505050565b600054610100900460ff1661356f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b613577613ae5565b6135b6816040518060400160405280600181526020017f3100000000000000000000000000000000000000000000000000000000000000815250613b7e565b611d5f81613c2f565b600054610100900460ff16613656576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b61365e613ae5565b610f8f8282613ced565b60006136ca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613dab9092919063ffffffff16565b80519091501561082d57808060200190518101906136e8919061455a565b61082d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610f1b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156137ab5750600090506003613883565b8460ff16601b141580156137c357508460ff16601c14155b156137d45750600090506004613883565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613828573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661387c57600060019250925050613883565b9150600090505b94509492505050565b60008160048111156138a0576138a061471a565b14156138a95750565b60018160048111156138bd576138bd61471a565b1415613925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610f1b565b60028160048111156139395761393961471a565b14156139a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610f1b565b60038160048111156139b5576139b561471a565b1415613a43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b6004816004811115613a5757613a5761471a565b1415611d5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b600054610100900460ff16613b7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b565b600054610100900460ff16613c15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b815160209283012081519190920120606591909155606655565b600054610100900460ff16613cc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b507f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9609a55565b600054610100900460ff16613d84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b8151613d97906036906020850190613f85565b50805161082d906037906020840190613f85565b6060613dba8484600085613dc2565b949350505050565b606082471015613e54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610f1b565b843b613ebc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610f1b565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613ee59190614749565b60006040518083038185875af1925050503d8060008114613f22576040519150601f19603f3d011682016040523d82523d6000602084013e613f27565b606091505b509150915061238882828660608315613f41575081610e4a565b825115613f515782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1b919061404a565b828054613f919061450c565b90600052602060002090601f016020900481019282613fb35760008555613ff9565b82601f10613fcc57805160ff1916838001178555613ff9565b82800160010185558215613ff9579182015b82811115613ff9578251825591602001919060010190613fde565b50614005929150614009565b5090565b5b80821115614005576000815560010161400a565b60005b83811015614039578181015183820152602001614021565b83811115612a395750506000910152565b602081526000825180602084015261406981604085016020870161401e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f8301126140db57600080fd5b813567ffffffffffffffff808211156140f6576140f661409b565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561413c5761413c61409b565b8160405283815286602085880101111561415557600080fd5b836020870160208301376000602085830101528094505050505092915050565b73ffffffffffffffffffffffffffffffffffffffff81168114611d5f57600080fd5b6000806000606084860312156141ac57600080fd5b833567ffffffffffffffff808211156141c457600080fd5b6141d0878388016140ca565b945060208601359150808211156141e657600080fd5b506141f3868287016140ca565b925050604084013561420481614175565b809150509250925092565b60006020828403121561422157600080fd5b8135610e4a81614175565b6000806040838503121561423f57600080fd5b823561424a81614175565b946020939093013593505050565b60008060006060848603121561426d57600080fd5b833561427881614175565b9250602084013561428881614175565b929592945050506040919091013590565b6000806000606084860312156142ae57600080fd5b83356142b981614175565b925060208401359150604084013561420481614175565b600080604083850312156142e357600080fd5b8235915060208301356142f581614175565b809150509250929050565b60008060006060848603121561431557600080fd5b83359250602084013561432781614175565b9150604084013561420481614175565b60006020828403121561434957600080fd5b5035919050565b803567ffffffffffffffff8116811461436857600080fd5b919050565b8015158114611d5f57600080fd5b600080600080600060a0868803121561439357600080fd5b853561439e81614175565b945060208601359350604086013592506143ba60608701614350565b915060808601356143ca8161436d565b809150509295509295909350565b600080604083850312156143eb57600080fd5b82356143f681614175565b915061440460208401614350565b90509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561445b57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614429565b50909695505050505050565b600080600080600080600060e0888a03121561448257600080fd5b873561448d81614175565b9650602088013561449d81614175565b95506040880135945060608801359350608088013560ff811681146144c157600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156144f157600080fd5b82356144fc81614175565b915060208301356142f581614175565b600181811c9082168061452057607f821691505b60208210811415613441577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006020828403121561456c57600080fd5b8151610e4a8161436d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156145b8576145b8614577565b500390565b6000602082840312156145cf57600080fd5b5051919050565b600082198211156145e9576145e9614577565b500190565b600082614624577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561466157614661614577565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156146c7576146c7614577565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60006020828403121561470f57600080fd5b8151610e4a81614175565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000825161475b81846020870161401e565b919091019291505056fea2646970667358221220103b8d652dd7975983cef70f41cb81056a0bf607243b7332223b4013506c7eb664736f6c634300080c0033
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102ff5760003560e01c806361d027b31161019c5780639f48118f116100ee578063ced67f0c11610097578063dd62ed3e11610071578063dd62ed3e14610724578063e3e286551461076a578063f0f442601461077d57600080fd5b8063ced67f0c1461066b578063d44ad63f146106fe578063d505accf1461071157600080fd5b8063aa271e1a116100c8578063aa271e1a14610620578063ba330bd714610643578063cd4839ca1461065657600080fd5b80639f48118f146105ef578063a457c2d7146105fa578063a9059cbb1461060d57600080fd5b80637ecebe001161015057806395d89b411161012a57806395d89b41146105c1578063983b2d56146105c95780639e4e0dae146105dc57600080fd5b80637ecebe00146105705780638933fb791461058357806390218cff146105ae57600080fd5b80637334d020116101815780637334d020146105425780637d4c9c2d146105555780637d74e25f1461056857600080fd5b806361d027b3146104c757806370a082311461050c57600080fd5b80633092afd511610255578063395093511161020957806340c10f19116101e357806340c10f19146104815780634dc32fcc146104945780635bfbec96146104a757600080fd5b8063395093511461043b5780633a55f89d1461044e5780633f4218e01461046157600080fd5b8063350ebe041161023a578063350ebe041461040d5780633644e5151461042057806336db43b51461042857600080fd5b80633092afd5146103eb578063313ce567146103fe57600080fd5b8063151dd755116102b757806323b872dd1161029157806323b872dd146103b25780632b471d8e146103c55780632e403e14146103d857600080fd5b8063151dd7551461038057806318160ddd146103a15780632342fb0e146103a957600080fd5b80630919a951116102e85780630919a95114610337578063095ea7b31461034a5780631171bda91461036d57600080fd5b806306fdde0314610304578063077f224a14610322575b600080fd5b61030c610790565b604051610319919061404a565b60405180910390f35b610335610330366004614197565b610822565b005b61033561034536600461420f565b610832565b61035d61035836600461422c565b610995565b6040519015158152602001610319565b61033561037b366004614258565b6109ab565b61039361038e366004614299565b610b00565b604051908152602001610319565b603554610393565b61039360d25481565b61035d6103c0366004614258565b610e51565b6103356103d33660046142d0565b610f3c565b6103356103e636600461420f565b610f93565b6103356103f936600461420f565b611345565b60405160128152602001610319565b61033561041b366004614300565b61142e565b610393611482565b61033561043636600461422c565b611491565b61035d61044936600461422c565b611621565b61033561045c366004614337565b61166a565b61039361046f36600461420f565b60d16020526000908152604090205481565b61033561048f36600461422c565b61176d565b6103936104a236600461420f565b6117c0565b6103936104b5366004614337565b60d36020526000908152604090205481565b60cd546104e79073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff9091168152602001610319565b61039361051a36600461420f565b73ffffffffffffffffffffffffffffffffffffffff1660009081526033602052604090205490565b61033561055036600461422c565b611808565b61033561056336600461437b565b61199b565b610393611d03565b61039361057e36600461420f565b611d28565b61039361059136600461422c565b60d060209081526000928352604080842090915290825290205481565b6103356105bc366004614337565b611d55565b61030c611d62565b6103356105d736600461420f565b611d71565b6103356105ea3660046143d8565b611e39565b610393633b9aca0081565b61035d61060836600461422c565b612045565b61035d61061b36600461422c565b61211d565b61035d61062e36600461420f565b60cc6020526000908152604090205460ff1681565b6104e7610651366004614337565b61212a565b61065e612161565b604051610319919061440d565b6106c561067936600461420f565b60ce6020526000908152604090208054600182015460029092015490919067ffffffffffffffff81169060ff680100000000000000008204811691690100000000000000000090041685565b60408051958652602086019490945267ffffffffffffffff9092169284019290925290151560608301521515608082015260a001610319565b61039361070c366004614299565b6121cf565b61033561071f366004614467565b612393565b6103936107323660046144de565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260346020908152604080832093909416825291909152205490565b61033561077836600461420f565b612534565b61033561078b36600461420f565b612708565b60606036805461079f9061450c565b80601f01602080910402602001604051908101604052809291908181526020018280546107cb9061450c565b80156108185780601f106107ed57610100808354040283529160200191610818565b820191906000526020600020905b8154815290600101906020018083116107fb57829003601f168201915b5050505050905090565b61082d8383836127ce565b505050565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156108a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108c4919061455a565b6108fa576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260d1602052604081205461092b9060016145a6565b73ffffffffffffffffffffffffffffffffffffffff8316600081815260d160205260409081902083905551919250907f979ef83e7e7a87cb48064e296dd7e997870d50f43acf8d7ad221313526c8ca0f906109899084815260200190565b60405180910390a25050565b60006109a2338484612a3f565b50600192915050565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015610a19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3d919061455a565b610a73576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610a9473ffffffffffffffffffffffffffffffffffffffff84168383612bea565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167ffff3b3844276f57024e0b42afec1a37f75db36511e43819a4f2a63ab7862b64883604051610af391815260200190565b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260ce60209081526040808320815160a081018352815481526001820154938101939093526002015467ffffffffffffffff81169183019190915260ff680100000000000000008204811615801560608501526901000000000000000000909204161515608083015280610b90575080608001515b15610bc7576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015260009073ffffffffffffffffffffffffffffffffffffffff8716906370a0823190602401602060405180830381865afa158015610c34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5891906145bd565b8251909150610c6786836145d6565b1115610c8f578151811015610c8a578151610c839082906145a6565b9450610c8f565b600094505b6000610c9d610e10426145ee565b73ffffffffffffffffffffffffffffffffffffffff8816600090815260d06020908152604080832084845290915281205491925090610cdd9088906145d6565b90508360200151811115610d715773ffffffffffffffffffffffffffffffffffffffff8816600090815260d060209081526040808320858452825290912054908501511115610d6c5773ffffffffffffffffffffffffffffffffffffffff8816600090815260d06020908152604080832085845282529091205490850151610d6591906145a6565b9650610d71565b600096505b73ffffffffffffffffffffffffffffffffffffffff8816600090815260d060209081526040808320858452909152902054610dad9088906145d6565b73ffffffffffffffffffffffffffffffffffffffff8916600081815260d060209081526040808320878452909152902091909155610ded9033308a612cbe565b33600090815260d160205260409020548790610e3957633b9aca00856040015167ffffffffffffffff1682610e229190614629565b610e2c91906145ee565b610e3690826145a6565b90505b610e438782612d1c565b9450505050505b9392505050565b6000610e5e848484612e3c565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260346020908152604080832033845290915290205482811015610f24576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b610f318533858403612a3f565b506001949350505050565b33600090815260cc602052604090205460ff16610f85576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f8f81836130ef565b5050565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015611001573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611025919061455a565b61105b576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff8216906370a0823190602401602060405180830381865afa1580156110c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e991906145bd565b15611120576040517f2ef630ec00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260ce602052604081208181556001810182905560020180547fffffffffffffffffffffffffffffffffffffffffffff0000000000000000000016905560cf54905b6111886001836145a6565b811015611296578273ffffffffffffffffffffffffffffffffffffffff1660cf82815481106111b9576111b9614666565b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff1614156112845760cf6111ee6001846145a6565b815481106111fe576111fe614666565b60009182526020909120015460cf805473ffffffffffffffffffffffffffffffffffffffff909216918390811061123757611237614666565b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611296565b8061128e81614695565b91505061117d565b5060cf8054806112a8576112a86146ce565b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff000000000000000000000000000000000000000016905590910190915560405173ffffffffffffffffffffffffffffffffffffffff8416917f5c95b49c4d59d97a2f044167723f29c74b30f99702e3fd406c3830160aa9ccb891a25050565b60cd5473ffffffffffffffffffffffffffffffffffffffff16331480159061138357503373ffffffffffffffffffffffffffffffffffffffff821614155b156113ba576040517fddb5de5e00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260cc602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055517f98c15241d6c02bc5ee0b780e11b3ea737a2defd9d04877edbe9f9497065bd02f9190a250565b33600090815260cc602052604090205460ff16611477576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61082d8383836132dc565b600061148c613397565b905090565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156114ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611523919061455a565b611559576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff166115c7576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602052604090819020839055517fe7b113fba37131b6396680a0c55790a697ec975e198ff8cfd89dac90a6379e61906109899084815260200190565b33600081815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8716845290915281205490916109a29185906116659086906145d6565b612a3f565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156116d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116fc919061455a565b611732576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60d28190556040518181527fc3b69829afe2345596a02c8b587d41f796ba0094481d899e1b2e07b7532a1e219060200160405180910390a150565b33600090815260cc602052604090205460ff166117b6576040517ff8d2906c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610f8f8282612d1c565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260d060205260408120816117f2610e10426145ee565b8152602001908152602001600020549050919050565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611876573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061189a919061455a565b6118d0576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff1661193e576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602052604090819020600101839055517fe13ac9338b2ee623233f83c1b3ceab16490fa3e3737fac7f0970d0830a9f4871906109899084815260200190565b60cd546040517fe43581b800000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063e43581b890602401602060405180830381865afa158015611a09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2d919061455a565b611a63576040517fee3675d400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516600090815260ce602052604090206002015468010000000000000000900460ff1680611aba575073ffffffffffffffffffffffffffffffffffffffff8516155b15611af1576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b633b9aca008267ffffffffffffffff161115611b39576040517feca1d2c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915284815260208082018581528315156080840190815267ffffffffffffffff808716604080870191825260016060880181815273ffffffffffffffffffffffffffffffffffffffff8e16600081815260ce9099528389208a5181559751888401559351600290970180549151965115156901000000000000000000027fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff97151568010000000000000000027fffffffffffffffffffffffffffffffffffffffffffffff000000000000000000909316989096169790971717949094169290921790935560cf805492830181559093527facb8d954e2cfef495862221e91bd7523613cf8808827cb33edfe4904cc51bf290180547fffffffffffffffffffffffff0000000000000000000000000000000000000000168217905590517f53087ff85d80a7671594bd2e86b92af22e0b3c2c441c8033bba7399b7b5cbe2390611cf3908890889088908890938452602084019290925267ffffffffffffffff1660408301521515606082015260800190565b60405180910390a2505050505050565b600060d381611d14610e10426145ee565b815260200190815260200160002054905090565b73ffffffffffffffffffffffffffffffffffffffff81166000908152609960205260408120545b92915050565b611d5f33826130ef565b50565b60606037805461079f9061450c565b60cd5473ffffffffffffffffffffffffffffffffffffffff163314611dc2576040517fb90cdbb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260cc602052604080822080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055517f98c15241d6c02bc5ee0b780e11b3ea737a2defd9d04877edbe9f9497065bd02f9190a250565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa158015611ea7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ecb919061455a565b611f01576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600090815260ce602052604090206002015468010000000000000000900460ff16611f6f576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b633b9aca008167ffffffffffffffff161115611fb7576040517feca1d2c600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216600081815260ce602090815260409182902060020180547fffffffffffffffffffffffffffffffffffffffffffffffff00000000000000001667ffffffffffffffff861690811790915591519182527f901f9de19b475adc8da4110434b8df940dce085afd05e2281c86807f3a899d299101610989565b33600090815260346020908152604080832073ffffffffffffffffffffffffffffffffffffffff8616845290915281205482811015612106576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f0000000000000000000000000000000000000000000000000000006064820152608401610f1b565b6121133385858403612a3f565b5060019392505050565b60006109a2338484612e3c565b60cf818154811061213a57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b606060cf80548060200260200160405190810160405280929190818152602001828054801561081857602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff16815260019091019060200180831161219b575050505050905090565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260ce60209081526040808320815160a081018352815481526001820154938101939093526002015467ffffffffffffffff81169183019190915260ff68010000000000000000820481161580156060850152690100000000000000000090920416151560808301528061225f575080608001515b15612296576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006122a4610e10426145ee565b600081815260d36020526040812054919250906122c29087906145d6565b905060d254811115612300576040517f6d43d1ac00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082815260d36020526040902081905561231b33876130ef565b33600090815260d16020526040902054869061236757633b9aca00846040015167ffffffffffffffff16826123509190614629565b61235a91906145ee565b61236490826145a6565b90505b61238873ffffffffffffffffffffffffffffffffffffffff89168783612bea565b979650505050505050565b834211156123fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e650000006044820152606401610f1b565b6000609a5488888861240e8c613412565b60408051602081019690965273ffffffffffffffffffffffffffffffffffffffff94851690860152929091166060840152608083015260a082015260c0810186905260e001604051602081830303815290604052805190602001209050600061247682613447565b90506000612486828787876134b0565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461251d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e617475726500006044820152606401610f1b565b6125288a8a8a612a3f565b50505050505050505050565b60cd546040517f521d4de900000000000000000000000000000000000000000000000000000000815233600482015273ffffffffffffffffffffffffffffffffffffffff9091169063521d4de990602401602060405180830381865afa1580156125a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125c6919061455a565b6125fc576040517f99e120bc00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260ce602052604090206002015468010000000000000000900460ff1661266a576040517fc1ab6dc100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260ce602090815260409182902060020180547fffffffffffffffffffffffffffffffffffffffffffff00ffffffffffffffffff811669010000000000000000009182900460ff16801592830291909117909255925192835292917ff7c93079dcbf699749d66345a351afab7d24219bb1d915c9f4fc4cf03f00d3979101610989565b60cd5473ffffffffffffffffffffffffffffffffffffffff163314612759576040517fb90cdbb100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60cd80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d190600090a250565b3b151590565b600054610100900460ff166127e95760005460ff16156127ed565b303b155b612879576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201527f647920696e697469616c697a65640000000000000000000000000000000000006064820152608401610f1b565b600054610100900460ff161580156128b857600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000166101011790555b6128c1846134d8565b6128cb84846135bf565b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1663e9cbd8226040518163ffffffff1660e01b8152600401602060405180830381865afa15801561292d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061295191906146fd565b73ffffffffffffffffffffffffffffffffffffffff161461299e576040517f14bcf5c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60cd80547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff84169081179091556040517f7dae230f18360d76a040c81f050aa14eb9d6dc7901b20fc5d855e2a20fe814d190600090a28015612a3957600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff1690555b50505050565b73ffffffffffffffffffffffffffffffffffffffff8316612ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f72657373000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff8216612b84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f73730000000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff83811660008181526034602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259101610af3565b60405173ffffffffffffffffffffffffffffffffffffffff831660248201526044810182905261082d9084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152613668565b60405173ffffffffffffffffffffffffffffffffffffffff80851660248301528316604482015260648101829052612a399085907f23b872dd0000000000000000000000000000000000000000000000000000000090608401612c3c565b73ffffffffffffffffffffffffffffffffffffffff8216612d99576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610f1b565b8060356000828254612dab91906145d6565b909155505073ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604081208054839290612de59084906145d6565b909155505060405181815273ffffffffffffffffffffffffffffffffffffffff8316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b73ffffffffffffffffffffffffffffffffffffffff8316612edf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f64726573730000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff8216612f82576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f65737300000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604090205481811015613038576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e636500000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff80851660009081526033602052604080822085850390559185168152908120805484929061307c9084906145d6565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516130e291815260200190565b60405180910390a3612a39565b73ffffffffffffffffffffffffffffffffffffffff8216613192576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f73000000000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff821660009081526033602052604090205481811015613248576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f63650000000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b73ffffffffffffffffffffffffffffffffffffffff831660009081526033602052604081208383039055603580548492906132849084906145a6565b909155505060405182815260009073ffffffffffffffffffffffffffffffffffffffff8516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a3505050565b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461338d5773ffffffffffffffffffffffffffffffffffffffff8281166000908152603460209081526040808320938516835292905220548381101561337c576040517f715ec26c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61338b838361166587856145a6565b505b61082d82846130ef565b600061148c7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6133c660655490565b6066546040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526099602052604090208054600181018255905b50919050565b6000611d4f613454613397565b836040517f19010000000000000000000000000000000000000000000000000000000000006020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006134c187878787613774565b915091506134ce8161388c565b5095945050505050565b600054610100900460ff1661356f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b613577613ae5565b6135b6816040518060400160405280600181526020017f3100000000000000000000000000000000000000000000000000000000000000815250613b7e565b611d5f81613c2f565b600054610100900460ff16613656576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b61365e613ae5565b610f8f8282613ced565b60006136ca826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16613dab9092919063ffffffff16565b80519091501561082d57808060200190518101906136e8919061455a565b61082d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610f1b565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156137ab5750600090506003613883565b8460ff16601b141580156137c357508460ff16601c14155b156137d45750600090506004613883565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613828573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff811661387c57600060019250925050613883565b9150600090505b94509492505050565b60008160048111156138a0576138a061471a565b14156138a95750565b60018160048111156138bd576138bd61471a565b1415613925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610f1b565b60028160048111156139395761393961471a565b14156139a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610f1b565b60038160048111156139b5576139b561471a565b1415613a43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b6004816004811115613a5757613a5761471a565b1415611d5f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c60448201527f75650000000000000000000000000000000000000000000000000000000000006064820152608401610f1b565b600054610100900460ff16613b7c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b565b600054610100900460ff16613c15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b815160209283012081519190920120606591909155606655565b600054610100900460ff16613cc6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b507f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9609a55565b600054610100900460ff16613d84576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201527f6e697469616c697a696e670000000000000000000000000000000000000000006064820152608401610f1b565b8151613d97906036906020850190613f85565b50805161082d906037906020840190613f85565b6060613dba8484600085613dc2565b949350505050565b606082471015613e54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610f1b565b843b613ebc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610f1b565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051613ee59190614749565b60006040518083038185875af1925050503d8060008114613f22576040519150601f19603f3d011682016040523d82523d6000602084013e613f27565b606091505b509150915061238882828660608315613f41575081610e4a565b825115613f515782518084602001fd5b816040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1b919061404a565b828054613f919061450c565b90600052602060002090601f016020900481019282613fb35760008555613ff9565b82601f10613fcc57805160ff1916838001178555613ff9565b82800160010185558215613ff9579182015b82811115613ff9578251825591602001919060010190613fde565b50614005929150614009565b5090565b5b80821115614005576000815560010161400a565b60005b83811015614039578181015183820152602001614021565b83811115612a395750506000910152565b602081526000825180602084015261406981604085016020870161401e565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f8301126140db57600080fd5b813567ffffffffffffffff808211156140f6576140f661409b565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f0116810190828211818310171561413c5761413c61409b565b8160405283815286602085880101111561415557600080fd5b836020870160208301376000602085830101528094505050505092915050565b73ffffffffffffffffffffffffffffffffffffffff81168114611d5f57600080fd5b6000806000606084860312156141ac57600080fd5b833567ffffffffffffffff808211156141c457600080fd5b6141d0878388016140ca565b945060208601359150808211156141e657600080fd5b506141f3868287016140ca565b925050604084013561420481614175565b809150509250925092565b60006020828403121561422157600080fd5b8135610e4a81614175565b6000806040838503121561423f57600080fd5b823561424a81614175565b946020939093013593505050565b60008060006060848603121561426d57600080fd5b833561427881614175565b9250602084013561428881614175565b929592945050506040919091013590565b6000806000606084860312156142ae57600080fd5b83356142b981614175565b925060208401359150604084013561420481614175565b600080604083850312156142e357600080fd5b8235915060208301356142f581614175565b809150509250929050565b60008060006060848603121561431557600080fd5b83359250602084013561432781614175565b9150604084013561420481614175565b60006020828403121561434957600080fd5b5035919050565b803567ffffffffffffffff8116811461436857600080fd5b919050565b8015158114611d5f57600080fd5b600080600080600060a0868803121561439357600080fd5b853561439e81614175565b945060208601359350604086013592506143ba60608701614350565b915060808601356143ca8161436d565b809150509295509295909350565b600080604083850312156143eb57600080fd5b82356143f681614175565b915061440460208401614350565b90509250929050565b6020808252825182820181905260009190848201906040850190845b8181101561445b57835173ffffffffffffffffffffffffffffffffffffffff1683529284019291840191600101614429565b50909695505050505050565b600080600080600080600060e0888a03121561448257600080fd5b873561448d81614175565b9650602088013561449d81614175565b95506040880135945060608801359350608088013560ff811681146144c157600080fd5b9699959850939692959460a0840135945060c09093013592915050565b600080604083850312156144f157600080fd5b82356144fc81614175565b915060208301356142f581614175565b600181811c9082168061452057607f821691505b60208210811415613441577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006020828403121561456c57600080fd5b8151610e4a8161436d565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000828210156145b8576145b8614577565b500390565b6000602082840312156145cf57600080fd5b5051919050565b600082198211156145e9576145e9614577565b500190565b600082614624577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561466157614661614577565b500290565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156146c7576146c7614577565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60006020828403121561470f57600080fd5b8151610e4a81614175565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6000825161475b81846020870161401e565b919091019291505056fea2646970667358221220103b8d652dd7975983cef70f41cb81056a0bf607243b7332223b4013506c7eb664736f6c634300080c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
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.