Feature Tip: Add private address tag to any address under My Name Tag !
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 1,349 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Fulfill | 21302310 | 2 hrs ago | IN | 0 ETH | 0.00164948 | ||||
Fulfill | 21302115 | 3 hrs ago | IN | 0 ETH | 0.00159105 | ||||
Fulfill | 21301971 | 3 hrs ago | IN | 0 ETH | 0.00173463 | ||||
Fulfill | 21301772 | 4 hrs ago | IN | 0 ETH | 0.00153962 | ||||
Fulfill | 21301164 | 6 hrs ago | IN | 0 ETH | 0.00120917 | ||||
Fulfill | 21300987 | 6 hrs ago | IN | 0 ETH | 0.00140551 | ||||
Fulfill | 21300983 | 6 hrs ago | IN | 0 ETH | 0.00158491 | ||||
Fulfill | 21300337 | 9 hrs ago | IN | 0 ETH | 0.00067685 | ||||
Fulfill | 21299671 | 11 hrs ago | IN | 0 ETH | 0.00088373 | ||||
Fulfill | 21298598 | 14 hrs ago | IN | 0 ETH | 0.00095744 | ||||
Send | 21295551 | 25 hrs ago | IN | 0 ETH | 0.00413378 | ||||
Send | 21295124 | 26 hrs ago | IN | 0 ETH | 0.00509304 | ||||
Send | 21294772 | 27 hrs ago | IN | 0 ETH | 0.00548845 | ||||
Send | 21294755 | 27 hrs ago | IN | 0 ETH | 0.00647043 | ||||
Fulfill | 21294185 | 29 hrs ago | IN | 0 ETH | 0.00260979 | ||||
Fulfill | 21294029 | 30 hrs ago | IN | 0 ETH | 0.00226884 | ||||
Fulfill | 21293645 | 31 hrs ago | IN | 0 ETH | 0.00194239 | ||||
Fulfill | 21293594 | 31 hrs ago | IN | 0 ETH | 0.00189897 | ||||
Fulfill | 21293081 | 33 hrs ago | IN | 0 ETH | 0.00154629 | ||||
Fulfill | 21292874 | 34 hrs ago | IN | 0 ETH | 0.00104871 | ||||
Fulfill | 21292689 | 34 hrs ago | IN | 0 ETH | 0.00101952 | ||||
Fulfill | 21292545 | 35 hrs ago | IN | 0 ETH | 0.00091322 | ||||
Fulfill | 21292503 | 35 hrs ago | IN | 0 ETH | 0.00092095 | ||||
Fulfill | 21292480 | 35 hrs ago | IN | 0 ETH | 0.00090443 | ||||
Fulfill | 21292455 | 35 hrs ago | IN | 0 ETH | 0.00091614 |
Advanced mode: Intended for advanced users or developers and will display all Internal Transactions including zero value transfers. Name tag integration is not available in advanced view.
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | ||||
---|---|---|---|---|---|---|---|
21302310 | 2 hrs ago | 0 ETH | |||||
21302310 | 2 hrs ago | 0 ETH | |||||
21302115 | 3 hrs ago | 0 ETH | |||||
21302115 | 3 hrs ago | 0 ETH | |||||
21301971 | 3 hrs ago | 0 ETH | |||||
21301971 | 3 hrs ago | 0 ETH | |||||
21301772 | 4 hrs ago | 0 ETH | |||||
21301772 | 4 hrs ago | 0 ETH | |||||
21301164 | 6 hrs ago | 0 ETH | |||||
21301164 | 6 hrs ago | 0 ETH | |||||
21300987 | 6 hrs ago | 0 ETH | |||||
21300987 | 6 hrs ago | 0 ETH | |||||
21300983 | 6 hrs ago | 0 ETH | |||||
21300983 | 6 hrs ago | 0 ETH | |||||
21300337 | 9 hrs ago | 0 ETH | |||||
21300337 | 9 hrs ago | 0 ETH | |||||
21299671 | 11 hrs ago | 0 ETH | |||||
21299671 | 11 hrs ago | 0 ETH | |||||
21298598 | 14 hrs ago | 0 ETH | |||||
21298598 | 14 hrs ago | 0 ETH | |||||
21295551 | 25 hrs ago | 0 ETH | |||||
21295551 | 25 hrs ago | 0 ETH | |||||
21295551 | 25 hrs ago | 0 ETH | |||||
21295551 | 25 hrs ago | 0 ETH | |||||
21295124 | 26 hrs ago | 0 ETH |
Loading...
Loading
Contract Name:
BridgeAssist
Compiler Version
v0.8.18+commit.87f61d96
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity =0.8.18; import '@openzeppelin/contracts/access/AccessControl.sol'; import '@openzeppelin/contracts/utils/cryptography/ECDSA.sol'; import '@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol'; import '@openzeppelin/contracts/security/Pausable.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import '@openzeppelin/contracts/utils/structs/EnumerableSet.sol'; import '@openzeppelin/contracts/utils/cryptography/EIP712.sol'; /// @title BridgeAssist /// @author gotbit /// @dev Contract for sending tokens between chains assisted by a relayer, /// supporting fee on send/fulfill, supporting multiple chains including /// non-EVM blockchains, with a configurable limit per send and exchange rate /// between chains. contract BridgeAssist is AccessControl, Pausable, EIP712 { using EnumerableSet for EnumerableSet.Bytes32Set; struct Transaction { uint256 amount; uint256 timestamp; address fromUser; string toUser; // can be a solana address string fromChain; string toChain; uint256 nonce; uint256 block; } struct FulfillTx { uint256 amount; string fromUser; // can be a solana address address toUser; string fromChain; uint256 nonce; } bytes32 public constant FULFILL_TX_TYPEHASH = keccak256( 'FulfillTx(uint256 amount,string fromUser,address toUser,string fromChain,uint256 nonce)' ); bytes32 public constant MANAGER_ROLE = keccak256('MANAGER_ROLE'); uint256 public constant FEE_DENOMINATOR = 10000; uint256 public constant MAX_RELAYERS = 100; bytes32 public immutable CURRENT_CHAIN_B32; IERC20 public immutable TOKEN; address public feeWallet; uint256 public limitPerSend; // maximum amount of tokens that can be sent in 1 tx uint256 public feeSend; uint256 public feeFulfill; uint256 public nonce; uint256 public relayerConsensusThreshold; mapping(address => Transaction[]) public transactions; mapping(string => mapping(string => mapping(uint256 => uint256))) public fulfilledAt; mapping(bytes32 => uint256) public exchangeRateFrom; EnumerableSet.Bytes32Set private availableChainsToSend; address[] public relayers; event SentTokens( address fromUser, string indexed toUser, string fromChain, string toChain, uint256 amount, uint256 exchangeRate ); event FulfilledTokens( string indexed fromUser, address indexed toUser, string fromChain, string toChain, uint256 amount, uint256 exchangeRate ); /// @param relayers_ list of relayers with NO DUPLICATES!! /// the check is not done for gas efficiency reasons constructor( IERC20 token, uint256 limitPerSend_, address feeWallet_, uint256 feeSend_, uint256 feeFulfill_, address owner, address[] memory relayers_, uint256 relayerConsensusThreshold_ ) EIP712('BridgeAssist', '1.0') { require(address(token) != address(0), 'Token is zero address'); require(feeWallet_ != address(0), 'Fee wallet is zero address'); require(feeSend_ < FEE_DENOMINATOR, 'Fee send is too high'); require(feeFulfill_ < FEE_DENOMINATOR, 'Fee fulfill is too high'); require(owner != address(0), 'Owner is zero address'); require(relayers_.length != 0, 'No relayers'); require(relayers_.length <= MAX_RELAYERS, 'Too many relayers'); require(relayerConsensusThreshold_ != 0, '0-of-N'); require(relayerConsensusThreshold_ <= relayers_.length, 'N-of-N'); for (uint256 i = 0; i < relayers_.length; ) { for (uint256 j = 0; j < relayers_.length; ) { require(i == j || relayers_[i] != relayers_[j], 'Duplicate relayers'); unchecked {++j;} } unchecked {++i;} } TOKEN = token; limitPerSend = limitPerSend_; feeWallet = feeWallet_; feeSend = feeSend_; feeFulfill = feeFulfill_; relayers = relayers_; relayerConsensusThreshold = relayerConsensusThreshold_; _grantRole(DEFAULT_ADMIN_ROLE, owner); CURRENT_CHAIN_B32 = bytes32( bytes.concat('evm.', bytes(Strings.toString(uint256(block.chainid)))) ); } /// @dev sends the user's tokens to another chain /// @param amount amount of tokens being sent /// @param toUser address of user on target chain /// @param toChain name of target chain (e.g. "evm.97", "sol.mainnet-beta") function send( uint256 amount, string memory toUser, // marked as memory to prevent "stack too deep" string calldata toChain ) external whenNotPaused { require(amount != 0, 'Amount = 0'); require(amount <= limitPerSend, 'Amount is more than limit'); require(bytes(toUser).length != 0, 'Field toUser is empty'); require(isSupportedChain(toChain), 'Chain is not supported'); uint256 exchangeRate = exchangeRateFrom[bytes32(bytes(toChain))]; require(amount % exchangeRate == 0, 'Amount is not divisible by exchange rate'); // minimum amount to make sure satisfactory amount of fee is taken require(amount / exchangeRate >= FEE_DENOMINATOR, 'amount < fee denominator'); // the fee recipient eats the precision loss uint256 currentFee = (amount * feeSend) / FEE_DENOMINATOR / exchangeRate; transactions[msg.sender].push( Transaction({ fromUser: msg.sender, toUser: toUser, amount: amount / exchangeRate - currentFee, // No logic of the system relies on this timestamp, // it's only needed for displaying on the frontend timestamp: block.timestamp, fromChain: CURRENT_CHAIN(), toChain: toChain, nonce: nonce++, block: block.number }) ); emit SentTokens( msg.sender, toUser, CURRENT_CHAIN(), toChain, // amount emitted is different than amount in the struct // because this is the amount that actually gets sent on this chain // it doesn't matter that much anyways since you can always get // the exchangeRate and do all the calculations yourself (amount - currentFee), exchangeRate ); { uint256 balanceBefore = TOKEN.balanceOf(address(this)); _receiveTokens(msg.sender, amount); uint256 balanceAfter = TOKEN.balanceOf(address(this)); require(balanceAfter - balanceBefore == amount, 'bad token'); } if (currentFee != 0) _dispenseTokens(feeWallet, currentFee * exchangeRate); } /// @dev fulfills a bridge transaction from another chain /// @param transaction bridge transaction to fulfill /// @param signatures signatures for `transaction` signed by `relayers` where /// `signatures[i]` is either a signature by `relayers[i]` or an empty array function fulfill(FulfillTx calldata transaction, bytes[] calldata signatures) external whenNotPaused { require(isSupportedChain(transaction.fromChain), 'Not supported fromChain'); require( fulfilledAt[transaction.fromChain][transaction.fromUser][transaction.nonce] == 0, 'Signature already fulfilled' ); require(signatures.length == relayers.length, 'Bad signatures length'); bytes32 hashedData = _hashTransaction(transaction); uint256 relayerConsensus = 0; for (uint256 i = 0; i < signatures.length; ) { if (signatures[i].length == 0) { unchecked {++i;} continue; } if (_verify(hashedData, signatures[i]) != relayers[i]) { revert(string.concat('Bad signature at index', Strings.toString(i))); } unchecked { ++relayerConsensus; ++i; } } require(relayerConsensus >= relayerConsensusThreshold, 'Not enough relayers'); fulfilledAt[transaction.fromChain][transaction.fromUser][transaction.nonce] = block.number; uint256 exchangeRate = exchangeRateFrom[bytes32(bytes(transaction.fromChain))]; uint256 amount = transaction.amount * exchangeRate; uint256 currentFee = (amount * feeFulfill) / FEE_DENOMINATOR; _dispenseTokens(transaction.toUser, amount - currentFee); if (currentFee != 0) _dispenseTokens(feeWallet, currentFee); emit FulfilledTokens( transaction.fromUser, transaction.toUser, transaction.fromChain, CURRENT_CHAIN(), // amount emitted is different than amount in the struct // because this is the amount that actually gets sent on this chain // it doesn't matter that much anyways since you can always get // the exchangeRate and do all the calculations yourself amount - currentFee, exchangeRate ); } /// @dev add chains to the whitelist /// @param chains chains to add /// @param exchangeRatesFromPow exchange rates for `chains` as a power of 10. /// exchange rate is a multiplier that fixes the difference /// between decimals on different chains function addChains(string[] calldata chains, uint256[] calldata exchangeRatesFromPow) external onlyRole(MANAGER_ROLE) { require(chains.length == exchangeRatesFromPow.length, 'bad input'); for (uint256 i; i < chains.length; ) { require( availableChainsToSend.add(bytes32(bytes(chains[i]))), 'Chain is already in the list' ); bytes32 chain = bytes32(bytes(chains[i])); // implicitly reverts on overflow uint256 exchangeRate = 10 ** exchangeRatesFromPow[i]; if (exchangeRateFrom[chain] != 0) { require(exchangeRateFrom[chain] == exchangeRate, 'cannot modify the exchange rate'); } else { exchangeRateFrom[chain] = exchangeRate; } unchecked { ++i; } } } /// @dev set the list of relayers and the consensus threshold used for fulfilling /// @param relayers_ list of relayers with NO DUPLICATES!! /// there is no check for that for gas efficiency reasons /// @param relayerConsensusThreshold_ number of relayers required to agree to fulfill a transaction function setRelayers(address[] calldata relayers_, uint256 relayerConsensusThreshold_) external onlyRole(MANAGER_ROLE) { require(relayers_.length != 0, 'No relayers'); require(relayers_.length <= MAX_RELAYERS, 'Too many relayers'); require(relayerConsensusThreshold_ != 0, '0-of-N'); require(relayerConsensusThreshold_ <= relayers_.length, 'N-of-N'); for (uint256 i = 0; i < relayers_.length; ) { for (uint256 j = 0; j < relayers_.length; ) { require(i == j || relayers_[i] != relayers_[j], 'Duplicate relayers'); unchecked {++j;} } unchecked {++i;} } relayers = relayers_; relayerConsensusThreshold = relayerConsensusThreshold_; } /// @dev remove chains from the whitelist /// @param chains chains to remove function removeChains(string[] calldata chains) external onlyRole(MANAGER_ROLE) { for (uint256 i; i < chains.length; ) { require( availableChainsToSend.remove(bytes32(bytes(chains[i]))), 'Chain is not in the list yet' ); unchecked { ++i; } } } /// @dev set fees for send and fulfill /// @param feeSend_ fee for send as numerator over FEE_DENOMINATOR /// @param feeFulfill_ fee for fulfill as numerator over FEE_DENOMINATOR function setFee(uint256 feeSend_, uint256 feeFulfill_) external onlyRole(MANAGER_ROLE) { require( feeSend != feeSend_ || feeFulfill != feeFulfill_, 'Fee numerator repeats' ); require(feeSend_ < FEE_DENOMINATOR, 'Fee is too high'); require(feeFulfill_ < FEE_DENOMINATOR, 'Fee is too high'); feeSend = feeSend_; feeFulfill = feeFulfill_; } /// @dev sets the wallet where fees are sent /// @param feeWallet_ fee wallet function setFeeWallet(address feeWallet_) external onlyRole(MANAGER_ROLE) { require(feeWallet != feeWallet_, 'Fee wallet repeats'); require(feeWallet_ != address(0), 'Fee wallet is zero address'); feeWallet = feeWallet_; } /// @dev sets the maximum amount of tokens that can be sent in one transaction /// @param limitPerSend_ limit value function setLimitPerSend(uint256 limitPerSend_) external onlyRole(MANAGER_ROLE) { require(limitPerSend != limitPerSend_, 'Limit per send repeats'); limitPerSend = limitPerSend_; } /// @dev withdraw tokens from bridge /// @param token token to withdraw /// @param to the address the tokens will be sent /// @param amount amount to withdraw function withdraw( IERC20 token, address to, uint256 amount ) external onlyRole(MANAGER_ROLE) { SafeERC20.safeTransfer(token, to, amount); } /// @dev pausing the contract function pause() external whenNotPaused onlyRole(MANAGER_ROLE) { _pause(); } /// @dev unpausing the contract function unpause() external whenPaused onlyRole(MANAGER_ROLE) { _unpause(); } /// @dev getting a slice of list of user transactions /// @param user_ user /// @param offset_ start index /// @param limit_ length of array /// @return transactions_ list of user transactions function getUserTransactionsSlice( address user_, uint256 offset_, uint256 limit_ ) external view returns (Transaction[] memory transactions_) { uint256 length = transactions[user_].length; require(length >= offset_ + limit_, 'bad offset/limit'); transactions_ = new Transaction[](limit_); for (uint256 i; i < limit_; ) { transactions_[i] = transactions[user_][offset_ + i]; unchecked { ++i; } } } /// @dev returns a list of bridge transactions sent by `user` /// from the current chain /// @param user sender address /// @return list of transactions function getUserTransactions(address user) external view returns (Transaction[] memory) { return transactions[user]; } /// @dev returns the amount of bridge transactions sent by `user` /// from the current chain /// @param user user /// @return amount of transactions function getUserTransactionsAmount(address user) external view returns (uint256) { return transactions[user].length; } /// @dev getting a list of supported chains /// @return list of supported chains function supportedChainList() external view returns (bytes32[] memory) { return availableChainsToSend.values(); } /// @return amount of relayers function relayersLength() external view returns (uint256) { return relayers.length; } /// @return list of relayers function getRelayers() external view returns (address[] memory) { return relayers; } /// @dev getting if chain is supported /// @return is chain supported function isSupportedChain(string calldata chain) public view returns (bool) { return availableChainsToSend.contains(bytes32(bytes(chain))); } /// @dev Returns the current chain name as a string. /// @return name of the current chain function CURRENT_CHAIN() public view returns (string memory) { return _toString(CURRENT_CHAIN_B32); } /// @dev receive `amount` of tokens from address `user` /// @param from address to take tokens from /// @param amount amount of tokens to take function _receiveTokens(address from, uint256 amount) private { SafeERC20.safeTransferFrom(TOKEN, from, address(this), amount); } /// @dev dispense `amount` of tokens to address `to` /// @param to address to dispense tokens to /// @param amount amount of tokens to dispense function _dispenseTokens(address to, uint256 amount) private { SafeERC20.safeTransfer(TOKEN, to, amount); } /// @dev hashes `Transaction` structure with EIP-712 standard /// @param transaction `Transaction` structure /// @return hash hashed `Transaction` structure function _hashTransaction(FulfillTx memory transaction) private view returns (bytes32) { return _hashTypedDataV4( keccak256( abi.encode( FULFILL_TX_TYPEHASH, transaction.amount, keccak256(abi.encodePacked(transaction.fromUser)), transaction.toUser, keccak256(abi.encodePacked(transaction.fromChain)), transaction.nonce ) ) ); } /// @dev verify whether `signature` of `data` is valid and return the signer address /// @param data keccak256 hash of the signed data /// @param signature signature of `data` /// @return the signer address function _verify(bytes32 data, bytes calldata signature) private pure returns (address) { return ECDSA.recover(data, signature); } /// @dev converts a null-terminated 32-byte string to a variable length string /// @param source null-terminated 32-byte string /// @return result a variable length null-terminated string function _toString(bytes32 source) private pure returns (string memory result) { uint8 length = 0; while (source[length] != 0 && length < 32) { length++; } assembly { result := mload(0x40) // new "memory end" including padding (the string isn't larger than 32 bytes) mstore(0x40, add(result, 0x40)) // store length in memory mstore(result, length) // write actual data mstore(add(result, 0x20), source) } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; import "../utils/Context.sol"; import "../utils/Strings.sol"; import "../utils/introspection/ERC165.sol"; /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping(address => bool) members; bytes32 adminRole; } mapping(bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view virtual override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `_msgSender()` is missing `role`. * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. * * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ */ function _checkRole(bytes32 role, address account) internal view virtual { if (!hasRole(role, account)) { revert( string( abi.encodePacked( "AccessControl: account ", Strings.toHexString(account), " is missing role ", Strings.toHexString(uint256(role), 32) ) ) ); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleGranted} event. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. * * May emit a {RoleRevoked} event. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been revoked `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. * * May emit a {RoleRevoked} event. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * May emit a {RoleGranted} event. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== * * NOTE: This function is deprecated in favor of {_grantRole}. */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { bytes32 previousAdminRole = getRoleAdmin(role); _roles[role].adminRole = adminRole; emit RoleAdminChanged(role, previousAdminRole, adminRole); } /** * @dev Grants `role` to `account`. * * Internal function without access restriction. * * May emit a {RoleGranted} event. */ function _grantRole(bytes32 role, address account) internal virtual { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } /** * @dev Revokes `role` from `account`. * * Internal function without access restriction. * * May emit a {RoleRevoked} event. */ function _revokeRole(bytes32 role, address account) internal virtual { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor() { _paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { _requireNotPaused(); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { _requirePaused(); _; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Throws if the contract is paused. */ function _requireNotPaused() internal view virtual { require(!paused(), "Pausable: paused"); } /** * @dev Throws if the contract is not paused. */ function _requirePaused() internal view virtual { require(paused(), "Pausable: not paused"); } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/draft-IERC20Permit.sol"; import "../../../utils/Address.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } function safePermit( IERC20Permit token, address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) internal { uint256 nonceBefore = token.nonces(owner); token.permit(owner, spender, value, deadline, v, r, s); uint256 nonceAfter = token.nonces(owner); require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed"); } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address-functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly /// @solidity memory-safe-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV // Deprecated in v4.8 } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. /// @solidity memory-safe-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/cryptography/EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.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 EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* 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]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } 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 ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/structs/EnumerableSet.sol) // This file was procedurally generated from scripts/generate/templates/EnumerableSet.js. pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. * * [WARNING] * ==== * Trying to delete such a structure from storage will likely result in data corruption, rendering the structure * unusable. * See https://github.com/ethereum/solidity/pull/11843[ethereum/solidity#11843] for more info. * * In order to clean an EnumerableSet, you can either remove all elements one by one or create a fresh instance using an * array of EnumerableSet. * ==== */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping(bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; if (lastIndex != toDeleteIndex) { bytes32 lastValue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastValue; // Update the index for the moved value set._indexes[lastValue] = valueIndex; // Replace lastValue's index to valueIndex } // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { return set._values[index]; } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function _values(Set storage set) private view returns (bytes32[] memory) { return set._values; } // Bytes32Set struct Bytes32Set { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _add(set._inner, value); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) { return _remove(set._inner, value); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) { return _contains(set._inner, value); } /** * @dev Returns the number of values in the set. O(1). */ function length(Bytes32Set storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) { return _at(set._inner, index); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(Bytes32Set storage set) internal view returns (bytes32[] memory) { bytes32[] memory store = _values(set._inner); bytes32[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(uint160(value)))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint160(uint256(_at(set._inner, index)))); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(AddressSet storage set) internal view returns (address[] memory) { bytes32[] memory store = _values(set._inner); address[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values in the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } /** * @dev Return the entire set in an array * * WARNING: This operation will copy the entire storage to memory, which can be quite expensive. This is designed * to mostly be used by view accessors that are queried without any gas fees. Developers should keep in mind that * this function has an unbounded cost, and using it as part of a state-changing function may render the function * uncallable if the set grows to a point where copying to memory consumes too much gas to fit in a block. */ function values(UintSet storage set) internal view returns (uint256[] memory) { bytes32[] memory store = _values(set._inner); uint256[] memory result; /// @solidity memory-safe-assembly assembly { result := store } return result; } }
{ "evmVersion": "paris", "libraries": {}, "metadata": { "bytecodeHash": "ipfs", "useLiteralContent": true }, "optimizer": { "enabled": true, "runs": 200 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"limitPerSend_","type":"uint256"},{"internalType":"address","name":"feeWallet_","type":"address"},{"internalType":"uint256","name":"feeSend_","type":"uint256"},{"internalType":"uint256","name":"feeFulfill_","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"address[]","name":"relayers_","type":"address[]"},{"internalType":"uint256","name":"relayerConsensusThreshold_","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"string","name":"fromUser","type":"string"},{"indexed":true,"internalType":"address","name":"toUser","type":"address"},{"indexed":false,"internalType":"string","name":"fromChain","type":"string"},{"indexed":false,"internalType":"string","name":"toChain","type":"string"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exchangeRate","type":"uint256"}],"name":"FulfilledTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"fromUser","type":"address"},{"indexed":true,"internalType":"string","name":"toUser","type":"string"},{"indexed":false,"internalType":"string","name":"fromChain","type":"string"},{"indexed":false,"internalType":"string","name":"toChain","type":"string"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"exchangeRate","type":"uint256"}],"name":"SentTokens","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"CURRENT_CHAIN","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"CURRENT_CHAIN_B32","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FULFILL_TX_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_RELAYERS","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[]","name":"chains","type":"string[]"},{"internalType":"uint256[]","name":"exchangeRatesFromPow","type":"uint256[]"}],"name":"addChains","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"exchangeRateFrom","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeFulfill","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeSend","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeWallet","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"fromUser","type":"string"},{"internalType":"address","name":"toUser","type":"address"},{"internalType":"string","name":"fromChain","type":"string"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct BridgeAssist.FulfillTx","name":"transaction","type":"tuple"},{"internalType":"bytes[]","name":"signatures","type":"bytes[]"}],"name":"fulfill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"},{"internalType":"string","name":"","type":"string"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"fulfilledAt","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRelayers","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserTransactions","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"address","name":"fromUser","type":"address"},{"internalType":"string","name":"toUser","type":"string"},{"internalType":"string","name":"fromChain","type":"string"},{"internalType":"string","name":"toChain","type":"string"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"block","type":"uint256"}],"internalType":"struct BridgeAssist.Transaction[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"getUserTransactionsAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user_","type":"address"},{"internalType":"uint256","name":"offset_","type":"uint256"},{"internalType":"uint256","name":"limit_","type":"uint256"}],"name":"getUserTransactionsSlice","outputs":[{"components":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"address","name":"fromUser","type":"address"},{"internalType":"string","name":"toUser","type":"string"},{"internalType":"string","name":"fromChain","type":"string"},{"internalType":"string","name":"toChain","type":"string"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"block","type":"uint256"}],"internalType":"struct BridgeAssist.Transaction[]","name":"transactions_","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"chain","type":"string"}],"name":"isSupportedChain","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"limitPerSend","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nonce","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"relayerConsensusThreshold","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"relayers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"relayersLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string[]","name":"chains","type":"string[]"}],"name":"removeChains","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"toUser","type":"string"},{"internalType":"string","name":"toChain","type":"string"}],"name":"send","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"feeSend_","type":"uint256"},{"internalType":"uint256","name":"feeFulfill_","type":"uint256"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"feeWallet_","type":"address"}],"name":"setFeeWallet","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"limitPerSend_","type":"uint256"}],"name":"setLimitPerSend","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"relayers_","type":"address[]"},{"internalType":"uint256","name":"relayerConsensusThreshold_","type":"uint256"}],"name":"setRelayers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"supportedChainList","outputs":[{"internalType":"bytes32[]","name":"","type":"bytes32[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"transactions","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"timestamp","type":"uint256"},{"internalType":"address","name":"fromUser","type":"address"},{"internalType":"string","name":"toUser","type":"string"},{"internalType":"string","name":"fromChain","type":"string"},{"internalType":"string","name":"toChain","type":"string"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"block","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101806040523480156200001257600080fd5b5060405162004a7638038062004a76833981016040819052620000359162000859565b604080518082018252600c81526b109c9a5919d9505cdcda5cdd60a21b6020808301918252835180850190945260038452620312e360ec1b908401526001805460ff191690558151902060e08190527fe6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b36101008190524660a0529192917f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f620001238184846040805160208101859052908101839052606081018290524660808201523060a082015260009060c0016040516020818303038152906040528051906020012090509392505050565b6080523060c052610120525050506001600160a01b03891690506200018f5760405162461bcd60e51b815260206004820152601560248201527f546f6b656e206973207a65726f2061646472657373000000000000000000000060448201526064015b60405180910390fd5b6001600160a01b038616620001e75760405162461bcd60e51b815260206004820152601a60248201527f4665652077616c6c6574206973207a65726f2061646472657373000000000000604482015260640162000186565b61271085106200023a5760405162461bcd60e51b815260206004820152601460248201527f4665652073656e6420697320746f6f2068696768000000000000000000000000604482015260640162000186565b61271084106200028d5760405162461bcd60e51b815260206004820152601760248201527f4665652066756c66696c6c20697320746f6f2068696768000000000000000000604482015260640162000186565b6001600160a01b038316620002e55760405162461bcd60e51b815260206004820152601560248201527f4f776e6572206973207a65726f20616464726573730000000000000000000000604482015260640162000186565b8151600003620003265760405162461bcd60e51b815260206004820152600b60248201526a4e6f2072656c617965727360a81b604482015260640162000186565b6064825111156200036e5760405162461bcd60e51b8152602060048201526011602482015270546f6f206d616e792072656c617965727360781b604482015260640162000186565b80600003620003a95760405162461bcd60e51b81526020600482015260066024820152651816b7b316a760d11b604482015260640162000186565b8151811115620003e55760405162461bcd60e51b81526020600482015260066024820152652716b7b316a760d11b604482015260640162000186565b60005b8251811015620004ae5760005b8351811015620004a457808214806200045857508381815181106200041e576200041e62000997565b60200260200101516001600160a01b031684838151811062000444576200044462000997565b60200260200101516001600160a01b031614155b6200049b5760405162461bcd60e51b81526020600482015260126024820152714475706c69636174652072656c617965727360701b604482015260640162000186565b600101620003f5565b50600101620003e8565b506001600160a01b038089166101605260028890556001805491881661010002610100600160a81b03199092169190911790556003859055600484905581516200050090600c90602085019062000797565b5060068190556200051360008462000568565b62000529466200060960201b620021971760201c565b6040516020016200053b9190620009ad565b6040516020818303038152906040526200055590620009ee565b610140525062000a169650505050505050565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000605576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620005c43390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b606060006200062383620006ad60201b620022291760201c565b60010190506000816001600160401b0381111562000645576200064562000843565b6040519080825280601f01601f19166020018201604052801562000670576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846200067a57509392505050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310620006f7577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831062000724576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106200074357662386f26fc10000830492506010015b6305f5e10083106200075c576305f5e100830492506008015b61271083106200077157612710830492506004015b6064831062000784576064830492506002015b600a831062000791576001015b92915050565b828054828255906000526020600020908101928215620007ef579160200282015b82811115620007ef57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190620007b8565b50620007fd92915062000801565b5090565b5b80821115620007fd576000815560010162000802565b6001600160a01b03811681146200082e57600080fd5b50565b80516200083e8162000818565b919050565b634e487b7160e01b600052604160045260246000fd5b600080600080600080600080610100898b0312156200087757600080fd5b8851620008848162000818565b809850506020808a0151975060408a0151620008a08162000818565b8097505060608a0151955060808a0151945060a08a0151620008c28162000818565b60c08b01519094506001600160401b0380821115620008e057600080fd5b818c0191508c601f830112620008f557600080fd5b8151818111156200090a576200090a62000843565b8060051b604051601f19603f8301168101818110858211171562000932576200093262000843565b60405291825284820192508381018501918f8311156200095157600080fd5b938501935b828510156200097a576200096a8562000831565b8452938501939285019262000956565b80975050505050505060e089015190509295985092959890939650565b634e487b7160e01b600052603260045260246000fd5b6332bb369760e11b81526000825160005b81811015620009dd5760208186018101516004868401015201620009be565b506000920160040191825250919050565b8051602080830151919081101562000a10576000198160200360031b1b821691505b50919050565b60805160a05160c05160e05161010051610120516101405161016051613fd762000a9f6000396000818161041301528181611db501528181611e4c015281816126cb015261277e0152600081816104e901526112d301526000612d2901526000612d7801526000612d5301526000612cac01526000612cd601526000612d000152613fd76000f3fe608060405234801561001057600080fd5b50600436106102685760003560e01c8063984bd4b211610151578063d3649d6c116100c3578063e029159211610087578063e02915921461058e578063ec87621c146105a1578063ef925399146105b6578063f25f4b56146105c9578063f7b2bf68146105e1578063fe62c28b1461063357600080fd5b8063d3649d6c14610541578063d547741f1461054a578063d73792a91461055d578063d9caed1214610566578063e026faa71461057957600080fd5b8063ac37b22611610115578063ac37b226146104e4578063ae7cabbd1461050b578063affed0e014610513578063b049cec71461051c578063b46c31a41461052f578063cfae73071461053857600080fd5b8063984bd4b21461049b5780639a48e7f9146104ae5780639debb3bd146104c1578063a217fddf146104c9578063a427b242146104d157600080fd5b80633f4ba83a116101ea5780637233a666116101ae5780637233a666146103f957806382bfefc81461040e5780638456cb591461044d57806390d49b9d1461045557806391d148541461046857806397901c5a1461047b57600080fd5b80633f4ba83a1461038c578063416553261461039457806352f7c988146103bb5780635c975abb146103ce5780635f282ba4146103d957600080fd5b8063248a9ca311610231578063248a9ca3146102f95780632aaf5ed51461032a5780632cf267011461033d5780632f2ff15d1461036657806336568abe1461037957600080fd5b8062f54e801461026d57806301ffc9a71461028257806314538128146102aa578063179ff4b2146102d15780631e12ef29146102e6575b600080fd5b61028061027b36600461325d565b61063c565b005b6102956102903660046132c8565b610818565b60405190151581526020015b60405180910390f35b6102bd6102b8366004613307565b61084f565b6040516102a1989796959493929190613383565b6102d9610a52565b6040516102a191906133f5565b6102806102f4366004613442565b610ab4565b61031c610307366004613483565b60009081526020819052604090206001015490565b6040519081526020016102a1565b61028061033836600461349c565b610b69565b61031c61034b3660046134e7565b6001600160a01b031660009081526007602052604090205490565b610280610374366004613504565b610d61565b610280610387366004613504565b610d8b565b610280610e09565b61031c7fcb87858191633bd77793d261daabf61ecc1356b8074c6678235852edf88a10dc81565b6102806103c9366004613534565b610e34565b60015460ff16610295565b6103ec6103e7366004613556565b610f35565b6040516102a1919061358b565b6104016112cc565b6040516102a1919061366e565b6104357f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016102a1565b6102806112fc565b6102806104633660046134e7565b611324565b610295610476366004613504565b611412565b61031c610489366004613483565b60096020526000908152604090205481565b6102806104a9366004613681565b61143b565b6104356104bc366004613483565b61189c565b61031c606481565b61031c600081565b6102806104df366004613483565b6118c6565b61031c7f000000000000000000000000000000000000000000000000000000000000000081565b600c5461031c565b61031c60055481565b61029561052a366004613732565b61192e565b61031c60045481565b61031c60035481565b61031c60025481565b610280610558366004613504565b61194c565b61031c61271081565b610280610574366004613767565b611971565b610581611994565b6040516102a191906137a8565b61028061059c366004613882565b6119a0565b61031c600080516020613f8283398151915281565b6103ec6105c43660046134e7565b611f2c565b6001546104359061010090046001600160a01b031681565b61031c6105ef3660046138e5565b825160208185018101805160088252928201958201959095209190945282518084018501805192815290850193850193909320925291526000908152604090205481565b61031c60065481565b600080516020613f8283398151915261065481612301565b8382146106945760405162461bcd60e51b8152602060048201526009602482015268189859081a5b9c1d5d60ba1b60448201526064015b60405180910390fd5b60005b84811015610810576106d78686838181106106b4576106b4613951565b90506020028101906106c69190613967565b6106cf916139ad565b600a9061230b565b6107235760405162461bcd60e51b815260206004820152601c60248201527f436861696e20697320616c726561647920696e20746865206c69737400000000604482015260640161068b565b600086868381811061073757610737613951565b90506020028101906107499190613967565b610752916139ad565b9050600085858481811061076857610768613951565b90506020020135600a61077b9190613ac5565b600083815260096020526040902054909150156107f45760008281526009602052604090205481146107ef5760405162461bcd60e51b815260206004820152601f60248201527f63616e6e6f74206d6f64696679207468652065786368616e6765207261746500604482015260640161068b565b610806565b60008281526009602052604090208190555b5050600101610697565b505050505050565b60006001600160e01b03198216637965db0b60e01b148061084957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6007602052816000526040600020818154811061086b57600080fd5b600091825260209091206008909102018054600182015460028301546003840180549396509194506001600160a01b031692916108a790613ad1565b80601f01602080910402602001604051908101604052809291908181526020018280546108d390613ad1565b80156109205780601f106108f557610100808354040283529160200191610920565b820191906000526020600020905b81548152906001019060200180831161090357829003601f168201915b50505050509080600401805461093590613ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461096190613ad1565b80156109ae5780601f10610983576101008083540402835291602001916109ae565b820191906000526020600020905b81548152906001019060200180831161099157829003601f168201915b5050505050908060050180546109c390613ad1565b80601f01602080910402602001604051908101604052809291908181526020018280546109ef90613ad1565b8015610a3c5780601f10610a1157610100808354040283529160200191610a3c565b820191906000526020600020905b815481529060010190602001808311610a1f57829003601f168201915b5050505050908060060154908060070154905088565b6060600c805480602002602001604051908101604052809291908181526020018280548015610aaa57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a8c575b5050505050905090565b600080516020613f82833981519152610acc81612301565b60005b82811015610b6357610b0f848483818110610aec57610aec613951565b9050602002810190610afe9190613967565b610b07916139ad565b600a90612317565b610b5b5760405162461bcd60e51b815260206004820152601c60248201527f436861696e206973206e6f7420696e20746865206c6973742079657400000000604482015260640161068b565b600101610acf565b50505050565b600080516020613f82833981519152610b8181612301565b6000839003610bc05760405162461bcd60e51b815260206004820152600b60248201526a4e6f2072656c617965727360a81b604482015260640161068b565b6064831115610c055760405162461bcd60e51b8152602060048201526011602482015270546f6f206d616e792072656c617965727360781b604482015260640161068b565b81600003610c3e5760405162461bcd60e51b81526020600482015260066024820152651816b7b316a760d11b604482015260640161068b565b82821115610c775760405162461bcd60e51b81526020600482015260066024820152652716b7b316a760d11b604482015260640161068b565b60005b83811015610d4b5760005b84811015610d425780821480610cf95750858582818110610ca857610ca8613951565b9050602002016020810190610cbd91906134e7565b6001600160a01b0316868684818110610cd857610cd8613951565b9050602002016020810190610ced91906134e7565b6001600160a01b031614155b610d3a5760405162461bcd60e51b81526020600482015260126024820152714475706c69636174652072656c617965727360701b604482015260640161068b565b600101610c85565b50600101610c7a565b50610d58600c85856131a1565b50506006555050565b600082815260208190526040902060010154610d7c81612301565b610d868383612323565b505050565b6001600160a01b0381163314610dfb5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161068b565b610e0582826123a7565b5050565b610e1161240c565b600080516020613f82833981519152610e2981612301565b610e31612457565b50565b600080516020613f82833981519152610e4c81612301565b82600354141580610e5f57508160045414155b610ea35760405162461bcd60e51b8152602060048201526015602482015274466565206e756d657261746f72207265706561747360581b604482015260640161068b565b6127108310610ee65760405162461bcd60e51b815260206004820152600f60248201526e08ccaca40d2e640e8dede40d0d2ced608b1b604482015260640161068b565b6127108210610f295760405162461bcd60e51b815260206004820152600f60248201526e08ccaca40d2e640e8dede40d0d2ced608b1b604482015260640161068b565b50600391909155600455565b6001600160a01b038316600090815260076020526040902054606090610f5b8385613b0b565b811015610f9d5760405162461bcd60e51b815260206004820152601060248201526f189859081bd9999cd95d0bdb1a5b5a5d60821b604482015260640161068b565b826001600160401b03811115610fb557610fb56137e0565b60405190808252806020026020018201604052801561103757816020015b611024604051806101000160405280600081526020016000815260200160006001600160a01b0316815260200160608152602001606081526020016060815260200160008152602001600081525090565b815260200190600190039081610fd35790505b50915060005b838110156112c3576001600160a01b03861660009081526007602052604090206110678287613b0b565b8154811061107757611077613951565b90600052602060002090600802016040518061010001604052908160008201548152602001600182015481526020016002820160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020016003820180546110e490613ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461111090613ad1565b801561115d5780601f106111325761010080835404028352916020019161115d565b820191906000526020600020905b81548152906001019060200180831161114057829003601f168201915b5050505050815260200160048201805461117690613ad1565b80601f01602080910402602001604051908101604052809291908181526020018280546111a290613ad1565b80156111ef5780601f106111c4576101008083540402835291602001916111ef565b820191906000526020600020905b8154815290600101906020018083116111d257829003601f168201915b5050505050815260200160058201805461120890613ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461123490613ad1565b80156112815780601f1061125657610100808354040283529160200191611281565b820191906000526020600020905b81548152906001019060200180831161126457829003601f168201915b50505050508152602001600682015481526020016007820154815250508382815181106112b0576112b0613951565b602090810291909101015260010161103d565b50509392505050565b60606112f77f00000000000000000000000000000000000000000000000000000000000000006124a9565b905090565b611304612514565b600080516020613f8283398151915261131c81612301565b610e3161255a565b600080516020613f8283398151915261133c81612301565b6001546001600160a01b0380841661010090920416036113935760405162461bcd60e51b81526020600482015260126024820152714665652077616c6c6574207265706561747360701b604482015260640161068b565b6001600160a01b0382166113e95760405162461bcd60e51b815260206004820152601a60248201527f4665652077616c6c6574206973207a65726f2061646472657373000000000000604482015260640161068b565b50600180546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b611443612514565b61145361052a6060850185613967565b61149f5760405162461bcd60e51b815260206004820152601760248201527f4e6f7420737570706f727465642066726f6d436861696e000000000000000000604482015260640161068b565b60086114ae6060850185613967565b6040516114bc929190613b1e565b90815260200160405180910390208380602001906114da9190613967565b6040516114e8929190613b1e565b90815260200160405180910390206000846080013581526020019081526020016000205460001461155b5760405162461bcd60e51b815260206004820152601b60248201527f5369676e617475726520616c72656164792066756c66696c6c65640000000000604482015260640161068b565b600c5481146115a45760405162461bcd60e51b8152602060048201526015602482015274084c2c840e6d2cedcc2e8eae4cae640d8cadccee8d605b1b604482015260640161068b565b60006115b76115b285613b2e565b612595565b90506000805b838110156116a8578484828181106115d7576115d7613951565b90506020028101906115e99190613967565b90506000036115fa576001016115bd565b600c818154811061160d5761160d613951565b6000918252602090912001546001600160a01b031661164f8487878581811061163857611638613951565b905060200281019061164a9190613967565b61267c565b6001600160a01b03161461169c5761166681612197565b6040516020016116769190613bde565b60408051601f198184030181529082905262461bcd60e51b825261068b9160040161366e565b600191820191016115bd565b506006548110156116f15760405162461bcd60e51b81526020600482015260136024820152724e6f7420656e6f7567682072656c617965727360681b604482015260640161068b565b4360086117016060880188613967565b60405161170f929190613b1e565b908152602001604051809103902086806020019061172d9190613967565b60405161173b929190613b1e565b908152604080516020928190038301902060808901356000908152925281209190915560098161176e6060890189613967565b611777916139ad565b815260208101919091526040016000908120549150611797828835613c1c565b90506000612710600454836117ac9190613c1c565b6117b69190613c49565b90506117da6117cb60608a0160408b016134e7565b6117d58385613c5d565b6126c6565b80156117fb576001546117fb9061010090046001600160a01b0316826126c6565b61180b6060890160408a016134e7565b6001600160a01b031661182160208a018a613967565b60405161182f929190613b1e565b6040519081900390207f1a82954c00ba4231b18dbc7d7d5187028cfc140ac6efedeeb60397b8710a9d9361186660608c018c613967565b61186e6112cc565b6118788789613c5d565b8960405161188a959493929190613c99565b60405180910390a35050505050505050565b600c81815481106118ac57600080fd5b6000918252602090912001546001600160a01b0316905081565b600080516020613f828339815191526118de81612301565b81600254036119285760405162461bcd60e51b81526020600482015260166024820152754c696d6974207065722073656e64207265706561747360501b604482015260640161068b565b50600255565b600061194561193d83856139ad565b600a906126f1565b9392505050565b60008281526020819052604090206001015461196781612301565b610d8683836123a7565b600080516020613f8283398151915261198981612301565b610b63848484612709565b60606112f7600a61276c565b6119a8612514565b836000036119e55760405162461bcd60e51b815260206004820152600a6024820152690416d6f756e74203d20360b41b604482015260640161068b565b600254841115611a375760405162461bcd60e51b815260206004820152601960248201527f416d6f756e74206973206d6f7265207468616e206c696d697400000000000000604482015260640161068b565b8251600003611a805760405162461bcd60e51b81526020600482015260156024820152744669656c6420746f5573657220697320656d70747960581b604482015260640161068b565b611a8a828261192e565b611acf5760405162461bcd60e51b815260206004820152601660248201527510da185a5b881a5cc81b9bdd081cdd5c1c1bdc9d195960521b604482015260640161068b565b6000600981611ade84866139ad565b81526020019081526020016000205490508085611afb9190613cd4565b15611b595760405162461bcd60e51b815260206004820152602860248201527f416d6f756e74206973206e6f7420646976697369626c652062792065786368616044820152676e6765207261746560c01b606482015260840161068b565b612710611b668287613c49565b1015611bb45760405162461bcd60e51b815260206004820152601860248201527f616d6f756e74203c206665652064656e6f6d696e61746f720000000000000000604482015260640161068b565b60008161271060035488611bc89190613c1c565b611bd29190613c49565b611bdc9190613c49565b3360009081526007602052604090819020815161010081019092529192508083611c06868b613c49565b611c109190613c5d565b815242602082015233604082015260608101889052608001611c306112cc565b815260200186868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525093855250506005805460209094019392909150611c8383613ce8565b909155508152436020918201528254600180820185556000948552938290208351600890920201908155908201519281019290925560408101516002830180546001600160a01b0319166001600160a01b0390921691909117905560608101519091906003820190611cf59082613d47565b5060808201516004820190611d0a9082613d47565b5060a08201516005820190611d1f9082613d47565b5060c0820151816006015560e08201518160070155505084604051611d449190613e06565b60405180910390207f39ca9eb9de2c42145bdc9525fbfac365c3f8e2abdf97dd94e64ec1258365b9f733611d766112cc565b8787611d82878d613c5d565b88604051611d9596959493929190613e22565b60405180910390a26040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611e04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e289190613e6f565b9050611e343388612779565b6040516370a0823160e01b81523060048201526000907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906370a0823190602401602060405180830381865afa158015611e9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebf9190613e6f565b905087611ecc8383613c5d565b14611f055760405162461bcd60e51b81526020600482015260096024820152683130b2103a37b5b2b760b91b604482015260640161068b565b50508015610810576001546108109061010090046001600160a01b03166117d58484613c1c565b6001600160a01b0381166000908152600760209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561218c5760008481526020908190206040805161010081018252600886029092018054835260018101549383019390935260028301546001600160a01b031690820152600382018054919291606084019190611fc390613ad1565b80601f0160208091040260200160405190810160405280929190818152602001828054611fef90613ad1565b801561203c5780601f106120115761010080835404028352916020019161203c565b820191906000526020600020905b81548152906001019060200180831161201f57829003601f168201915b5050505050815260200160048201805461205590613ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461208190613ad1565b80156120ce5780601f106120a3576101008083540402835291602001916120ce565b820191906000526020600020905b8154815290600101906020018083116120b157829003601f168201915b505050505081526020016005820180546120e790613ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461211390613ad1565b80156121605780601f1061213557610100808354040283529160200191612160565b820191906000526020600020905b81548152906001019060200180831161214357829003601f168201915b505050505081526020016006820154815260200160078201548152505081526020019060010190611f64565b505050509050919050565b606060006121a483612229565b60010190506000816001600160401b038111156121c3576121c36137e0565b6040519080825280601f01601f1916602001820160405280156121ed576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846121f757509392505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106122685772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612294576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106122b257662386f26fc10000830492506010015b6305f5e10083106122ca576305f5e100830492506008015b61271083106122de57612710830492506004015b606483106122f0576064830492506002015b600a83106108495760010192915050565b610e3181336127a5565b600061194583836127d8565b60006119458383612827565b61232d8282611412565b610e05576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556123633390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6123b18282611412565b15610e05576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60015460ff166124555760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161068b565b565b61245f61240c565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b606060005b828160ff16602081106124c3576124c3613951565b1a60f81b6001600160f81b031916158015906124e2575060208160ff16105b156124f957806124f181613e88565b9150506124ae565b60405191506040820160405280825282602083015250919050565b60015460ff16156124555760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161068b565b612562612514565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2583361248c565b60006108497fcb87858191633bd77793d261daabf61ecc1356b8074c6678235852edf88a10dc836000015184602001516040516020016125d59190613e06565b60405160208183030381529060405280519060200120856040015186606001516040516020016126059190613e06565b60405160208183030381529060405280519060200120876080015160405160200161266196959493929190958652602086019490945260408501929092526001600160a01b03166060840152608083015260a082015260c00190565b6040516020818303038152906040528051906020012061291a565b60006126be8484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061296892505050565b949350505050565b610e057f00000000000000000000000000000000000000000000000000000000000000008383612709565b60008181526001830160205260408120541515611945565b6040516001600160a01b038316602482015260448101829052610d8690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261298c565b6060600061194583612a5e565b610e057f0000000000000000000000000000000000000000000000000000000000000000833084612aba565b6127af8282611412565b610e05576127bc81612af2565b6127c7836020612b04565b604051602001611676929190613ea7565b600081815260018301602052604081205461281f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610849565b506000610849565b6000818152600183016020526040812054801561291057600061284b600183613c5d565b855490915060009061285f90600190613c5d565b90508181146128c457600086600001828154811061287f5761287f613951565b90600052602060002001549050808760000184815481106128a2576128a2613951565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806128d5576128d5613f1c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610849565b6000915050610849565b6000610849612927612c9f565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006129778585612dc6565b9150915061298481612e0b565b509392505050565b60006129e1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612f559092919063ffffffff16565b805190915015610d8657808060200190518101906129ff9190613f32565b610d865760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161068b565b606081600001805480602002602001604051908101604052809291908181526020018280548015612aae57602002820191906000526020600020905b815481526020019060010190808311612a9a575b50505050509050919050565b6040516001600160a01b0380851660248301528316604482015260648101829052610b639085906323b872dd60e01b90608401612735565b60606108496001600160a01b03831660145b60606000612b13836002613c1c565b612b1e906002613b0b565b6001600160401b03811115612b3557612b356137e0565b6040519080825280601f01601f191660200182016040528015612b5f576020820181803683370190505b509050600360fc1b81600081518110612b7a57612b7a613951565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612ba957612ba9613951565b60200101906001600160f81b031916908160001a9053506000612bcd846002613c1c565b612bd8906001613b0b565b90505b6001811115612c50576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612c0c57612c0c613951565b1a60f81b828281518110612c2257612c22613951565b60200101906001600160f81b031916908160001a90535060049490941c93612c4981613f54565b9050612bdb565b5083156119455760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161068b565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612cf857507f000000000000000000000000000000000000000000000000000000000000000046145b15612d2257507f000000000000000000000000000000000000000000000000000000000000000090565b50604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103612dfc5760208301516040840151606085015160001a612df087828585612f64565b94509450505050612e04565b506000905060025b9250929050565b6000816004811115612e1f57612e1f613f6b565b03612e275750565b6001816004811115612e3b57612e3b613f6b565b03612e885760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161068b565b6002816004811115612e9c57612e9c613f6b565b03612ee95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161068b565b6003816004811115612efd57612efd613f6b565b03610e315760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161068b565b60606126be8484600085613028565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612f9b575060009050600361301f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612fef573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166130185760006001925092505061301f565b9150600090505b94509492505050565b6060824710156130895760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161068b565b600080866001600160a01b031685876040516130a59190613e06565b60006040518083038185875af1925050503d80600081146130e2576040519150601f19603f3d011682016040523d82523d6000602084013e6130e7565b606091505b50915091506130f887838387613103565b979650505050505050565b6060831561317257825160000361316b576001600160a01b0385163b61316b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161068b565b50816126be565b6126be83838151156131875781518083602001fd5b8060405162461bcd60e51b815260040161068b919061366e565b8280548282559060005260206000209081019282156131f4579160200282015b828111156131f45781546001600160a01b0319166001600160a01b038435161782556020909201916001909101906131c1565b50613200929150613204565b5090565b5b808211156132005760008155600101613205565b60008083601f84011261322b57600080fd5b5081356001600160401b0381111561324257600080fd5b6020830191508360208260051b8501011115612e0457600080fd5b6000806000806040858703121561327357600080fd5b84356001600160401b038082111561328a57600080fd5b61329688838901613219565b909650945060208701359150808211156132af57600080fd5b506132bc87828801613219565b95989497509550505050565b6000602082840312156132da57600080fd5b81356001600160e01b03198116811461194557600080fd5b6001600160a01b0381168114610e3157600080fd5b6000806040838503121561331a57600080fd5b8235613325816132f2565b946020939093013593505050565b60005b8381101561334e578181015183820152602001613336565b50506000910152565b6000815180845261336f816020860160208601613333565b601f01601f19169290920160200192915050565b888152602081018890526001600160a01b0387166040820152610100606082018190526000906133b583820189613357565b905082810360808401526133c98188613357565b905082810360a08401526133dd8187613357565b60c0840195909552505060e001529695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156134365783516001600160a01b031683529284019291840191600101613411565b50909695505050505050565b6000806020838503121561345557600080fd5b82356001600160401b0381111561346b57600080fd5b61347785828601613219565b90969095509350505050565b60006020828403121561349557600080fd5b5035919050565b6000806000604084860312156134b157600080fd5b83356001600160401b038111156134c757600080fd5b6134d386828701613219565b909790965060209590950135949350505050565b6000602082840312156134f957600080fd5b8135611945816132f2565b6000806040838503121561351757600080fd5b823591506020830135613529816132f2565b809150509250929050565b6000806040838503121561354757600080fd5b50508035926020909101359150565b60008060006060848603121561356b57600080fd5b8335613576816132f2565b95602085013595506040909401359392505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561366057888303603f190185528151805184528781015188850152868101516001600160a01b03811688860152610100905060608083015182828801526135ff83880182613357565b925050506080808301518683038288015261361a8382613357565b9250505060a080830151868303828801526136358382613357565b60c0858101519089015260e094850151949097019390935250505093860193908601906001016135b2565b509098975050505050505050565b6020815260006119456020830184613357565b60008060006040848603121561369657600080fd5b83356001600160401b03808211156136ad57600080fd5b9085019060a082880312156136c157600080fd5b909350602085013590808211156136d757600080fd5b506136e486828701613219565b9497909650939450505050565b60008083601f84011261370357600080fd5b5081356001600160401b0381111561371a57600080fd5b602083019150836020828501011115612e0457600080fd5b6000806020838503121561374557600080fd5b82356001600160401b0381111561375b57600080fd5b613477858286016136f1565b60008060006060848603121561377c57600080fd5b8335613787816132f2565b92506020840135613797816132f2565b929592945050506040919091013590565b6020808252825182820181905260009190848201906040850190845b81811015613436578351835292840192918401916001016137c4565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261380757600080fd5b81356001600160401b0380821115613821576138216137e0565b604051601f8301601f19908116603f01168101908282118183101715613849576138496137e0565b8160405283815286602085880101111561386257600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806060858703121561389857600080fd5b8435935060208501356001600160401b03808211156138b657600080fd5b6138c2888389016137f6565b945060408701359150808211156138d857600080fd5b506132bc878288016136f1565b6000806000606084860312156138fa57600080fd5b83356001600160401b038082111561391157600080fd5b61391d878388016137f6565b9450602086013591508082111561393357600080fd5b50613940868287016137f6565b925050604084013590509250925092565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261397e57600080fd5b8301803591506001600160401b0382111561399857600080fd5b602001915036819003821315612e0457600080fd5b8035602083101561084957600019602084900360031b1b1692915050565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115613a1c578160001904821115613a0257613a026139cb565b80851615613a0f57918102915b93841c93908002906139e6565b509250929050565b600082613a3357506001610849565b81613a4057506000610849565b8160018114613a565760028114613a6057613a7c565b6001915050610849565b60ff841115613a7157613a716139cb565b50506001821b610849565b5060208310610133831016604e8410600b8410161715613a9f575081810a610849565b613aa983836139e1565b8060001904821115613abd57613abd6139cb565b029392505050565b60006119458383613a24565b600181811c90821680613ae557607f821691505b602082108103613b0557634e487b7160e01b600052602260045260246000fd5b50919050565b80820180821115610849576108496139cb565b8183823760009101908152919050565b600060a08236031215613b4057600080fd5b60405160a081016001600160401b038282108183111715613b6357613b636137e0565b81604052843583526020850135915080821115613b7f57600080fd5b613b8b368387016137f6565b602084015260408501359150613ba0826132f2565b8160408401526060850135915080821115613bba57600080fd5b50613bc7368286016137f6565b606083015250608092830135928101929092525090565b75084c2c840e6d2cedcc2e8eae4ca40c2e840d2dcc8caf60531b815260008251613c0f816016850160208701613333565b9190910160160192915050565b8082028115828204841417610849576108496139cb565b634e487b7160e01b600052601260045260246000fd5b600082613c5857613c58613c33565b500490565b81810381811115610849576108496139cb565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b608081526000613cad608083018789613c70565b8281036020840152613cbf8187613357565b60408401959095525050606001529392505050565b600082613ce357613ce3613c33565b500690565b600060018201613cfa57613cfa6139cb565b5060010190565b601f821115610d8657600081815260208120601f850160051c81016020861015613d285750805b601f850160051c820191505b8181101561081057828155600101613d34565b81516001600160401b03811115613d6057613d606137e0565b613d7481613d6e8454613ad1565b84613d01565b602080601f831160018114613da95760008415613d915750858301515b600019600386901b1c1916600185901b178555610810565b600085815260208120601f198616915b82811015613dd857888601518255948401946001909101908401613db9565b5085821015613df65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251613e18818460208701613333565b9190910192915050565b6001600160a01b038716815260a060208201819052600090613e4690830188613357565b8281036040840152613e59818789613c70565b6060840195909552505060800152949350505050565b600060208284031215613e8157600080fd5b5051919050565b600060ff821660ff8103613e9e57613e9e6139cb565b60010192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613edf816017850160208801613333565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613f10816028840160208801613333565b01602801949350505050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215613f4457600080fd5b8151801515811461194557600080fd5b600081613f6357613f636139cb565b506000190190565b634e487b7160e01b600052602160045260246000fdfe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220405730b1f02c6e7cd91a293384cc27517ebea967c81239f3a3dac4b3e846480864736f6c63430008120033000000000000000000000000e636f94a71ec52cc61ef21787ae351ad832347b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000047ff3169c515a69eb4f53bb5d29c0804e7e038c800000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b0bb5da78cd0a231173ec42e02cb1059aa31b492000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d614c551873f42596a5890a7f8c0be92336b1949
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102685760003560e01c8063984bd4b211610151578063d3649d6c116100c3578063e029159211610087578063e02915921461058e578063ec87621c146105a1578063ef925399146105b6578063f25f4b56146105c9578063f7b2bf68146105e1578063fe62c28b1461063357600080fd5b8063d3649d6c14610541578063d547741f1461054a578063d73792a91461055d578063d9caed1214610566578063e026faa71461057957600080fd5b8063ac37b22611610115578063ac37b226146104e4578063ae7cabbd1461050b578063affed0e014610513578063b049cec71461051c578063b46c31a41461052f578063cfae73071461053857600080fd5b8063984bd4b21461049b5780639a48e7f9146104ae5780639debb3bd146104c1578063a217fddf146104c9578063a427b242146104d157600080fd5b80633f4ba83a116101ea5780637233a666116101ae5780637233a666146103f957806382bfefc81461040e5780638456cb591461044d57806390d49b9d1461045557806391d148541461046857806397901c5a1461047b57600080fd5b80633f4ba83a1461038c578063416553261461039457806352f7c988146103bb5780635c975abb146103ce5780635f282ba4146103d957600080fd5b8063248a9ca311610231578063248a9ca3146102f95780632aaf5ed51461032a5780632cf267011461033d5780632f2ff15d1461036657806336568abe1461037957600080fd5b8062f54e801461026d57806301ffc9a71461028257806314538128146102aa578063179ff4b2146102d15780631e12ef29146102e6575b600080fd5b61028061027b36600461325d565b61063c565b005b6102956102903660046132c8565b610818565b60405190151581526020015b60405180910390f35b6102bd6102b8366004613307565b61084f565b6040516102a1989796959493929190613383565b6102d9610a52565b6040516102a191906133f5565b6102806102f4366004613442565b610ab4565b61031c610307366004613483565b60009081526020819052604090206001015490565b6040519081526020016102a1565b61028061033836600461349c565b610b69565b61031c61034b3660046134e7565b6001600160a01b031660009081526007602052604090205490565b610280610374366004613504565b610d61565b610280610387366004613504565b610d8b565b610280610e09565b61031c7fcb87858191633bd77793d261daabf61ecc1356b8074c6678235852edf88a10dc81565b6102806103c9366004613534565b610e34565b60015460ff16610295565b6103ec6103e7366004613556565b610f35565b6040516102a1919061358b565b6104016112cc565b6040516102a1919061366e565b6104357f000000000000000000000000e636f94a71ec52cc61ef21787ae351ad832347b781565b6040516001600160a01b0390911681526020016102a1565b6102806112fc565b6102806104633660046134e7565b611324565b610295610476366004613504565b611412565b61031c610489366004613483565b60096020526000908152604090205481565b6102806104a9366004613681565b61143b565b6104356104bc366004613483565b61189c565b61031c606481565b61031c600081565b6102806104df366004613483565b6118c6565b61031c7f65766d2e3100000000000000000000000000000000000000000000000000000081565b600c5461031c565b61031c60055481565b61029561052a366004613732565b61192e565b61031c60045481565b61031c60035481565b61031c60025481565b610280610558366004613504565b61194c565b61031c61271081565b610280610574366004613767565b611971565b610581611994565b6040516102a191906137a8565b61028061059c366004613882565b6119a0565b61031c600080516020613f8283398151915281565b6103ec6105c43660046134e7565b611f2c565b6001546104359061010090046001600160a01b031681565b61031c6105ef3660046138e5565b825160208185018101805160088252928201958201959095209190945282518084018501805192815290850193850193909320925291526000908152604090205481565b61031c60065481565b600080516020613f8283398151915261065481612301565b8382146106945760405162461bcd60e51b8152602060048201526009602482015268189859081a5b9c1d5d60ba1b60448201526064015b60405180910390fd5b60005b84811015610810576106d78686838181106106b4576106b4613951565b90506020028101906106c69190613967565b6106cf916139ad565b600a9061230b565b6107235760405162461bcd60e51b815260206004820152601c60248201527f436861696e20697320616c726561647920696e20746865206c69737400000000604482015260640161068b565b600086868381811061073757610737613951565b90506020028101906107499190613967565b610752916139ad565b9050600085858481811061076857610768613951565b90506020020135600a61077b9190613ac5565b600083815260096020526040902054909150156107f45760008281526009602052604090205481146107ef5760405162461bcd60e51b815260206004820152601f60248201527f63616e6e6f74206d6f64696679207468652065786368616e6765207261746500604482015260640161068b565b610806565b60008281526009602052604090208190555b5050600101610697565b505050505050565b60006001600160e01b03198216637965db0b60e01b148061084957506301ffc9a760e01b6001600160e01b03198316145b92915050565b6007602052816000526040600020818154811061086b57600080fd5b600091825260209091206008909102018054600182015460028301546003840180549396509194506001600160a01b031692916108a790613ad1565b80601f01602080910402602001604051908101604052809291908181526020018280546108d390613ad1565b80156109205780601f106108f557610100808354040283529160200191610920565b820191906000526020600020905b81548152906001019060200180831161090357829003601f168201915b50505050509080600401805461093590613ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461096190613ad1565b80156109ae5780601f10610983576101008083540402835291602001916109ae565b820191906000526020600020905b81548152906001019060200180831161099157829003601f168201915b5050505050908060050180546109c390613ad1565b80601f01602080910402602001604051908101604052809291908181526020018280546109ef90613ad1565b8015610a3c5780601f10610a1157610100808354040283529160200191610a3c565b820191906000526020600020905b815481529060010190602001808311610a1f57829003601f168201915b5050505050908060060154908060070154905088565b6060600c805480602002602001604051908101604052809291908181526020018280548015610aaa57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a8c575b5050505050905090565b600080516020613f82833981519152610acc81612301565b60005b82811015610b6357610b0f848483818110610aec57610aec613951565b9050602002810190610afe9190613967565b610b07916139ad565b600a90612317565b610b5b5760405162461bcd60e51b815260206004820152601c60248201527f436861696e206973206e6f7420696e20746865206c6973742079657400000000604482015260640161068b565b600101610acf565b50505050565b600080516020613f82833981519152610b8181612301565b6000839003610bc05760405162461bcd60e51b815260206004820152600b60248201526a4e6f2072656c617965727360a81b604482015260640161068b565b6064831115610c055760405162461bcd60e51b8152602060048201526011602482015270546f6f206d616e792072656c617965727360781b604482015260640161068b565b81600003610c3e5760405162461bcd60e51b81526020600482015260066024820152651816b7b316a760d11b604482015260640161068b565b82821115610c775760405162461bcd60e51b81526020600482015260066024820152652716b7b316a760d11b604482015260640161068b565b60005b83811015610d4b5760005b84811015610d425780821480610cf95750858582818110610ca857610ca8613951565b9050602002016020810190610cbd91906134e7565b6001600160a01b0316868684818110610cd857610cd8613951565b9050602002016020810190610ced91906134e7565b6001600160a01b031614155b610d3a5760405162461bcd60e51b81526020600482015260126024820152714475706c69636174652072656c617965727360701b604482015260640161068b565b600101610c85565b50600101610c7a565b50610d58600c85856131a1565b50506006555050565b600082815260208190526040902060010154610d7c81612301565b610d868383612323565b505050565b6001600160a01b0381163314610dfb5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b606482015260840161068b565b610e0582826123a7565b5050565b610e1161240c565b600080516020613f82833981519152610e2981612301565b610e31612457565b50565b600080516020613f82833981519152610e4c81612301565b82600354141580610e5f57508160045414155b610ea35760405162461bcd60e51b8152602060048201526015602482015274466565206e756d657261746f72207265706561747360581b604482015260640161068b565b6127108310610ee65760405162461bcd60e51b815260206004820152600f60248201526e08ccaca40d2e640e8dede40d0d2ced608b1b604482015260640161068b565b6127108210610f295760405162461bcd60e51b815260206004820152600f60248201526e08ccaca40d2e640e8dede40d0d2ced608b1b604482015260640161068b565b50600391909155600455565b6001600160a01b038316600090815260076020526040902054606090610f5b8385613b0b565b811015610f9d5760405162461bcd60e51b815260206004820152601060248201526f189859081bd9999cd95d0bdb1a5b5a5d60821b604482015260640161068b565b826001600160401b03811115610fb557610fb56137e0565b60405190808252806020026020018201604052801561103757816020015b611024604051806101000160405280600081526020016000815260200160006001600160a01b0316815260200160608152602001606081526020016060815260200160008152602001600081525090565b815260200190600190039081610fd35790505b50915060005b838110156112c3576001600160a01b03861660009081526007602052604090206110678287613b0b565b8154811061107757611077613951565b90600052602060002090600802016040518061010001604052908160008201548152602001600182015481526020016002820160009054906101000a90046001600160a01b03166001600160a01b03166001600160a01b031681526020016003820180546110e490613ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461111090613ad1565b801561115d5780601f106111325761010080835404028352916020019161115d565b820191906000526020600020905b81548152906001019060200180831161114057829003601f168201915b5050505050815260200160048201805461117690613ad1565b80601f01602080910402602001604051908101604052809291908181526020018280546111a290613ad1565b80156111ef5780601f106111c4576101008083540402835291602001916111ef565b820191906000526020600020905b8154815290600101906020018083116111d257829003601f168201915b5050505050815260200160058201805461120890613ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461123490613ad1565b80156112815780601f1061125657610100808354040283529160200191611281565b820191906000526020600020905b81548152906001019060200180831161126457829003601f168201915b50505050508152602001600682015481526020016007820154815250508382815181106112b0576112b0613951565b602090810291909101015260010161103d565b50509392505050565b60606112f77f65766d2e310000000000000000000000000000000000000000000000000000006124a9565b905090565b611304612514565b600080516020613f8283398151915261131c81612301565b610e3161255a565b600080516020613f8283398151915261133c81612301565b6001546001600160a01b0380841661010090920416036113935760405162461bcd60e51b81526020600482015260126024820152714665652077616c6c6574207265706561747360701b604482015260640161068b565b6001600160a01b0382166113e95760405162461bcd60e51b815260206004820152601a60248201527f4665652077616c6c6574206973207a65726f2061646472657373000000000000604482015260640161068b565b50600180546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b611443612514565b61145361052a6060850185613967565b61149f5760405162461bcd60e51b815260206004820152601760248201527f4e6f7420737570706f727465642066726f6d436861696e000000000000000000604482015260640161068b565b60086114ae6060850185613967565b6040516114bc929190613b1e565b90815260200160405180910390208380602001906114da9190613967565b6040516114e8929190613b1e565b90815260200160405180910390206000846080013581526020019081526020016000205460001461155b5760405162461bcd60e51b815260206004820152601b60248201527f5369676e617475726520616c72656164792066756c66696c6c65640000000000604482015260640161068b565b600c5481146115a45760405162461bcd60e51b8152602060048201526015602482015274084c2c840e6d2cedcc2e8eae4cae640d8cadccee8d605b1b604482015260640161068b565b60006115b76115b285613b2e565b612595565b90506000805b838110156116a8578484828181106115d7576115d7613951565b90506020028101906115e99190613967565b90506000036115fa576001016115bd565b600c818154811061160d5761160d613951565b6000918252602090912001546001600160a01b031661164f8487878581811061163857611638613951565b905060200281019061164a9190613967565b61267c565b6001600160a01b03161461169c5761166681612197565b6040516020016116769190613bde565b60408051601f198184030181529082905262461bcd60e51b825261068b9160040161366e565b600191820191016115bd565b506006548110156116f15760405162461bcd60e51b81526020600482015260136024820152724e6f7420656e6f7567682072656c617965727360681b604482015260640161068b565b4360086117016060880188613967565b60405161170f929190613b1e565b908152602001604051809103902086806020019061172d9190613967565b60405161173b929190613b1e565b908152604080516020928190038301902060808901356000908152925281209190915560098161176e6060890189613967565b611777916139ad565b815260208101919091526040016000908120549150611797828835613c1c565b90506000612710600454836117ac9190613c1c565b6117b69190613c49565b90506117da6117cb60608a0160408b016134e7565b6117d58385613c5d565b6126c6565b80156117fb576001546117fb9061010090046001600160a01b0316826126c6565b61180b6060890160408a016134e7565b6001600160a01b031661182160208a018a613967565b60405161182f929190613b1e565b6040519081900390207f1a82954c00ba4231b18dbc7d7d5187028cfc140ac6efedeeb60397b8710a9d9361186660608c018c613967565b61186e6112cc565b6118788789613c5d565b8960405161188a959493929190613c99565b60405180910390a35050505050505050565b600c81815481106118ac57600080fd5b6000918252602090912001546001600160a01b0316905081565b600080516020613f828339815191526118de81612301565b81600254036119285760405162461bcd60e51b81526020600482015260166024820152754c696d6974207065722073656e64207265706561747360501b604482015260640161068b565b50600255565b600061194561193d83856139ad565b600a906126f1565b9392505050565b60008281526020819052604090206001015461196781612301565b610d8683836123a7565b600080516020613f8283398151915261198981612301565b610b63848484612709565b60606112f7600a61276c565b6119a8612514565b836000036119e55760405162461bcd60e51b815260206004820152600a6024820152690416d6f756e74203d20360b41b604482015260640161068b565b600254841115611a375760405162461bcd60e51b815260206004820152601960248201527f416d6f756e74206973206d6f7265207468616e206c696d697400000000000000604482015260640161068b565b8251600003611a805760405162461bcd60e51b81526020600482015260156024820152744669656c6420746f5573657220697320656d70747960581b604482015260640161068b565b611a8a828261192e565b611acf5760405162461bcd60e51b815260206004820152601660248201527510da185a5b881a5cc81b9bdd081cdd5c1c1bdc9d195960521b604482015260640161068b565b6000600981611ade84866139ad565b81526020019081526020016000205490508085611afb9190613cd4565b15611b595760405162461bcd60e51b815260206004820152602860248201527f416d6f756e74206973206e6f7420646976697369626c652062792065786368616044820152676e6765207261746560c01b606482015260840161068b565b612710611b668287613c49565b1015611bb45760405162461bcd60e51b815260206004820152601860248201527f616d6f756e74203c206665652064656e6f6d696e61746f720000000000000000604482015260640161068b565b60008161271060035488611bc89190613c1c565b611bd29190613c49565b611bdc9190613c49565b3360009081526007602052604090819020815161010081019092529192508083611c06868b613c49565b611c109190613c5d565b815242602082015233604082015260608101889052608001611c306112cc565b815260200186868080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525093855250506005805460209094019392909150611c8383613ce8565b909155508152436020918201528254600180820185556000948552938290208351600890920201908155908201519281019290925560408101516002830180546001600160a01b0319166001600160a01b0390921691909117905560608101519091906003820190611cf59082613d47565b5060808201516004820190611d0a9082613d47565b5060a08201516005820190611d1f9082613d47565b5060c0820151816006015560e08201518160070155505084604051611d449190613e06565b60405180910390207f39ca9eb9de2c42145bdc9525fbfac365c3f8e2abdf97dd94e64ec1258365b9f733611d766112cc565b8787611d82878d613c5d565b88604051611d9596959493929190613e22565b60405180910390a26040516370a0823160e01b81523060048201526000907f000000000000000000000000e636f94a71ec52cc61ef21787ae351ad832347b76001600160a01b0316906370a0823190602401602060405180830381865afa158015611e04573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e289190613e6f565b9050611e343388612779565b6040516370a0823160e01b81523060048201526000907f000000000000000000000000e636f94a71ec52cc61ef21787ae351ad832347b76001600160a01b0316906370a0823190602401602060405180830381865afa158015611e9b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ebf9190613e6f565b905087611ecc8383613c5d565b14611f055760405162461bcd60e51b81526020600482015260096024820152683130b2103a37b5b2b760b91b604482015260640161068b565b50508015610810576001546108109061010090046001600160a01b03166117d58484613c1c565b6001600160a01b0381166000908152600760209081526040808320805482518185028101850190935280835260609492939192909184015b8282101561218c5760008481526020908190206040805161010081018252600886029092018054835260018101549383019390935260028301546001600160a01b031690820152600382018054919291606084019190611fc390613ad1565b80601f0160208091040260200160405190810160405280929190818152602001828054611fef90613ad1565b801561203c5780601f106120115761010080835404028352916020019161203c565b820191906000526020600020905b81548152906001019060200180831161201f57829003601f168201915b5050505050815260200160048201805461205590613ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461208190613ad1565b80156120ce5780601f106120a3576101008083540402835291602001916120ce565b820191906000526020600020905b8154815290600101906020018083116120b157829003601f168201915b505050505081526020016005820180546120e790613ad1565b80601f016020809104026020016040519081016040528092919081815260200182805461211390613ad1565b80156121605780601f1061213557610100808354040283529160200191612160565b820191906000526020600020905b81548152906001019060200180831161214357829003601f168201915b505050505081526020016006820154815260200160078201548152505081526020019060010190611f64565b505050509050919050565b606060006121a483612229565b60010190506000816001600160401b038111156121c3576121c36137e0565b6040519080825280601f01601f1916602001820160405280156121ed576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a85049450846121f757509392505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b83106122685772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612294576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc1000083106122b257662386f26fc10000830492506010015b6305f5e10083106122ca576305f5e100830492506008015b61271083106122de57612710830492506004015b606483106122f0576064830492506002015b600a83106108495760010192915050565b610e3181336127a5565b600061194583836127d8565b60006119458383612827565b61232d8282611412565b610e05576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556123633390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6123b18282611412565b15610e05576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60015460ff166124555760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161068b565b565b61245f61240c565b6001805460ff191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b606060005b828160ff16602081106124c3576124c3613951565b1a60f81b6001600160f81b031916158015906124e2575060208160ff16105b156124f957806124f181613e88565b9150506124ae565b60405191506040820160405280825282602083015250919050565b60015460ff16156124555760405162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015260640161068b565b612562612514565b6001805460ff1916811790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2583361248c565b60006108497fcb87858191633bd77793d261daabf61ecc1356b8074c6678235852edf88a10dc836000015184602001516040516020016125d59190613e06565b60405160208183030381529060405280519060200120856040015186606001516040516020016126059190613e06565b60405160208183030381529060405280519060200120876080015160405160200161266196959493929190958652602086019490945260408501929092526001600160a01b03166060840152608083015260a082015260c00190565b6040516020818303038152906040528051906020012061291a565b60006126be8484848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061296892505050565b949350505050565b610e057f000000000000000000000000e636f94a71ec52cc61ef21787ae351ad832347b78383612709565b60008181526001830160205260408120541515611945565b6040516001600160a01b038316602482015260448101829052610d8690849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261298c565b6060600061194583612a5e565b610e057f000000000000000000000000e636f94a71ec52cc61ef21787ae351ad832347b7833084612aba565b6127af8282611412565b610e05576127bc81612af2565b6127c7836020612b04565b604051602001611676929190613ea7565b600081815260018301602052604081205461281f57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610849565b506000610849565b6000818152600183016020526040812054801561291057600061284b600183613c5d565b855490915060009061285f90600190613c5d565b90508181146128c457600086600001828154811061287f5761287f613951565b90600052602060002001549050808760000184815481106128a2576128a2613951565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806128d5576128d5613f1c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610849565b6000915050610849565b6000610849612927612c9f565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b60008060006129778585612dc6565b9150915061298481612e0b565b509392505050565b60006129e1826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612f559092919063ffffffff16565b805190915015610d8657808060200190518101906129ff9190613f32565b610d865760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b606482015260840161068b565b606081600001805480602002602001604051908101604052809291908181526020018280548015612aae57602002820191906000526020600020905b815481526020019060010190808311612a9a575b50505050509050919050565b6040516001600160a01b0380851660248301528316604482015260648101829052610b639085906323b872dd60e01b90608401612735565b60606108496001600160a01b03831660145b60606000612b13836002613c1c565b612b1e906002613b0b565b6001600160401b03811115612b3557612b356137e0565b6040519080825280601f01601f191660200182016040528015612b5f576020820181803683370190505b509050600360fc1b81600081518110612b7a57612b7a613951565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612ba957612ba9613951565b60200101906001600160f81b031916908160001a9053506000612bcd846002613c1c565b612bd8906001613b0b565b90505b6001811115612c50576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612c0c57612c0c613951565b1a60f81b828281518110612c2257612c22613951565b60200101906001600160f81b031916908160001a90535060049490941c93612c4981613f54565b9050612bdb565b5083156119455760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e74604482015260640161068b565b6000306001600160a01b037f0000000000000000000000008351de5788022a96047f34918a97a9f871ed6e8b16148015612cf857507f000000000000000000000000000000000000000000000000000000000000000146145b15612d2257507f49c4b4e982c7a051d85c416763f7c62ebb13b33221b373fd85e722d184490b2890565b50604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527f9ae07bc5b995cfa8b0340c8b63e566d5c884d873bdddb1069de56e4a87caf345828401527fe6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b360608301524660808301523060a0808401919091528351808403909101815260c0909201909252805191012090565b6000808251604103612dfc5760208301516040840151606085015160001a612df087828585612f64565b94509450505050612e04565b506000905060025b9250929050565b6000816004811115612e1f57612e1f613f6b565b03612e275750565b6001816004811115612e3b57612e3b613f6b565b03612e885760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161068b565b6002816004811115612e9c57612e9c613f6b565b03612ee95760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161068b565b6003816004811115612efd57612efd613f6b565b03610e315760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161068b565b60606126be8484600085613028565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612f9b575060009050600361301f565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612fef573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166130185760006001925092505061301f565b9150600090505b94509492505050565b6060824710156130895760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b606482015260840161068b565b600080866001600160a01b031685876040516130a59190613e06565b60006040518083038185875af1925050503d80600081146130e2576040519150601f19603f3d011682016040523d82523d6000602084013e6130e7565b606091505b50915091506130f887838387613103565b979650505050505050565b6060831561317257825160000361316b576001600160a01b0385163b61316b5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161068b565b50816126be565b6126be83838151156131875781518083602001fd5b8060405162461bcd60e51b815260040161068b919061366e565b8280548282559060005260206000209081019282156131f4579160200282015b828111156131f45781546001600160a01b0319166001600160a01b038435161782556020909201916001909101906131c1565b50613200929150613204565b5090565b5b808211156132005760008155600101613205565b60008083601f84011261322b57600080fd5b5081356001600160401b0381111561324257600080fd5b6020830191508360208260051b8501011115612e0457600080fd5b6000806000806040858703121561327357600080fd5b84356001600160401b038082111561328a57600080fd5b61329688838901613219565b909650945060208701359150808211156132af57600080fd5b506132bc87828801613219565b95989497509550505050565b6000602082840312156132da57600080fd5b81356001600160e01b03198116811461194557600080fd5b6001600160a01b0381168114610e3157600080fd5b6000806040838503121561331a57600080fd5b8235613325816132f2565b946020939093013593505050565b60005b8381101561334e578181015183820152602001613336565b50506000910152565b6000815180845261336f816020860160208601613333565b601f01601f19169290920160200192915050565b888152602081018890526001600160a01b0387166040820152610100606082018190526000906133b583820189613357565b905082810360808401526133c98188613357565b905082810360a08401526133dd8187613357565b60c0840195909552505060e001529695505050505050565b6020808252825182820181905260009190848201906040850190845b818110156134365783516001600160a01b031683529284019291840191600101613411565b50909695505050505050565b6000806020838503121561345557600080fd5b82356001600160401b0381111561346b57600080fd5b61347785828601613219565b90969095509350505050565b60006020828403121561349557600080fd5b5035919050565b6000806000604084860312156134b157600080fd5b83356001600160401b038111156134c757600080fd5b6134d386828701613219565b909790965060209590950135949350505050565b6000602082840312156134f957600080fd5b8135611945816132f2565b6000806040838503121561351757600080fd5b823591506020830135613529816132f2565b809150509250929050565b6000806040838503121561354757600080fd5b50508035926020909101359150565b60008060006060848603121561356b57600080fd5b8335613576816132f2565b95602085013595506040909401359392505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b8381101561366057888303603f190185528151805184528781015188850152868101516001600160a01b03811688860152610100905060608083015182828801526135ff83880182613357565b925050506080808301518683038288015261361a8382613357565b9250505060a080830151868303828801526136358382613357565b60c0858101519089015260e094850151949097019390935250505093860193908601906001016135b2565b509098975050505050505050565b6020815260006119456020830184613357565b60008060006040848603121561369657600080fd5b83356001600160401b03808211156136ad57600080fd5b9085019060a082880312156136c157600080fd5b909350602085013590808211156136d757600080fd5b506136e486828701613219565b9497909650939450505050565b60008083601f84011261370357600080fd5b5081356001600160401b0381111561371a57600080fd5b602083019150836020828501011115612e0457600080fd5b6000806020838503121561374557600080fd5b82356001600160401b0381111561375b57600080fd5b613477858286016136f1565b60008060006060848603121561377c57600080fd5b8335613787816132f2565b92506020840135613797816132f2565b929592945050506040919091013590565b6020808252825182820181905260009190848201906040850190845b81811015613436578351835292840192918401916001016137c4565b634e487b7160e01b600052604160045260246000fd5b600082601f83011261380757600080fd5b81356001600160401b0380821115613821576138216137e0565b604051601f8301601f19908116603f01168101908282118183101715613849576138496137e0565b8160405283815286602085880101111561386257600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806000806060858703121561389857600080fd5b8435935060208501356001600160401b03808211156138b657600080fd5b6138c2888389016137f6565b945060408701359150808211156138d857600080fd5b506132bc878288016136f1565b6000806000606084860312156138fa57600080fd5b83356001600160401b038082111561391157600080fd5b61391d878388016137f6565b9450602086013591508082111561393357600080fd5b50613940868287016137f6565b925050604084013590509250925092565b634e487b7160e01b600052603260045260246000fd5b6000808335601e1984360301811261397e57600080fd5b8301803591506001600160401b0382111561399857600080fd5b602001915036819003821315612e0457600080fd5b8035602083101561084957600019602084900360031b1b1692915050565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115613a1c578160001904821115613a0257613a026139cb565b80851615613a0f57918102915b93841c93908002906139e6565b509250929050565b600082613a3357506001610849565b81613a4057506000610849565b8160018114613a565760028114613a6057613a7c565b6001915050610849565b60ff841115613a7157613a716139cb565b50506001821b610849565b5060208310610133831016604e8410600b8410161715613a9f575081810a610849565b613aa983836139e1565b8060001904821115613abd57613abd6139cb565b029392505050565b60006119458383613a24565b600181811c90821680613ae557607f821691505b602082108103613b0557634e487b7160e01b600052602260045260246000fd5b50919050565b80820180821115610849576108496139cb565b8183823760009101908152919050565b600060a08236031215613b4057600080fd5b60405160a081016001600160401b038282108183111715613b6357613b636137e0565b81604052843583526020850135915080821115613b7f57600080fd5b613b8b368387016137f6565b602084015260408501359150613ba0826132f2565b8160408401526060850135915080821115613bba57600080fd5b50613bc7368286016137f6565b606083015250608092830135928101929092525090565b75084c2c840e6d2cedcc2e8eae4ca40c2e840d2dcc8caf60531b815260008251613c0f816016850160208701613333565b9190910160160192915050565b8082028115828204841417610849576108496139cb565b634e487b7160e01b600052601260045260246000fd5b600082613c5857613c58613c33565b500490565b81810381811115610849576108496139cb565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b608081526000613cad608083018789613c70565b8281036020840152613cbf8187613357565b60408401959095525050606001529392505050565b600082613ce357613ce3613c33565b500690565b600060018201613cfa57613cfa6139cb565b5060010190565b601f821115610d8657600081815260208120601f850160051c81016020861015613d285750805b601f850160051c820191505b8181101561081057828155600101613d34565b81516001600160401b03811115613d6057613d606137e0565b613d7481613d6e8454613ad1565b84613d01565b602080601f831160018114613da95760008415613d915750858301515b600019600386901b1c1916600185901b178555610810565b600085815260208120601f198616915b82811015613dd857888601518255948401946001909101908401613db9565b5085821015613df65787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008251613e18818460208701613333565b9190910192915050565b6001600160a01b038716815260a060208201819052600090613e4690830188613357565b8281036040840152613e59818789613c70565b6060840195909552505060800152949350505050565b600060208284031215613e8157600080fd5b5051919050565b600060ff821660ff8103613e9e57613e9e6139cb565b60010192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613edf816017850160208801613333565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613f10816028840160208801613333565b01602801949350505050565b634e487b7160e01b600052603160045260246000fd5b600060208284031215613f4457600080fd5b8151801515811461194557600080fd5b600081613f6357613f636139cb565b506000190190565b634e487b7160e01b600052602160045260246000fdfe241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08a2646970667358221220405730b1f02c6e7cd91a293384cc27517ebea967c81239f3a3dac4b3e846480864736f6c63430008120033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000e636f94a71ec52cc61ef21787ae351ad832347b7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000000000000000000047ff3169c515a69eb4f53bb5d29c0804e7e038c800000000000000000000000000000000000000000000000000000000000000320000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b0bb5da78cd0a231173ec42e02cb1059aa31b492000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d614c551873f42596a5890a7f8c0be92336b1949
-----Decoded View---------------
Arg [0] : token (address): 0xe636f94a71eC52Cc61eF21787aE351AD832347B7
Arg [1] : limitPerSend_ (uint256): 115792089237316195423570985008687907853269984665640564039457584007913129639935
Arg [2] : feeWallet_ (address): 0x47FF3169C515A69Eb4f53bb5D29C0804E7E038c8
Arg [3] : feeSend_ (uint256): 50
Arg [4] : feeFulfill_ (uint256): 0
Arg [5] : owner (address): 0xB0BB5da78cd0a231173eC42E02cB1059Aa31B492
Arg [6] : relayers_ (address[]): 0xd614C551873f42596a5890a7f8C0bE92336B1949
Arg [7] : relayerConsensusThreshold_ (uint256): 1
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000e636f94a71ec52cc61ef21787ae351ad832347b7
Arg [1] : ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Arg [2] : 00000000000000000000000047ff3169c515a69eb4f53bb5d29c0804e7e038c8
Arg [3] : 0000000000000000000000000000000000000000000000000000000000000032
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [5] : 000000000000000000000000b0bb5da78cd0a231173ec42e02cb1059aa31b492
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000100
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [9] : 000000000000000000000000d614c551873f42596a5890a7f8c0be92336b1949
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $0.05674 | 976,377,481.2304 | $55,399,839.2 |
Loading...
Loading
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.