Overview
ETH Balance
0 ETH
ETH Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x61012060 | 6912998 | 81 days ago | IN | 0 ETH | 0.00147332 |
Loading...
Loading
Contract Name:
Proposals
Compiler Version
v0.8.22+commit.4fc1097e
Optimization Enabled:
Yes with 10000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol"; import "openzeppelin-contracts/contracts/utils/structs/EnumerableSet.sol"; import "openzeppelin-contracts/contracts/security/ReentrancyGuard.sol"; import "openzeppelin-contracts/contracts/utils/Strings.sol"; import "../pools/interfaces/IPoolsConfig.sol"; import "../staking/interfaces/IStaking.sol"; import "../interfaces/IExchangeConfig.sol"; import "./interfaces/IDAOConfig.sol"; import "./interfaces/IProposals.sol"; // Allows ZERO token stakers to propose and vote on various types of ballots such as parameter changes, token whitelisting/unwhitelisting, sending tokens, calling contracts, and updating website URLs. // Ensures ballot uniqueness, tracks and validates user voting power, enforces quorums, and provides a mechanism for users to alter votes. contract Proposals is IProposals, ReentrancyGuard { event ProposalCreated(uint256 indexed ballotID, BallotType ballotType, string ballotName); event BallotFinalized(uint256 indexed ballotID); event VoteCast(address indexed voter, uint256 indexed ballotID, Vote vote, uint256 votingPower); using EnumerableSet for EnumerableSet.UintSet; IStaking immutable public staking; IExchangeConfig immutable public exchangeConfig; IPoolsConfig immutable public poolsConfig; IDAOConfig immutable public daoConfig; // A special pool that represents staked ZERO tokens that is not associated with any actual liquidity pool. bytes32 constant public STAKED_ZERO = bytes32(0); uint256 constant NUMBER_OF_PARAMETERS = 16; // Mapping from ballotName to a currently open ballotID (zero if none). // Used to check for existing ballots by name so as to not allow duplicate ballots to be created. mapping(string=>uint256) public openBallotsByName; // Maps ballotID to the corresponding Ballot mapping(uint256=>Ballot) public ballots; uint256 public nextBallotID = 1; // All of the ballotIDs that are currently open for voting EnumerableSet.UintSet private _allOpenBallots; // The ballotIDs of the tokens currently being proposed for whitelisting EnumerableSet.UintSet private _openBallotsForTokenWhitelisting; // The number of votes cast for a given ballot by Vote type mapping(uint256=>mapping(Vote=>uint256)) private _votesCastForBallot; // The last vote cast by a user for a given ballot. // Allows users to change their vote - so that the previous vote can be undone before casting the new vote. mapping(uint256=>mapping(address=>UserVote)) private _lastUserVoteForBallot; // Which users currently have active proposals // Useful for checking that users are only able to create one active proposal at a time (to discourage spam proposals). mapping(address=>bool) private _userHasActiveProposal; // Which users proposed which ballots. // Useful when a ballot is finalized - so that the user that proposed it can have their _usersWithActiveProposals status cleared mapping(uint256=>address) private _usersThatProposedBallots; // The time at which the first proposal can be made (45 days after deployment). // This is to allow some time for users to start staking - as some percent of stake is required to propose ballots and if the total amount staked. uint256 immutable firstPossibleProposalTimestamp = block.timestamp + 45 days; constructor( IStaking _staking, IExchangeConfig _exchangeConfig, IPoolsConfig _poolsConfig, IDAOConfig _daoConfig ) { staking = _staking; exchangeConfig = _exchangeConfig; poolsConfig = _poolsConfig; daoConfig = _daoConfig; } function _possiblyCreateProposal( string memory ballotName, BallotType ballotType, address address1, uint256 number1, string memory string1, string memory string2 ) internal returns (uint256 ballotID) { require( block.timestamp >= firstPossibleProposalTimestamp, "Cannot propose ballots within the first 45 days of deployment" ); // The DAO can create confirmation proposals which won't have the below requirements if ( msg.sender != address(exchangeConfig.dao() ) ) { // Make sure that the sender has the minimum amount of veZERO required to make the proposal uint256 totalStaked = staking.totalShares(STAKED_ZERO); uint256 requiredVeZERO = ( totalStaked * daoConfig.requiredProposalPercentStakeTimes1000() ) / ( 100 * 1000 ); require( requiredVeZERO > 0, "requiredVeZERO cannot be zero" ); uint256 userVeZERO = staking.userShareForPool( msg.sender, STAKED_ZERO ); require( userVeZERO >= requiredVeZERO, "Sender does not have enough veZERO to make the proposal" ); // Make sure that the user doesn't already have an active proposal require( ! _userHasActiveProposal[msg.sender], "Users can only have one active proposal at a time" ); } // Make sure that a proposal of the same name is not already open for the ballot require( openBallotsByName[ballotName] == 0, "Cannot create a proposal similar to a ballot that is still open" ); require( openBallotsByName[ string.concat("confirm_", ballotName)] == 0, "Cannot create a proposal for a ballot with a secondary confirmation" ); uint256 ballotMinimumEndTime = block.timestamp + daoConfig.ballotMinimumDuration(); uint256 ballotMaximumEndTime = block.timestamp + daoConfig.ballotMaximumDuration(); // Add the new Ballot to storage ballotID = nextBallotID++; uint requiredQuorum = requiredQuorumForBallotType(ballotType); ballots[ballotID] = Ballot( ballotID, true, ballotType, ballotName, address1, number1, string1, string2, ballotMinimumEndTime, ballotMaximumEndTime, requiredQuorum ); openBallotsByName[ballotName] = ballotID; _allOpenBallots.add( ballotID ); // Remember that the user made a proposal _userHasActiveProposal[msg.sender] = true; _usersThatProposedBallots[ballotID] = msg.sender; emit ProposalCreated(ballotID, ballotType, ballotName); } // Create a confirmation proposal from the DAO function createConfirmationProposal( string calldata ballotName, BallotType ballotType, address address1, string calldata string1, string calldata description ) external returns (uint256 ballotID) { require( msg.sender == address(exchangeConfig.dao()), "Only the DAO can create a confirmation proposal" ); return _possiblyCreateProposal( ballotName, ballotType, address1, 0, string1, description ); } function markBallotAsFinalized( uint256 ballotID ) external nonReentrant { require( msg.sender == address(exchangeConfig.dao()), "Only the DAO can mark a ballot as finalized" ); Ballot storage ballot = ballots[ballotID]; require( ballot.ballotIsLive, "The ballot has already been finalized" ); // Remove finalized whitelist token ballots from the list of open whitelisting proposals if ( ballot.ballotType == BallotType.WHITELIST_TOKEN ) _openBallotsForTokenWhitelisting.remove( ballotID ); // Remove from the list of all open ballots _allOpenBallots.remove( ballotID ); ballot.ballotIsLive = false; // Indicate that the user who posted the proposal no longer has an active proposal address userThatPostedBallot = _usersThatProposedBallots[ballotID]; _userHasActiveProposal[userThatPostedBallot] = false; delete openBallotsByName[ballot.ballotName]; emit BallotFinalized(ballotID); } function proposeParameterBallot( uint256 parameterType, string calldata description ) external nonReentrant returns (uint256 ballotID) { require( parameterType < NUMBER_OF_PARAMETERS, "Invalid parameterType" ); string memory ballotName = string.concat("parameter:", Strings.toString(parameterType), description ); return _possiblyCreateProposal( ballotName, BallotType.PARAMETER, address(0), parameterType, "", description ); } function proposeTokenWhitelisting( IERC20 token, string calldata tokenIconURL, string calldata description ) external nonReentrant returns (uint256 _ballotID) { require( address(token) != address(0), "token cannot be address(0)" ); require( token.totalSupply() < type(uint112).max, "Token supply cannot exceed uint112.max" ); // 5 quadrillion max supply with 18 decimals of precision require( IERC20Metadata(address(token)).decimals() <= 18, "Token decimal maximum is 18" ); require( poolsConfig.numberOfWhitelistedPools() < poolsConfig.maximumWhitelistedPools(), "Maximum number of whitelisted pools already reached" ); require( ! poolsConfig.tokenHasBeenWhitelisted(token, exchangeConfig.weth(), exchangeConfig.zero()), "The token has already been whitelisted" ); string memory ballotName = string.concat("whitelist:", Strings.toHexString(address(token)), tokenIconURL, description ); uint256 ballotID = _possiblyCreateProposal( ballotName, BallotType.WHITELIST_TOKEN, address(token), 0, tokenIconURL, description ); _openBallotsForTokenWhitelisting.add( ballotID ); return ballotID; } function proposeTokenUnwhitelisting( IERC20 token, string calldata tokenIconURL, string calldata description ) external nonReentrant returns (uint256 ballotID) { require( poolsConfig.tokenHasBeenWhitelisted(token, exchangeConfig.weth(), exchangeConfig.zero()), "Can only unwhitelist a whitelisted token" ); // require( address(token) != address(exchangeConfig.wbtc()), "Cannot unwhitelist WBTC" ); require( address(token) != address(exchangeConfig.weth()), "Cannot unwhitelist WETH" ); require( address(token) != address(exchangeConfig.usdc()), "Cannot unwhitelist USDC" ); // require( address(token) != address(exchangeConfig.usdt()), "Cannot unwhitelist USDT" ); require( address(token) != address(exchangeConfig.zero()), "Cannot unwhitelist ZERO" ); string memory ballotName = string.concat("unwhitelist:", Strings.toHexString(address(token)), tokenIconURL, description ); return _possiblyCreateProposal( ballotName, BallotType.UNWHITELIST_TOKEN, address(token), 0, tokenIconURL, description ); } // Proposes sending a specified amount of ZERO tokens to a wallet or contract. // There is a sending limit is 5% of the current ZERO token balance of the DAO. function proposeSendZERO( address wallet, uint256 amount, string calldata description ) external nonReentrant returns (uint256 ballotID) { require( wallet != address(0), "Cannot send ZERO to address(0)" ); // Limit to 5% of current balance uint256 balance = exchangeConfig.zero().balanceOf( address(exchangeConfig.dao()) ); uint256 maxSendable = balance * 5 / 100; require( amount <= maxSendable, "Cannot send more than 5% of the DAO ZERO token balance" ); string memory ballotName = string.concat("sendZERO:", Strings.toHexString(wallet), Strings.toString(amount), description ); return _possiblyCreateProposal( ballotName, BallotType.SEND_ZERO, wallet, amount, "", description ); } // Proposes calling the callFromDAO(uint256) function on an arbitrary contract. function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external nonReentrant returns (uint256 ballotID) { require( contractAddress != address(0), "Contract address cannot be address(0)" ); string memory ballotName = string.concat("callContract:", Strings.toHexString(address(contractAddress)), Strings.toString(number), description ); return _possiblyCreateProposal( ballotName, BallotType.CALL_CONTRACT, contractAddress, number, "", description ); } function _checkCountryCode( string calldata countryCode ) internal pure { require( bytes(countryCode).length == 2, "Country must be an ISO 3166 Alpha-2 Code" ); require(bytes(countryCode)[0] >= 0x41 && bytes(countryCode)[0] <= 0x5A && bytes(countryCode)[1] >= 0x41 && bytes(countryCode)[1] <= 0x5A, "Invalid country code"); } function proposeCountryInclusion( string calldata countryCode, string calldata description ) external nonReentrant returns (uint256 ballotID) { _checkCountryCode(countryCode); require(exchangeConfig.dao().countryIsExcluded(countryCode), "Country is not excluded"); string memory ballotName = string.concat("include:", countryCode, description ); return _possiblyCreateProposal( ballotName, BallotType.INCLUDE_COUNTRY, address(0), 0, countryCode, description ); } function proposeCountryExclusion( string calldata countryCode, string calldata description ) external nonReentrant returns (uint256 ballotID) { _checkCountryCode(countryCode); require( ! exchangeConfig.dao().countryIsExcluded(countryCode), "Country is already excluded"); string memory ballotName = string.concat("exclude:", countryCode, description ); return _possiblyCreateProposal( ballotName, BallotType.EXCLUDE_COUNTRY, address(0), 0, countryCode, description ); } function proposeSetAccessManager( address newAddress, string calldata description ) external nonReentrant returns (uint256 ballotID) { require( newAddress != address(0), "Proposed address cannot be address(0)" ); string memory ballotName = string.concat("setAccessManager:", Strings.toHexString(newAddress), description ); return _possiblyCreateProposal( ballotName, BallotType.SET_ACCESS_MANAGER, newAddress, 0, "", description ); } function proposeWebsiteUpdate( string calldata newWebsiteURL, string calldata description ) external nonReentrant returns (uint256 ballotID) { require( keccak256(abi.encodePacked(newWebsiteURL)) != keccak256(abi.encodePacked("")), "newWebsiteURL cannot be empty" ); for (uint i = 0; i < bytes(newWebsiteURL).length; i++) require(bytes(newWebsiteURL)[i] >= 0x2D && bytes(newWebsiteURL)[i] <= 0x7A, "Invalid character in URL"); string memory ballotName = string.concat("setURL:", newWebsiteURL, description ); return _possiblyCreateProposal( ballotName, BallotType.SET_WEBSITE_URL, address(0), 0, newWebsiteURL, description ); } // Cast a vote on an open ballot function castVote( uint256 ballotID, Vote vote ) external nonReentrant { Ballot memory ballot = ballots[ballotID]; // Require that the ballot is actually live require( ballot.ballotIsLive, "The specified ballot is not open for voting" ); // Make sure that the vote type is valid for the given ballot if ( ballot.ballotType == BallotType.PARAMETER ) require( (vote == Vote.INCREASE) || (vote == Vote.DECREASE) || (vote == Vote.NO_CHANGE), "Invalid VoteType for Parameter Ballot" ); else // If a Ballot is not a Parameter Ballot, it is an Approval ballot require( (vote == Vote.YES) || (vote == Vote.NO), "Invalid VoteType for Approval Ballot" ); // Make sure that the user has voting power before proceeding. // Voting power is equal to their userShare of STAKED_ZERO. // If the user changes their stake after voting they will have to recast their vote. uint256 userVotingPower = staking.userShareForPool( msg.sender, STAKED_ZERO ); require( userVotingPower > 0, "Staked ZERO tokens are required to vote" ); // Remove any previous votes made by the user on the ballot UserVote memory lastVote = _lastUserVoteForBallot[ballotID][msg.sender]; // Undo the last vote? if ( lastVote.votingPower > 0 ) _votesCastForBallot[ballotID][lastVote.vote] -= lastVote.votingPower; // Update the votes cast for the ballot with the user's current voting power _votesCastForBallot[ballotID][vote] += userVotingPower; // Remember how the user voted in case they change their vote later _lastUserVoteForBallot[ballotID][msg.sender] = UserVote( vote, userVotingPower ); emit VoteCast(msg.sender, ballotID, vote, userVotingPower); } // === VIEWS === function ballotForID( uint256 ballotID ) external view returns (Ballot memory) { return ballots[ballotID]; } function lastUserVoteForBallot( uint256 ballotID, address user ) external view returns (UserVote memory) { return _lastUserVoteForBallot[ballotID][user]; } function votesCastForBallot( uint256 ballotID, Vote vote ) external view returns (uint256) { return _votesCastForBallot[ballotID][vote]; } // The required quorum is normally a default 10% of the amount of ZERO tokens staked. // There is though a minimum of 0.50% of ZERO.totalSupply function requiredQuorumForBallotType( BallotType ballotType ) public view returns (uint256 requiredQuorum) { // The quorum will be specified as a percentage of the total amount of ZERO tokens staked uint256 totalStaked = staking.totalShares( STAKED_ZERO ); require( totalStaked != 0, "ZERO tokens staked cannot be zero to determine quorum" ); if ( ballotType == BallotType.PARAMETER ) requiredQuorum = ( 1 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 ); else if ( ( ballotType == BallotType.WHITELIST_TOKEN ) || ( ballotType == BallotType.UNWHITELIST_TOKEN ) ) requiredQuorum = ( 2 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 ); else // All other ballot types require 3x multiple of the baseQuorum requiredQuorum = ( 3 * totalStaked * daoConfig.baseBallotQuorumPercentTimes1000()) / ( 100 * 1000 ); // Make sure that the requiredQuorum is at least 0.50% of the total ZERO token supply. // Circulating supply after the first 45 days of emissions will be about 8 million - so this would require about 6% of the circulating // ZERO tokens to be staked and voting to pass a proposal (including whitelisting) 45 days after deployment.. uint256 totalSupply = IERC20Metadata(address(exchangeConfig.zero())).totalSupply(); uint256 minimumQuorum = totalSupply * 5 / 1000; if ( requiredQuorum < minimumQuorum ) requiredQuorum = minimumQuorum; } function totalVotesCastForBallot( uint256 ballotID ) public view returns (uint256) { mapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID]; Ballot memory ballot = ballots[ballotID]; if ( ballot.ballotType == BallotType.PARAMETER ) return votes[Vote.INCREASE] + votes[Vote.DECREASE] + votes[Vote.NO_CHANGE]; else return votes[Vote.YES] + votes[Vote.NO]; } // Assumes that the quorum has been checked elsewhere function ballotIsApproved( uint256 ballotID ) external view returns (bool) { mapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID]; return votes[Vote.YES] > votes[Vote.NO]; } // Assumes that the quorum has been checked elsewhere function winningParameterVote( uint256 ballotID ) external view returns (Vote) { mapping(Vote=>uint256) storage votes = _votesCastForBallot[ballotID]; uint256 increaseTotal = votes[Vote.INCREASE]; uint256 decreaseTotal = votes[Vote.DECREASE]; uint256 noChangeTotal = votes[Vote.NO_CHANGE]; if ( increaseTotal > decreaseTotal ) if ( increaseTotal > noChangeTotal ) return Vote.INCREASE; if ( decreaseTotal > increaseTotal ) if ( decreaseTotal > noChangeTotal ) return Vote.DECREASE; return Vote.NO_CHANGE; } // Checks that ballot is live, and minimumEndTime and quorum have both been reached. function canFinalizeBallot( uint256 ballotID ) external view returns (bool) { Ballot memory ballot = ballots[ballotID]; if ( ! ballot.ballotIsLive ) return false; // Check that the minimum duration has passed if (block.timestamp < ballot.ballotMinimumEndTime ) return false; // Check that the required quorum has been reached if ( totalVotesCastForBallot(ballotID) < ballot.requiredQuorum) return false; return true; } function openBallots() external view returns (uint256[] memory) { return _allOpenBallots.values(); } function openBallotsForTokenWhitelisting() external view returns (uint256[] memory) { return _openBallotsForTokenWhitelisting.values(); } function userHasActiveProposal( address user ) external view returns (bool) { return _userHasActiveProposal[user]; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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. * * ```solidity * 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: MIT // OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; import "./math/SignedMath.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 `int256` to its ASCII `string` decimal representation. */ function toString(int256 value) internal pure returns (string memory) { return string(abi.encodePacked(value < 0 ? "-" : "", toString(SignedMath.abs(value)))); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { 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); } /** * @dev Returns true if the two strings are equal. */ function equal(string memory a, string memory b) internal pure returns (bool) { return keccak256(bytes(a)) == keccak256(bytes(b)); } }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import "./IPools.sol"; interface IPoolsConfig { function whitelistPool( IERC20 tokenA, IERC20 tokenB ) external; // onlyOwner function unwhitelistPool( IERC20 tokenA, IERC20 tokenB ) external; // onlyOwner function changeMaximumWhitelistedPools(bool increase) external; // onlyOwner // Views function maximumWhitelistedPools() external view returns (uint256); function numberOfWhitelistedPools() external view returns (uint256); function isWhitelisted( bytes32 poolID ) external view returns (bool); function whitelistedPools() external view returns (bytes32[] calldata); function underlyingTokenPair( bytes32 poolID ) external view returns (IERC20 tokenA, IERC20 tokenB); // Returns true if the token has been whitelisted (meaning it has been pooled with either WETH and ZERO) function tokenHasBeenWhitelisted( IERC20 token, IERC20 weth, IERC20 zero ) external view returns (bool); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "./IStakingRewards.sol"; // Enum representing the possible states of an unstake request: // NONE: The default state, indicating that no unstake request has been made. // PENDING: The state indicating that an unstake request has been made, but has not yet completed. // CANCELLED: The state indicating that a pending unstake request has been cancelled by the user. // CLAIMED: The state indicating that a pending unstake request has been completed and the user can claim their ZERO tokens. enum UnstakeState { NONE, PENDING, CANCELLED, CLAIMED } struct Unstake { UnstakeState status; // see above address wallet; // the wallet of the user performing the unstake uint256 unstakedVeZERO; // the amount of veZERO that was unstaked uint256 claimableZERO; // claimable ZERO tokens at completion time uint256 completionTime; // the timestamp when the unstake completes uint256 unstakeID; // the unstake ID } interface IStaking is IStakingRewards { function stakeZERO( uint256 amountToStake ) external; function unstake( uint256 amountUnstaked, uint256 numWeeks ) external returns (uint256 unstakeID); function cancelUnstake( uint256 unstakeID ) external; function recoverZERO( uint256 unstakeID ) external; // Views function userVeZERO( address wallet ) external view returns (uint256); function unstakesForUser( address wallet, uint256 start, uint256 end ) external view returns (Unstake[] calldata); function unstakesForUser( address wallet ) external view returns (Unstake[] calldata); function userUnstakeIDs( address user ) external view returns (uint256[] calldata); function unstakeByID(uint256 id) external view returns (Unstake calldata); function calculateUnstake( uint256 unstakedVeZERO, uint256 numWeeks ) external view returns (uint256); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/finance/VestingWallet.sol"; import "../staking/interfaces/ILiquidity.sol"; import "../launch/interfaces/IInitialDistribution.sol"; import "../rewards/interfaces/IRewardsEmitter.sol"; import "../rewards/interfaces/IZeroRewards.sol"; import "../rewards/interfaces/IEmissions.sol"; import "../interfaces/IAccessManager.sol"; import "../launch/interfaces/IAirdrop.sol"; import "../dao/interfaces/IDAO.sol"; import "../interfaces/IZero.sol"; import "./IUpkeep.sol"; interface IExchangeConfig { function setContracts( IDAO _dao, IUpkeep _upkeep, IInitialDistribution _initialDistribution, VestingWallet _teamVestingWallet, VestingWallet _daoVestingWallet ) external; // onlyOwner function setAccessManager( IAccessManager _accessManager ) external; // onlyOwner // Views function zero() external view returns (IZero); function wbtc() external view returns (IERC20); function weth() external view returns (IERC20); function usdc() external view returns (IERC20); function usdt() external view returns (IERC20); function daoVestingWallet() external view returns (VestingWallet); function teamVestingWallet() external view returns (VestingWallet); function initialDistribution() external view returns (IInitialDistribution); function accessManager() external view returns (IAccessManager); function dao() external view returns (IDAO); function upkeep() external view returns (IUpkeep); function teamWallet() external view returns (address); function walletHasAccess( address wallet ) external view returns (bool); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; interface IDAOConfig { function changeBootstrappingRewards(bool increase) external; // onlyOwner function changePercentRewardsBurned(bool increase) external; // onlyOwner function changeBaseBallotQuorumPercent(bool increase) external; // onlyOwner function changeBallotDuration(bool increase) external; // onlyOwner function changeBallotMaximumDuration(bool increase) external; // onlyOwner function changeRequiredProposalPercentStake(bool increase) external; // onlyOwner function changePercentRewardsForReserve(bool increase) external; // onlyOwner function changeUpkeepRewardPercent(bool increase) external; // onlyOwner // Views function bootstrappingRewards() external view returns (uint256); function percentRewardsBurned() external view returns (uint256); function baseBallotQuorumPercentTimes1000() external view returns (uint256); function ballotMinimumDuration() external view returns (uint256); function ballotMaximumDuration() external view returns (uint256); function requiredProposalPercentStakeTimes1000() external view returns (uint256); function percentRewardsForReserve() external view returns (uint256); function upkeepRewardPercent() external view returns (uint256); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; enum Vote { INCREASE, DECREASE, NO_CHANGE, YES, NO } enum BallotType { PARAMETER, WHITELIST_TOKEN, UNWHITELIST_TOKEN, SEND_ZERO, CALL_CONTRACT, INCLUDE_COUNTRY, EXCLUDE_COUNTRY, SET_ACCESS_MANAGER, SET_WEBSITE_URL, CONFIRM_SET_ACCESS_MANAGER, CONFIRM_SET_WEBSITE_URL } struct UserVote { Vote vote; uint256 votingPower; // Voting power at the time the vote was cast } struct Ballot { uint256 ballotID; bool ballotIsLive; BallotType ballotType; string ballotName; address address1; uint256 number1; string string1; string description; // The earliest timestamp at which a ballot can end. Can be open longer if the quorum has not yet been reached for instance. uint256 ballotMinimumEndTime; // The time at which any user can end the ballot - even if it hasn't been successfully finalized. uint256 ballotMaximumEndTime; // The requiredQuorum for the ballot uint256 requiredQuorum; } interface IProposals { function createConfirmationProposal( string calldata ballotName, BallotType ballotType, address address1, string calldata string1, string calldata description ) external returns (uint256 ballotID); function markBallotAsFinalized( uint256 ballotID ) external; function proposeParameterBallot( uint256 parameterType, string calldata description ) external returns (uint256 ballotID); function proposeTokenWhitelisting( IERC20 token, string calldata tokenIconURL, string calldata description ) external returns (uint256 ballotID); function proposeTokenUnwhitelisting( IERC20 token, string calldata tokenIconURL, string calldata description ) external returns (uint256 ballotID); function proposeSendZERO( address wallet, uint256 amount, string calldata description ) external returns (uint256 ballotID); function proposeCallContract( address contractAddress, uint256 number, string calldata description ) external returns (uint256 ballotID); function proposeCountryInclusion( string calldata country, string calldata description ) external returns (uint256 ballotID); function proposeCountryExclusion( string calldata country, string calldata description ) external returns (uint256 ballotID); function proposeSetAccessManager( address newAddress, string calldata description ) external returns (uint256 ballotID); function proposeWebsiteUpdate( string calldata newWebsiteURL, string calldata description ) external returns (uint256 ballotID); function castVote( uint256 ballotID, Vote vote ) external; // Views function nextBallotID() external view returns (uint256); function openBallotsByName( string calldata name ) external view returns (uint256); function ballotForID( uint256 ballotID ) external view returns (Ballot calldata); function lastUserVoteForBallot( uint256 ballotID, address user ) external view returns (UserVote calldata); function votesCastForBallot( uint256 ballotID, Vote vote ) external view returns (uint256); function requiredQuorumForBallotType( BallotType ballotType ) external view returns (uint256 requiredQuorum); function totalVotesCastForBallot( uint256 ballotID ) external view returns (uint256); function ballotIsApproved( uint256 ballotID ) external view returns (bool); function winningParameterVote( uint256 ballotID ) external view returns (Vote); function canFinalizeBallot( uint256 ballotID ) external view returns (bool); function openBallots() external view returns (uint256[] memory); function openBallotsForTokenWhitelisting() external view returns (uint256[] memory); function userHasActiveProposal( address user ) external view returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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.9.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) { // Solidity will revert if denominator == 0, unlike the div opcode on its own. // The surrounding unchecked block does not change this fact. // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic. return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1, "Math: mulDiv overflow"); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // 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 256, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result << 3) < value ? 1 : 0); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/SignedMath.sol) pragma solidity ^0.8.0; /** * @dev Standard signed math utilities missing in the Solidity language. */ library SignedMath { /** * @dev Returns the largest of two signed numbers. */ function max(int256 a, int256 b) internal pure returns (int256) { return a > b ? a : b; } /** * @dev Returns the smallest of two signed numbers. */ function min(int256 a, int256 b) internal pure returns (int256) { return a < b ? a : b; } /** * @dev Returns the average of two signed numbers without overflow. * The result is rounded towards zero. */ function average(int256 a, int256 b) internal pure returns (int256) { // Formula from the book "Hacker's Delight" int256 x = (a & b) + ((a ^ b) >> 1); return x + (int256(uint256(x) >> 255) & (a ^ b)); } /** * @dev Returns the absolute unsigned value of a signed value. */ function abs(int256 n) internal pure returns (uint256) { unchecked { // must be unchecked in order to support `n = type(int256).min` return uint256(n >= 0 ? n : -n); } } }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "../../staking/interfaces/ILiquidity.sol"; import "../../dao/interfaces/IDAO.sol"; import "./IPoolStats.sol"; interface IPools is IPoolStats { function startExchangeApproved() external; function setContracts( IDAO _dao, ILiquidity _liquidity ) external; // onlyOwner function addLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 maxAmountA, uint256 maxAmountB, uint256 minAddedAmountA, uint256 minAddedAmountB, uint256 totalLiquidity ) external returns (uint256 addedAmountA, uint256 addedAmountB, uint256 addedLiquidity); function removeLiquidity( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToRemove, uint256 minReclaimedA, uint256 minReclaimedB, uint256 totalLiquidity ) external returns (uint256 reclaimedA, uint256 reclaimedB); function deposit( IERC20 token, uint256 amount ) external; function withdraw( IERC20 token, uint256 amount ) external; function swap( IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut); function depositSwapWithdraw(IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut); function depositDoubleSwapWithdraw( IERC20 swapTokenIn, IERC20 swapTokenMiddle, IERC20 swapTokenOut, uint256 swapAmountIn, uint256 minAmountOut, uint256 deadline ) external returns (uint256 swapAmountOut); function depositZapSwapWithdraw(IERC20 swapTokenIn, IERC20 swapTokenOut, uint256 swapAmountIn ) external returns (uint256 swapAmountOut); // Views function exchangeIsLive() external view returns (bool); function getPoolReserves(IERC20 tokenA, IERC20 tokenB) external view returns (uint256 reserveA, uint256 reserveB); function depositedUserBalance(address user, IERC20 token) external view returns (uint256); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; struct AddedReward { bytes32 poolID; // The pool to add rewards to uint256 amountToAdd; // The amount of rewards (as ZERO) to add } struct UserShareInfo { uint256 userShare; // A user's share for a given poolID uint256 virtualRewards; // The amount of rewards that were added to maintain proper rewards/share ratio - and will be deducted from a user's pending rewards. uint256 cooldownExpiration; // The timestamp when the user can modify their share } interface IStakingRewards { function claimAllRewards( bytes32[] calldata poolIDs ) external returns (uint256 rewardsAmount); function addZERORewards( AddedReward[] calldata addedRewards ) external; // Views function totalShares(bytes32 poolID) external view returns (uint256); function totalSharesForPools( bytes32[] calldata poolIDs ) external view returns (uint256[] calldata shares); function totalRewardsForPools( bytes32[] calldata poolIDs ) external view returns (uint256[] calldata rewards); function userRewardForPool( address wallet, bytes32 poolID ) external view returns (uint256); function userShareForPool( address wallet, bytes32 poolID ) external view returns (uint256); function userVirtualRewardsForPool( address wallet, bytes32 poolID ) external view returns (uint256); function userRewardsForPools( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata rewards); function userShareForPools( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata shares); function userCooldowns( address wallet, bytes32[] calldata poolIDs ) external view returns (uint256[] calldata cooldowns); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (finance/VestingWallet.sol) pragma solidity ^0.8.0; import "../token/ERC20/utils/SafeERC20.sol"; import "../utils/Address.sol"; import "../utils/Context.sol"; /** * @title VestingWallet * @dev This contract handles the vesting of Eth and ERC20 tokens for a given beneficiary. Custody of multiple tokens * can be given to this contract, which will release the token to the beneficiary following a given vesting schedule. * The vesting schedule is customizable through the {vestedAmount} function. * * Any token transferred to this contract will follow the vesting schedule as if they were locked from the beginning. * Consequently, if the vesting has already started, any amount of tokens sent to this contract will (at least partly) * be immediately releasable. */ contract VestingWallet is Context { event EtherReleased(uint256 amount); event ERC20Released(address indexed token, uint256 amount); uint256 private _released; mapping(address => uint256) private _erc20Released; address private immutable _beneficiary; uint64 private immutable _start; uint64 private immutable _duration; /** * @dev Set the beneficiary, start timestamp and vesting duration of the vesting wallet. */ constructor(address beneficiaryAddress, uint64 startTimestamp, uint64 durationSeconds) payable { require(beneficiaryAddress != address(0), "VestingWallet: beneficiary is zero address"); _beneficiary = beneficiaryAddress; _start = startTimestamp; _duration = durationSeconds; } /** * @dev The contract should be able to receive Eth. */ receive() external payable virtual {} /** * @dev Getter for the beneficiary address. */ function beneficiary() public view virtual returns (address) { return _beneficiary; } /** * @dev Getter for the start timestamp. */ function start() public view virtual returns (uint256) { return _start; } /** * @dev Getter for the vesting duration. */ function duration() public view virtual returns (uint256) { return _duration; } /** * @dev Amount of eth already released */ function released() public view virtual returns (uint256) { return _released; } /** * @dev Amount of token already released */ function released(address token) public view virtual returns (uint256) { return _erc20Released[token]; } /** * @dev Getter for the amount of releasable eth. */ function releasable() public view virtual returns (uint256) { return vestedAmount(uint64(block.timestamp)) - released(); } /** * @dev Getter for the amount of releasable `token` tokens. `token` should be the address of an * IERC20 contract. */ function releasable(address token) public view virtual returns (uint256) { return vestedAmount(token, uint64(block.timestamp)) - released(token); } /** * @dev Release the native token (ether) that have already vested. * * Emits a {EtherReleased} event. */ function release() public virtual { uint256 amount = releasable(); _released += amount; emit EtherReleased(amount); Address.sendValue(payable(beneficiary()), amount); } /** * @dev Release the tokens that have already vested. * * Emits a {ERC20Released} event. */ function release(address token) public virtual { uint256 amount = releasable(token); _erc20Released[token] += amount; emit ERC20Released(token, amount); SafeERC20.safeTransfer(IERC20(token), beneficiary(), amount); } /** * @dev Calculates the amount of ether that has already vested. Default implementation is a linear vesting curve. */ function vestedAmount(uint64 timestamp) public view virtual returns (uint256) { return _vestingSchedule(address(this).balance + released(), timestamp); } /** * @dev Calculates the amount of tokens that has already vested. Default implementation is a linear vesting curve. */ function vestedAmount(address token, uint64 timestamp) public view virtual returns (uint256) { return _vestingSchedule(IERC20(token).balanceOf(address(this)) + released(token), timestamp); } /** * @dev Virtual implementation of the vesting formula. This returns the amount vested, as a function of time, for * an asset given its total historical allocation. */ function _vestingSchedule(uint256 totalAllocation, uint64 timestamp) internal view virtual returns (uint256) { if (timestamp < start()) { return 0; } else if (timestamp > start() + duration()) { return totalAllocation; } else { return (totalAllocation * (timestamp - start())) / duration(); } } }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; import "./IStakingRewards.sol"; interface ILiquidity is IStakingRewards { function depositLiquidityAndIncreaseShare( IERC20 tokenA, IERC20 tokenB, uint256 maxAmountA, uint256 maxAmountB, uint256 minAddedAmountA, uint256 minAddedAmountB, uint256 minAddedLiquidity, uint256 deadline, bool useZapping ) external returns (uint256 addedLiquidity); function withdrawLiquidityAndClaim( IERC20 tokenA, IERC20 tokenB, uint256 liquidityToWithdraw, uint256 minReclaimedA, uint256 minReclaimedB, uint256 deadline ) external returns (uint256 reclaimedA, uint256 reclaimedB); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "./IBootstrapBallot.sol"; import "./IAirdrop.sol"; interface IInitialDistribution { function distributionApproved( IAirdrop airdrop1, IAirdrop airdrop2 ) external; // Views function bootstrapBallot() external view returns (IBootstrapBallot); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "../../staking/interfaces/IStakingRewards.sol"; interface IRewardsEmitter { function addZERORewards( AddedReward[] calldata addedRewards ) external; function performUpkeep( uint256 timeSinceLastUpkeep ) external; // Views function pendingRewardsForPools( bytes32[] calldata pools ) external view returns (uint256[] calldata); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "./IRewardsEmitter.sol"; interface IZeroRewards { function sendInitialZERORewards( uint256 liquidityBootstrapAmount, bytes32[] calldata poolIDs ) external; function performUpkeep( bytes32[] calldata poolIDs, uint256[] calldata profitsForPools ) external; // Views function stakingRewardsEmitter() external view returns (IRewardsEmitter); function liquidityRewardsEmitter() external view returns (IRewardsEmitter); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; interface IEmissions { function performUpkeep( uint256 timeSinceLastUpkeep ) external; }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; interface IAccessManager { function excludedCountriesUpdated() external; function grantAccess(bytes calldata signature) external; // Views function geoVersion() external view returns (uint256); function walletHasAccess(address wallet) external view returns (bool); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; interface IAirdrop { function authorizeWallet( address wallet, uint256 zeroAmount ) external; function allowClaiming() external; function claim() external; // Views function claimedByUser( address wallet) external view returns (uint256); function claimingAllowed() external view returns (bool); function claimingStartTimestamp() external view returns (uint256); function claimableAmount(address wallet) external view returns (uint256); function airdropForUser( address wallet ) external view returns (uint256); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "../../rewards/interfaces/IZeroRewards.sol"; import "../../pools/interfaces/IPools.sol"; import "../../interfaces/IZero.sol"; interface IDAO { function finalizeBallot( uint256 ballotID ) external; function manuallyRemoveBallot( uint256 ballotID ) external; function withdrawFromDAO( IERC20 token ) external returns (uint256 withdrawnAmount); // Views function pools() external view returns (IPools); function websiteURL() external view returns (string memory); function countryIsExcluded( string calldata country ) external view returns (bool); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; import "openzeppelin-contracts/contracts/token/ERC20/IERC20.sol"; interface IZero is IERC20 { function burnTokensInContract() external; // Views function totalBurned() external view returns (uint256); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; interface IUpkeep { function performUpkeep() external; // Views function currentRewardsForCallingPerformUpkeep() external view returns (uint256); function lastUpkeepTimeEmissions() external view returns (uint256); function lastUpkeepTimeRewardsEmitters() external view returns (uint256); }
// SPDX-License-Identifier: BUSL 1.1 pragma solidity =0.8.22; interface IPoolStats { // These are the indicies (in terms of a poolIDs location in the current whitelistedPoolIDs array) of pools involved in an arbitrage path struct ArbitrageIndicies { uint64 index1; uint64 index2; uint64 index3; } function clearProfitsForPools() external; function updateArbitrageIndicies() external; // Views function profitsForWhitelistedPools() external view returns (uint256[] memory _calculatedProfits); function arbitrageIndicies(bytes32 poolID) external view returns (ArbitrageIndicies memory); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/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; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ 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)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ 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"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ 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"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // 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 cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [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://consensys.net/diligence/blog/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.8.0/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: BUSL 1.1 pragma solidity =0.8.22; interface IBootstrapBallot { function vote( bool voteStartExchangeYes, uint256 zeroAmount, bytes calldata signature ) external; function finalizeBallot() external; function authorizeAirdrop2( uint256 zeroAmount, bytes calldata signature ) external; function finalizeAirdrop2() external; // Views function claimableTimestamp1() external view returns (uint256); function claimableTimestamp2() external view returns (uint256); function hasVoted(address user) external view returns (bool); function ballotFinalized() external view returns (bool); function startExchangeYes() external view returns (uint256); function startExchangeNo() external view returns (uint256); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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); }
{ "remappings": [ "chainlink/=lib/chainlink/", "ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/", "forge-std/=lib/openzeppelin-contracts/lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "openzeppelin/=lib/openzeppelin-contracts/contracts/", "v3-core/=lib/v3-core/contracts/" ], "optimizer": { "enabled": true, "runs": 10000 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "paris", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IStaking","name":"_staking","type":"address"},{"internalType":"contract IExchangeConfig","name":"_exchangeConfig","type":"address"},{"internalType":"contract IPoolsConfig","name":"_poolsConfig","type":"address"},{"internalType":"contract IDAOConfig","name":"_daoConfig","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"ballotID","type":"uint256"}],"name":"BallotFinalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"ballotID","type":"uint256"},{"indexed":false,"internalType":"enum BallotType","name":"ballotType","type":"uint8"},{"indexed":false,"internalType":"string","name":"ballotName","type":"string"}],"name":"ProposalCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"voter","type":"address"},{"indexed":true,"internalType":"uint256","name":"ballotID","type":"uint256"},{"indexed":false,"internalType":"enum Vote","name":"vote","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"votingPower","type":"uint256"}],"name":"VoteCast","type":"event"},{"inputs":[],"name":"STAKED_ZERO","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"name":"ballotForID","outputs":[{"components":[{"internalType":"uint256","name":"ballotID","type":"uint256"},{"internalType":"bool","name":"ballotIsLive","type":"bool"},{"internalType":"enum BallotType","name":"ballotType","type":"uint8"},{"internalType":"string","name":"ballotName","type":"string"},{"internalType":"address","name":"address1","type":"address"},{"internalType":"uint256","name":"number1","type":"uint256"},{"internalType":"string","name":"string1","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"uint256","name":"ballotMinimumEndTime","type":"uint256"},{"internalType":"uint256","name":"ballotMaximumEndTime","type":"uint256"},{"internalType":"uint256","name":"requiredQuorum","type":"uint256"}],"internalType":"struct Ballot","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"name":"ballotIsApproved","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"ballots","outputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"},{"internalType":"bool","name":"ballotIsLive","type":"bool"},{"internalType":"enum BallotType","name":"ballotType","type":"uint8"},{"internalType":"string","name":"ballotName","type":"string"},{"internalType":"address","name":"address1","type":"address"},{"internalType":"uint256","name":"number1","type":"uint256"},{"internalType":"string","name":"string1","type":"string"},{"internalType":"string","name":"description","type":"string"},{"internalType":"uint256","name":"ballotMinimumEndTime","type":"uint256"},{"internalType":"uint256","name":"ballotMaximumEndTime","type":"uint256"},{"internalType":"uint256","name":"requiredQuorum","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"name":"canFinalizeBallot","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"},{"internalType":"enum Vote","name":"vote","type":"uint8"}],"name":"castVote","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"ballotName","type":"string"},{"internalType":"enum BallotType","name":"ballotType","type":"uint8"},{"internalType":"address","name":"address1","type":"address"},{"internalType":"string","name":"string1","type":"string"},{"internalType":"string","name":"description","type":"string"}],"name":"createConfirmationProposal","outputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"daoConfig","outputs":[{"internalType":"contract IDAOConfig","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchangeConfig","outputs":[{"internalType":"contract IExchangeConfig","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"},{"internalType":"address","name":"user","type":"address"}],"name":"lastUserVoteForBallot","outputs":[{"components":[{"internalType":"enum Vote","name":"vote","type":"uint8"},{"internalType":"uint256","name":"votingPower","type":"uint256"}],"internalType":"struct UserVote","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"name":"markBallotAsFinalized","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"nextBallotID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openBallots","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"","type":"string"}],"name":"openBallotsByName","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openBallotsForTokenWhitelisting","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolsConfig","outputs":[{"internalType":"contract IPoolsConfig","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"contractAddress","type":"address"},{"internalType":"uint256","name":"number","type":"uint256"},{"internalType":"string","name":"description","type":"string"}],"name":"proposeCallContract","outputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"countryCode","type":"string"},{"internalType":"string","name":"description","type":"string"}],"name":"proposeCountryExclusion","outputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"countryCode","type":"string"},{"internalType":"string","name":"description","type":"string"}],"name":"proposeCountryInclusion","outputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"parameterType","type":"uint256"},{"internalType":"string","name":"description","type":"string"}],"name":"proposeParameterBallot","outputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"wallet","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"string","name":"description","type":"string"}],"name":"proposeSendZERO","outputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newAddress","type":"address"},{"internalType":"string","name":"description","type":"string"}],"name":"proposeSetAccessManager","outputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"string","name":"tokenIconURL","type":"string"},{"internalType":"string","name":"description","type":"string"}],"name":"proposeTokenUnwhitelisting","outputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"string","name":"tokenIconURL","type":"string"},{"internalType":"string","name":"description","type":"string"}],"name":"proposeTokenWhitelisting","outputs":[{"internalType":"uint256","name":"_ballotID","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"newWebsiteURL","type":"string"},{"internalType":"string","name":"description","type":"string"}],"name":"proposeWebsiteUpdate","outputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum BallotType","name":"ballotType","type":"uint8"}],"name":"requiredQuorumForBallotType","outputs":[{"internalType":"uint256","name":"requiredQuorum","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"staking","outputs":[{"internalType":"contract IStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"name":"totalVotesCastForBallot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"user","type":"address"}],"name":"userHasActiveProposal","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"},{"internalType":"enum Vote","name":"vote","type":"uint8"}],"name":"votesCastForBallot","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ballotID","type":"uint256"}],"name":"winningParameterVote","outputs":[{"internalType":"enum Vote","name":"","type":"uint8"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
61012060405260016003556200001942623b538062000075565b610100523480156200002a57600080fd5b5060405162005da138038062005da18339810160408190526200004d91620000b6565b60016000556001600160a01b0393841660805291831660a052821660c0521660e0526200011e565b808201808211156200009757634e487b7160e01b600052601160045260246000fd5b92915050565b6001600160a01b0381168114620000b357600080fd5b50565b60008060008060808587031215620000cd57600080fd5b8451620000da816200009d565b6020860151909450620000ed816200009d565b604086015190935062000100816200009d565b606086015190925062000113816200009d565b939692955090935050565b60805160a05160c05160e05161010051615b736200022e6000396000613c8f015260008181610519015281816130280152818161310a0152818161319b01528181613e6c0152818161426e01526142fe01526000818161030b015281816122c701528181613551015281816135d301526136c801526000818161022f015281816108b9015281816115e801528181611a9201528181611ffb0152818161208b015281816122f701528181612379015281816124fd015281816125df015281816126c1015281816128b101528181613241015281816136f80152818161377a0152613d250152600081816102dc015281816112f901528181612f1e01528181613def0152613f8a0152615b736000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c806369907b751161010f578063d095a4d5116100a2578063e671f77711610071578063e671f777146104c2578063ebf2e8bd146104ee578063f26c5f5614610501578063fa05dd001461051457600080fd5b8063d095a4d514610476578063d8782dae14610489578063e2fb7e091461049c578063e646fd66146104af57600080fd5b80639d219f8f116100de5780639d219f8f14610412578063ac4236ae14610425578063b43f4e1014610450578063cae26e5d1461046357600080fd5b806369907b751461038757806384526cec1461039a578063880d266c146103df5780639534c9f3146103f257600080fd5b806345074887116101875780635678138811610156578063567813881461032d578063568d86d7146103425780635c4db523146103555780635c632b381461035d57600080fd5b806345074887146102b75780634cf088d9146102d75780634e86351b146102fe57806352c19b5a1461030657600080fd5b80632bd32564116101c35780632bd3256414610269578063312aab9e1461027e5780633b958e2f146102915780633c2edb39146102a457600080fd5b80630bb44e76146101ea5780630bc88fed146102135780630e2789bb1461022a575b600080fd5b6101fd6101f8366004614bf3565b61053b565b60405161020a9190614c4f565b60405180910390f35b61021c60035481565b60405190815260200161020a565b6102517f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161020a565b6102716105ae565b60405161020a9190614c5d565b61021c61028c366004614bf3565b6105bf565b61021c61029f366004614cea565b6108a3565b61021c6102b2366004614d56565b610aa8565b6102ca6102c5366004614bf3565b610b9a565b60405161020a9190614e02565b6102517f000000000000000000000000000000000000000000000000000000000000000081565b61021c600081565b6102517f000000000000000000000000000000000000000000000000000000000000000081565b61034061033b366004614ee4565b610e63565b005b610340610350366004614bf3565b6115de565b61027161186c565b61037061036b366004614bf3565b611878565b60405161020a9b9a99989796959493929190614f18565b61021c610395366004614cea565b611a7c565b6103cf6103a8366004614bf3565b60009081526008602090815260408083206004845290915280822054600383529120541190565b604051901515815260200161020a565b6103cf6103ed366004614bf3565b611c70565b610405610400366004614fc0565b611f1b565b60405161020a9190614fe5565b61021c610420366004615006565b611f97565b61021c610433366004615085565b805160208183018101805160018252928201919093012091525481565b61021c61045e366004615136565b6122bb565b61021c610471366004614ee4565b612864565b61021c6104843660046151cd565b6128ad565b61021c610497366004615006565b612a6f565b61021c6104aa366004614cea565b612b83565b61021c6104bd36600461528f565b612ddf565b6103cf6104d03660046152cb565b6001600160a01b03166000908152600a602052604090205460ff1690565b61021c6104fc3660046152e8565b612eea565b61021c61050f366004615136565b613354565b6102517f000000000000000000000000000000000000000000000000000000000000000081565b60008181526008602090815260408083208380529182905280832054600184528184205460028552918420549091908183111561058657808311156105865750600095945050505050565b828211156105a257808211156105a25750600195945050505050565b50600295945050505050565b60606105ba60066139c7565b905090565b60008181526008602090815260408083206002835281842082516101608101845281548152600182015460ff80821615159683019690965292948694919391840191610100900416600a81111561061857610618614c0c565b600a81111561062957610629614c0c565b815260200160028201805461063d90615303565b80601f016020809104026020016040519081016040528092919081815260200182805461066990615303565b80156106b65780601f1061068b576101008083540402835291602001916106b6565b820191906000526020600020905b81548152906001019060200180831161069957829003601f168201915b505050918352505060038201546001600160a01b03166020820152600482015460408201526005820180546060909201916106f090615303565b80601f016020809104026020016040519081016040528092919081815260200182805461071c90615303565b80156107695780601f1061073e57610100808354040283529160200191610769565b820191906000526020600020905b81548152906001019060200180831161074c57829003601f168201915b5050505050815260200160068201805461078290615303565b80601f01602080910402602001604051908101604052809291908181526020018280546107ae90615303565b80156107fb5780601f106107d0576101008083540402835291602001916107fb565b820191906000526020600020905b8154815290600101906020018083116107de57829003601f168201915b50505091835250506007820154602082015260088201546040820152600990910154606090910152905060008160400151600a81111561083d5761083d614c0c565b03610880576002600090815260208390526040808220546001835281832054838052919092205461086e9190615385565b6108789190615385565b949350505050565b600460009081526020839052604080822054600383529120546108789190615385565b60006108ad6139d4565b6108b78585613a2d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610915573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109399190615398565b6001600160a01b03166313ea84a786866040518363ffffffff1660e01b81526004016109669291906153b5565b602060405180830381865afa158015610983573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a791906153e4565b6109f85760405162461bcd60e51b815260206004820152601760248201527f436f756e747279206973206e6f74206578636c7564656400000000000000000060448201526064015b60405180910390fd5b600085858585604051602001610a119493929190615406565b6040516020818303038152906040529050610a9b8160056000808a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8e018190048102820181019092528c815292508c91508b9081908401838280828437600092019190915250613c8b92505050565b9150506108786001600055565b6000610ab26139d4565b60108410610b025760405162461bcd60e51b815260206004820152601560248201527f496e76616c696420706172616d6574657254797065000000000000000000000060448201526064016109ef565b6000610b0d8561465e565b8484604051602001610b2193929190615456565b6040516020818303038152906040529050610b8681600080886040518060200160405280600081525089898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613c8b92505050565b915050610b936001600055565b9392505050565b610c006040805161016081018252600080825260208201819052909182019081526020016060815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016000815260200160008152602001600081525090565b60008281526002602090815260409182902082516101608101845281548152600182015460ff808216151594830194909452909391929184019161010090910416600a811115610c5257610c52614c0c565b600a811115610c6357610c63614c0c565b8152602001600282018054610c7790615303565b80601f0160208091040260200160405190810160405280929190818152602001828054610ca390615303565b8015610cf05780601f10610cc557610100808354040283529160200191610cf0565b820191906000526020600020905b815481529060010190602001808311610cd357829003601f168201915b505050918352505060038201546001600160a01b0316602082015260048201546040820152600582018054606090920191610d2a90615303565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5690615303565b8015610da35780601f10610d7857610100808354040283529160200191610da3565b820191906000526020600020905b815481529060010190602001808311610d8657829003601f168201915b50505050508152602001600682018054610dbc90615303565b80601f0160208091040260200160405190810160405280929190818152602001828054610de890615303565b8015610e355780601f10610e0a57610100808354040283529160200191610e35565b820191906000526020600020905b815481529060010190602001808311610e1857829003601f168201915b5050505050815260200160078201548152602001600882015481526020016009820154815250509050919050565b610e6b6139d4565b600082815260026020908152604080832081516101608101835281548152600182015460ff8082161515958301959095529093919284019161010090910416600a811115610ebb57610ebb614c0c565b600a811115610ecc57610ecc614c0c565b8152602001600282018054610ee090615303565b80601f0160208091040260200160405190810160405280929190818152602001828054610f0c90615303565b8015610f595780601f10610f2e57610100808354040283529160200191610f59565b820191906000526020600020905b815481529060010190602001808311610f3c57829003601f168201915b505050918352505060038201546001600160a01b0316602082015260048201546040820152600582018054606090920191610f9390615303565b80601f0160208091040260200160405190810160405280929190818152602001828054610fbf90615303565b801561100c5780601f10610fe15761010080835404028352916020019161100c565b820191906000526020600020905b815481529060010190602001808311610fef57829003601f168201915b5050505050815260200160068201805461102590615303565b80601f016020809104026020016040519081016040528092919081815260200182805461105190615303565b801561109e5780601f106110735761010080835404028352916020019161109e565b820191906000526020600020905b81548152906001019060200180831161108157829003601f168201915b5050505050815260200160078201548152602001600882015481526020016009820154815250509050806020015161113e5760405162461bcd60e51b815260206004820152602b60248201527f546865207370656369666965642062616c6c6f74206973206e6f74206f70656e60448201527f20666f7220766f74696e6700000000000000000000000000000000000000000060648201526084016109ef565b60008160400151600a81111561115657611156614c0c565b0361121f57600082600481111561116f5761116f614c0c565b148061118c5750600182600481111561118a5761118a614c0c565b145b806111a8575060028260048111156111a6576111a6614c0c565b145b61121a5760405162461bcd60e51b815260206004820152602560248201527f496e76616c696420566f74655479706520666f7220506172616d65746572204260448201527f616c6c6f7400000000000000000000000000000000000000000000000000000060648201526084016109ef565b6112c1565b600382600481111561123357611233614c0c565b14806112505750600482600481111561124e5761124e614c0c565b145b6112c15760405162461bcd60e51b8152602060048201526024808201527f496e76616c696420566f74655479706520666f7220417070726f76616c20426160448201527f6c6c6f740000000000000000000000000000000000000000000000000000000060648201526084016109ef565b6040517f97146776000000000000000000000000000000000000000000000000000000008152336004820152600060248201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639714677690604401602060405180830381865afa158015611348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136c91906154aa565b9050600081116113e45760405162461bcd60e51b815260206004820152602760248201527f5374616b6564205a45524f20746f6b656e73206172652072657175697265642060448201527f746f20766f74650000000000000000000000000000000000000000000000000060648201526084016109ef565b600084815260096020908152604080832033845290915280822081518083019092528054829060ff16600481111561141e5761141e614c0c565b600481111561142f5761142f614c0c565b815260019190910154602091820152810151909150156114a8576020808201516000878152600890925260408220835191929091600481111561147457611474614c0c565b600481111561148557611485614c0c565b815260200190815260200160002060008282546114a291906154c3565b90915550505b600085815260086020526040812083918660048111156114ca576114ca614c0c565b60048111156114db576114db614c0c565b815260200190815260200160002060008282546114f89190615385565b92505081905550604051806040016040528085600481111561151c5761151c614c0c565b815260209081018490526000878152600982526040808220338352909252208151815482907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600183600481111561157757611577614c0c565b02179055506020820151816001015590505084336001600160a01b03167f2c9deb38f462962eadbd85a9d3a4120503ee091f1582eaaa10aa8c6797651d2986856040516115c59291906154d6565b60405180910390a35050506115da6001600055565b5050565b6115e66139d4565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611644573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116689190615398565b6001600160a01b0316336001600160a01b0316146116ee5760405162461bcd60e51b815260206004820152602b60248201527f4f6e6c79207468652044414f2063616e206d61726b20612062616c6c6f74206160448201527f732066696e616c697a656400000000000000000000000000000000000000000060648201526084016109ef565b6000818152600260205260409020600181015460ff166117765760405162461bcd60e51b815260206004820152602560248201527f5468652062616c6c6f742068617320616c7265616479206265656e2066696e6160448201527f6c697a656400000000000000000000000000000000000000000000000000000060648201526084016109ef565b600180820154610100900460ff16600a81111561179557611795614c0c565b036117a7576117a560068361471c565b505b6117b260048361471c565b50600180820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009081169091556000848152600b60209081526040808320546001600160a01b0316808452600a909252918290208054909316909255519091906118229060028501906154f1565b90815260405190819003602001812060009081905584917fd470bb0d3dcb39ff5a62757e0a1cdfe60f8200eba22fd0d82383630d457f86869190a250506118696001600055565b50565b60606105ba60046139c7565b6002602081905260009182526040909120805460018201549282018054919360ff8082169461010090920416929091906118b190615303565b80601f01602080910402602001604051908101604052809291908181526020018280546118dd90615303565b801561192a5780601f106118ff5761010080835404028352916020019161192a565b820191906000526020600020905b81548152906001019060200180831161190d57829003601f168201915b505050506003830154600484015460058501805494956001600160a01b03909316949193509061195990615303565b80601f016020809104026020016040519081016040528092919081815260200182805461198590615303565b80156119d25780601f106119a7576101008083540402835291602001916119d2565b820191906000526020600020905b8154815290600101906020018083116119b557829003601f168201915b5050505050908060060180546119e790615303565b80601f0160208091040260200160405190810160405280929190818152602001828054611a1390615303565b8015611a605780601f10611a3557610100808354040283529160200191611a60565b820191906000526020600020905b815481529060010190602001808311611a4357829003601f168201915b505050505090806007015490806008015490806009015490508b565b6000611a866139d4565b611a908585613a2d565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b129190615398565b6001600160a01b03166313ea84a786866040518363ffffffff1660e01b8152600401611b3f9291906153b5565b602060405180830381865afa158015611b5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8091906153e4565b15611bcd5760405162461bcd60e51b815260206004820152601b60248201527f436f756e74727920697320616c7265616479206578636c75646564000000000060448201526064016109ef565b600085858585604051602001611be69493929190615585565b6040516020818303038152906040529050610a9b8160066000808a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8e018190048102820181019092528c815292508c91508b9081908401838280828437600092019190915250613c8b92505050565b600081815260026020908152604080832081516101608101835281548152600182015460ff8082161515958301959095528594919384019161010090910416600a811115611cc057611cc0614c0c565b600a811115611cd157611cd1614c0c565b8152602001600282018054611ce590615303565b80601f0160208091040260200160405190810160405280929190818152602001828054611d1190615303565b8015611d5e5780601f10611d3357610100808354040283529160200191611d5e565b820191906000526020600020905b815481529060010190602001808311611d4157829003601f168201915b505050918352505060038201546001600160a01b0316602082015260048201546040820152600582018054606090920191611d9890615303565b80601f0160208091040260200160405190810160405280929190818152602001828054611dc490615303565b8015611e115780601f10611de657610100808354040283529160200191611e11565b820191906000526020600020905b815481529060010190602001808311611df457829003601f168201915b50505050508152602001600682018054611e2a90615303565b80601f0160208091040260200160405190810160405280929190818152602001828054611e5690615303565b8015611ea35780601f10611e7857610100808354040283529160200191611ea3565b820191906000526020600020905b815481529060010190602001808311611e8657829003601f168201915b50505050508152602001600782015481526020016008820154815260200160098201548152505090508060200151611ede5750600092915050565b806101000151421015611ef45750600092915050565b806101400151611f03846105bf565b1015611f125750600092915050565b50600192915050565b60408051808201825260008082526020808301829052858252600981528382206001600160a01b0386168352905282902082518084019093528054919291829060ff166004811115611f6f57611f6f614c0c565b6004811115611f8057611f80614c0c565b815260200160018201548152505090505b92915050565b6000611fa16139d4565b6001600160a01b038516611ff75760405162461bcd60e51b815260206004820152601e60248201527f43616e6e6f742073656e64205a45524f20746f2061646472657373283029000060448201526064016109ef565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bc1b392d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612057573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207b9190615398565b6001600160a01b03166370a082317f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210b9190615398565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015612167573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218b91906154aa565b90506000606461219c8360056155d5565b6121a691906155ec565b90508086111561221e5760405162461bcd60e51b815260206004820152603660248201527f43616e6e6f742073656e64206d6f7265207468616e203525206f66207468652060448201527f44414f205a45524f20746f6b656e2062616c616e63650000000000000000000060648201526084016109ef565b600061222988614728565b6122328861465e565b87876040516020016122479493929190615627565b60405160208183030381529060405290506122ac8160038a8a604051806020016040528060008152508b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613c8b92505050565b93505050506108786001600055565b60006122c56139d4565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166390e439bc877f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633fc8cef36040518163ffffffff1660e01b8152600401602060405180830381865afa158015612353573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123779190615398565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bc1b392d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123f99190615398565b60405160e085901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b03938416600482015291831660248301529091166044820152606401602060405180830381865afa158015612465573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248991906153e4565b6124fb5760405162461bcd60e51b815260206004820152602860248201527f43616e206f6e6c7920756e77686974656c69737420612077686974656c69737460448201527f656420746f6b656e00000000000000000000000000000000000000000000000060648201526084016109ef565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633fc8cef36040518163ffffffff1660e01b8152600401602060405180830381865afa158015612559573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061257d9190615398565b6001600160a01b0316866001600160a01b0316036125dd5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f7420756e77686974656c697374205745544800000000000000000060448201526064016109ef565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633e413bee6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561263b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265f9190615398565b6001600160a01b0316866001600160a01b0316036126bf5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f7420756e77686974656c697374205553444300000000000000000060448201526064016109ef565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bc1b392d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561271d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127419190615398565b6001600160a01b0316866001600160a01b0316036127a15760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f7420756e77686974656c697374205a45524f00000000000000000060448201526064016109ef565b60006127ac87614728565b868686866040516020016127c4959493929190615692565b604051602081830303815290604052905061284e8160028960008a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8e018190048102820181019092528c815292508c91508b9081908401838280828437600092019190915250613c8b92505050565b91505061285b6001600055565b95945050505050565b60008281526008602052604081208183600481111561288557612885614c0c565b600481111561289657612896614c0c565b815260200190815260200160002054905092915050565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561290d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129319190615398565b6001600160a01b0316336001600160a01b0316146129b75760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c79207468652044414f2063616e20637265617465206120636f6e66697260448201527f6d6174696f6e2070726f706f73616c000000000000000000000000000000000060648201526084016109ef565b612a6289898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020601f8d018190048102820181019092528b81528e95508d94509192508b908b908190840183828082843760009201919091525050604080516020601f8d018190048102820181019092528b815292508b91508a9081908401838280828437600092019190915250613c8b92505050565b9998505050505050505050565b6000612a796139d4565b6001600160a01b038516612af55760405162461bcd60e51b815260206004820152602560248201527f436f6e747261637420616464726573732063616e6e6f7420626520616464726560448201527f737328302900000000000000000000000000000000000000000000000000000060648201526084016109ef565b6000612b0086614728565b612b098661465e565b8585604051602001612b1e94939291906156fa565b6040516020818303038152906040529050610a9b81600488886040518060200160405280600081525089898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613c8b92505050565b6000612b8d6139d4565b6040805160008152602081018083528151902091612baf918891889101615765565b6040516020818303038152906040528051906020012003612c125760405162461bcd60e51b815260206004820152601d60248201527f6e65775765627369746555524c2063616e6e6f7420626520656d70747900000060448201526064016109ef565b60005b84811015612d3b577f2d00000000000000000000000000000000000000000000000000000000000000868683818110612c5057612c50615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610158015612ce757507f7a00000000000000000000000000000000000000000000000000000000000000868683818110612cb857612cb8615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b612d335760405162461bcd60e51b815260206004820152601860248201527f496e76616c69642063686172616374657220696e2055524c000000000000000060448201526064016109ef565b600101612c15565b50600085858585604051602001612d5594939291906157a4565b6040516020818303038152906040529050610a9b8160086000808a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8e018190048102820181019092528c815292508c91508b9081908401838280828437600092019190915250613c8b92505050565b6000612de96139d4565b6001600160a01b038416612e655760405162461bcd60e51b815260206004820152602560248201527f50726f706f73656420616464726573732063616e6e6f7420626520616464726560448201527f737328302900000000000000000000000000000000000000000000000000000060648201526084016109ef565b6000612e7085614728565b8484604051602001612e84939291906157f4565b6040516020818303038152906040529050610b868160078760006040518060200160405280600081525089898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613c8b92505050565b6040517f12e8d5940000000000000000000000000000000000000000000000000000000081526000600482018190529081907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906312e8d59490602401602060405180830381865afa158015612f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f9191906154aa565b9050806000036130095760405162461bcd60e51b815260206004820152603560248201527f5a45524f20746f6b656e73207374616b65642063616e6e6f74206265207a657260448201527f6f20746f2064657465726d696e652071756f72756d000000000000000000000060648201526084016109ef565b600083600a81111561301d5761301d614c0c565b036130ce57620186a07f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663189bfaa76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a891906154aa565b6130b38360016155d5565b6130bd91906155d5565b6130c791906155ec565b915061323d565b600183600a8111156130e2576130e2614c0c565b14806130ff5750600283600a8111156130fd576130fd614c0c565b145b1561319557620186a07f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663189bfaa76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613166573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061318a91906154aa565b6130b38360026155d5565b620186a07f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663189bfaa76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321b91906154aa565b6132268360036155d5565b61323091906155d5565b61323a91906155ec565b91505b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bc1b392d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561329d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132c19190615398565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061332291906154aa565b905060006103e86133348360056155d5565b61333e91906155ec565b90508084101561334c578093505b505050919050565b600061335e6139d4565b6001600160a01b0386166133b45760405162461bcd60e51b815260206004820152601a60248201527f746f6b656e2063616e6e6f74206265206164647265737328302900000000000060448201526064016109ef565b6dffffffffffffffffffffffffffff8016866001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613403573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061342791906154aa565b1061349a5760405162461bcd60e51b815260206004820152602660248201527f546f6b656e20737570706c792063616e6e6f74206578636565642075696e743160448201527f31322e6d6178000000000000000000000000000000000000000000000000000060648201526084016109ef565b6012866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156134da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134fe9190615848565b60ff16111561354f5760405162461bcd60e51b815260206004820152601b60248201527f546f6b656e20646563696d616c206d6178696d756d206973203138000000000060448201526064016109ef565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316639d4f6d906040518163ffffffff1660e01b8152600401602060405180830381865afa1580156135ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135d191906154aa565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634a03895b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561362f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365391906154aa565b106136c65760405162461bcd60e51b815260206004820152603360248201527f4d6178696d756d206e756d626572206f662077686974656c697374656420706f60448201527f6f6c7320616c726561647920726561636865640000000000000000000000000060648201526084016109ef565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166390e439bc877f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633fc8cef36040518163ffffffff1660e01b8152600401602060405180830381865afa158015613754573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137789190615398565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663bc1b392d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156137d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137fa9190615398565b60405160e085901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b03938416600482015291831660248301529091166044820152606401602060405180830381865afa158015613866573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061388a91906153e4565b156138fd5760405162461bcd60e51b815260206004820152602660248201527f54686520746f6b656e2068617320616c7265616479206265656e20776869746560448201527f6c6973746564000000000000000000000000000000000000000000000000000060648201526084016109ef565b600061390887614728565b8686868660405160200161392095949392919061586b565b604051602081830303815290604052905060006139ac8260018a60008b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c9081908401838280828437600092019190915250613c8b92505050565b90506139b960068261473e565b5091505061285b6001600055565b60606000610b938361474a565b600260005403613a265760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109ef565b6002600055565b60028114613aa35760405162461bcd60e51b815260206004820152602860248201527f436f756e747279206d75737420626520616e2049534f203331363620416c706860448201527f612d3220436f646500000000000000000000000000000000000000000000000060648201526084016109ef565b7f41000000000000000000000000000000000000000000000000000000000000008282600081613ad557613ad5615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610158015613b6b57507f5a000000000000000000000000000000000000000000000000000000000000008282600081613b3c57613b3c615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b8015613bd557507f410000000000000000000000000000000000000000000000000000000000000082826001818110613ba657613ba6615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610155b8015613c3f57507f5a0000000000000000000000000000000000000000000000000000000000000082826001818110613c1057613c10615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b6115da5760405162461bcd60e51b815260206004820152601460248201527f496e76616c696420636f756e74727920636f646500000000000000000000000060448201526064016109ef565b60007f0000000000000000000000000000000000000000000000000000000000000000421015613d235760405162461bcd60e51b815260206004820152603d60248201527f43616e6e6f742070726f706f73652062616c6c6f74732077697468696e20746860448201527f652066697273742034352064617973206f66206465706c6f796d656e7400000060648201526084016109ef565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613da59190615398565b6001600160a01b0316336001600160a01b0316146140ff576040517f12e8d594000000000000000000000000000000000000000000000000000000008152600060048201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316906312e8d59490602401602060405180830381865afa158015613e3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e6291906154aa565b90506000620186a07f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663924c23356040518163ffffffff1660e01b8152600401602060405180830381865afa158015613ec8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613eec91906154aa565b613ef690846155d5565b613f0091906155ec565b905060008111613f525760405162461bcd60e51b815260206004820152601d60248201527f726571756972656456655a45524f2063616e6e6f74206265207a65726f00000060448201526064016109ef565b6040517f97146776000000000000000000000000000000000000000000000000000000008152336004820152600060248201819052907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690639714677690604401602060405180830381865afa158015613fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ffd91906154aa565b9050818110156140755760405162461bcd60e51b815260206004820152603760248201527f53656e64657220646f6573206e6f74206861766520656e6f7567682076655a4560448201527f524f20746f206d616b65207468652070726f706f73616c00000000000000000060648201526084016109ef565b336000908152600a602052604090205460ff16156140fb5760405162461bcd60e51b815260206004820152603160248201527f55736572732063616e206f6e6c792068617665206f6e6520616374697665207060448201527f726f706f73616c20617420612074696d6500000000000000000000000000000060648201526084016109ef565b5050505b60018760405161410f91906158d3565b9081526020016040518091039020546000146141935760405162461bcd60e51b815260206004820152603f60248201527f43616e6e6f742063726561746520612070726f706f73616c2073696d696c617260448201527f20746f20612062616c6c6f742074686174206973207374696c6c206f70656e0060648201526084016109ef565b6001876040516020016141a691906158ef565b60408051601f19818403018152908290526141c0916158d3565b90815260200160405180910390205460001461426a5760405162461bcd60e51b815260206004820152604360248201527f43616e6e6f742063726561746520612070726f706f73616c20666f722061206260448201527f616c6c6f7420776974682061207365636f6e6461727920636f6e6669726d617460648201527f696f6e0000000000000000000000000000000000000000000000000000000000608482015260a4016109ef565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316634fa1acb36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142ee91906154aa565b6142f89042615385565b905060007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166336b5a6c66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561435a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061437e91906154aa565b6143889042615385565b60038054919250600061439a83615934565b91905055925060006143ab89612eea565b60408051610160810182528681526001602082015291925081018a600a8111156143d7576143d7614c0c565b815260208082018d90526001600160a01b038b16604080840191909152606083018b9052608083018a905260a0830189905260c0830187905260e0830186905261010092830185905260008881526002835281902084518155918401516001830180549115157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083168117825592860151939490927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216919091179083600a8111156144c9576144c9614c0c565b0217905550606082015160028201906144e290826159bd565b5060808201516003820180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0390921691909117905560a0820151600482015560c0820151600582019061453f90826159bd565b5060e0820151600682019061455490826159bd565b506101008201518160070155610120820151816008015561014082015181600901559050508360018b60405161458a91906158d3565b908152604051908190036020019020556145a560048561473e565b50336000818152600a6020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055878352600b9091529081902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169092179091555184907f2d6a2a1a504050a1fa6107e44f49971fd89dbe544b433d65f1c572ce5fa3b7d190614649908c908e90615ab9565b60405180910390a25050509695505050505050565b6060600061466b836147a6565b600101905060008167ffffffffffffffff81111561468b5761468b615056565b6040519080825280601f01601f1916602001820160405280156146b5576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846146bf57509392505050565b6000610b938383614888565b6060611f916001600160a01b038316601461497b565b6000610b938383614ba4565b60608160000180548060200260200160405190810160405280929190818152602001828054801561479a57602002820191906000526020600020905b815481526020019060010190808311614786575b50505050509050919050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106147ef577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831061481b576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061483957662386f26fc10000830492506010015b6305f5e1008310614851576305f5e100830492506008015b612710831061486557612710830492506004015b60648310614877576064830492506002015b600a8310611f915760010192915050565b600081815260018301602052604081205480156149715760006148ac6001836154c3565b85549091506000906148c0906001906154c3565b90508181146149255760008660000182815481106148e0576148e0615775565b906000526020600020015490508087600001848154811061490357614903615775565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061493657614936615ad9565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f91565b6000915050611f91565b6060600061498a8360026155d5565b614995906002615385565b67ffffffffffffffff8111156149ad576149ad615056565b6040519080825280601f01601f1916602001820160405280156149d7576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110614a0e57614a0e615775565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110614a7157614a71615775565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000614aad8460026155d5565b614ab8906001615385565b90505b6001811115614b55577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110614af957614af9615775565b1a60f81b828281518110614b0f57614b0f615775565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93614b4e81615b08565b9050614abb565b508315610b935760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109ef565b6000818152600183016020526040812054614beb57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611f91565b506000611f91565b600060208284031215614c0557600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60058110614c4b57614c4b614c0c565b9052565b60208101611f918284614c3b565b6020808252825182820181905260009190848201906040850190845b81811015614c9557835183529284019291840191600101614c79565b50909695505050505050565b60008083601f840112614cb357600080fd5b50813567ffffffffffffffff811115614ccb57600080fd5b602083019150836020828501011115614ce357600080fd5b9250929050565b60008060008060408587031215614d0057600080fd5b843567ffffffffffffffff80821115614d1857600080fd5b614d2488838901614ca1565b90965094506020870135915080821115614d3d57600080fd5b50614d4a87828801614ca1565b95989497509550505050565b600080600060408486031215614d6b57600080fd5b83359250602084013567ffffffffffffffff811115614d8957600080fd5b614d9586828701614ca1565b9497909650939450505050565b600b8110614c4b57614c4b614c0c565b60005b83811015614dcd578181015183820152602001614db5565b50506000910152565b60008151808452614dee816020860160208601614db2565b601f01601f19169290920160200192915050565b602081528151602082015260006020830151614e22604084018215159052565b506040830151614e356060840182614da2565b506060830151610160806080850152614e52610180850183614dd6565b91506080850151614e6e60a08601826001600160a01b03169052565b5060a085015160c085015260c0850151601f19808685030160e0870152614e958483614dd6565b935060e08701519150610100818786030181880152614eb48584614dd6565b90880151610120888101919091528801516101408089019190915290970151929095019190915250929392505050565b60008060408385031215614ef757600080fd5b82359150602083013560058110614f0d57600080fd5b809150509250929050565b60006101608d83528c15156020840152614f35604084018d614da2565b806060840152614f478184018c614dd6565b90506001600160a01b038a1660808401528860a084015282810360c0840152614f708189614dd6565b905082810360e0840152614f848188614dd6565b61010084019690965250506101208101929092526101409091015298975050505050505050565b6001600160a01b038116811461186957600080fd5b60008060408385031215614fd357600080fd5b823591506020830135614f0d81614fab565b6000604082019050614ff8828451614c3b565b602092830151919092015290565b6000806000806060858703121561501c57600080fd5b843561502781614fab565b935060208501359250604085013567ffffffffffffffff81111561504a57600080fd5b614d4a87828801614ca1565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561509757600080fd5b813567ffffffffffffffff808211156150af57600080fd5b818401915084601f8301126150c357600080fd5b8135818111156150d5576150d5615056565b604051601f8201601f19908116603f011681019083821181831017156150fd576150fd615056565b8160405282815287602084870101111561511657600080fd5b826020860160208301376000928101602001929092525095945050505050565b60008060008060006060868803121561514e57600080fd5b853561515981614fab565b9450602086013567ffffffffffffffff8082111561517657600080fd5b61518289838a01614ca1565b9096509450604088013591508082111561519b57600080fd5b506151a888828901614ca1565b969995985093965092949392505050565b8035600b81106151c857600080fd5b919050565b60008060008060008060008060a0898b0312156151e957600080fd5b883567ffffffffffffffff8082111561520157600080fd5b61520d8c838d01614ca1565b909a50985088915061522160208c016151b9565b975060408b0135915061523382614fab565b90955060608a0135908082111561524957600080fd5b6152558c838d01614ca1565b909650945060808b013591508082111561526e57600080fd5b5061527b8b828c01614ca1565b999c989b5096995094979396929594505050565b6000806000604084860312156152a457600080fd5b83356152af81614fab565b9250602084013567ffffffffffffffff811115614d8957600080fd5b6000602082840312156152dd57600080fd5b8135610b9381614fab565b6000602082840312156152fa57600080fd5b610b93826151b9565b600181811c9082168061531757607f821691505b602082108103615350577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115611f9157611f91615356565b6000602082840312156153aa57600080fd5b8151610b9381614fab565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b6000602082840312156153f657600080fd5b81518015158114610b9357600080fd5b7f696e636c7564653a000000000000000000000000000000000000000000000000815283856008830137600084820160088101600081528486823750600093016008019283525090949350505050565b7f706172616d657465723a0000000000000000000000000000000000000000000081526000845161548e81600a850160208901614db2565b82018385600a83013760009301600a0192835250909392505050565b6000602082840312156154bc57600080fd5b5051919050565b81810381811115611f9157611f91615356565b604081016154e48285614c3b565b8260208301529392505050565b60008083546154ff81615303565b60018281168015615517576001811461554a57615579565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0084168752821515830287019450615579565b8760005260208060002060005b858110156155705781548a820152908401908201615557565b50505082870194505b50929695505050505050565b7f6578636c7564653a000000000000000000000000000000000000000000000000815283856008830137600084820160088101600081528486823750600093016008019283525090949350505050565b8082028115828204841417611f9157611f91615356565b600082615622577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f73656e645a45524f3a000000000000000000000000000000000000000000000081526000855161565f816009850160208a01614db2565b855190830190615676816009840160208a01614db2565b0183856009830137600093016009019283525090949350505050565b7f756e77686974656c6973743a00000000000000000000000000000000000000008152600086516156ca81600c850160208b01614db2565b82018587600c8301378581019050600c810160008152848682375060009301600c01928352509095945050505050565b7f63616c6c436f6e74726163743a0000000000000000000000000000000000000081526000855161573281600d850160208a01614db2565b85519083019061574981600d840160208a01614db2565b018385600d83013760009301600d019283525090949350505050565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f73657455524c3a00000000000000000000000000000000000000000000000000815283856007830137600084820160078101600081528486823750600093016007019283525090949350505050565b7f7365744163636573734d616e616765723a00000000000000000000000000000081526000845161582c816011850160208901614db2565b8201838560118301376000930160110192835250909392505050565b60006020828403121561585a57600080fd5b815160ff81168114610b9357600080fd5b7f77686974656c6973743a000000000000000000000000000000000000000000008152600086516158a381600a850160208b01614db2565b82018587600a8301378581019050600a810160008152848682375060009301600a01928352509095945050505050565b600082516158e5818460208701614db2565b9190910192915050565b7f636f6e6669726d5f000000000000000000000000000000000000000000000000815260008251615927816008850160208701614db2565b9190910160080192915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361596557615965615356565b5060010190565b601f8211156159b8576000816000526020600020601f850160051c810160208610156159955750805b601f850160051c820191505b818110156159b4578281556001016159a1565b5050505b505050565b815167ffffffffffffffff8111156159d7576159d7615056565b6159eb816159e58454615303565b8461596c565b602080601f831160018114615a3e5760008415615a085750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556159b4565b600085815260208120601f198616915b82811015615a6d57888601518255948401946001909101908401615a4e565b5085821015615aa957878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b615ac38184614da2565b6040602082015260006108786040830184614dd6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600081615b1757615b17615356565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea2646970667358221220c33f37718d5f59711bdc40e18293f589b645a9084ec4cbc963de800115bce7bf64736f6c6343000816003300000000000000000000000010d0c7fbd6178e204481f2241b930eea6fe2d0c9000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd90000000000000000000000000ac992636f863504039a028a6e9a2c192529c4870000000000000000000000002a2bc9fdf452f7ba7e33b8d5db3955a6d6cdf335
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c806369907b751161010f578063d095a4d5116100a2578063e671f77711610071578063e671f777146104c2578063ebf2e8bd146104ee578063f26c5f5614610501578063fa05dd001461051457600080fd5b8063d095a4d514610476578063d8782dae14610489578063e2fb7e091461049c578063e646fd66146104af57600080fd5b80639d219f8f116100de5780639d219f8f14610412578063ac4236ae14610425578063b43f4e1014610450578063cae26e5d1461046357600080fd5b806369907b751461038757806384526cec1461039a578063880d266c146103df5780639534c9f3146103f257600080fd5b806345074887116101875780635678138811610156578063567813881461032d578063568d86d7146103425780635c4db523146103555780635c632b381461035d57600080fd5b806345074887146102b75780634cf088d9146102d75780634e86351b146102fe57806352c19b5a1461030657600080fd5b80632bd32564116101c35780632bd3256414610269578063312aab9e1461027e5780633b958e2f146102915780633c2edb39146102a457600080fd5b80630bb44e76146101ea5780630bc88fed146102135780630e2789bb1461022a575b600080fd5b6101fd6101f8366004614bf3565b61053b565b60405161020a9190614c4f565b60405180910390f35b61021c60035481565b60405190815260200161020a565b6102517f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd981565b6040516001600160a01b03909116815260200161020a565b6102716105ae565b60405161020a9190614c5d565b61021c61028c366004614bf3565b6105bf565b61021c61029f366004614cea565b6108a3565b61021c6102b2366004614d56565b610aa8565b6102ca6102c5366004614bf3565b610b9a565b60405161020a9190614e02565b6102517f00000000000000000000000010d0c7fbd6178e204481f2241b930eea6fe2d0c981565b61021c600081565b6102517f0000000000000000000000000ac992636f863504039a028a6e9a2c192529c48781565b61034061033b366004614ee4565b610e63565b005b610340610350366004614bf3565b6115de565b61027161186c565b61037061036b366004614bf3565b611878565b60405161020a9b9a99989796959493929190614f18565b61021c610395366004614cea565b611a7c565b6103cf6103a8366004614bf3565b60009081526008602090815260408083206004845290915280822054600383529120541190565b604051901515815260200161020a565b6103cf6103ed366004614bf3565b611c70565b610405610400366004614fc0565b611f1b565b60405161020a9190614fe5565b61021c610420366004615006565b611f97565b61021c610433366004615085565b805160208183018101805160018252928201919093012091525481565b61021c61045e366004615136565b6122bb565b61021c610471366004614ee4565b612864565b61021c6104843660046151cd565b6128ad565b61021c610497366004615006565b612a6f565b61021c6104aa366004614cea565b612b83565b61021c6104bd36600461528f565b612ddf565b6103cf6104d03660046152cb565b6001600160a01b03166000908152600a602052604090205460ff1690565b61021c6104fc3660046152e8565b612eea565b61021c61050f366004615136565b613354565b6102517f0000000000000000000000002a2bc9fdf452f7ba7e33b8d5db3955a6d6cdf33581565b60008181526008602090815260408083208380529182905280832054600184528184205460028552918420549091908183111561058657808311156105865750600095945050505050565b828211156105a257808211156105a25750600195945050505050565b50600295945050505050565b60606105ba60066139c7565b905090565b60008181526008602090815260408083206002835281842082516101608101845281548152600182015460ff80821615159683019690965292948694919391840191610100900416600a81111561061857610618614c0c565b600a81111561062957610629614c0c565b815260200160028201805461063d90615303565b80601f016020809104026020016040519081016040528092919081815260200182805461066990615303565b80156106b65780601f1061068b576101008083540402835291602001916106b6565b820191906000526020600020905b81548152906001019060200180831161069957829003601f168201915b505050918352505060038201546001600160a01b03166020820152600482015460408201526005820180546060909201916106f090615303565b80601f016020809104026020016040519081016040528092919081815260200182805461071c90615303565b80156107695780601f1061073e57610100808354040283529160200191610769565b820191906000526020600020905b81548152906001019060200180831161074c57829003601f168201915b5050505050815260200160068201805461078290615303565b80601f01602080910402602001604051908101604052809291908181526020018280546107ae90615303565b80156107fb5780601f106107d0576101008083540402835291602001916107fb565b820191906000526020600020905b8154815290600101906020018083116107de57829003601f168201915b50505091835250506007820154602082015260088201546040820152600990910154606090910152905060008160400151600a81111561083d5761083d614c0c565b03610880576002600090815260208390526040808220546001835281832054838052919092205461086e9190615385565b6108789190615385565b949350505050565b600460009081526020839052604080822054600383529120546108789190615385565b60006108ad6139d4565b6108b78585613a2d565b7f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610915573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109399190615398565b6001600160a01b03166313ea84a786866040518363ffffffff1660e01b81526004016109669291906153b5565b602060405180830381865afa158015610983573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a791906153e4565b6109f85760405162461bcd60e51b815260206004820152601760248201527f436f756e747279206973206e6f74206578636c7564656400000000000000000060448201526064015b60405180910390fd5b600085858585604051602001610a119493929190615406565b6040516020818303038152906040529050610a9b8160056000808a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8e018190048102820181019092528c815292508c91508b9081908401838280828437600092019190915250613c8b92505050565b9150506108786001600055565b6000610ab26139d4565b60108410610b025760405162461bcd60e51b815260206004820152601560248201527f496e76616c696420706172616d6574657254797065000000000000000000000060448201526064016109ef565b6000610b0d8561465e565b8484604051602001610b2193929190615456565b6040516020818303038152906040529050610b8681600080886040518060200160405280600081525089898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613c8b92505050565b915050610b936001600055565b9392505050565b610c006040805161016081018252600080825260208201819052909182019081526020016060815260200160006001600160a01b031681526020016000815260200160608152602001606081526020016000815260200160008152602001600081525090565b60008281526002602090815260409182902082516101608101845281548152600182015460ff808216151594830194909452909391929184019161010090910416600a811115610c5257610c52614c0c565b600a811115610c6357610c63614c0c565b8152602001600282018054610c7790615303565b80601f0160208091040260200160405190810160405280929190818152602001828054610ca390615303565b8015610cf05780601f10610cc557610100808354040283529160200191610cf0565b820191906000526020600020905b815481529060010190602001808311610cd357829003601f168201915b505050918352505060038201546001600160a01b0316602082015260048201546040820152600582018054606090920191610d2a90615303565b80601f0160208091040260200160405190810160405280929190818152602001828054610d5690615303565b8015610da35780601f10610d7857610100808354040283529160200191610da3565b820191906000526020600020905b815481529060010190602001808311610d8657829003601f168201915b50505050508152602001600682018054610dbc90615303565b80601f0160208091040260200160405190810160405280929190818152602001828054610de890615303565b8015610e355780601f10610e0a57610100808354040283529160200191610e35565b820191906000526020600020905b815481529060010190602001808311610e1857829003601f168201915b5050505050815260200160078201548152602001600882015481526020016009820154815250509050919050565b610e6b6139d4565b600082815260026020908152604080832081516101608101835281548152600182015460ff8082161515958301959095529093919284019161010090910416600a811115610ebb57610ebb614c0c565b600a811115610ecc57610ecc614c0c565b8152602001600282018054610ee090615303565b80601f0160208091040260200160405190810160405280929190818152602001828054610f0c90615303565b8015610f595780601f10610f2e57610100808354040283529160200191610f59565b820191906000526020600020905b815481529060010190602001808311610f3c57829003601f168201915b505050918352505060038201546001600160a01b0316602082015260048201546040820152600582018054606090920191610f9390615303565b80601f0160208091040260200160405190810160405280929190818152602001828054610fbf90615303565b801561100c5780601f10610fe15761010080835404028352916020019161100c565b820191906000526020600020905b815481529060010190602001808311610fef57829003601f168201915b5050505050815260200160068201805461102590615303565b80601f016020809104026020016040519081016040528092919081815260200182805461105190615303565b801561109e5780601f106110735761010080835404028352916020019161109e565b820191906000526020600020905b81548152906001019060200180831161108157829003601f168201915b5050505050815260200160078201548152602001600882015481526020016009820154815250509050806020015161113e5760405162461bcd60e51b815260206004820152602b60248201527f546865207370656369666965642062616c6c6f74206973206e6f74206f70656e60448201527f20666f7220766f74696e6700000000000000000000000000000000000000000060648201526084016109ef565b60008160400151600a81111561115657611156614c0c565b0361121f57600082600481111561116f5761116f614c0c565b148061118c5750600182600481111561118a5761118a614c0c565b145b806111a8575060028260048111156111a6576111a6614c0c565b145b61121a5760405162461bcd60e51b815260206004820152602560248201527f496e76616c696420566f74655479706520666f7220506172616d65746572204260448201527f616c6c6f7400000000000000000000000000000000000000000000000000000060648201526084016109ef565b6112c1565b600382600481111561123357611233614c0c565b14806112505750600482600481111561124e5761124e614c0c565b145b6112c15760405162461bcd60e51b8152602060048201526024808201527f496e76616c696420566f74655479706520666f7220417070726f76616c20426160448201527f6c6c6f740000000000000000000000000000000000000000000000000000000060648201526084016109ef565b6040517f97146776000000000000000000000000000000000000000000000000000000008152336004820152600060248201819052907f00000000000000000000000010d0c7fbd6178e204481f2241b930eea6fe2d0c96001600160a01b031690639714677690604401602060405180830381865afa158015611348573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136c91906154aa565b9050600081116113e45760405162461bcd60e51b815260206004820152602760248201527f5374616b6564205a45524f20746f6b656e73206172652072657175697265642060448201527f746f20766f74650000000000000000000000000000000000000000000000000060648201526084016109ef565b600084815260096020908152604080832033845290915280822081518083019092528054829060ff16600481111561141e5761141e614c0c565b600481111561142f5761142f614c0c565b815260019190910154602091820152810151909150156114a8576020808201516000878152600890925260408220835191929091600481111561147457611474614c0c565b600481111561148557611485614c0c565b815260200190815260200160002060008282546114a291906154c3565b90915550505b600085815260086020526040812083918660048111156114ca576114ca614c0c565b60048111156114db576114db614c0c565b815260200190815260200160002060008282546114f89190615385565b92505081905550604051806040016040528085600481111561151c5761151c614c0c565b815260209081018490526000878152600982526040808220338352909252208151815482907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016600183600481111561157757611577614c0c565b02179055506020820151816001015590505084336001600160a01b03167f2c9deb38f462962eadbd85a9d3a4120503ee091f1582eaaa10aa8c6797651d2986856040516115c59291906154d6565b60405180910390a35050506115da6001600055565b5050565b6115e66139d4565b7f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611644573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116689190615398565b6001600160a01b0316336001600160a01b0316146116ee5760405162461bcd60e51b815260206004820152602b60248201527f4f6e6c79207468652044414f2063616e206d61726b20612062616c6c6f74206160448201527f732066696e616c697a656400000000000000000000000000000000000000000060648201526084016109ef565b6000818152600260205260409020600181015460ff166117765760405162461bcd60e51b815260206004820152602560248201527f5468652062616c6c6f742068617320616c7265616479206265656e2066696e6160448201527f6c697a656400000000000000000000000000000000000000000000000000000060648201526084016109ef565b600180820154610100900460ff16600a81111561179557611795614c0c565b036117a7576117a560068361471c565b505b6117b260048361471c565b50600180820180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff009081169091556000848152600b60209081526040808320546001600160a01b0316808452600a909252918290208054909316909255519091906118229060028501906154f1565b90815260405190819003602001812060009081905584917fd470bb0d3dcb39ff5a62757e0a1cdfe60f8200eba22fd0d82383630d457f86869190a250506118696001600055565b50565b60606105ba60046139c7565b6002602081905260009182526040909120805460018201549282018054919360ff8082169461010090920416929091906118b190615303565b80601f01602080910402602001604051908101604052809291908181526020018280546118dd90615303565b801561192a5780601f106118ff5761010080835404028352916020019161192a565b820191906000526020600020905b81548152906001019060200180831161190d57829003601f168201915b505050506003830154600484015460058501805494956001600160a01b03909316949193509061195990615303565b80601f016020809104026020016040519081016040528092919081815260200182805461198590615303565b80156119d25780601f106119a7576101008083540402835291602001916119d2565b820191906000526020600020905b8154815290600101906020018083116119b557829003601f168201915b5050505050908060060180546119e790615303565b80601f0160208091040260200160405190810160405280929190818152602001828054611a1390615303565b8015611a605780601f10611a3557610100808354040283529160200191611a60565b820191906000526020600020905b815481529060010190602001808311611a4357829003601f168201915b505050505090806007015490806008015490806009015490508b565b6000611a866139d4565b611a908585613a2d565b7f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611aee573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b129190615398565b6001600160a01b03166313ea84a786866040518363ffffffff1660e01b8152600401611b3f9291906153b5565b602060405180830381865afa158015611b5c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b8091906153e4565b15611bcd5760405162461bcd60e51b815260206004820152601b60248201527f436f756e74727920697320616c7265616479206578636c75646564000000000060448201526064016109ef565b600085858585604051602001611be69493929190615585565b6040516020818303038152906040529050610a9b8160066000808a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8e018190048102820181019092528c815292508c91508b9081908401838280828437600092019190915250613c8b92505050565b600081815260026020908152604080832081516101608101835281548152600182015460ff8082161515958301959095528594919384019161010090910416600a811115611cc057611cc0614c0c565b600a811115611cd157611cd1614c0c565b8152602001600282018054611ce590615303565b80601f0160208091040260200160405190810160405280929190818152602001828054611d1190615303565b8015611d5e5780601f10611d3357610100808354040283529160200191611d5e565b820191906000526020600020905b815481529060010190602001808311611d4157829003601f168201915b505050918352505060038201546001600160a01b0316602082015260048201546040820152600582018054606090920191611d9890615303565b80601f0160208091040260200160405190810160405280929190818152602001828054611dc490615303565b8015611e115780601f10611de657610100808354040283529160200191611e11565b820191906000526020600020905b815481529060010190602001808311611df457829003601f168201915b50505050508152602001600682018054611e2a90615303565b80601f0160208091040260200160405190810160405280929190818152602001828054611e5690615303565b8015611ea35780601f10611e7857610100808354040283529160200191611ea3565b820191906000526020600020905b815481529060010190602001808311611e8657829003601f168201915b50505050508152602001600782015481526020016008820154815260200160098201548152505090508060200151611ede5750600092915050565b806101000151421015611ef45750600092915050565b806101400151611f03846105bf565b1015611f125750600092915050565b50600192915050565b60408051808201825260008082526020808301829052858252600981528382206001600160a01b0386168352905282902082518084019093528054919291829060ff166004811115611f6f57611f6f614c0c565b6004811115611f8057611f80614c0c565b815260200160018201548152505090505b92915050565b6000611fa16139d4565b6001600160a01b038516611ff75760405162461bcd60e51b815260206004820152601e60248201527f43616e6e6f742073656e64205a45524f20746f2061646472657373283029000060448201526064016109ef565b60007f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b031663bc1b392d6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612057573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061207b9190615398565b6001600160a01b03166370a082317f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156120e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210b9190615398565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b1681526001600160a01b039091166004820152602401602060405180830381865afa158015612167573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061218b91906154aa565b90506000606461219c8360056155d5565b6121a691906155ec565b90508086111561221e5760405162461bcd60e51b815260206004820152603660248201527f43616e6e6f742073656e64206d6f7265207468616e203525206f66207468652060448201527f44414f205a45524f20746f6b656e2062616c616e63650000000000000000000060648201526084016109ef565b600061222988614728565b6122328861465e565b87876040516020016122479493929190615627565b60405160208183030381529060405290506122ac8160038a8a604051806020016040528060008152508b8b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613c8b92505050565b93505050506108786001600055565b60006122c56139d4565b7f0000000000000000000000000ac992636f863504039a028a6e9a2c192529c4876001600160a01b03166390e439bc877f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b0316633fc8cef36040518163ffffffff1660e01b8152600401602060405180830381865afa158015612353573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123779190615398565b7f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b031663bc1b392d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156123d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123f99190615398565b60405160e085901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b03938416600482015291831660248301529091166044820152606401602060405180830381865afa158015612465573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248991906153e4565b6124fb5760405162461bcd60e51b815260206004820152602860248201527f43616e206f6e6c7920756e77686974656c69737420612077686974656c69737460448201527f656420746f6b656e00000000000000000000000000000000000000000000000060648201526084016109ef565b7f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b0316633fc8cef36040518163ffffffff1660e01b8152600401602060405180830381865afa158015612559573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061257d9190615398565b6001600160a01b0316866001600160a01b0316036125dd5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f7420756e77686974656c697374205745544800000000000000000060448201526064016109ef565b7f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b0316633e413bee6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561263b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061265f9190615398565b6001600160a01b0316866001600160a01b0316036126bf5760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f7420756e77686974656c697374205553444300000000000000000060448201526064016109ef565b7f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b031663bc1b392d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561271d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127419190615398565b6001600160a01b0316866001600160a01b0316036127a15760405162461bcd60e51b815260206004820152601760248201527f43616e6e6f7420756e77686974656c697374205a45524f00000000000000000060448201526064016109ef565b60006127ac87614728565b868686866040516020016127c4959493929190615692565b604051602081830303815290604052905061284e8160028960008a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8e018190048102820181019092528c815292508c91508b9081908401838280828437600092019190915250613c8b92505050565b91505061285b6001600055565b95945050505050565b60008281526008602052604081208183600481111561288557612885614c0c565b600481111561289657612896614c0c565b815260200190815260200160002054905092915050565b60007f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561290d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129319190615398565b6001600160a01b0316336001600160a01b0316146129b75760405162461bcd60e51b815260206004820152602f60248201527f4f6e6c79207468652044414f2063616e20637265617465206120636f6e66697260448201527f6d6174696f6e2070726f706f73616c000000000000000000000000000000000060648201526084016109ef565b612a6289898080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920182905250604080516020601f8d018190048102820181019092528b81528e95508d94509192508b908b908190840183828082843760009201919091525050604080516020601f8d018190048102820181019092528b815292508b91508a9081908401838280828437600092019190915250613c8b92505050565b9998505050505050505050565b6000612a796139d4565b6001600160a01b038516612af55760405162461bcd60e51b815260206004820152602560248201527f436f6e747261637420616464726573732063616e6e6f7420626520616464726560448201527f737328302900000000000000000000000000000000000000000000000000000060648201526084016109ef565b6000612b0086614728565b612b098661465e565b8585604051602001612b1e94939291906156fa565b6040516020818303038152906040529050610a9b81600488886040518060200160405280600081525089898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613c8b92505050565b6000612b8d6139d4565b6040805160008152602081018083528151902091612baf918891889101615765565b6040516020818303038152906040528051906020012003612c125760405162461bcd60e51b815260206004820152601d60248201527f6e65775765627369746555524c2063616e6e6f7420626520656d70747900000060448201526064016109ef565b60005b84811015612d3b577f2d00000000000000000000000000000000000000000000000000000000000000868683818110612c5057612c50615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610158015612ce757507f7a00000000000000000000000000000000000000000000000000000000000000868683818110612cb857612cb8615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b612d335760405162461bcd60e51b815260206004820152601860248201527f496e76616c69642063686172616374657220696e2055524c000000000000000060448201526064016109ef565b600101612c15565b50600085858585604051602001612d5594939291906157a4565b6040516020818303038152906040529050610a9b8160086000808a8a8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8e018190048102820181019092528c815292508c91508b9081908401838280828437600092019190915250613c8b92505050565b6000612de96139d4565b6001600160a01b038416612e655760405162461bcd60e51b815260206004820152602560248201527f50726f706f73656420616464726573732063616e6e6f7420626520616464726560448201527f737328302900000000000000000000000000000000000000000000000000000060648201526084016109ef565b6000612e7085614728565b8484604051602001612e84939291906157f4565b6040516020818303038152906040529050610b868160078760006040518060200160405280600081525089898080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250613c8b92505050565b6040517f12e8d5940000000000000000000000000000000000000000000000000000000081526000600482018190529081907f00000000000000000000000010d0c7fbd6178e204481f2241b930eea6fe2d0c96001600160a01b0316906312e8d59490602401602060405180830381865afa158015612f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f9191906154aa565b9050806000036130095760405162461bcd60e51b815260206004820152603560248201527f5a45524f20746f6b656e73207374616b65642063616e6e6f74206265207a657260448201527f6f20746f2064657465726d696e652071756f72756d000000000000000000000060648201526084016109ef565b600083600a81111561301d5761301d614c0c565b036130ce57620186a07f0000000000000000000000002a2bc9fdf452f7ba7e33b8d5db3955a6d6cdf3356001600160a01b031663189bfaa76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906130a891906154aa565b6130b38360016155d5565b6130bd91906155d5565b6130c791906155ec565b915061323d565b600183600a8111156130e2576130e2614c0c565b14806130ff5750600283600a8111156130fd576130fd614c0c565b145b1561319557620186a07f0000000000000000000000002a2bc9fdf452f7ba7e33b8d5db3955a6d6cdf3356001600160a01b031663189bfaa76040518163ffffffff1660e01b8152600401602060405180830381865afa158015613166573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061318a91906154aa565b6130b38360026155d5565b620186a07f0000000000000000000000002a2bc9fdf452f7ba7e33b8d5db3955a6d6cdf3356001600160a01b031663189bfaa76040518163ffffffff1660e01b8152600401602060405180830381865afa1580156131f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061321b91906154aa565b6132268360036155d5565b61323091906155d5565b61323a91906155ec565b91505b60007f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b031663bc1b392d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561329d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906132c19190615398565b6001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156132fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061332291906154aa565b905060006103e86133348360056155d5565b61333e91906155ec565b90508084101561334c578093505b505050919050565b600061335e6139d4565b6001600160a01b0386166133b45760405162461bcd60e51b815260206004820152601a60248201527f746f6b656e2063616e6e6f74206265206164647265737328302900000000000060448201526064016109ef565b6dffffffffffffffffffffffffffff8016866001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613403573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061342791906154aa565b1061349a5760405162461bcd60e51b815260206004820152602660248201527f546f6b656e20737570706c792063616e6e6f74206578636565642075696e743160448201527f31322e6d6178000000000000000000000000000000000000000000000000000060648201526084016109ef565b6012866001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa1580156134da573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906134fe9190615848565b60ff16111561354f5760405162461bcd60e51b815260206004820152601b60248201527f546f6b656e20646563696d616c206d6178696d756d206973203138000000000060448201526064016109ef565b7f0000000000000000000000000ac992636f863504039a028a6e9a2c192529c4876001600160a01b0316639d4f6d906040518163ffffffff1660e01b8152600401602060405180830381865afa1580156135ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906135d191906154aa565b7f0000000000000000000000000ac992636f863504039a028a6e9a2c192529c4876001600160a01b0316634a03895b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561362f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061365391906154aa565b106136c65760405162461bcd60e51b815260206004820152603360248201527f4d6178696d756d206e756d626572206f662077686974656c697374656420706f60448201527f6f6c7320616c726561647920726561636865640000000000000000000000000060648201526084016109ef565b7f0000000000000000000000000ac992636f863504039a028a6e9a2c192529c4876001600160a01b03166390e439bc877f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b0316633fc8cef36040518163ffffffff1660e01b8152600401602060405180830381865afa158015613754573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137789190615398565b7f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b031663bc1b392d6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156137d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906137fa9190615398565b60405160e085901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b03938416600482015291831660248301529091166044820152606401602060405180830381865afa158015613866573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061388a91906153e4565b156138fd5760405162461bcd60e51b815260206004820152602660248201527f54686520746f6b656e2068617320616c7265616479206265656e20776869746560448201527f6c6973746564000000000000000000000000000000000000000000000000000060648201526084016109ef565b600061390887614728565b8686868660405160200161392095949392919061586b565b604051602081830303815290604052905060006139ac8260018a60008b8b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525050604080516020601f8f018190048102820181019092528d815292508d91508c9081908401838280828437600092019190915250613c8b92505050565b90506139b960068261473e565b5091505061285b6001600055565b60606000610b938361474a565b600260005403613a265760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016109ef565b6002600055565b60028114613aa35760405162461bcd60e51b815260206004820152602860248201527f436f756e747279206d75737420626520616e2049534f203331363620416c706860448201527f612d3220436f646500000000000000000000000000000000000000000000000060648201526084016109ef565b7f41000000000000000000000000000000000000000000000000000000000000008282600081613ad557613ad5615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610158015613b6b57507f5a000000000000000000000000000000000000000000000000000000000000008282600081613b3c57613b3c615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b8015613bd557507f410000000000000000000000000000000000000000000000000000000000000082826001818110613ba657613ba6615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191610155b8015613c3f57507f5a0000000000000000000000000000000000000000000000000000000000000082826001818110613c1057613c10615775565b9050013560f81c60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191611155b6115da5760405162461bcd60e51b815260206004820152601460248201527f496e76616c696420636f756e74727920636f646500000000000000000000000060448201526064016109ef565b60007f0000000000000000000000000000000000000000000000000000000066b7f0b4421015613d235760405162461bcd60e51b815260206004820152603d60248201527f43616e6e6f742070726f706f73652062616c6c6f74732077697468696e20746860448201527f652066697273742034352064617973206f66206465706c6f796d656e7400000060648201526084016109ef565b7f000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd96001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015613d81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613da59190615398565b6001600160a01b0316336001600160a01b0316146140ff576040517f12e8d594000000000000000000000000000000000000000000000000000000008152600060048201819052907f00000000000000000000000010d0c7fbd6178e204481f2241b930eea6fe2d0c96001600160a01b0316906312e8d59490602401602060405180830381865afa158015613e3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613e6291906154aa565b90506000620186a07f0000000000000000000000002a2bc9fdf452f7ba7e33b8d5db3955a6d6cdf3356001600160a01b031663924c23356040518163ffffffff1660e01b8152600401602060405180830381865afa158015613ec8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613eec91906154aa565b613ef690846155d5565b613f0091906155ec565b905060008111613f525760405162461bcd60e51b815260206004820152601d60248201527f726571756972656456655a45524f2063616e6e6f74206265207a65726f00000060448201526064016109ef565b6040517f97146776000000000000000000000000000000000000000000000000000000008152336004820152600060248201819052907f00000000000000000000000010d0c7fbd6178e204481f2241b930eea6fe2d0c96001600160a01b031690639714677690604401602060405180830381865afa158015613fd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613ffd91906154aa565b9050818110156140755760405162461bcd60e51b815260206004820152603760248201527f53656e64657220646f6573206e6f74206861766520656e6f7567682076655a4560448201527f524f20746f206d616b65207468652070726f706f73616c00000000000000000060648201526084016109ef565b336000908152600a602052604090205460ff16156140fb5760405162461bcd60e51b815260206004820152603160248201527f55736572732063616e206f6e6c792068617665206f6e6520616374697665207060448201527f726f706f73616c20617420612074696d6500000000000000000000000000000060648201526084016109ef565b5050505b60018760405161410f91906158d3565b9081526020016040518091039020546000146141935760405162461bcd60e51b815260206004820152603f60248201527f43616e6e6f742063726561746520612070726f706f73616c2073696d696c617260448201527f20746f20612062616c6c6f742074686174206973207374696c6c206f70656e0060648201526084016109ef565b6001876040516020016141a691906158ef565b60408051601f19818403018152908290526141c0916158d3565b90815260200160405180910390205460001461426a5760405162461bcd60e51b815260206004820152604360248201527f43616e6e6f742063726561746520612070726f706f73616c20666f722061206260448201527f616c6c6f7420776974682061207365636f6e6461727920636f6e6669726d617460648201527f696f6e0000000000000000000000000000000000000000000000000000000000608482015260a4016109ef565b60007f0000000000000000000000002a2bc9fdf452f7ba7e33b8d5db3955a6d6cdf3356001600160a01b0316634fa1acb36040518163ffffffff1660e01b8152600401602060405180830381865afa1580156142ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906142ee91906154aa565b6142f89042615385565b905060007f0000000000000000000000002a2bc9fdf452f7ba7e33b8d5db3955a6d6cdf3356001600160a01b03166336b5a6c66040518163ffffffff1660e01b8152600401602060405180830381865afa15801561435a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061437e91906154aa565b6143889042615385565b60038054919250600061439a83615934565b91905055925060006143ab89612eea565b60408051610160810182528681526001602082015291925081018a600a8111156143d7576143d7614c0c565b815260208082018d90526001600160a01b038b16604080840191909152606083018b9052608083018a905260a0830189905260c0830187905260e0830186905261010092830185905260008881526002835281902084518155918401516001830180549115157fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0083168117825592860151939490927fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000909216919091179083600a8111156144c9576144c9614c0c565b0217905550606082015160028201906144e290826159bd565b5060808201516003820180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0390921691909117905560a0820151600482015560c0820151600582019061453f90826159bd565b5060e0820151600682019061455490826159bd565b506101008201518160070155610120820151816008015561014082015181600901559050508360018b60405161458a91906158d3565b908152604051908190036020019020556145a560048561473e565b50336000818152600a6020908152604080832080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055878352600b9091529081902080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169092179091555184907f2d6a2a1a504050a1fa6107e44f49971fd89dbe544b433d65f1c572ce5fa3b7d190614649908c908e90615ab9565b60405180910390a25050509695505050505050565b6060600061466b836147a6565b600101905060008167ffffffffffffffff81111561468b5761468b615056565b6040519080825280601f01601f1916602001820160405280156146b5576020820181803683370190505b5090508181016020015b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff017f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85049450846146bf57509392505050565b6000610b938383614888565b6060611f916001600160a01b038316601461497b565b6000610b938383614ba4565b60608160000180548060200260200160405190810160405280929190818152602001828054801561479a57602002820191906000526020600020905b815481526020019060010190808311614786575b50505050509050919050565b6000807a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106147ef577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000830492506040015b6d04ee2d6d415b85acef8100000000831061481b576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc10000831061483957662386f26fc10000830492506010015b6305f5e1008310614851576305f5e100830492506008015b612710831061486557612710830492506004015b60648310614877576064830492506002015b600a8310611f915760010192915050565b600081815260018301602052604081205480156149715760006148ac6001836154c3565b85549091506000906148c0906001906154c3565b90508181146149255760008660000182815481106148e0576148e0615775565b906000526020600020015490508087600001848154811061490357614903615775565b6000918252602080832090910192909255918252600188019052604090208390555b855486908061493657614936615ad9565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050611f91565b6000915050611f91565b6060600061498a8360026155d5565b614995906002615385565b67ffffffffffffffff8111156149ad576149ad615056565b6040519080825280601f01601f1916602001820160405280156149d7576020820181803683370190505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110614a0e57614a0e615775565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110614a7157614a71615775565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000614aad8460026155d5565b614ab8906001615385565b90505b6001811115614b55577f303132333435363738396162636465660000000000000000000000000000000085600f1660108110614af957614af9615775565b1a60f81b828281518110614b0f57614b0f615775565b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060049490941c93614b4e81615b08565b9050614abb565b508315610b935760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016109ef565b6000818152600183016020526040812054614beb57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155611f91565b506000611f91565b600060208284031215614c0557600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60058110614c4b57614c4b614c0c565b9052565b60208101611f918284614c3b565b6020808252825182820181905260009190848201906040850190845b81811015614c9557835183529284019291840191600101614c79565b50909695505050505050565b60008083601f840112614cb357600080fd5b50813567ffffffffffffffff811115614ccb57600080fd5b602083019150836020828501011115614ce357600080fd5b9250929050565b60008060008060408587031215614d0057600080fd5b843567ffffffffffffffff80821115614d1857600080fd5b614d2488838901614ca1565b90965094506020870135915080821115614d3d57600080fd5b50614d4a87828801614ca1565b95989497509550505050565b600080600060408486031215614d6b57600080fd5b83359250602084013567ffffffffffffffff811115614d8957600080fd5b614d9586828701614ca1565b9497909650939450505050565b600b8110614c4b57614c4b614c0c565b60005b83811015614dcd578181015183820152602001614db5565b50506000910152565b60008151808452614dee816020860160208601614db2565b601f01601f19169290920160200192915050565b602081528151602082015260006020830151614e22604084018215159052565b506040830151614e356060840182614da2565b506060830151610160806080850152614e52610180850183614dd6565b91506080850151614e6e60a08601826001600160a01b03169052565b5060a085015160c085015260c0850151601f19808685030160e0870152614e958483614dd6565b935060e08701519150610100818786030181880152614eb48584614dd6565b90880151610120888101919091528801516101408089019190915290970151929095019190915250929392505050565b60008060408385031215614ef757600080fd5b82359150602083013560058110614f0d57600080fd5b809150509250929050565b60006101608d83528c15156020840152614f35604084018d614da2565b806060840152614f478184018c614dd6565b90506001600160a01b038a1660808401528860a084015282810360c0840152614f708189614dd6565b905082810360e0840152614f848188614dd6565b61010084019690965250506101208101929092526101409091015298975050505050505050565b6001600160a01b038116811461186957600080fd5b60008060408385031215614fd357600080fd5b823591506020830135614f0d81614fab565b6000604082019050614ff8828451614c3b565b602092830151919092015290565b6000806000806060858703121561501c57600080fd5b843561502781614fab565b935060208501359250604085013567ffffffffffffffff81111561504a57600080fd5b614d4a87828801614ca1565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60006020828403121561509757600080fd5b813567ffffffffffffffff808211156150af57600080fd5b818401915084601f8301126150c357600080fd5b8135818111156150d5576150d5615056565b604051601f8201601f19908116603f011681019083821181831017156150fd576150fd615056565b8160405282815287602084870101111561511657600080fd5b826020860160208301376000928101602001929092525095945050505050565b60008060008060006060868803121561514e57600080fd5b853561515981614fab565b9450602086013567ffffffffffffffff8082111561517657600080fd5b61518289838a01614ca1565b9096509450604088013591508082111561519b57600080fd5b506151a888828901614ca1565b969995985093965092949392505050565b8035600b81106151c857600080fd5b919050565b60008060008060008060008060a0898b0312156151e957600080fd5b883567ffffffffffffffff8082111561520157600080fd5b61520d8c838d01614ca1565b909a50985088915061522160208c016151b9565b975060408b0135915061523382614fab565b90955060608a0135908082111561524957600080fd5b6152558c838d01614ca1565b909650945060808b013591508082111561526e57600080fd5b5061527b8b828c01614ca1565b999c989b5096995094979396929594505050565b6000806000604084860312156152a457600080fd5b83356152af81614fab565b9250602084013567ffffffffffffffff811115614d8957600080fd5b6000602082840312156152dd57600080fd5b8135610b9381614fab565b6000602082840312156152fa57600080fd5b610b93826151b9565b600181811c9082168061531757607f821691505b602082108103615350577f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115611f9157611f91615356565b6000602082840312156153aa57600080fd5b8151610b9381614fab565b60208152816020820152818360408301376000818301604090810191909152601f909201601f19160101919050565b6000602082840312156153f657600080fd5b81518015158114610b9357600080fd5b7f696e636c7564653a000000000000000000000000000000000000000000000000815283856008830137600084820160088101600081528486823750600093016008019283525090949350505050565b7f706172616d657465723a0000000000000000000000000000000000000000000081526000845161548e81600a850160208901614db2565b82018385600a83013760009301600a0192835250909392505050565b6000602082840312156154bc57600080fd5b5051919050565b81810381811115611f9157611f91615356565b604081016154e48285614c3b565b8260208301529392505050565b60008083546154ff81615303565b60018281168015615517576001811461554a57615579565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0084168752821515830287019450615579565b8760005260208060002060005b858110156155705781548a820152908401908201615557565b50505082870194505b50929695505050505050565b7f6578636c7564653a000000000000000000000000000000000000000000000000815283856008830137600084820160088101600081528486823750600093016008019283525090949350505050565b8082028115828204841417611f9157611f91615356565b600082615622577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b7f73656e645a45524f3a000000000000000000000000000000000000000000000081526000855161565f816009850160208a01614db2565b855190830190615676816009840160208a01614db2565b0183856009830137600093016009019283525090949350505050565b7f756e77686974656c6973743a00000000000000000000000000000000000000008152600086516156ca81600c850160208b01614db2565b82018587600c8301378581019050600c810160008152848682375060009301600c01928352509095945050505050565b7f63616c6c436f6e74726163743a0000000000000000000000000000000000000081526000855161573281600d850160208a01614db2565b85519083019061574981600d840160208a01614db2565b018385600d83013760009301600d019283525090949350505050565b8183823760009101908152919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f73657455524c3a00000000000000000000000000000000000000000000000000815283856007830137600084820160078101600081528486823750600093016007019283525090949350505050565b7f7365744163636573734d616e616765723a00000000000000000000000000000081526000845161582c816011850160208901614db2565b8201838560118301376000930160110192835250909392505050565b60006020828403121561585a57600080fd5b815160ff81168114610b9357600080fd5b7f77686974656c6973743a000000000000000000000000000000000000000000008152600086516158a381600a850160208b01614db2565b82018587600a8301378581019050600a810160008152848682375060009301600a01928352509095945050505050565b600082516158e5818460208701614db2565b9190910192915050565b7f636f6e6669726d5f000000000000000000000000000000000000000000000000815260008251615927816008850160208701614db2565b9190910160080192915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361596557615965615356565b5060010190565b601f8211156159b8576000816000526020600020601f850160051c810160208610156159955750805b601f850160051c820191505b818110156159b4578281556001016159a1565b5050505b505050565b815167ffffffffffffffff8111156159d7576159d7615056565b6159eb816159e58454615303565b8461596c565b602080601f831160018114615a3e5760008415615a085750858301515b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600386901b1c1916600185901b1785556159b4565b600085815260208120601f198616915b82811015615a6d57888601518255948401946001909101908401615a4e565b5085821015615aa957878501517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600388901b60f8161c191681555b5050505050600190811b01905550565b615ac38184614da2565b6040602082015260006108786040830184614dd6565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b600081615b1757615b17615356565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019056fea2646970667358221220c33f37718d5f59711bdc40e18293f589b645a9084ec4cbc963de800115bce7bf64736f6c63430008160033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000010d0c7fbd6178e204481f2241b930eea6fe2d0c9000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd90000000000000000000000000ac992636f863504039a028a6e9a2c192529c4870000000000000000000000002a2bc9fdf452f7ba7e33b8d5db3955a6d6cdf335
-----Decoded View---------------
Arg [0] : _staking (address): 0x10d0C7fbd6178e204481f2241B930eEa6fE2D0c9
Arg [1] : _exchangeConfig (address): 0xF2fEd4a7a8D1CC2dB73AE0439E07db21D0D58bD9
Arg [2] : _poolsConfig (address): 0x0aC992636f863504039A028A6E9a2c192529c487
Arg [3] : _daoConfig (address): 0x2A2BC9FDF452f7Ba7e33B8d5Db3955a6D6cDF335
-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000010d0c7fbd6178e204481f2241b930eea6fe2d0c9
Arg [1] : 000000000000000000000000f2fed4a7a8d1cc2db73ae0439e07db21d0d58bd9
Arg [2] : 0000000000000000000000000ac992636f863504039a028a6e9a2c192529c487
Arg [3] : 0000000000000000000000002a2bc9fdf452f7ba7e33b8d5db3955a6d6cdf335
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 27 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.