Feature Tip: Add private address tag to any address under My Name Tag !
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Contract Name:
RoundImplementation
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 400 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.17; import "./IRoundImplementation.sol"; import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol"; import "../settings/AlloSettings.sol"; import "../votingStrategy/IVotingStrategy.sol"; import "../payoutStrategy/IPayoutStrategy.sol"; import "../utils/MetaPtr.sol"; /** * @notice Contract deployed per Round which would managed by * a group of ROUND_OPERATOR via the RoundFactory * */ contract RoundImplementation is IRoundImplementation, AccessControlEnumerable, Initializable { string public constant VERSION = "1.0.0"; // --- Libraries --- using Address for address; using SafeERC20 for IERC20; // --- Roles --- /// @notice round operator role bytes32 public constant ROUND_OPERATOR_ROLE = keccak256("ROUND_OPERATOR"); // --- Events --- /// @notice Emitted when match amount is updated event MatchAmountUpdated(uint256 newAmount); /// @notice Emitted when a Round fee percentage is updated event RoundFeePercentageUpdated(uint32 roundFeePercentage); /// @notice Emitted when a Round wallet address is updated event RoundFeeAddressUpdated(address roundFeeAddress); /// @notice Emitted when the round metaPtr is updated event RoundMetaPtrUpdated(MetaPtr oldMetaPtr, MetaPtr newMetaPtr); /// @notice Emitted when the application form metaPtr is updated event ApplicationMetaPtrUpdated(MetaPtr oldMetaPtr, MetaPtr newMetaPtr); /// @notice Emitted when application start time is updated event ApplicationsStartTimeUpdated(uint256 oldTime, uint256 newTime); /// @notice Emitted when application end time is updated event ApplicationsEndTimeUpdated(uint256 oldTime, uint256 newTime); /// @notice Emitted when a round start time is updated event RoundStartTimeUpdated(uint256 oldTime, uint256 newTime); /// @notice Emitted when a round end time is updated event RoundEndTimeUpdated(uint256 oldTime, uint256 newTime); /// @notice Emitted when projects metaPtr is updated event ProjectsMetaPtrUpdated(MetaPtr oldMetaPtr, MetaPtr newMetaPtr); /// @notice Emitted when a project has applied to the round event NewProjectApplication(bytes32 indexed projectID, uint256 applicationIndex, MetaPtr applicationMetaPtr); /// @notice Emitted when protocol & round fees are paid event PayFeeAndEscrowFundsToPayoutContract(uint256 matchAmountAfterFees, uint protocolFeeAmount, uint roundFeeAmount); event ApplicationStatusesUpdated(uint256 indexed index, uint256 indexed status); // --- Modifier --- /// @notice modifier to check if round has not ended. modifier roundHasNotEnded() { // slither-disable-next-line timestamp require(block.timestamp <= roundEndTime, "Round: Round has ended"); _; } /// @notice modifier to check if round has not ended. modifier roundHasEnded() { // slither-disable-next-line timestamp require(block.timestamp > roundEndTime, "Round: Round has not ended"); _; } // --- Data --- /// @notice Allo Config Contract Address AlloSettings public alloSettings; /// @notice Voting Strategy Contract Address IVotingStrategy public votingStrategy; /// @notice Payout Strategy Contract Address IPayoutStrategy public payoutStrategy; /// @notice Unix timestamp from when round can accept applications uint256 public applicationsStartTime; /// @notice Unix timestamp from when round stops accepting applications uint256 public applicationsEndTime; /// @notice Unix timestamp of the start of the round uint256 public roundStartTime; /// @notice Unix timestamp of the end of the round uint256 public roundEndTime; /// @notice Match Amount (excluding protocol fee & round fee) uint256 public matchAmount; /// @notice Token used to payout match amounts at the end of a round address public token; /// @notice Round fee percentage uint32 public roundFeePercentage; /// @notice Round fee address address payable public roundFeeAddress; /// @notice MetaPtr to the round metadata MetaPtr public roundMetaPtr; /// @notice MetaPtr to the application form schema MetaPtr public applicationMetaPtr; // --- Struct --- struct InitAddress { IVotingStrategy votingStrategy; // Deployed voting strategy contract IPayoutStrategy payoutStrategy; // Deployed payout strategy contract } struct InitRoundTime { uint256 applicationsStartTime; // Unix timestamp from when round can accept applications uint256 applicationsEndTime; // Unix timestamp from when round stops accepting applications uint256 roundStartTime; // Unix timestamp of the start of the round uint256 roundEndTime; // Unix timestamp of the end of the round } struct InitMetaPtr { MetaPtr roundMetaPtr; // MetaPtr to the round metadata MetaPtr applicationMetaPtr; // MetaPtr to the application form schema } struct InitRoles { address[] adminRoles; // Addresses to be granted DEFAULT_ADMIN_ROLE address[] roundOperators; // Addresses to be granted ROUND_OPERATOR_ROLE } struct Application { bytes32 projectID; uint256 applicationIndex; MetaPtr metaPtr; } uint256 public nextApplicationIndex; // An array of applications, each new application is appended to the array Application[] public applications; mapping(bytes32 => uint256[]) public applicationsIndexesByProjectID; // This is a packed array of booleans. // statuses[0] is the first row of the bitmap and allows to store 256 bits to describe // the status of 256 projects. // statuses[1] is the second row, and so on. // Instead of using 1 bit for each application status, we use 2 bits to allow 4 statuses: // 0: pending // 1: approved // 2: rejected // 3: canceled // Since it's a mapping the storage it's pre-allocated with zero values, // so if we check the status of an existing application, the value is by default 0 (pending). // If we want to check the status of an application, we take its index from the `applications` array // and convert it to the 2-bits position in the bitmap. mapping(uint256 => uint256) public applicationStatusesBitMap; // --- Core methods --- /** * @notice Instantiates a new round * @param encodedParameters Encoded parameters for program creation * @dev encodedParameters * - _initAddress Related contract / wallet addresses * - _initRoundTime Round timestamps * - _feePercentage Fee percentage * - _matchAmount Amount of tokens in the matching pool * - _token Address of the ERC20/native token for accepting matching pool contributions * - _initMetaPtr Round metaPtrs * - _initRoles Round roles */ function initialize( bytes calldata encodedParameters, address _alloSettings ) external initializer { // Decode _encodedParameters ( InitAddress memory _initAddress, InitRoundTime memory _initRoundTime, uint256 _matchAmount, address _token, uint32 _roundFeePercentage, address payable _roundFeeAddress, InitMetaPtr memory _initMetaPtr, InitRoles memory _initRoles ) = abi.decode( encodedParameters, ( (InitAddress), (InitRoundTime), uint256, address, uint32, address, (InitMetaPtr), (InitRoles) )); // slither-disable-next-line timestamp require( _initRoundTime.applicationsStartTime >= block.timestamp, "Round: Time has already passed" ); require( _initRoundTime.applicationsEndTime > _initRoundTime.applicationsStartTime, "Round: App end is before app start" ); require( _initRoundTime.roundEndTime >= _initRoundTime.applicationsEndTime, "Round: Round end is before app end" ); require( _initRoundTime.roundEndTime > _initRoundTime.roundStartTime, "Round: Round end is before round start" ); require( _initRoundTime.roundStartTime >= _initRoundTime.applicationsStartTime, "Round: Round start is before app start" ); alloSettings = AlloSettings(_alloSettings); votingStrategy = _initAddress.votingStrategy; payoutStrategy = _initAddress.payoutStrategy; applicationsStartTime = _initRoundTime.applicationsStartTime; applicationsEndTime = _initRoundTime.applicationsEndTime; roundStartTime = _initRoundTime.roundStartTime; roundEndTime = _initRoundTime.roundEndTime; token = _token; // Invoke init on voting contract votingStrategy.init(); // Invoke init on payout contract payoutStrategy.init(); matchAmount = _matchAmount; roundFeePercentage = _roundFeePercentage; roundFeeAddress = _roundFeeAddress; roundMetaPtr = _initMetaPtr.roundMetaPtr; applicationMetaPtr = _initMetaPtr.applicationMetaPtr; // Assigning default admin role for (uint256 i = 0; i < _initRoles.adminRoles.length; ++i) { _grantRole(DEFAULT_ADMIN_ROLE, _initRoles.adminRoles[i]); } // Assigning round operators for (uint256 i = 0; i < _initRoles.roundOperators.length; ++i) { _grantRole(ROUND_OPERATOR_ROLE, _initRoles.roundOperators[i]); } } // @notice Update match amount (only by ROUND_OPERATOR_ROLE) /// @param newAmount new Amount function updateMatchAmount(uint256 newAmount) external roundHasNotEnded onlyRole(ROUND_OPERATOR_ROLE) { require(newAmount > matchAmount, "Round: Lesser than current match amount"); matchAmount = newAmount; emit MatchAmountUpdated(newAmount); } // @notice Update round fee percentage (only by ROUND_OPERATOR_ROLE) /// @param newFeePercentage new fee percentage function updateRoundFeePercentage(uint32 newFeePercentage) external roundHasNotEnded onlyRole(ROUND_OPERATOR_ROLE) { roundFeePercentage = newFeePercentage; emit RoundFeePercentageUpdated(roundFeePercentage); } // @notice Update round fee address (only by ROUND_OPERATOR_ROLE) /// @param newFeeAddress new fee address function updateRoundFeeAddress(address payable newFeeAddress) external roundHasNotEnded onlyRole(ROUND_OPERATOR_ROLE) { roundFeeAddress = newFeeAddress; emit RoundFeeAddressUpdated(roundFeeAddress); } // @notice Update roundMetaPtr (only by ROUND_OPERATOR_ROLE) /// @param newRoundMetaPtr new roundMetaPtr function updateRoundMetaPtr(MetaPtr memory newRoundMetaPtr) external roundHasNotEnded onlyRole(ROUND_OPERATOR_ROLE) { emit RoundMetaPtrUpdated(roundMetaPtr, newRoundMetaPtr); roundMetaPtr = newRoundMetaPtr; } // @notice Update applicationMetaPtr (only by ROUND_OPERATOR_ROLE) /// @param newApplicationMetaPtr new applicationMetaPtr function updateApplicationMetaPtr(MetaPtr memory newApplicationMetaPtr) external roundHasNotEnded onlyRole(ROUND_OPERATOR_ROLE) { emit ApplicationMetaPtrUpdated(applicationMetaPtr, newApplicationMetaPtr); applicationMetaPtr = newApplicationMetaPtr; } /// @notice Update application, round start & end times (only by ROUND_OPERATOR_ROLE) /// @dev Only updates if new time is in the future and current set time is also in the future /// @param newApplicationsStartTime new applicationsStartTime /// @param newApplicationsEndTime new applicationsEndTime /// @param newRoundStartTime new roundStartTime /// @param newRoundEndTime new roundEndTime function updateStartAndEndTimes( uint256 newApplicationsStartTime, uint256 newApplicationsEndTime, uint256 newRoundStartTime, uint256 newRoundEndTime ) external roundHasNotEnded onlyRole(ROUND_OPERATOR_ROLE) { // slither-disable-next-line timestamp require(newApplicationsStartTime < newApplicationsEndTime, "Round: Application end is before application start"); require(newRoundStartTime < newRoundEndTime, "Round: Round end is before round start"); require(newApplicationsStartTime <= newRoundStartTime, "Round: Round start is before application start"); require(newApplicationsEndTime <= newRoundEndTime, "Round: Round end is before application end"); require(block.timestamp <= newApplicationsStartTime, "Round: Time has already passed"); if ( applicationsStartTime >= block.timestamp && newApplicationsStartTime != applicationsStartTime ) { emit ApplicationsStartTimeUpdated(applicationsStartTime, newApplicationsStartTime); applicationsStartTime = newApplicationsStartTime; } if ( applicationsEndTime >= block.timestamp && newApplicationsEndTime != applicationsEndTime ) { emit ApplicationsEndTimeUpdated(applicationsEndTime, newApplicationsEndTime); applicationsEndTime = newApplicationsEndTime; } if ( roundStartTime >= block.timestamp && newRoundStartTime != roundStartTime ) { emit RoundStartTimeUpdated(roundStartTime, newRoundStartTime); roundStartTime = newRoundStartTime; } if ( roundEndTime >= block.timestamp && newRoundEndTime != roundEndTime ) { emit RoundEndTimeUpdated(roundEndTime, newRoundEndTime); roundEndTime = newRoundEndTime; } } /// @notice Submit a project application /// @param projectID unique hash of the project /// @param newApplicationMetaPtr appliction metaPtr function applyToRound(bytes32 projectID, MetaPtr calldata newApplicationMetaPtr) external { // slither-disable-next-line timestamp require( applicationsStartTime <= block.timestamp && block.timestamp <= applicationsEndTime, "Round: Applications period not started or over" ); applications.push(Application(projectID, nextApplicationIndex, newApplicationMetaPtr)); applicationsIndexesByProjectID[projectID].push(nextApplicationIndex); emit NewProjectApplication(projectID, nextApplicationIndex, newApplicationMetaPtr); nextApplicationIndex++; } /// @notice Get all applications of a projectID /// @param projectID unique hash of the project /// @return applicationIndexes indexes of the applications function getApplicationIndexesByProjectID(bytes32 projectID) external view returns(uint256[] memory) { return applicationsIndexesByProjectID[projectID]; } // Statuses: // * 0 - pending // * 1 - approved // * 2 - rejected // * 3 - canceled /// Set application statuses /// @param statuses new statuses function setApplicationStatuses(ApplicationStatus[] memory statuses) external roundHasNotEnded onlyRole(ROUND_OPERATOR_ROLE) { for (uint256 i = 0; i < statuses.length;) { uint256 rowIndex = statuses[i].index; uint256 fullRow = statuses[i].statusRow; applicationStatusesBitMap[rowIndex] = fullRow; emit ApplicationStatusesUpdated(rowIndex, fullRow); unchecked { i++; } } } /// @notice Get application status /// @param applicationIndex index of the application /// @return status status of the application function getApplicationStatus(uint256 applicationIndex) external view returns(uint256) { require(applicationIndex < applications.length, "Round: Application does not exist"); uint256 rowIndex = applicationIndex / 128; uint256 colIndex = (applicationIndex % 128) * 2; uint256 currentRow = applicationStatusesBitMap[rowIndex]; uint256 status = (currentRow >> colIndex) & 3; return status; } /// @notice Invoked by voter to cast votes /// @param encodedVotes encoded vote function vote(bytes[] memory encodedVotes) external payable { // slither-disable-next-line timestamp require( roundStartTime <= block.timestamp && block.timestamp <= roundEndTime, "Round: Round is not active" ); votingStrategy.vote{value: msg.value}(encodedVotes, msg.sender); } /// @notice Pay Protocol & Round Fees and transfer funds to payout contract (only by ROUND_OPERATOR_ROLE) function setReadyForPayout() external payable roundHasEnded onlyRole(ROUND_OPERATOR_ROLE) { uint256 fundsInContract = _getTokenBalance(token); uint32 denominator = alloSettings.DENOMINATOR(); uint256 protocolFeeAmount = (matchAmount * alloSettings.protocolFeePercentage()) / denominator; uint256 roundFeeAmount = (matchAmount * roundFeePercentage) / denominator; // total funds needed for payout uint256 neededFunds = matchAmount + protocolFeeAmount + roundFeeAmount; require(fundsInContract >= neededFunds, "Round: Not enough funds in contract"); // deduct protocol fee if (protocolFeeAmount > 0) { address payable protocolTreasury = alloSettings.protocolTreasury(); _transferAmount(protocolTreasury, protocolFeeAmount, token); } // deduct round fee if (roundFeeAmount > 0) { _transferAmount(roundFeeAddress, roundFeeAmount, token); } // update funds in contract after fee deduction fundsInContract = _getTokenBalance(token); // transfer funds to payout contract if (token == address(0)) { payoutStrategy.setReadyForPayout{value: fundsInContract}(); } else { IERC20(token).safeTransfer(address(payoutStrategy), fundsInContract); payoutStrategy.setReadyForPayout(); } emit PayFeeAndEscrowFundsToPayoutContract(fundsInContract, protocolFeeAmount, roundFeeAmount); } /// @notice Withdraw funds from the contract (only by ROUND_OPERATOR_ROLE) /// @param tokenAddress token address /// @param recipent recipient address function withdraw(address tokenAddress, address payable recipent) external onlyRole(ROUND_OPERATOR_ROLE) { require(tokenAddress != token, "Round: Cannot withdraw round token"); _transferAmount(recipent, _getTokenBalance(tokenAddress), tokenAddress); } /// @notice Util function to get token balance in the contract /// @param tokenAddress token address function _getTokenBalance(address tokenAddress) private view returns (uint256) { if (tokenAddress == address(0)) { return address(this).balance; } else { return IERC20(tokenAddress).balanceOf(address(this)); } } /// @notice Util function to transfer amount to recipient /// @param _recipient recipient address /// @param _amount amount to transfer /// @param _tokenAddress token address function _transferAmount(address payable _recipient, uint256 _amount, address _tokenAddress) private { if (_tokenAddress == address(0)) { Address.sendValue(_recipient, _amount); } else { IERC20(_tokenAddress).safeTransfer(_recipient, _amount); } } receive() external payable {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[49] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.1) (proxy/utils/Initializable.sol) pragma solidity ^0.8.2; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in * case an upgrade adds a module that needs to be initialized. * * For example: * * [.hljs-theme-light.nopadding] * ``` * contract MyToken is ERC20Upgradeable { * function initialize() initializer public { * __ERC20_init("MyToken", "MTK"); * } * } * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable { * function initializeV2() reinitializer(2) public { * __ERC20Permit_init("MyToken"); * } * } * ``` * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() { * _disableInitializers(); * } * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. * @custom:oz-retyped-from bool */ uint8 private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Triggered when the contract has been initialized or reinitialized. */ event Initialized(uint8 version); /** * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope, * `onlyInitializing` functions can be used to initialize parent contracts. * * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a * constructor. * * Emits an {Initialized} event. */ modifier initializer() { bool isTopLevelCall = !_initializing; require( (isTopLevelCall && _initialized < 1) || (!AddressUpgradeable.isContract(address(this)) && _initialized == 1), "Initializable: contract is already initialized" ); _initialized = 1; if (isTopLevelCall) { _initializing = true; } _; if (isTopLevelCall) { _initializing = false; emit Initialized(1); } } /** * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be * used to initialize parent contracts. * * A reinitializer may be used after the original initialization step. This is essential to configure modules that * are added through upgrades and that require initialization. * * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer` * cannot be nested. If one is invoked in the context of another, execution will revert. * * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in * a contract, executing them in the right order is up to the developer or operator. * * WARNING: setting the version to 255 will prevent any future reinitialization. * * Emits an {Initialized} event. */ modifier reinitializer(uint8 version) { require(!_initializing && _initialized < version, "Initializable: contract is already initialized"); _initialized = version; _initializing = true; _; _initializing = false; emit Initialized(version); } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} and {reinitializer} modifiers, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } /** * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call. * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized * to any version. It is recommended to use this to lock implementation contracts that are designed to be called * through proxies. * * Emits an {Initialized} event the first time it is successfully executed. */ function _disableInitializers() internal virtual { require(!_initializing, "Initializable: contract is initializing"); if (_initialized < type(uint8).max) { _initialized = type(uint8).max; emit Initialized(type(uint8).max); } } /** * @dev Returns the highest version that has been initialized. See {reinitializer}. */ function _getInitializedVersion() internal view returns (uint8) { return _initialized; } /** * @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}. */ function _isInitializing() internal view returns (bool) { return _initializing; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20PermitUpgradeable { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20Upgradeable.sol"; import "../extensions/draft-IERC20PermitUpgradeable.sol"; import "../../../utils/AddressUpgradeable.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 SafeERC20Upgradeable { using AddressUpgradeable for address; function safeTransfer( IERC20Upgradeable token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20Upgradeable 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( IERC20Upgradeable 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( IERC20Upgradeable 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( IERC20Upgradeable 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( IERC20PermitUpgradeable 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(IERC20Upgradeable 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 AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return 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 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; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } /** * @dev This empty reserved space is put in place to allow future versions to add new * variables without shifting down storage in the inheritance chain. * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps */ uint256[50] private __gap; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (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 (last updated v4.5.0) (access/AccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControlEnumerable.sol"; import "./AccessControl.sol"; import "../utils/structs/EnumerableSet.sol"; /** * @dev Extension of {AccessControl} that allows enumerating the members of each role. */ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessControl { using EnumerableSet for EnumerableSet.AddressSet; mapping(bytes32 => EnumerableSet.AddressSet) private _roleMembers; /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControlEnumerable).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { return _roleMembers[role].at(index); } /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { return _roleMembers[role].length(); } /** * @dev Overload {_grantRole} to track enumerable memberships */ function _grantRole(bytes32 role, address account) internal virtual override { super._grantRole(role, account); _roleMembers[role].add(account); } /** * @dev Overload {_revokeRole} to track enumerable memberships */ function _revokeRole(bytes32 role, address account) internal virtual override { super._revokeRole(role, account); _roleMembers[role].remove(account); } }
// 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 v4.4.1 (access/IAccessControlEnumerable.sol) pragma solidity ^0.8.0; import "./IAccessControl.sol"; /** * @dev External interface of AccessControlEnumerable declared to support ERC165 detection. */ interface IAccessControlEnumerable is IAccessControl { /** * @dev Returns one of the accounts that have `role`. `index` must be a * value between 0 and {getRoleMemberCount}, non-inclusive. * * Role bearers are not sorted in any particular way, and their ordering may * change at any point. * * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure * you perform all queries on the same block. See the following * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ function getRoleMember(bytes32 role, uint256 index) external view returns (address); /** * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ function getRoleMemberCount(bytes32 role) external view returns (uint256); }
// 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.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 (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 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/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/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; } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.17; import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol"; import "../utils/MetaPtr.sol"; import "../round/RoundImplementation.sol"; /** * @notice Defines the abstract contract for payout strategies * for a round. Any new payout strategy would be expected to * extend this abstract contract. * Every PayoutStrategyImplementation contract would be unique to RoundImplementation * and would be deployed before creating a round. * * Functions that are marked as `virtual` are expected to be overridden * by the implementation contract. * * - updateDistribution * - payout * * @dev * - Deployed before creating a round * - Funds are transferred to the payout contract from round only during payout */ abstract contract IPayoutStrategy { using SafeERC20Upgradeable for IERC20Upgradeable; // --- Constants --- /// @notice round operator role bytes32 public constant ROUND_OPERATOR_ROLE = keccak256("ROUND_OPERATOR"); /// @notice Locking duration uint256 public constant LOCK_DURATION = 0 days; // --- Data --- /// @notice RoundImplementation address address payable public roundAddress; /// @notice Token address address public tokenAddress; /// MetaPtr containing the distribution MetaPtr public distributionMetaPtr; // @notice bool public isReadyForPayout; // --- Event --- /// @notice Emitted when funds are withdrawn from the payout contract event FundsWithdrawn(address indexed tokenAddress, uint256 amount, address withdrawAddress); /// @notice Emitted when contract is ready for payout event ReadyForPayout(); // --- Modifier --- /// @notice modifier to check if sender is round contract. modifier isRoundContract() { require(roundAddress != address(0), "not linked to a round"); require(msg.sender == roundAddress, "not invoked by round"); _; } /// @notice modifier to check if sender is round operator. modifier isRoundOperator() { require( RoundImplementation(roundAddress).hasRole(ROUND_OPERATOR_ROLE, msg.sender), "not round operator" ); _; } /// @notice modifier to check if round has ended. modifier roundHasEnded() { uint roundEndTime = RoundImplementation(roundAddress).roundEndTime(); require(block.timestamp >= roundEndTime,"round has not ended"); _; } // --- Core methods --- /** * @notice Invoked by RoundImplementation on creation to * set the round for which the payout strategy is to be used * */ function init() external { require(roundAddress == address(0x0), "roundAddress already set"); roundAddress = payable(msg.sender); // set the token address tokenAddress = RoundImplementation(roundAddress).token(); isReadyForPayout = false; } /**s * @notice Invoked by RoundImplementation to upload distribution to the * payout strategy * * @dev * - ideally IPayoutStrategy implementation should emit events after * distribution is updated * - would be invoked at the end of the round * * Modifiers: * - isRoundOperator * - roundHasEnded * * @param _encodedDistribution encoded distribution */ function updateDistribution(bytes calldata _encodedDistribution) external virtual; /// @notice Invoked by RoundImplementation to set isReadyForPayout function setReadyForPayout() external payable isRoundContract roundHasEnded { require(isReadyForPayout == false, "isReadyForPayout already set"); isReadyForPayout = true; emit ReadyForPayout(); } /** * @notice Invoked by RoundImplementation to trigger payout * * @dev * - could be used to trigger payout / enable payout * - should be invoked only when isReadyForPayout is ttue * - should emit event after every payout is triggered * * @param _encodedPayoutData encoded payout data */ function payout(bytes[] calldata _encodedPayoutData) external virtual payable; /** * @notice Invoked by RoundImplementation to withdraw funds to * withdrawAddress from the payout contract * * @param withdrawAddress withdraw funds address */ function withdrawFunds(address payable withdrawAddress) external payable virtual isRoundOperator { uint roundEndTime = RoundImplementation(roundAddress).roundEndTime(); require(block.timestamp >= roundEndTime + LOCK_DURATION, "Lock duration has not ended"); uint balance = _getTokenBalance(); if (tokenAddress == address(0)) { /// @dev native token AddressUpgradeable.sendValue( withdrawAddress, balance ); } else { /// @dev ERC20 token IERC20Upgradeable(tokenAddress).safeTransfer( withdrawAddress, balance ); } emit FundsWithdrawn(tokenAddress, balance, withdrawAddress); } /** * Util function to get token balance in the contract */ function _getTokenBalance() internal view returns (uint) { if (tokenAddress == address(0)) { return address(this).balance; } else { return IERC20Upgradeable(tokenAddress).balanceOf(address(this)); } } receive() external payable {} }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.17; import "../utils/MetaPtr.sol"; interface IRoundImplementation { struct ApplicationStatus { uint256 index; uint256 statusRow; } function initialize( bytes calldata encodedParameters, address _alloSettings ) external; function updateMatchAmount(uint256 newAmount) external; function updateRoundFeePercentage(uint32 newFeePercentage) external; function updateRoundFeeAddress(address payable newFeeAddress) external; function updateRoundMetaPtr(MetaPtr memory newRoundMetaPtr) external; function updateApplicationMetaPtr( MetaPtr memory newApplicationMetaPtr ) external; function updateStartAndEndTimes( uint256 newApplicationsStartTime, uint256 newApplicationsEndTime, uint256 newRoundStartTime, uint256 newRoundEndTime ) external; function applyToRound( bytes32 projectID, MetaPtr calldata newApplicationMetaPtr ) external; function getApplicationIndexesByProjectID( bytes32 projectID ) external view returns (uint256[] memory); function setApplicationStatuses( ApplicationStatus[] memory statuses ) external; function getApplicationStatus( uint256 applicationIndex ) external view returns (uint256); function vote(bytes[] memory encodedVotes) external payable; function setReadyForPayout() external payable; function withdraw(address tokenAddress, address payable recipent) external; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.17; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; contract AlloSettings is OwnableUpgradeable { string public constant VERSION = "1.0.0"; // 1000 * 100 uint24 public constant DENOMINATOR = 100000; // --- Data --- /// @notice Address of the protocol treasury address payable public protocolTreasury; /// @notice Protocol fee percentage /// 100% = 100_000 | 10% = 10_000 | 1% = 1_000 | 0.1% = 100 | 0.01% = 10 uint24 public protocolFeePercentage; // --- Event --- /// @notice Emitted when protocol fee percentage is updated event ProtocolFeePercentageUpdated(uint24 protocolFeePercentage); /// @notice Emitted when a protocol wallet address is updated event ProtocolTreasuryUpdated(address protocolTreasuryAddress); /// @notice constructor function which ensure deployer is set as owner function initialize() external initializer { __Context_init_unchained(); __Ownable_init_unchained(); } // --- Core methods --- /// @notice Set the protocol fee percentage /// @param _protocolFeePercentage The new protocol fee percentage function updateProtocolFeePercentage(uint24 _protocolFeePercentage) external onlyOwner { require(_protocolFeePercentage <= DENOMINATOR , "value exceeds 100%"); protocolFeePercentage = _protocolFeePercentage; emit ProtocolFeePercentageUpdated(protocolFeePercentage); } /// @notice Set the protocol treasury address /// @param _protocolTreasury The new protocol treasury address function updateProtocolTreasury(address payable _protocolTreasury) external onlyOwner { protocolTreasury = _protocolTreasury; emit ProtocolTreasuryUpdated(protocolTreasury); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.17; struct MetaPtr { /// @notice Protocol ID corresponding to a specific protocol. /// More info at https://github.com/allo-protocol/contracts/tree/main/docs/MetaPtrProtocol.md uint256 protocol; /// @notice Pointer to fetch metadata for the specified protocol string pointer; }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity 0.8.17; /** * @notice Defines the abstract contract for voting algorithms on grants * within a round. Any new voting algorithm would be expected to * extend this abstract contract. * Every IVotingStrategy contract would be unique to RoundImplementation * and would be deployed before creating a round */ abstract contract IVotingStrategy { // --- Data --- /// @notice Round address address public roundAddress; // --- Modifier --- /// @notice modifier to check if sender is round contract. modifier isRoundContract() { require(roundAddress != address(0), "error: voting contract not linked to a round"); require(msg.sender == roundAddress, "error: can be invoked only by round contract"); _; } // --- Core methods --- /** * @notice Invoked by RoundImplementation on creation to * set the round for which the voting contracts is to be used * */ function init() external { require(roundAddress == address(0), "init: roundAddress already set"); roundAddress = msg.sender; } /** * @notice Invoked by RoundImplementation to allow voter to case * vote for grants during a round. * * @dev * - allows contributor to do cast multiple votes which could be weighted. * - should be invoked by RoundImplementation contract * - ideally IVotingStrategy implementation should emit events after a vote is cast * - this would be triggered when a voter casts their vote via grant explorer * * @param _encodedVotes encoded votes * @param _voterAddress voter address */ function vote(bytes[] calldata _encodedVotes, address _voterAddress) external virtual payable; }
{ "optimizer": { "enabled": true, "runs": 400 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"anonymous":false,"inputs":[{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"indexed":false,"internalType":"struct MetaPtr","name":"oldMetaPtr","type":"tuple"},{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"indexed":false,"internalType":"struct MetaPtr","name":"newMetaPtr","type":"tuple"}],"name":"ApplicationMetaPtrUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"index","type":"uint256"},{"indexed":true,"internalType":"uint256","name":"status","type":"uint256"}],"name":"ApplicationStatusesUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTime","type":"uint256"}],"name":"ApplicationsEndTimeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTime","type":"uint256"}],"name":"ApplicationsStartTimeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newAmount","type":"uint256"}],"name":"MatchAmountUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"projectID","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"applicationIndex","type":"uint256"},{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"indexed":false,"internalType":"struct MetaPtr","name":"applicationMetaPtr","type":"tuple"}],"name":"NewProjectApplication","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"matchAmountAfterFees","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"protocolFeeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"roundFeeAmount","type":"uint256"}],"name":"PayFeeAndEscrowFundsToPayoutContract","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"indexed":false,"internalType":"struct MetaPtr","name":"oldMetaPtr","type":"tuple"},{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"indexed":false,"internalType":"struct MetaPtr","name":"newMetaPtr","type":"tuple"}],"name":"ProjectsMetaPtrUpdated","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":"uint256","name":"oldTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTime","type":"uint256"}],"name":"RoundEndTimeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"roundFeeAddress","type":"address"}],"name":"RoundFeeAddressUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint32","name":"roundFeePercentage","type":"uint32"}],"name":"RoundFeePercentageUpdated","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"indexed":false,"internalType":"struct MetaPtr","name":"oldMetaPtr","type":"tuple"},{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"indexed":false,"internalType":"struct MetaPtr","name":"newMetaPtr","type":"tuple"}],"name":"RoundMetaPtrUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"oldTime","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newTime","type":"uint256"}],"name":"RoundStartTimeUpdated","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROUND_OPERATOR_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"alloSettings","outputs":[{"internalType":"contract AlloSettings","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"applicationMetaPtr","outputs":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"applicationStatusesBitMap","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"applications","outputs":[{"internalType":"bytes32","name":"projectID","type":"bytes32"},{"internalType":"uint256","name":"applicationIndex","type":"uint256"},{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"internalType":"struct MetaPtr","name":"metaPtr","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"applicationsEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"applicationsIndexesByProjectID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"applicationsStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"projectID","type":"bytes32"},{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"internalType":"struct MetaPtr","name":"newApplicationMetaPtr","type":"tuple"}],"name":"applyToRound","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"projectID","type":"bytes32"}],"name":"getApplicationIndexesByProjectID","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"applicationIndex","type":"uint256"}],"name":"getApplicationStatus","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"bytes","name":"encodedParameters","type":"bytes"},{"internalType":"address","name":"_alloSettings","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"matchAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextApplicationIndex","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"payoutStrategy","outputs":[{"internalType":"contract IPayoutStrategy","name":"","type":"address"}],"stateMutability":"view","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":[],"name":"roundEndTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roundFeeAddress","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roundFeePercentage","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roundMetaPtr","outputs":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"roundStartTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"statusRow","type":"uint256"}],"internalType":"struct IRoundImplementation.ApplicationStatus[]","name":"statuses","type":"tuple[]"}],"name":"setApplicationStatuses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setReadyForPayout","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"internalType":"struct MetaPtr","name":"newApplicationMetaPtr","type":"tuple"}],"name":"updateApplicationMetaPtr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newAmount","type":"uint256"}],"name":"updateMatchAmount","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"newFeeAddress","type":"address"}],"name":"updateRoundFeeAddress","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint32","name":"newFeePercentage","type":"uint32"}],"name":"updateRoundFeePercentage","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"protocol","type":"uint256"},{"internalType":"string","name":"pointer","type":"string"}],"internalType":"struct MetaPtr","name":"newRoundMetaPtr","type":"tuple"}],"name":"updateRoundMetaPtr","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newApplicationsStartTime","type":"uint256"},{"internalType":"uint256","name":"newApplicationsEndTime","type":"uint256"},{"internalType":"uint256","name":"newRoundStartTime","type":"uint256"},{"internalType":"uint256","name":"newRoundEndTime","type":"uint256"}],"name":"updateStartAndEndTimes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"encodedVotes","type":"bytes[]"}],"name":"vote","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"votingStrategy","outputs":[{"internalType":"contract IVotingStrategy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address payable","name":"recipent","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
608060405234801561001057600080fd5b5061394f806100206000396000f3fe6080604052600436106102755760003560e01c8063b02f18e711610149578063d97f3dcf116100c6578063f940e3851161008a578063fc0c546a11610064578063fc0c546a146107c0578063fe169f76146107e0578063ffa1ad74146107e857600080fd5b8063f940e38514610760578063fa1910e814610780578063fb5c8bfd146107a057600080fd5b8063d97f3dcf146106cd578063dd4f8f74146106ef578063dfefadff14610705578063e40205d614610734578063f7f8ebca1461074a57600080fd5b8063cce2df031161010d578063cce2df0314610637578063d195bba114610657578063d32cca471461066d578063d547741f1461068d578063d7bf7840146106ad57600080fd5b8063b02f18e71461057d578063b9ff5ebe1461059d578063c03fd662146105bd578063c5069b61146105ea578063ca15c8731461061757600080fd5b8063685bd21b116101f25780638e421b85116101b657806391d148541161019057806391d14854146104fe5780639c3b68ce14610542578063a217fddf1461056857600080fd5b80638e421b85146104855780638e9745dc146104a55780639010d07c146104de57600080fd5b8063685bd21b146103fd578063697e5f691461041257806376bacc99146104325780637aa54b68146104525780638926a8881461046557600080fd5b80632698f3fb116102395780632698f3fb1461036257806328ab75c7146103855780632f2ff15d146103a757806336568abe146103c757806344b278a6146103e757600080fd5b806301ffc9a7146102815780630c0a56b6146102b657806310a11a6d146102ee5780631e949c9e1461031c578063248a9ca31461033257600080fd5b3661027c57005b600080fd5b34801561028d57600080fd5b506102a161029c366004612b44565b610826565b60405190151581526020015b60405180910390f35b3480156102c257600080fd5b506004546102d6906001600160a01b031681565b6040516001600160a01b0390911681526020016102ad565b3480156102fa57600080fd5b5061030e610309366004612b6e565b610851565b6040519081526020016102ad565b34801561032857600080fd5b5061030e60065481565b34801561033e57600080fd5b5061030e61034d366004612b90565b60009081526020819052604090206001015490565b34801561036e57600080fd5b50610377610882565b6040516102ad929190612bf9565b34801561039157600080fd5b506103a56103a0366004612c26565b610919565b005b3480156103b357600080fd5b506103a56103c2366004612c56565b6109e0565b3480156103d357600080fd5b506103a56103e2366004612c56565b610a0a565b3480156103f357600080fd5b5061030e60105481565b34801561040957600080fd5b50610377610a88565b34801561041e57600080fd5b506103a561042d366004612b90565b610a9c565b34801561043e57600080fd5b50600b546102d6906001600160a01b031681565b6103a5610460366004612d72565b610b95565b34801561047157600080fd5b506103a5610480366004612ea3565b610c5e565b34801561049157600080fd5b506103a56104a0366004612ed8565b610d1e565b3480156104b157600080fd5b50600a546104c990600160a01b900463ffffffff1681565b60405163ffffffff90911681526020016102ad565b3480156104ea57600080fd5b506102d66104f9366004612b6e565b6110dd565b34801561050a57600080fd5b506102a1610519366004612c56565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561054e57600080fd5b506002546102d6906201000090046001600160a01b031681565b34801561057457600080fd5b5061030e600081565b34801561058957600080fd5b506103a5610598366004612f0a565b6110fc565b3480156105a957600080fd5b506103a56105b8366004612f58565b61126c565b3480156105c957600080fd5b5061030e6105d8366004612b90565b60136020526000908152604090205481565b3480156105f657600080fd5b5061060a610605366004612b90565b61131d565b6040516102ad9190612f75565b34801561062357600080fd5b5061030e610632366004612b90565b61137f565b34801561064357600080fd5b506103a5610652366004612fb9565b611396565b34801561066357600080fd5b5061030e60055481565b34801561067957600080fd5b5061030e610688366004612b90565b6118f9565b34801561069957600080fd5b506103a56106a8366004612c56565b61199b565b3480156106b957600080fd5b506103a56106c8366004612ea3565b6119c0565b3480156106d957600080fd5b5061030e6000805160206138fa83398151915281565b3480156106fb57600080fd5b5061030e60075481565b34801561071157600080fd5b50610725610720366004612b90565b611a79565b6040516102ad9392919061305b565b34801561074057600080fd5b5061030e60085481565b34801561075657600080fd5b5061030e60095481565b34801561076c57600080fd5b506103a561077b366004613083565b611b59565b34801561078c57600080fd5b506103a561079b3660046130b1565b611bed565b3480156107ac57600080fd5b506003546102d6906001600160a01b031681565b3480156107cc57600080fd5b50600a546102d6906001600160a01b031681565b6103a5611ce9565b3480156107f457600080fd5b50610819604051806040016040528060058152602001640312e302e360dc1b81525081565b6040516102ad919061315c565b60006001600160e01b03198216635a05180f60e01b148061084b575061084b82612146565b92915050565b6012602052816000526040600020818154811061086d57600080fd5b90600052602060002001600091509150505481565b600c8054600d80549192916108969061316f565b80601f01602080910402602001604051908101604052809291908181526020018280546108c29061316f565b801561090f5780601f106108e45761010080835404028352916020019161090f565b820191906000526020600020905b8154815290600101906020018083116108f257829003601f168201915b5050505050905082565b6008544211156109695760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b60448201526064015b60405180910390fd5b6000805160206138fa8339815191526109818161217b565b600a805463ffffffff60a01b1916600160a01b63ffffffff8581168202929092179283905560405192041681527f94ef22170df1c9a0e250ce2eae5fd3abc6d1379de9f9855fee7e490f15ddda87906020015b60405180910390a15050565b6000828152602081905260409020600101546109fb8161217b565b610a058383612188565b505050565b6001600160a01b0381163314610a7a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610960565b610a8482826121aa565b5050565b600e8054600f80549192916108969061316f565b600854421115610ae75760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa833981519152610aff8161217b565b6009548211610b605760405162461bcd60e51b815260206004820152602760248201527f526f756e643a204c6573736572207468616e2063757272656e74206d6174636860448201526608185b5bdd5b9d60ca1b6064820152608401610960565b60098290556040518281527f36407b7517f93b8dd6bf87384f27398dc6c7158776015e7492bbae639be60bdd906020016109d4565b4260075411158015610ba957506008544211155b610bf55760405162461bcd60e51b815260206004820152601a60248201527f526f756e643a20526f756e64206973206e6f74206163746976650000000000006044820152606401610960565b60035460405163fc6d4e3960e01b81526001600160a01b039091169063fc6d4e39903490610c2990859033906004016131a9565b6000604051808303818588803b158015610c4257600080fd5b505af1158015610c56573d6000803e3d6000fd5b505050505050565b600854421115610ca95760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa833981519152610cc18161217b565b7ffd4633953debc7fbfababf529ffe33c4a6dd78c9ff13db552b571df088478641600e83604051610cf392919061321e565b60405180910390a18151600e9081556020830151839190600f90610d17908261330b565b5050505050565b600854421115610d695760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa833981519152610d818161217b565b838510610df65760405162461bcd60e51b815260206004820152603260248201527f526f756e643a204170706c69636174696f6e20656e64206973206265666f726560448201527f206170706c69636174696f6e20737461727400000000000000000000000000006064820152608401610960565b818310610e545760405162461bcd60e51b815260206004820152602660248201527f526f756e643a20526f756e6420656e64206973206265666f726520726f756e64604482015265081cdd185c9d60d21b6064820152608401610960565b82851115610ebb5760405162461bcd60e51b815260206004820152602e60248201527f526f756e643a20526f756e64207374617274206973206265666f72652061707060448201526d1b1a58d85d1a5bdb881cdd185c9d60921b6064820152608401610960565b81841115610f1e5760405162461bcd60e51b815260206004820152602a60248201527f526f756e643a20526f756e6420656e64206973206265666f7265206170706c6960448201526918d85d1a5bdb88195b9960b21b6064820152608401610960565b84421115610f6e5760405162461bcd60e51b815260206004820152601e60248201527f526f756e643a2054696d652068617320616c72656164792070617373656400006044820152606401610960565b4260055410158015610f8257506005548514155b15610fc95760055460408051918252602082018790527f1fde68e630df12a4f2baa029dd016929d2c6bccc0fdd80dec2a787b01035517e910160405180910390a160058590555b4260065410158015610fdd57506006548414155b156110245760065460408051918252602082018690527fa7fbc7103523f0d44281a3a3ba5aa119e9cab30ae02c09932eb2524c7d81f463910160405180910390a160068490555b426007541015801561103857506007548314155b1561107f5760075460408051918252602082018590527fbd905b0cf9e380e3eaf972d7cb542694f66361043fcce248341d90626d467476910160405180910390a160078390555b426008541015801561109357506008548214155b15610d175760085460408051918252602082018490527fc0395d95a518149baa3521bb5b3c6988c7806a48ea42726ee3a9686bbd2a08cd910160405180910390a150600855505050565b60008281526001602052604081206110f590836121cc565b9392505050565b426005541115801561111057506006544211155b6111735760405162461bcd60e51b815260206004820152602e60248201527f526f756e643a204170706c69636174696f6e7320706572696f64206e6f74207360448201526d3a30b93a32b21037b91037bb32b960911b6064820152608401610960565b60116040518060600160405280848152602001601054815260200183611198906133cb565b90528154600181810184556000938452602093849020835160049093020191825583830151908201556040820151805160028301908155938101519293919290919060038401906111e9908261330b565b5050506000848152601260209081526040808320601080548254600181018455928652939094200191909155905490518593507fca792622046325e9cd4e24b490cb000ef72acea3a15284efc14ee709307a5e00925061124b919085906133d7565b60405180910390a26010805490600061126383613478565b91905055505050565b6008544211156112b75760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa8339815191526112cf8161217b565b600b80546001600160a01b0319166001600160a01b0384169081179091556040519081527f88ae92ef8eb8a634a01f4e404d706ac67bc00a88bdf46af83630c6ade6e97953906020016109d4565b60008181526012602090815260409182902080548351818402810184019094528084526060939283018282801561137357602002820191906000526020600020905b81548152602001906001019080831161135f575b50505050509050919050565b600081815260016020526040812061084b906121d8565b600254610100900460ff16158080156113b65750600254600160ff909116105b806113d05750303b1580156113d0575060025460ff166001145b6114335760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610960565b6002805460ff191660011790558015611456576002805461ff0019166101001790555b60008080808080808061146b8b8d018d61362c565b9750975097509750975097509750975042876000015110156114cf5760405162461bcd60e51b815260206004820152601e60248201527f526f756e643a2054696d652068617320616c72656164792070617373656400006044820152606401610960565b865160208801511161152e5760405162461bcd60e51b815260206004820152602260248201527f526f756e643a2041707020656e64206973206265666f726520617070207374616044820152611c9d60f21b6064820152608401610960565b8660200151876060015110156115915760405162461bcd60e51b815260206004820152602260248201527f526f756e643a20526f756e6420656e64206973206265666f72652061707020656044820152611b9960f21b6064820152608401610960565b86604001518760600151116115f75760405162461bcd60e51b815260206004820152602660248201527f526f756e643a20526f756e6420656e64206973206265666f726520726f756e64604482015265081cdd185c9d60d21b6064820152608401610960565b86516040880151101561165b5760405162461bcd60e51b815260206004820152602660248201527f526f756e643a20526f756e64207374617274206973206265666f726520617070604482015265081cdd185c9d60d21b6064820152608401610960565b6002805475ffffffffffffffffffffffffffffffffffffffff00001916620100006001600160a01b038d811691909102919091179091558851600380546001600160a01b03199081169284169283179091556020808c01516004805484169186169190911781558b51600555908b01516006556040808c015160075560608c0151600855600a8054909316948a169490941790915582516370e39c9560e11b81529251919263e1c7392a928183019260009282900301818387803b15801561172257600080fd5b505af1158015611736573d6000803e3d6000fd5b505060048054604080516370e39c9560e11b815290516001600160a01b03909216945063e1c7392a9350808301926000929182900301818387803b15801561177d57600080fd5b505af1158015611791573d6000803e3d6000fd5b505050600987905550600a805463ffffffff60a01b1916600160a01b63ffffffff871602179055600b80546001600160a01b0319166001600160a01b03851617905581518051600c9081556020820151600d906117ee908261330b565b5050506020808301518051600e90815591810151909190600f90611812908261330b565b5090505060005b81515181101561185b578151805161184b916000918490811061183e5761183e613721565b6020026020010151612188565b61185481613478565b9050611819565b5060005b8160200151518110156118a4576118946000805160206138fa8339815191528360200151838151811061183e5761183e613721565b61189d81613478565b905061185f565b50505050505050505080156118f3576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60115460009082106119575760405162461bcd60e51b815260206004820152602160248201527f526f756e643a204170706c69636174696f6e20646f6573206e6f7420657869736044820152601d60fa1b6064820152608401610960565b600061196460808461374d565b90506000611973608085613761565b61197e906002613775565b6000928352601360205260409092205490911c6003169392505050565b6000828152602081905260409020600101546119b68161217b565b610a0583836121aa565b600854421115611a0b5760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa833981519152611a238161217b565b7fb625c4faee7533bf09da813b9c0e169f98d36c22d9ce5181c9e4d7577556760a600c83604051611a5592919061321e565b60405180910390a18151600c9081556020830151839190600d90610d17908261330b565b60118181548110611a8957600080fd5b90600052602060002090600402016000915090508060000154908060010154908060020160405180604001604052908160008201548152602001600182018054611ad29061316f565b80601f0160208091040260200160405190810160405280929190818152602001828054611afe9061316f565b8015611b4b5780601f10611b2057610100808354040283529160200191611b4b565b820191906000526020600020905b815481529060010190602001808311611b2e57829003601f168201915b505050505081525050905083565b6000805160206138fa833981519152611b718161217b565b600a546001600160a01b0390811690841603611bda5760405162461bcd60e51b815260206004820152602260248201527f526f756e643a2043616e6e6f7420776974686472617720726f756e6420746f6b60448201526132b760f11b6064820152608401610960565b610a0582611be7856121e2565b85612266565b600854421115611c385760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa833981519152611c508161217b565b60005b8251811015610a05576000838281518110611c7057611c70613721565b60200260200101516000015190506000848381518110611c9257611c92613721565b60209081029190910181015181015160008481526013909252604080832082905551909250829184917f5d498eb0ba08d4494201d7dd654e1f1c3e8a74dd0f860bb3c3e1b64eb79885c89190a35050600101611c53565b6008544211611d3a5760405162461bcd60e51b815260206004820152601a60248201527f526f756e643a20526f756e6420686173206e6f7420656e6465640000000000006044820152606401610960565b6000805160206138fa833981519152611d528161217b565b600a54600090611d6a906001600160a01b03166121e2565b9050600060028054906101000a90046001600160a01b03166001600160a01b031663918f86746040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de3919061378c565b62ffffff16905060008163ffffffff1660028054906101000a90046001600160a01b03166001600160a01b0316638e50e5096040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e68919061378c565b62ffffff16600954611e7a9190613775565b611e84919061374d565b905060008263ffffffff16600a60149054906101000a900463ffffffff1663ffffffff16600954611eb59190613775565b611ebf919061374d565b905060008183600954611ed291906137b1565b611edc91906137b1565b905080851015611f3a5760405162461bcd60e51b815260206004820152602360248201527f526f756e643a204e6f7420656e6f7567682066756e647320696e20636f6e74726044820152621858dd60ea1b6064820152608401610960565b8215611fd557600060028054906101000a90046001600160a01b03166001600160a01b031663803db96d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb791906137c4565b600a54909150611fd390829086906001600160a01b0316612266565b505b8115611ff957600b54600a54611ff9916001600160a01b0390811691859116612266565b600a5461200e906001600160a01b03166121e2565b600a549095506001600160a01b0316612084576004805460408051637f0b4fbb60e11b815290516001600160a01b039092169263fe169f76928992808301926000929182900301818588803b15801561206657600080fd5b505af115801561207a573d6000803e3d6000fd5b50505050506120fd565b600454600a546120a1916001600160a01b0391821691168761228e565b6004805460408051637f0b4fbb60e11b815290516001600160a01b039092169263fe169f7692828201926000929082900301818387803b1580156120e457600080fd5b505af11580156120f8573d6000803e3d6000fd5b505050505b60408051868152602081018590529081018390527fd3680093ec73f97fd84953765908e9ecbc0c567d97ee6e5465e742ace7b18bfc9060600160405180910390a1505050505050565b60006001600160e01b03198216637965db0b60e01b148061084b57506301ffc9a760e01b6001600160e01b031983161461084b565b61218581336122f5565b50565b6121928282612368565b6000828152600160205260409020610a059082612406565b6121b4828261241b565b6000828152600160205260409020610a05908261249a565b60006110f583836124af565b600061084b825490565b60006001600160a01b0382166121f9575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561223d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084b91906137e1565b919050565b6001600160a01b03811661227e57610a0583836124d9565b610a056001600160a01b03821684845b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610a059084906125f2565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610a8457612326816126c4565b6123318360206126d6565b6040516020016123429291906137fa565b60408051601f198184030181529082905262461bcd60e51b82526109609160040161315c565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610a84576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556123c23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006110f5836001600160a01b038416612872565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610a84576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f5836001600160a01b0384166128c1565b60008260000182815481106124c6576124c6613721565b9060005260206000200154905092915050565b804710156125295760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610960565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612576576040519150601f19603f3d011682016040523d82523d6000602084013e61257b565b606091505b5050905080610a055760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610960565b6000612647826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129b49092919063ffffffff16565b805190915015610a055780806020019051810190612665919061387b565b610a055760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610960565b606061084b6001600160a01b03831660145b606060006126e5836002613775565b6126f09060026137b1565b67ffffffffffffffff81111561270857612708612c86565b6040519080825280601f01601f191660200182016040528015612732576020820181803683370190505b509050600360fc1b8160008151811061274d5761274d613721565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061277c5761277c613721565b60200101906001600160f81b031916908160001a90535060006127a0846002613775565b6127ab9060016137b1565b90505b6001811115612823576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106127df576127df613721565b1a60f81b8282815181106127f5576127f5613721565b60200101906001600160f81b031916908160001a90535060049490941c9361281c8161389d565b90506127ae565b5083156110f55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610960565b60008181526001830160205260408120546128b95750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561084b565b50600061084b565b600081815260018301602052604081205480156129aa5760006128e56001836138b4565b85549091506000906128f9906001906138b4565b905081811461295e57600086600001828154811061291957612919613721565b906000526020600020015490508087600001848154811061293c5761293c613721565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061296f5761296f6138c7565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061084b565b600091505061084b565b60606129c384846000856129cb565b949350505050565b606082471015612a2c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610960565b600080866001600160a01b03168587604051612a4891906138dd565b60006040518083038185875af1925050503d8060008114612a85576040519150601f19603f3d011682016040523d82523d6000602084013e612a8a565b606091505b5091509150612a9b87838387612aa6565b979650505050505050565b60608315612b15578251600003612b0e576001600160a01b0385163b612b0e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610960565b50816129c3565b6129c38383815115612b2a5781518083602001fd5b8060405162461bcd60e51b8152600401610960919061315c565b600060208284031215612b5657600080fd5b81356001600160e01b0319811681146110f557600080fd5b60008060408385031215612b8157600080fd5b50508035926020909101359150565b600060208284031215612ba257600080fd5b5035919050565b60005b83811015612bc4578181015183820152602001612bac565b50506000910152565b60008151808452612be5816020860160208601612ba9565b601f01601f19169290920160200192915050565b8281526040602082015260006129c36040830184612bcd565b803563ffffffff8116811461226157600080fd5b600060208284031215612c3857600080fd5b6110f582612c12565b6001600160a01b038116811461218557600080fd5b60008060408385031215612c6957600080fd5b823591506020830135612c7b81612c41565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715612cbf57612cbf612c86565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715612cee57612cee612c86565b604052919050565b600067ffffffffffffffff821115612d1057612d10612c86565b5060051b60200190565b600067ffffffffffffffff831115612d3457612d34612c86565b612d47601f8401601f1916602001612cc5565b9050828152838383011115612d5b57600080fd5b828260208301376000602084830101529392505050565b60006020808385031215612d8557600080fd5b823567ffffffffffffffff80821115612d9d57600080fd5b818501915085601f830112612db157600080fd5b8135612dc4612dbf82612cf6565b612cc5565b81815260059190911b83018401908481019088831115612de357600080fd5b8585015b83811015612e3057803585811115612dff5760008081fd5b8601603f81018b13612e115760008081fd5b612e228b8983013560408401612d1a565b845250918601918601612de7565b5098975050505050505050565b600060408284031215612e4f57600080fd5b612e57612c9c565b905081358152602082013567ffffffffffffffff811115612e7757600080fd5b8201601f81018413612e8857600080fd5b612e9784823560208401612d1a565b60208301525092915050565b600060208284031215612eb557600080fd5b813567ffffffffffffffff811115612ecc57600080fd5b6129c384828501612e3d565b60008060008060808587031215612eee57600080fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215612f1d57600080fd5b82359150602083013567ffffffffffffffff811115612f3b57600080fd5b830160408186031215612c7b57600080fd5b803561226181612c41565b600060208284031215612f6a57600080fd5b81356110f581612c41565b6020808252825182820181905260009190848201906040850190845b81811015612fad57835183529284019291840191600101612f91565b50909695505050505050565b600080600060408486031215612fce57600080fd5b833567ffffffffffffffff80821115612fe657600080fd5b818601915086601f830112612ffa57600080fd5b81358181111561300957600080fd5b87602082850101111561301b57600080fd5b6020928301955093505084013561303181612c41565b809150509250925092565b8051825260006020820151604060208501526129c36040850182612bcd565b83815282602082015260606040820152600061307a606083018461303c565b95945050505050565b6000806040838503121561309657600080fd5b82356130a181612c41565b91506020830135612c7b81612c41565b600060208083850312156130c457600080fd5b823567ffffffffffffffff8111156130db57600080fd5b8301601f810185136130ec57600080fd5b80356130fa612dbf82612cf6565b81815260069190911b8201830190838101908783111561311957600080fd5b928401925b82841015612a9b57604084890312156131375760008081fd5b61313f612c9c565b84358152858501358682015282526040909301929084019061311e565b6020815260006110f56020830184612bcd565b600181811c9082168061318357607f821691505b6020821081036131a357634e487b7160e01b600052602260045260246000fd5b50919050565b6000604082016040835280855180835260608501915060608160051b8601019250602080880160005b8381101561320057605f198887030185526131ee868351612bcd565b955093820193908201906001016131d2565b50508394506001600160a01b03871681870152505050509392505050565b60408152825460408201526000600180850160406060850152600081546132448161316f565b80608088015260a085831660008114613264576001811461327e576132af565b60ff1984168983015282151560051b8901820194506132af565b8560005260208060002060005b858110156132a65781548c820186015290890190820161328b565b8b018401965050505b505050508481036020860152612a9b818761303c565b601f821115610a0557600081815260208120601f850160051c810160208610156132ec5750805b601f850160051c820191505b81811015610c56578281556001016132f8565b815167ffffffffffffffff81111561332557613325612c86565b61333981613333845461316f565b846132c5565b602080601f83116001811461336e57600084156133565750858301515b600019600386901b1c1916600185901b178555610c56565b600085815260208120601f198616915b8281101561339d5788860151825594840194600190910190840161337e565b50858210156133bb5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600061084b3683612e3d565b828152604060208201528135604082015260006020830135601e1984360301811261340157600080fd5b830160208101903567ffffffffffffffff81111561341e57600080fd5b80360382131561342d57600080fd5b60406060850152806080850152808260a0860137600060a0828601015260a0601f19601f830116850101925050509392505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161348a5761348a613462565b5060010190565b6000608082840312156134a357600080fd5b6040516080810181811067ffffffffffffffff821117156134c6576134c6612c86565b8060405250809150823581526020830135602082015260408301356040820152606083013560608201525092915050565b60006040828403121561350957600080fd5b613511612c9c565b9050813567ffffffffffffffff8082111561352b57600080fd5b61353785838601612e3d565b8352602084013591508082111561354d57600080fd5b50612e9784828501612e3d565b600082601f83011261356b57600080fd5b8135602061357b612dbf83612cf6565b82815260059290921b8401810191818101908684111561359a57600080fd5b8286015b848110156135be5780356135b181612c41565b835291830191830161359e565b509695505050505050565b6000604082840312156135db57600080fd5b6135e3612c9c565b9050813567ffffffffffffffff808211156135fd57600080fd5b6136098583860161355a565b8352602084013591508082111561361f57600080fd5b50612e978482850161355a565b600080600080600080600080888a0361018081121561364a57600080fd5b604081121561365857600080fd5b50613661612c9c565b893561366c81612c41565b815260208a013561367c81612c41565b602082015297506136908a60408b01613491565b965060c089013595506136a560e08a01612f4d565b94506136b46101008a01612c12565b93506136c36101208a01612f4d565b925061014089013567ffffffffffffffff808211156136e157600080fd5b6136ed8c838d016134f7565b93506101608b013591508082111561370457600080fd5b506137118b828c016135c9565b9150509295985092959890939650565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261375c5761375c613737565b500490565b60008261377057613770613737565b500690565b808202811582820484141761084b5761084b613462565b60006020828403121561379e57600080fd5b815162ffffff811681146110f557600080fd5b8082018082111561084b5761084b613462565b6000602082840312156137d657600080fd5b81516110f581612c41565b6000602082840312156137f357600080fd5b5051919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613832816017850160208801612ba9565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161386f816028840160208801612ba9565b01602801949350505050565b60006020828403121561388d57600080fd5b815180151581146110f557600080fd5b6000816138ac576138ac613462565b506000190190565b8181038181111561084b5761084b613462565b634e487b7160e01b600052603160045260246000fd5b600082516138ef818460208701612ba9565b919091019291505056feec61da14b5abbac5c5fda6f1d57642a264ebd5d0674f35852829746dfb8174a5a26469706673582212207ffbd32cefc3a3f54ea8c5fbe0d79fd54795ef462d3dd921b824bf3776ac92fd64736f6c63430008110033
Deployed Bytecode
0x6080604052600436106102755760003560e01c8063b02f18e711610149578063d97f3dcf116100c6578063f940e3851161008a578063fc0c546a11610064578063fc0c546a146107c0578063fe169f76146107e0578063ffa1ad74146107e857600080fd5b8063f940e38514610760578063fa1910e814610780578063fb5c8bfd146107a057600080fd5b8063d97f3dcf146106cd578063dd4f8f74146106ef578063dfefadff14610705578063e40205d614610734578063f7f8ebca1461074a57600080fd5b8063cce2df031161010d578063cce2df0314610637578063d195bba114610657578063d32cca471461066d578063d547741f1461068d578063d7bf7840146106ad57600080fd5b8063b02f18e71461057d578063b9ff5ebe1461059d578063c03fd662146105bd578063c5069b61146105ea578063ca15c8731461061757600080fd5b8063685bd21b116101f25780638e421b85116101b657806391d148541161019057806391d14854146104fe5780639c3b68ce14610542578063a217fddf1461056857600080fd5b80638e421b85146104855780638e9745dc146104a55780639010d07c146104de57600080fd5b8063685bd21b146103fd578063697e5f691461041257806376bacc99146104325780637aa54b68146104525780638926a8881461046557600080fd5b80632698f3fb116102395780632698f3fb1461036257806328ab75c7146103855780632f2ff15d146103a757806336568abe146103c757806344b278a6146103e757600080fd5b806301ffc9a7146102815780630c0a56b6146102b657806310a11a6d146102ee5780631e949c9e1461031c578063248a9ca31461033257600080fd5b3661027c57005b600080fd5b34801561028d57600080fd5b506102a161029c366004612b44565b610826565b60405190151581526020015b60405180910390f35b3480156102c257600080fd5b506004546102d6906001600160a01b031681565b6040516001600160a01b0390911681526020016102ad565b3480156102fa57600080fd5b5061030e610309366004612b6e565b610851565b6040519081526020016102ad565b34801561032857600080fd5b5061030e60065481565b34801561033e57600080fd5b5061030e61034d366004612b90565b60009081526020819052604090206001015490565b34801561036e57600080fd5b50610377610882565b6040516102ad929190612bf9565b34801561039157600080fd5b506103a56103a0366004612c26565b610919565b005b3480156103b357600080fd5b506103a56103c2366004612c56565b6109e0565b3480156103d357600080fd5b506103a56103e2366004612c56565b610a0a565b3480156103f357600080fd5b5061030e60105481565b34801561040957600080fd5b50610377610a88565b34801561041e57600080fd5b506103a561042d366004612b90565b610a9c565b34801561043e57600080fd5b50600b546102d6906001600160a01b031681565b6103a5610460366004612d72565b610b95565b34801561047157600080fd5b506103a5610480366004612ea3565b610c5e565b34801561049157600080fd5b506103a56104a0366004612ed8565b610d1e565b3480156104b157600080fd5b50600a546104c990600160a01b900463ffffffff1681565b60405163ffffffff90911681526020016102ad565b3480156104ea57600080fd5b506102d66104f9366004612b6e565b6110dd565b34801561050a57600080fd5b506102a1610519366004612c56565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b34801561054e57600080fd5b506002546102d6906201000090046001600160a01b031681565b34801561057457600080fd5b5061030e600081565b34801561058957600080fd5b506103a5610598366004612f0a565b6110fc565b3480156105a957600080fd5b506103a56105b8366004612f58565b61126c565b3480156105c957600080fd5b5061030e6105d8366004612b90565b60136020526000908152604090205481565b3480156105f657600080fd5b5061060a610605366004612b90565b61131d565b6040516102ad9190612f75565b34801561062357600080fd5b5061030e610632366004612b90565b61137f565b34801561064357600080fd5b506103a5610652366004612fb9565b611396565b34801561066357600080fd5b5061030e60055481565b34801561067957600080fd5b5061030e610688366004612b90565b6118f9565b34801561069957600080fd5b506103a56106a8366004612c56565b61199b565b3480156106b957600080fd5b506103a56106c8366004612ea3565b6119c0565b3480156106d957600080fd5b5061030e6000805160206138fa83398151915281565b3480156106fb57600080fd5b5061030e60075481565b34801561071157600080fd5b50610725610720366004612b90565b611a79565b6040516102ad9392919061305b565b34801561074057600080fd5b5061030e60085481565b34801561075657600080fd5b5061030e60095481565b34801561076c57600080fd5b506103a561077b366004613083565b611b59565b34801561078c57600080fd5b506103a561079b3660046130b1565b611bed565b3480156107ac57600080fd5b506003546102d6906001600160a01b031681565b3480156107cc57600080fd5b50600a546102d6906001600160a01b031681565b6103a5611ce9565b3480156107f457600080fd5b50610819604051806040016040528060058152602001640312e302e360dc1b81525081565b6040516102ad919061315c565b60006001600160e01b03198216635a05180f60e01b148061084b575061084b82612146565b92915050565b6012602052816000526040600020818154811061086d57600080fd5b90600052602060002001600091509150505481565b600c8054600d80549192916108969061316f565b80601f01602080910402602001604051908101604052809291908181526020018280546108c29061316f565b801561090f5780601f106108e45761010080835404028352916020019161090f565b820191906000526020600020905b8154815290600101906020018083116108f257829003601f168201915b5050505050905082565b6008544211156109695760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b60448201526064015b60405180910390fd5b6000805160206138fa8339815191526109818161217b565b600a805463ffffffff60a01b1916600160a01b63ffffffff8581168202929092179283905560405192041681527f94ef22170df1c9a0e250ce2eae5fd3abc6d1379de9f9855fee7e490f15ddda87906020015b60405180910390a15050565b6000828152602081905260409020600101546109fb8161217b565b610a058383612188565b505050565b6001600160a01b0381163314610a7a5760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610960565b610a8482826121aa565b5050565b600e8054600f80549192916108969061316f565b600854421115610ae75760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa833981519152610aff8161217b565b6009548211610b605760405162461bcd60e51b815260206004820152602760248201527f526f756e643a204c6573736572207468616e2063757272656e74206d6174636860448201526608185b5bdd5b9d60ca1b6064820152608401610960565b60098290556040518281527f36407b7517f93b8dd6bf87384f27398dc6c7158776015e7492bbae639be60bdd906020016109d4565b4260075411158015610ba957506008544211155b610bf55760405162461bcd60e51b815260206004820152601a60248201527f526f756e643a20526f756e64206973206e6f74206163746976650000000000006044820152606401610960565b60035460405163fc6d4e3960e01b81526001600160a01b039091169063fc6d4e39903490610c2990859033906004016131a9565b6000604051808303818588803b158015610c4257600080fd5b505af1158015610c56573d6000803e3d6000fd5b505050505050565b600854421115610ca95760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa833981519152610cc18161217b565b7ffd4633953debc7fbfababf529ffe33c4a6dd78c9ff13db552b571df088478641600e83604051610cf392919061321e565b60405180910390a18151600e9081556020830151839190600f90610d17908261330b565b5050505050565b600854421115610d695760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa833981519152610d818161217b565b838510610df65760405162461bcd60e51b815260206004820152603260248201527f526f756e643a204170706c69636174696f6e20656e64206973206265666f726560448201527f206170706c69636174696f6e20737461727400000000000000000000000000006064820152608401610960565b818310610e545760405162461bcd60e51b815260206004820152602660248201527f526f756e643a20526f756e6420656e64206973206265666f726520726f756e64604482015265081cdd185c9d60d21b6064820152608401610960565b82851115610ebb5760405162461bcd60e51b815260206004820152602e60248201527f526f756e643a20526f756e64207374617274206973206265666f72652061707060448201526d1b1a58d85d1a5bdb881cdd185c9d60921b6064820152608401610960565b81841115610f1e5760405162461bcd60e51b815260206004820152602a60248201527f526f756e643a20526f756e6420656e64206973206265666f7265206170706c6960448201526918d85d1a5bdb88195b9960b21b6064820152608401610960565b84421115610f6e5760405162461bcd60e51b815260206004820152601e60248201527f526f756e643a2054696d652068617320616c72656164792070617373656400006044820152606401610960565b4260055410158015610f8257506005548514155b15610fc95760055460408051918252602082018790527f1fde68e630df12a4f2baa029dd016929d2c6bccc0fdd80dec2a787b01035517e910160405180910390a160058590555b4260065410158015610fdd57506006548414155b156110245760065460408051918252602082018690527fa7fbc7103523f0d44281a3a3ba5aa119e9cab30ae02c09932eb2524c7d81f463910160405180910390a160068490555b426007541015801561103857506007548314155b1561107f5760075460408051918252602082018590527fbd905b0cf9e380e3eaf972d7cb542694f66361043fcce248341d90626d467476910160405180910390a160078390555b426008541015801561109357506008548214155b15610d175760085460408051918252602082018490527fc0395d95a518149baa3521bb5b3c6988c7806a48ea42726ee3a9686bbd2a08cd910160405180910390a150600855505050565b60008281526001602052604081206110f590836121cc565b9392505050565b426005541115801561111057506006544211155b6111735760405162461bcd60e51b815260206004820152602e60248201527f526f756e643a204170706c69636174696f6e7320706572696f64206e6f74207360448201526d3a30b93a32b21037b91037bb32b960911b6064820152608401610960565b60116040518060600160405280848152602001601054815260200183611198906133cb565b90528154600181810184556000938452602093849020835160049093020191825583830151908201556040820151805160028301908155938101519293919290919060038401906111e9908261330b565b5050506000848152601260209081526040808320601080548254600181018455928652939094200191909155905490518593507fca792622046325e9cd4e24b490cb000ef72acea3a15284efc14ee709307a5e00925061124b919085906133d7565b60405180910390a26010805490600061126383613478565b91905055505050565b6008544211156112b75760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa8339815191526112cf8161217b565b600b80546001600160a01b0319166001600160a01b0384169081179091556040519081527f88ae92ef8eb8a634a01f4e404d706ac67bc00a88bdf46af83630c6ade6e97953906020016109d4565b60008181526012602090815260409182902080548351818402810184019094528084526060939283018282801561137357602002820191906000526020600020905b81548152602001906001019080831161135f575b50505050509050919050565b600081815260016020526040812061084b906121d8565b600254610100900460ff16158080156113b65750600254600160ff909116105b806113d05750303b1580156113d0575060025460ff166001145b6114335760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610960565b6002805460ff191660011790558015611456576002805461ff0019166101001790555b60008080808080808061146b8b8d018d61362c565b9750975097509750975097509750975042876000015110156114cf5760405162461bcd60e51b815260206004820152601e60248201527f526f756e643a2054696d652068617320616c72656164792070617373656400006044820152606401610960565b865160208801511161152e5760405162461bcd60e51b815260206004820152602260248201527f526f756e643a2041707020656e64206973206265666f726520617070207374616044820152611c9d60f21b6064820152608401610960565b8660200151876060015110156115915760405162461bcd60e51b815260206004820152602260248201527f526f756e643a20526f756e6420656e64206973206265666f72652061707020656044820152611b9960f21b6064820152608401610960565b86604001518760600151116115f75760405162461bcd60e51b815260206004820152602660248201527f526f756e643a20526f756e6420656e64206973206265666f726520726f756e64604482015265081cdd185c9d60d21b6064820152608401610960565b86516040880151101561165b5760405162461bcd60e51b815260206004820152602660248201527f526f756e643a20526f756e64207374617274206973206265666f726520617070604482015265081cdd185c9d60d21b6064820152608401610960565b6002805475ffffffffffffffffffffffffffffffffffffffff00001916620100006001600160a01b038d811691909102919091179091558851600380546001600160a01b03199081169284169283179091556020808c01516004805484169186169190911781558b51600555908b01516006556040808c015160075560608c0151600855600a8054909316948a169490941790915582516370e39c9560e11b81529251919263e1c7392a928183019260009282900301818387803b15801561172257600080fd5b505af1158015611736573d6000803e3d6000fd5b505060048054604080516370e39c9560e11b815290516001600160a01b03909216945063e1c7392a9350808301926000929182900301818387803b15801561177d57600080fd5b505af1158015611791573d6000803e3d6000fd5b505050600987905550600a805463ffffffff60a01b1916600160a01b63ffffffff871602179055600b80546001600160a01b0319166001600160a01b03851617905581518051600c9081556020820151600d906117ee908261330b565b5050506020808301518051600e90815591810151909190600f90611812908261330b565b5090505060005b81515181101561185b578151805161184b916000918490811061183e5761183e613721565b6020026020010151612188565b61185481613478565b9050611819565b5060005b8160200151518110156118a4576118946000805160206138fa8339815191528360200151838151811061183e5761183e613721565b61189d81613478565b905061185f565b50505050505050505080156118f3576002805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b50505050565b60115460009082106119575760405162461bcd60e51b815260206004820152602160248201527f526f756e643a204170706c69636174696f6e20646f6573206e6f7420657869736044820152601d60fa1b6064820152608401610960565b600061196460808461374d565b90506000611973608085613761565b61197e906002613775565b6000928352601360205260409092205490911c6003169392505050565b6000828152602081905260409020600101546119b68161217b565b610a0583836121aa565b600854421115611a0b5760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa833981519152611a238161217b565b7fb625c4faee7533bf09da813b9c0e169f98d36c22d9ce5181c9e4d7577556760a600c83604051611a5592919061321e565b60405180910390a18151600c9081556020830151839190600d90610d17908261330b565b60118181548110611a8957600080fd5b90600052602060002090600402016000915090508060000154908060010154908060020160405180604001604052908160008201548152602001600182018054611ad29061316f565b80601f0160208091040260200160405190810160405280929190818152602001828054611afe9061316f565b8015611b4b5780601f10611b2057610100808354040283529160200191611b4b565b820191906000526020600020905b815481529060010190602001808311611b2e57829003601f168201915b505050505081525050905083565b6000805160206138fa833981519152611b718161217b565b600a546001600160a01b0390811690841603611bda5760405162461bcd60e51b815260206004820152602260248201527f526f756e643a2043616e6e6f7420776974686472617720726f756e6420746f6b60448201526132b760f11b6064820152608401610960565b610a0582611be7856121e2565b85612266565b600854421115611c385760405162461bcd60e51b8152602060048201526016602482015275149bdd5b990e88149bdd5b99081a185cc8195b99195960521b6044820152606401610960565b6000805160206138fa833981519152611c508161217b565b60005b8251811015610a05576000838281518110611c7057611c70613721565b60200260200101516000015190506000848381518110611c9257611c92613721565b60209081029190910181015181015160008481526013909252604080832082905551909250829184917f5d498eb0ba08d4494201d7dd654e1f1c3e8a74dd0f860bb3c3e1b64eb79885c89190a35050600101611c53565b6008544211611d3a5760405162461bcd60e51b815260206004820152601a60248201527f526f756e643a20526f756e6420686173206e6f7420656e6465640000000000006044820152606401610960565b6000805160206138fa833981519152611d528161217b565b600a54600090611d6a906001600160a01b03166121e2565b9050600060028054906101000a90046001600160a01b03166001600160a01b031663918f86746040518163ffffffff1660e01b8152600401602060405180830381865afa158015611dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de3919061378c565b62ffffff16905060008163ffffffff1660028054906101000a90046001600160a01b03166001600160a01b0316638e50e5096040518163ffffffff1660e01b8152600401602060405180830381865afa158015611e44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e68919061378c565b62ffffff16600954611e7a9190613775565b611e84919061374d565b905060008263ffffffff16600a60149054906101000a900463ffffffff1663ffffffff16600954611eb59190613775565b611ebf919061374d565b905060008183600954611ed291906137b1565b611edc91906137b1565b905080851015611f3a5760405162461bcd60e51b815260206004820152602360248201527f526f756e643a204e6f7420656e6f7567682066756e647320696e20636f6e74726044820152621858dd60ea1b6064820152608401610960565b8215611fd557600060028054906101000a90046001600160a01b03166001600160a01b031663803db96d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb791906137c4565b600a54909150611fd390829086906001600160a01b0316612266565b505b8115611ff957600b54600a54611ff9916001600160a01b0390811691859116612266565b600a5461200e906001600160a01b03166121e2565b600a549095506001600160a01b0316612084576004805460408051637f0b4fbb60e11b815290516001600160a01b039092169263fe169f76928992808301926000929182900301818588803b15801561206657600080fd5b505af115801561207a573d6000803e3d6000fd5b50505050506120fd565b600454600a546120a1916001600160a01b0391821691168761228e565b6004805460408051637f0b4fbb60e11b815290516001600160a01b039092169263fe169f7692828201926000929082900301818387803b1580156120e457600080fd5b505af11580156120f8573d6000803e3d6000fd5b505050505b60408051868152602081018590529081018390527fd3680093ec73f97fd84953765908e9ecbc0c567d97ee6e5465e742ace7b18bfc9060600160405180910390a1505050505050565b60006001600160e01b03198216637965db0b60e01b148061084b57506301ffc9a760e01b6001600160e01b031983161461084b565b61218581336122f5565b50565b6121928282612368565b6000828152600160205260409020610a059082612406565b6121b4828261241b565b6000828152600160205260409020610a05908261249a565b60006110f583836124af565b600061084b825490565b60006001600160a01b0382166121f9575047919050565b6040516370a0823160e01b81523060048201526001600160a01b038316906370a0823190602401602060405180830381865afa15801561223d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084b91906137e1565b919050565b6001600160a01b03811661227e57610a0583836124d9565b610a056001600160a01b03821684845b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1663a9059cbb60e01b179052610a059084906125f2565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610a8457612326816126c4565b6123318360206126d6565b6040516020016123429291906137fa565b60408051601f198184030181529082905262461bcd60e51b82526109609160040161315c565b6000828152602081815260408083206001600160a01b038516845290915290205460ff16610a84576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556123c23390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60006110f5836001600160a01b038416612872565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1615610a84576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b60006110f5836001600160a01b0384166128c1565b60008260000182815481106124c6576124c6613721565b9060005260206000200154905092915050565b804710156125295760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610960565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114612576576040519150601f19603f3d011682016040523d82523d6000602084013e61257b565b606091505b5050905080610a055760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d617920686176652072657665727465640000000000006064820152608401610960565b6000612647826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166129b49092919063ffffffff16565b805190915015610a055780806020019051810190612665919061387b565b610a055760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610960565b606061084b6001600160a01b03831660145b606060006126e5836002613775565b6126f09060026137b1565b67ffffffffffffffff81111561270857612708612c86565b6040519080825280601f01601f191660200182016040528015612732576020820181803683370190505b509050600360fc1b8160008151811061274d5761274d613721565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061277c5761277c613721565b60200101906001600160f81b031916908160001a90535060006127a0846002613775565b6127ab9060016137b1565b90505b6001811115612823576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106127df576127df613721565b1a60f81b8282815181106127f5576127f5613721565b60200101906001600160f81b031916908160001a90535060049490941c9361281c8161389d565b90506127ae565b5083156110f55760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610960565b60008181526001830160205260408120546128b95750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561084b565b50600061084b565b600081815260018301602052604081205480156129aa5760006128e56001836138b4565b85549091506000906128f9906001906138b4565b905081811461295e57600086600001828154811061291957612919613721565b906000526020600020015490508087600001848154811061293c5761293c613721565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061296f5761296f6138c7565b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061084b565b600091505061084b565b60606129c384846000856129cb565b949350505050565b606082471015612a2c5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610960565b600080866001600160a01b03168587604051612a4891906138dd565b60006040518083038185875af1925050503d8060008114612a85576040519150601f19603f3d011682016040523d82523d6000602084013e612a8a565b606091505b5091509150612a9b87838387612aa6565b979650505050505050565b60608315612b15578251600003612b0e576001600160a01b0385163b612b0e5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610960565b50816129c3565b6129c38383815115612b2a5781518083602001fd5b8060405162461bcd60e51b8152600401610960919061315c565b600060208284031215612b5657600080fd5b81356001600160e01b0319811681146110f557600080fd5b60008060408385031215612b8157600080fd5b50508035926020909101359150565b600060208284031215612ba257600080fd5b5035919050565b60005b83811015612bc4578181015183820152602001612bac565b50506000910152565b60008151808452612be5816020860160208601612ba9565b601f01601f19169290920160200192915050565b8281526040602082015260006129c36040830184612bcd565b803563ffffffff8116811461226157600080fd5b600060208284031215612c3857600080fd5b6110f582612c12565b6001600160a01b038116811461218557600080fd5b60008060408385031215612c6957600080fd5b823591506020830135612c7b81612c41565b809150509250929050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff81118282101715612cbf57612cbf612c86565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715612cee57612cee612c86565b604052919050565b600067ffffffffffffffff821115612d1057612d10612c86565b5060051b60200190565b600067ffffffffffffffff831115612d3457612d34612c86565b612d47601f8401601f1916602001612cc5565b9050828152838383011115612d5b57600080fd5b828260208301376000602084830101529392505050565b60006020808385031215612d8557600080fd5b823567ffffffffffffffff80821115612d9d57600080fd5b818501915085601f830112612db157600080fd5b8135612dc4612dbf82612cf6565b612cc5565b81815260059190911b83018401908481019088831115612de357600080fd5b8585015b83811015612e3057803585811115612dff5760008081fd5b8601603f81018b13612e115760008081fd5b612e228b8983013560408401612d1a565b845250918601918601612de7565b5098975050505050505050565b600060408284031215612e4f57600080fd5b612e57612c9c565b905081358152602082013567ffffffffffffffff811115612e7757600080fd5b8201601f81018413612e8857600080fd5b612e9784823560208401612d1a565b60208301525092915050565b600060208284031215612eb557600080fd5b813567ffffffffffffffff811115612ecc57600080fd5b6129c384828501612e3d565b60008060008060808587031215612eee57600080fd5b5050823594602084013594506040840135936060013592509050565b60008060408385031215612f1d57600080fd5b82359150602083013567ffffffffffffffff811115612f3b57600080fd5b830160408186031215612c7b57600080fd5b803561226181612c41565b600060208284031215612f6a57600080fd5b81356110f581612c41565b6020808252825182820181905260009190848201906040850190845b81811015612fad57835183529284019291840191600101612f91565b50909695505050505050565b600080600060408486031215612fce57600080fd5b833567ffffffffffffffff80821115612fe657600080fd5b818601915086601f830112612ffa57600080fd5b81358181111561300957600080fd5b87602082850101111561301b57600080fd5b6020928301955093505084013561303181612c41565b809150509250925092565b8051825260006020820151604060208501526129c36040850182612bcd565b83815282602082015260606040820152600061307a606083018461303c565b95945050505050565b6000806040838503121561309657600080fd5b82356130a181612c41565b91506020830135612c7b81612c41565b600060208083850312156130c457600080fd5b823567ffffffffffffffff8111156130db57600080fd5b8301601f810185136130ec57600080fd5b80356130fa612dbf82612cf6565b81815260069190911b8201830190838101908783111561311957600080fd5b928401925b82841015612a9b57604084890312156131375760008081fd5b61313f612c9c565b84358152858501358682015282526040909301929084019061311e565b6020815260006110f56020830184612bcd565b600181811c9082168061318357607f821691505b6020821081036131a357634e487b7160e01b600052602260045260246000fd5b50919050565b6000604082016040835280855180835260608501915060608160051b8601019250602080880160005b8381101561320057605f198887030185526131ee868351612bcd565b955093820193908201906001016131d2565b50508394506001600160a01b03871681870152505050509392505050565b60408152825460408201526000600180850160406060850152600081546132448161316f565b80608088015260a085831660008114613264576001811461327e576132af565b60ff1984168983015282151560051b8901820194506132af565b8560005260208060002060005b858110156132a65781548c820186015290890190820161328b565b8b018401965050505b505050508481036020860152612a9b818761303c565b601f821115610a0557600081815260208120601f850160051c810160208610156132ec5750805b601f850160051c820191505b81811015610c56578281556001016132f8565b815167ffffffffffffffff81111561332557613325612c86565b61333981613333845461316f565b846132c5565b602080601f83116001811461336e57600084156133565750858301515b600019600386901b1c1916600185901b178555610c56565b600085815260208120601f198616915b8281101561339d5788860151825594840194600190910190840161337e565b50858210156133bb5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600061084b3683612e3d565b828152604060208201528135604082015260006020830135601e1984360301811261340157600080fd5b830160208101903567ffffffffffffffff81111561341e57600080fd5b80360382131561342d57600080fd5b60406060850152806080850152808260a0860137600060a0828601015260a0601f19601f830116850101925050509392505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161348a5761348a613462565b5060010190565b6000608082840312156134a357600080fd5b6040516080810181811067ffffffffffffffff821117156134c6576134c6612c86565b8060405250809150823581526020830135602082015260408301356040820152606083013560608201525092915050565b60006040828403121561350957600080fd5b613511612c9c565b9050813567ffffffffffffffff8082111561352b57600080fd5b61353785838601612e3d565b8352602084013591508082111561354d57600080fd5b50612e9784828501612e3d565b600082601f83011261356b57600080fd5b8135602061357b612dbf83612cf6565b82815260059290921b8401810191818101908684111561359a57600080fd5b8286015b848110156135be5780356135b181612c41565b835291830191830161359e565b509695505050505050565b6000604082840312156135db57600080fd5b6135e3612c9c565b9050813567ffffffffffffffff808211156135fd57600080fd5b6136098583860161355a565b8352602084013591508082111561361f57600080fd5b50612e978482850161355a565b600080600080600080600080888a0361018081121561364a57600080fd5b604081121561365857600080fd5b50613661612c9c565b893561366c81612c41565b815260208a013561367c81612c41565b602082015297506136908a60408b01613491565b965060c089013595506136a560e08a01612f4d565b94506136b46101008a01612c12565b93506136c36101208a01612f4d565b925061014089013567ffffffffffffffff808211156136e157600080fd5b6136ed8c838d016134f7565b93506101608b013591508082111561370457600080fd5b506137118b828c016135c9565b9150509295985092959890939650565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601260045260246000fd5b60008261375c5761375c613737565b500490565b60008261377057613770613737565b500690565b808202811582820484141761084b5761084b613462565b60006020828403121561379e57600080fd5b815162ffffff811681146110f557600080fd5b8082018082111561084b5761084b613462565b6000602082840312156137d657600080fd5b81516110f581612c41565b6000602082840312156137f357600080fd5b5051919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613832816017850160208801612ba9565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000601791840191820152835161386f816028840160208801612ba9565b01602801949350505050565b60006020828403121561388d57600080fd5b815180151581146110f557600080fd5b6000816138ac576138ac613462565b506000190190565b8181038181111561084b5761084b613462565b634e487b7160e01b600052603160045260246000fd5b600082516138ef818460208701612ba9565b919091019291505056feec61da14b5abbac5c5fda6f1d57642a264ebd5d0674f35852829746dfb8174a5a26469706673582212207ffbd32cefc3a3f54ea8c5fbe0d79fd54795ef462d3dd921b824bf3776ac92fd64736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.