Address Details
contract
0x6dB8df7e3B471Da88Fdf98C90097Ac05Cc5F3FdD
- Contract Name
- ImpactMarketCouncilImpl..ntation
- Creator
- 0xa34737–43edab at 0x82f65c–a547d1
- Balance
- 0 CELO ( )
- Locked CELO Balance
- 0.00 CELO
- Voting CELO Balance
- 0.00 CELO
- Pending Unlocked Gold
- 0.00 CELO
- Tokens
-
Fetching tokens...
- Transactions
- 0 Transactions
- Transfers
- 0 Transfers
- Gas Used
- Fetching gas used...
- Last Balance Update
- 25566521
This contract has been verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- ImpactMarketCouncilImplementation
- Optimization enabled
- true
- Compiler version
- v0.8.4+commit.c7e474f2
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2023-05-15T22:48:45.164638Z
contracts/governor/impactMarketCouncil/ImpactMarketCouncilImplementation.sol
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.4; import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol"; import "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol"; import "./interfaces/ImpactMarketCouncilStorageV1.sol"; contract ImpactMarketCouncilImplementation is Initializable, OwnableUpgradeable, ReentrancyGuardUpgradeable, ImpactMarketCouncilStorageV1 { /// @notice The max setable voting period uint256 public constant MAX_VOTING_PERIOD = 518400; // About 30 days /// @notice The maximum number of actions that can be included in a proposal uint256 public constant PROPOSAL_MAX_OPERATIONS = 10; // 10 actions /// @notice An event emitted when a new proposal is created event ProposalCreated( uint256 id, address proposer, address[] targets, string[] signatures, bytes[] calldatas, uint256 endBlock, string description ); /// @notice An event emitted when a vote has been cast on a proposal /// @param voter The address which casted a vote /// @param proposalId The proposal id which was voted on /// @param support Support value for the vote. 0=against, 1=for, 2=abstain /// @param votes Number of votes which were cast by the voter /// @param reason The reason given for the vote by the voter event VoteCast( address indexed voter, uint256 proposalId, uint8 support, uint256 votes, string reason ); /// @notice An event emitted when a proposal has been canceled event ProposalCanceled(uint256 id); /// @notice An event emitted when a proposal has been executed in the Timelock event ProposalExecuted(uint256 id); /// @notice Emitted when implementation is changed event NewImplementation(address oldImplementation, address newImplementation); /// @notice An event emitted when the quorum votes is set event QuorumVotesSet(uint256 oldQuorumVotes, uint256 newQuorumVotes); /// @notice An event emitted when a member is added event MemberAdded(address member); /// @notice An event emitted when a member is removed event MemberRemoved(address member); /** * @notice Triggered when an amount of an ERC20 has been transferred from this contract to an address * * @param token ERC20 token address * @param to Address of the receiver * @param amount Amount of the transaction */ event TransferERC20(address indexed token, address indexed to, uint256 amount); modifier onlyMember() { require(members[msg.sender] == true, "PACT:: Not a member"); _; } /** * @notice Used to initialize the contract during delegator constructor * @param _quorumVotes The initial quorum votes */ function initialize( uint256 _quorumVotes, ICommunityAdmin _communityAdmin, address[] calldata _members ) public initializer { require(_quorumVotes >= 1, "PACT::initialize: invalid proposal threshold"); require(_quorumVotes <= _members.length, "PACT::initialize: params mismatch"); __Ownable_init(); __ReentrancyGuard_init(); communityProxyAdmin = new ProxyAdmin(); communityAdmin = _communityAdmin; quorumVotes = _quorumVotes; // Create dummy proposal Proposal memory _dummyProposal = Proposal({ id: proposalCount, proposer: address(this), endBlock: 0, forVotes: 0, againstVotes: 0, abstainVotes: 0, canceled: true, executed: false }); proposalCount++; proposals[_dummyProposal.id] = _dummyProposal; latestProposalIds[_dummyProposal.proposer] = _dummyProposal.id; uint256 _index; uint256 _numberOfMembers = _members.length; for (; _index < _numberOfMembers; _index++) { members[_members[_index]] = true; emit MemberAdded(_members[_index]); } emit ProposalCreated( _dummyProposal.id, address(this), proposalTargets[_dummyProposal.id], proposalSignatures[_dummyProposal.id], proposalCalldatas[_dummyProposal.id], 0, "" ); } /** * @notice Function used to add new members to the impactMarket Council. * @param _member Member address. */ function addMember(address _member) external onlyOwner { require(members[_member] == false, "PACT::addMember: already a member"); members[_member] = true; emit MemberAdded(_member); } /** * @notice Function used to remove members from the impactMarket Council. * @param _member Member address. */ function removeMember(address _member) external onlyOwner { require(members[_member] == true, "PACT::removeMember: not a member"); members[_member] = false; emit MemberRemoved(_member); } /** * @notice Function used to propose a new proposal. Sender must have delegates above the proposal threshold. * @param _targets Target addresses for proposal calls. * @param _signatures Function signatures for proposal calls. * @param _calldatas Calldatas for proposal calls. * @param _description String description of the proposal. * @return Proposal id of new proposal. */ function propose( address[] memory _targets, string[] memory _signatures, bytes[] memory _calldatas, string memory _description ) external onlyMember returns (uint256) { require( _targets.length == _calldatas.length && _signatures.length == _calldatas.length, "PACT::propose: proposal function information arity mismatch" ); require(_signatures.length != 0, "PACT::propose: must provide actions"); require(_signatures.length <= PROPOSAL_MAX_OPERATIONS, "PACT::propose: too many actions"); uint256 _endBlock = add256(block.number, MAX_VOTING_PERIOD); // (518400) 30 days Proposal memory _newProposal = Proposal({ id: proposalCount, proposer: msg.sender, endBlock: _endBlock, forVotes: 0, againstVotes: 0, abstainVotes: 0, canceled: false, executed: false }); proposalCount++; proposals[_newProposal.id] = _newProposal; proposalTargets[_newProposal.id] = _targets; proposalSignatures[_newProposal.id] = _signatures; proposalCalldatas[_newProposal.id] = _calldatas; latestProposalIds[_newProposal.proposer] = _newProposal.id; emit ProposalCreated( _newProposal.id, msg.sender, _targets, _signatures, _calldatas, _endBlock, _description ); return _newProposal.id; } /** * @notice Executes a queued proposal if eta has passed * @param _proposalId The id of the proposal to execute */ function execute(uint256 _proposalId) external onlyMember payable { require( state(_proposalId) == ProposalState.Succeeded, "PACT::execute: proposal can only be executed if it is succeeded" ); Proposal storage _proposal = proposals[_proposalId]; _proposal.executed = true; uint256 _i; uint256 _numberOfActions = proposalCalldatas[_proposalId].length; for (; _i < _numberOfActions; _i++) { bytes memory _callData; if (bytes(proposalSignatures[_proposalId][_i]).length == 0) { _callData = proposalCalldatas[_proposalId][_i]; } else { _callData = abi.encodePacked( bytes4(keccak256(bytes(proposalSignatures[_proposalId][_i]))), proposalCalldatas[_proposalId][_i] ); } // solium-disable-next-line security/no-call-value (bool _success, ) = proposalTargets[_proposalId][_i].call{value: 0}(_callData); require(_success, "PACT::execute: Transaction execution reverted."); } emit ProposalExecuted(_proposalId); } /** * @notice Cancels a proposal only if sender is the proposer, or proposer delegates dropped below proposal threshold * @param _proposalId The id of the proposal to cancel */ function cancel(uint256 _proposalId) external onlyMember { require( state(_proposalId) != ProposalState.Executed, "PACT::cancel: cannot cancel executed proposal" ); Proposal storage _proposal = proposals[_proposalId]; require(msg.sender == _proposal.proposer, "PACT::cancel: proposer not allowed"); _proposal.canceled = true; emit ProposalCanceled(_proposalId); } /** * @notice Gets actions of a proposal. * @param _proposalId Proposal to query. * @return signatures Function signatures for proposal calls. * @return calldatas Calldatas for proposal calls. */ function getActions(uint256 _proposalId) external view returns (string[] memory signatures, bytes[] memory calldatas) { return (proposalSignatures[_proposalId], proposalCalldatas[_proposalId]); } /** * @notice Gets the receipt for a voter on a given proposal * @param _proposalId the id of proposal * @param _voter The address of the voter * @return The voting receipt */ function getReceipt(uint256 _proposalId, address _voter) external view returns (Receipt memory) { return proposalReceipts[_proposalId][_voter]; } /** * @notice Gets the state of a proposal * @param _proposalId The id of the proposal * @return Proposal state */ function state(uint256 _proposalId) public view returns (ProposalState) { require(proposalCount > _proposalId, "PACT::state: invalid proposal id"); Proposal storage _proposal = proposals[_proposalId]; if (_proposal.canceled) { return ProposalState.Canceled; } else if (_proposal.executed) { return ProposalState.Executed; } else if (block.number > _proposal.endBlock) { return ProposalState.Expired; } else if ( _proposal.forVotes > _proposal.againstVotes && _proposal.forVotes >= quorumVotes ) { return ProposalState.Succeeded; } else { return ProposalState.Active; } } /** * @notice Cast a vote for a proposal * @param _proposalId The id of the proposal to vote on * @param _support The support value for the vote. 0=against, 1=for, 2=abstain */ function castVote(uint256 _proposalId, uint8 _support) external onlyMember { emit VoteCast( msg.sender, _proposalId, _support, castVoteInternal(msg.sender, _proposalId, _support), "" ); } /** * @notice Internal function that caries out voting logic * @param _voter The voter that is casting their vote * @param _proposalId The id of the proposal to vote on * @param _support The support value for the vote. 0=against, 1=for, 2=abstain * @return The number of votes cast */ function castVoteInternal( address _voter, uint256 _proposalId, uint8 _support ) internal returns (uint96) { require( state(_proposalId) == ProposalState.Active, "PACT::castVoteInternal: voting is closed" ); require(_support <= 2, "PACT::castVoteInternal: invalid vote type"); Proposal storage _proposal = proposals[_proposalId]; Receipt storage _receipt = proposalReceipts[_proposalId][_voter]; require(_receipt.hasVoted == false, "PACT::castVoteInternal: voter already voted"); uint96 _votes = 1; if (_support == 0) { _proposal.againstVotes = add256(_proposal.againstVotes, _votes); } else if (_support == 1) { _proposal.forVotes = add256(_proposal.forVotes, _votes); } else if (_support == 2) { _proposal.abstainVotes = add256(_proposal.abstainVotes, _votes); } _receipt.hasVoted = true; _receipt.support = _support; _receipt.votes = _votes; return _votes; } /** * @notice Owner function for setting the quorum votes * @param _newQuorumVotes new quorum votes */ function setQuorumVotes(uint256 _newQuorumVotes) external onlyOwner { require(_newQuorumVotes >= 1, "PACT::_setQuorumVotes: invalid quorum votes"); emit QuorumVotesSet(quorumVotes, _newQuorumVotes); quorumVotes = _newQuorumVotes; } function add256(uint256 _a, uint256 _b) internal pure returns (uint256) { uint256 _c = _a + _b; require(_c >= _a, "addition overflow"); return _c; } function sub256(uint256 _a, uint256 _b) internal pure returns (uint256) { require(_b <= _a, "subtraction underflow"); return _a - _b; } function add96( uint96 _a, uint96 _b, string memory _errorMessage ) internal pure returns (uint96) { uint96 _c = _a + _b; require(_c >= _a, _errorMessage); return _c; } }
/_openzeppelin/contracts/access/Ownable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
/_openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol) pragma solidity ^0.8.0; import "../Proxy.sol"; import "./ERC1967Upgrade.sol"; /** * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an * implementation address that can be changed. This address is stored in storage in the location specified by * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the * implementation behind the proxy. */ contract ERC1967Proxy is Proxy, ERC1967Upgrade { /** * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`. * * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded * function call, and allows initializating the storage of the proxy like a Solidity constructor. */ constructor(address _logic, bytes memory _data) payable { assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1)); _upgradeToAndCall(_logic, _data, false); } /** * @dev Returns the current implementation address. */ function _implementation() internal view virtual override returns (address impl) { return ERC1967Upgrade._getImplementation(); } }
/_openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Upgrade.sol) pragma solidity ^0.8.2; import "../beacon/IBeacon.sol"; import "../../utils/Address.sol"; import "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * * _Available since v4.1._ * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967Upgrade { // This is the keccak-256 hash of "eip1967.proxy.rollback" subtracted by 1 bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143; /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Emitted when the implementation is upgraded. */ event Upgraded(address indexed implementation); /** * @dev Returns the current implementation address. */ function _getImplementation() internal view returns (address) { return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; } /** * @dev Stores a new address in the EIP1967 implementation slot. */ function _setImplementation(address newImplementation) private { require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; } /** * @dev Perform implementation upgrade * * Emits an {Upgraded} event. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Perform implementation upgrade with additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCall( address newImplementation, bytes memory data, bool forceCall ) internal { _upgradeTo(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } } /** * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call. * * Emits an {Upgraded} event. */ function _upgradeToAndCallSecure( address newImplementation, bytes memory data, bool forceCall ) internal { address oldImplementation = _getImplementation(); // Initial upgrade and setup call _setImplementation(newImplementation); if (data.length > 0 || forceCall) { Address.functionDelegateCall(newImplementation, data); } // Perform rollback test if not already in progress StorageSlot.BooleanSlot storage rollbackTesting = StorageSlot.getBooleanSlot(_ROLLBACK_SLOT); if (!rollbackTesting.value) { // Trigger rollback using upgradeTo from the new implementation rollbackTesting.value = true; Address.functionDelegateCall( newImplementation, abi.encodeWithSignature("upgradeTo(address)", oldImplementation) ); rollbackTesting.value = false; // Check rollback was effective require(oldImplementation == _getImplementation(), "ERC1967Upgrade: upgrade breaks further upgrades"); // Finally reset to the new implementation and log the upgrade _upgradeTo(newImplementation); } } /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Emitted when the admin account has changed. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Returns the current admin. */ function _getAdmin() internal view returns (address) { return StorageSlot.getAddressSlot(_ADMIN_SLOT).value; } /** * @dev Stores a new address in the EIP1967 admin slot. */ function _setAdmin(address newAdmin) private { require(newAdmin != address(0), "ERC1967: new admin is the zero address"); StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin; } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. */ function _changeAdmin(address newAdmin) internal { emit AdminChanged(_getAdmin(), newAdmin); _setAdmin(newAdmin); } /** * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy. * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor. */ bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50; /** * @dev Emitted when the beacon is upgraded. */ event BeaconUpgraded(address indexed beacon); /** * @dev Returns the current beacon. */ function _getBeacon() internal view returns (address) { return StorageSlot.getAddressSlot(_BEACON_SLOT).value; } /** * @dev Stores a new beacon in the EIP1967 beacon slot. */ function _setBeacon(address newBeacon) private { require(Address.isContract(newBeacon), "ERC1967: new beacon is not a contract"); require( Address.isContract(IBeacon(newBeacon).implementation()), "ERC1967: beacon implementation is not a contract" ); StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon; } /** * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that). * * Emits a {BeaconUpgraded} event. */ function _upgradeBeaconToAndCall( address newBeacon, bytes memory data, bool forceCall ) internal { _setBeacon(newBeacon); emit BeaconUpgraded(newBeacon); if (data.length > 0 || forceCall) { Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data); } } }
/_openzeppelin/contracts/proxy/Proxy.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/Proxy.sol) pragma solidity ^0.8.0; /** * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to * be specified by overriding the virtual {_implementation} function. * * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a * different contract through the {_delegate} function. * * The success and return data of the delegated call will be returned back to the caller of the proxy. */ abstract contract Proxy { /** * @dev Delegates the current call to `implementation`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _delegate(address implementation) internal virtual { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function * and {_fallback} should delegate. */ function _implementation() internal view virtual returns (address); /** * @dev Delegates the current call to the address returned by `_implementation()`. * * This function does not return to its internall call site, it will return directly to the external caller. */ function _fallback() internal virtual { _beforeFallback(); _delegate(_implementation()); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other * function in the contract matches the call data. */ fallback() external payable virtual { _fallback(); } /** * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data * is empty. */ receive() external payable virtual { _fallback(); } /** * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback` * call, or as part of the Solidity `fallback` or `receive` functions. * * If overriden should call `super._beforeFallback()`. */ function _beforeFallback() internal virtual {} }
/_openzeppelin/contracts/proxy/beacon/IBeacon.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol) pragma solidity ^0.8.0; /** * @dev This is the interface that {BeaconProxy} expects of its beacon. */ interface IBeacon { /** * @dev Must return an address that can be used as a delegate call target. * * {BeaconProxy} will check that this address is a contract. */ function implementation() external view returns (address); }
/_openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/transparent/ProxyAdmin.sol) pragma solidity ^0.8.0; import "./TransparentUpgradeableProxy.sol"; import "../../access/Ownable.sol"; /** * @dev This is an auxiliary contract meant to be assigned as the admin of a {TransparentUpgradeableProxy}. For an * explanation of why you would want to use this see the documentation for {TransparentUpgradeableProxy}. */ contract ProxyAdmin is Ownable { /** * @dev Returns the current implementation of `proxy`. * * Requirements: * * - This contract must be the admin of `proxy`. */ function getProxyImplementation(TransparentUpgradeableProxy proxy) public view virtual returns (address) { // We need to manually run the static call since the getter cannot be flagged as view // bytes4(keccak256("implementation()")) == 0x5c60da1b (bool success, bytes memory returndata) = address(proxy).staticcall(hex"5c60da1b"); require(success); return abi.decode(returndata, (address)); } /** * @dev Returns the current admin of `proxy`. * * Requirements: * * - This contract must be the admin of `proxy`. */ function getProxyAdmin(TransparentUpgradeableProxy proxy) public view virtual returns (address) { // We need to manually run the static call since the getter cannot be flagged as view // bytes4(keccak256("admin()")) == 0xf851a440 (bool success, bytes memory returndata) = address(proxy).staticcall(hex"f851a440"); require(success); return abi.decode(returndata, (address)); } /** * @dev Changes the admin of `proxy` to `newAdmin`. * * Requirements: * * - This contract must be the current admin of `proxy`. */ function changeProxyAdmin(TransparentUpgradeableProxy proxy, address newAdmin) public virtual onlyOwner { proxy.changeAdmin(newAdmin); } /** * @dev Upgrades `proxy` to `implementation`. See {TransparentUpgradeableProxy-upgradeTo}. * * Requirements: * * - This contract must be the admin of `proxy`. */ function upgrade(TransparentUpgradeableProxy proxy, address implementation) public virtual onlyOwner { proxy.upgradeTo(implementation); } /** * @dev Upgrades `proxy` to `implementation` and calls a function on the new implementation. See * {TransparentUpgradeableProxy-upgradeToAndCall}. * * Requirements: * * - This contract must be the admin of `proxy`. */ function upgradeAndCall( TransparentUpgradeableProxy proxy, address implementation, bytes memory data ) public payable virtual onlyOwner { proxy.upgradeToAndCall{value: msg.value}(implementation, data); } }
/_openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol) pragma solidity ^0.8.0; import "../ERC1967/ERC1967Proxy.sol"; /** * @dev This contract implements a proxy that is upgradeable by an admin. * * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector * clashing], which can potentially be used in an attack, this contract uses the * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two * things that go hand in hand: * * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if * that call matches one of the admin functions exposed by the proxy itself. * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the * implementation. If the admin tries to call a function on the implementation it will fail with an error that says * "admin cannot fallback to proxy target". * * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due * to sudden errors when trying to call a function from the proxy implementation. * * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy. */ contract TransparentUpgradeableProxy is ERC1967Proxy { /** * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}. */ constructor( address _logic, address admin_, bytes memory _data ) payable ERC1967Proxy(_logic, _data) { assert(_ADMIN_SLOT == bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1)); _changeAdmin(admin_); } /** * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin. */ modifier ifAdmin() { if (msg.sender == _getAdmin()) { _; } else { _fallback(); } } /** * @dev Returns the current admin. * * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103` */ function admin() external ifAdmin returns (address admin_) { admin_ = _getAdmin(); } /** * @dev Returns the current implementation. * * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. * * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc` */ function implementation() external ifAdmin returns (address implementation_) { implementation_ = _implementation(); } /** * @dev Changes the admin of the proxy. * * Emits an {AdminChanged} event. * * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}. */ function changeAdmin(address newAdmin) external virtual ifAdmin { _changeAdmin(newAdmin); } /** * @dev Upgrade the implementation of the proxy. * * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeToAndCall(newImplementation, bytes(""), false); } /** * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the * proxied contract. * * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}. */ function upgradeToAndCall(address newImplementation, bytes calldata data) external payable ifAdmin { _upgradeToAndCall(newImplementation, data, true); } /** * @dev Returns the current admin. */ function _admin() internal view virtual returns (address) { return _getAdmin(); } /** * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}. */ function _beforeFallback() internal virtual override { require(msg.sender != _getAdmin(), "TransparentUpgradeableProxy: admin cannot fallback to proxy target"); super._beforeFallback(); } }
/_openzeppelin/contracts/utils/Address.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
/_openzeppelin/contracts/utils/Context.sol
// 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; } }
/_openzeppelin/contracts/utils/StorageSlot.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol) pragma solidity ^0.8.0; /** * @dev Library for reading and writing primitive types to specific storage slots. * * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts. * This library helps with reading and writing to such slots without the need for inline assembly. * * The functions in this library return Slot structs that contain a `value` member that can be used to read or write. * * Example usage to set ERC1967 implementation slot: * ``` * contract ERC1967 { * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; * * function _getImplementation() internal view returns (address) { * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value; * } * * function _setImplementation(address newImplementation) internal { * require(Address.isContract(newImplementation), "ERC1967: new implementation is not a contract"); * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation; * } * } * ``` * * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlot { struct AddressSlot { address value; } struct BooleanSlot { bool value; } struct Bytes32Slot { bytes32 value; } struct Uint256Slot { uint256 value; } /** * @dev Returns an `AddressSlot` with member `value` located at `slot`. */ function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `BooleanSlot` with member `value` located at `slot`. */ function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Bytes32Slot` with member `value` located at `slot`. */ function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) { assembly { r.slot := slot } } /** * @dev Returns an `Uint256Slot` with member `value` located at `slot`. */ function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) { assembly { r.slot := slot } } }
/_openzeppelin/contracts/utils/structs/EnumerableSet.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/structs/EnumerableSet.sol) pragma solidity ^0.8.0; /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`) * and `uint256` (`UintSet`) are supported. */ 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) { return _values(set._inner); } // 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; 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 on 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; assembly { result := store } return result; } }
/_openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol) pragma solidity ^0.8.0; /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControlUpgradeable { /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {AccessControl-_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) external view returns (bool); /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {AccessControl-_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) external view returns (bytes32); /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) external; /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) external; /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) external; }
/_openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/ContextUpgradeable.sol"; import "../proxy/utils/Initializable.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract OwnableUpgradeable is Initializable, ContextUpgradeable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ function __Ownable_init() internal onlyInitializing { __Context_init_unchained(); __Ownable_init_unchained(); } function __Ownable_init_unchained() internal onlyInitializing { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } uint256[49] private __gap; }
/_openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (proxy/utils/Initializable.sol) pragma solidity ^0.8.0; import "../../utils/AddressUpgradeable.sol"; /** * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed * behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. * * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. * * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. * * [CAUTION] * ==== * Avoid leaving a contract uninitialized. * * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: * * [.hljs-theme-light.nopadding] * ``` * /// @custom:oz-upgrades-unsafe-allow constructor * constructor() initializer {} * ``` * ==== */ abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private _initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private _initializing; /** * @dev Modifier to protect an initializer function from being invoked twice. */ modifier initializer() { // If the contract is initializing we ignore whether _initialized is set in order to support multiple // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the // contract may have been reentered. require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized"); bool isTopLevelCall = !_initializing; if (isTopLevelCall) { _initializing = true; _initialized = true; } _; if (isTopLevelCall) { _initializing = false; } } /** * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the * {initializer} modifier, directly or indirectly. */ modifier onlyInitializing() { require(_initializing, "Initializable: contract is not initializing"); _; } function _isConstructor() private view returns (bool) { return !AddressUpgradeable.isContract(address(this)); } }
/_openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @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 ReentrancyGuardUpgradeable is Initializable { // 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; function __ReentrancyGuard_init() internal onlyInitializing { __ReentrancyGuard_init_unchained(); } function __ReentrancyGuard_init_unchained() internal onlyInitializing { _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() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } uint256[49] private __gap; }
/_openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20Upgradeable { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
/_openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Address.sol) pragma solidity ^0.8.0; /** * @dev Collection of functions related to the address type */ library AddressUpgradeable { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResult(success, returndata, errorMessage); } /** * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason using the provided one. * * _Available since v4.3._ */ function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
/_openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; import "../proxy/utils/Initializable.sol"; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract ContextUpgradeable is Initializable { function __Context_init() internal onlyInitializing { __Context_init_unchained(); } function __Context_init_unchained() internal onlyInitializing { } function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } uint256[50] private __gap; }
/contracts/ambassadors/interfaces/IAmbassadors.sol
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.4; interface IAmbassadors { function getVersion() external pure returns(uint256); function isAmbassador(address _ambassador) external view returns (bool); function isAmbassadorOf(address _ambassador, address _community) external view returns (bool); function isEntityOf(address _ambassador, address _entityAddress) external view returns (bool); function isAmbassadorAt(address _ambassador, address _entityAddress) external view returns (bool); function addEntity(address _entity) external; function removeEntity(address _entity) external; function replaceEntityAccount(address _entity, address _newEntity) external; function addAmbassador(address _ambassador) external; function removeAmbassador(address _ambassador) external; function replaceAmbassadorAccount(address _ambassador, address _newAmbassador) external; function replaceAmbassador(address _oldAmbassador, address _newAmbassador) external; function transferAmbassador(address _ambassador, address _toEntity, bool _keepCommunities) external; function transferCommunityToAmbassador(address _to, address _community) external; function setCommunityToAmbassador(address _ambassador, address _community) external; function removeCommunity(address _community) external; }
/contracts/community/interfaces/ICommunity.sol
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.4; import "@openzeppelin/contracts-upgradeable/access/IAccessControlUpgradeable.sol"; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "./ICommunityAdmin.sol"; interface ICommunity { enum BeneficiaryState { NONE, //the beneficiary hasn't been added yet Valid, Locked, Removed, AddressChanged, Copied //the beneficiary has been moved in a copy community } struct Beneficiary { BeneficiaryState state; //beneficiary state uint256 claims; //total number of claims uint256 claimedAmount; //total amount of tokens received //(based on token ratios when there are more than one token) uint256 lastClaim; //block number of the last claim mapping(address => uint256) claimedAmounts; } struct TokenUpdates { address tokenAddress; //address of the token uint256 ratio; //ratio between maxClaim and previous token maxClaim uint256 startBlock; //the number of the block from which the this token was "active" } function initialize( address _tokenAddress, address[] memory _managers, uint256 _claimAmount, uint256 _maxClaim, uint256 _decreaseStep, uint256 _baseInterval, uint256 _incrementInterval, uint256 _minTranche, uint256 _maxTranche, uint256 _maxBeneficiaries, ICommunity _previousCommunity ) external; function getVersion() external pure returns(uint256); function previousCommunity() external view returns(ICommunity); function copyOf() external view returns(ICommunity); function copies() external view returns(address[] memory); function originalClaimAmount() external view returns(uint256); function claimAmount() external view returns(uint256); function baseInterval() external view returns(uint256); function incrementInterval() external view returns(uint256); function maxClaim() external view returns(uint256); function maxTotalClaim() external view returns(uint256); function validBeneficiaryCount() external view returns(uint); function maxBeneficiaries() external view returns(uint); function treasuryFunds() external view returns(uint); function privateFunds() external view returns(uint); function communityAdmin() external view returns(ICommunityAdmin); function cUSD() external view returns(IERC20); function token() external view returns(IERC20); function tokenList() external view returns(address[] memory); function locked() external view returns(bool); function beneficiaries(address _beneficiaryAddress) external view returns( BeneficiaryState state, uint256 claims, uint256 claimedAmount, uint256 lastClaim ); function beneficiaryClaimedAmounts(address _beneficiaryAddress) external view returns (uint256[] memory claimedAmounts); function decreaseStep() external view returns(uint); function beneficiaryListAt(uint256 _index) external view returns (address); function impactMarketAddress() external pure returns (address); function beneficiaryListLength() external view returns (uint256); function minTranche() external view returns(uint256); function maxTranche() external view returns(uint256); function lastFundRequest() external view returns(uint256); function tokenUpdates(uint256 _index) external view returns ( address tokenAddress, uint256 ratio, uint256 startBlock ); function tokenUpdatesLength() external view returns (uint256); function isSelfFunding() external view returns (bool); function setBeneficiaryState(address _beneficiaryAddress, BeneficiaryState _state) external; function updateCommunityAdmin(ICommunityAdmin _communityAdmin) external; function updatePreviousCommunity(ICommunity _newPreviousCommunity) external; function updateBeneficiaryParams( uint256 _claimAmount, uint256 _maxClaim, uint256 _decreaseStep, uint256 _baseInterval, uint256 _incrementInterval ) external; function updateCommunityParams( uint256 _minTranche, uint256 _maxTranche ) external; function updateMaxBeneficiaries(uint256 _newMaxBeneficiaries) external; function updateToken( IERC20 _newToken, address[] calldata _exchangePath, uint256 _claimAmount, uint256 _maxClaim, uint256 _decreaseStep, uint256 _baseInterval, uint256 _incrementInterval ) external; function donate(address _sender, uint256 _amount) external; function addTreasuryFunds(uint256 _amount) external; function transfer(IERC20 _token, address _to, uint256 _amount) external; function addManager(address _managerAddress) external; function removeManager(address _managerAddress) external; function addBeneficiary(address _beneficiaryAddress) external; function addBeneficiaries(address[] memory _beneficiaryAddresses) external; function addBeneficiariesUsingSignature( address[] memory _beneficiaryAddresses, uint256 _expirationTimestamp, bytes calldata _signature ) external; function copyBeneficiaries(address[] memory _beneficiaryAddresses) external; function lockBeneficiary(address _beneficiaryAddress) external; function lockBeneficiaries(address[] memory _beneficiaryAddresses) external; function lockBeneficiariesUsingSignature( address[] memory _beneficiaryAddresses, uint256 _expirationTimestamp, bytes calldata _signature ) external; function unlockBeneficiary(address _beneficiaryAddress) external; function unlockBeneficiaries(address[] memory _beneficiaryAddresses) external; function unlockBeneficiariesUsingSignature( address[] memory _beneficiaryAddresses, uint256 _expirationTimestamp, bytes calldata _signature ) external; function removeBeneficiary(address _beneficiaryAddress) external; function removeBeneficiaries(address[] memory _beneficiaryAddresses) external; function removeBeneficiariesUsingSignature( address[] memory _beneficiaryAddresses, uint256 _expirationTimestamp, bytes calldata _signature ) external; function changeBeneficiaryAddressByManager(address _oldBeneficiaryAddress, address _newBeneficiaryAddress) external; function changeBeneficiaryAddress(address _newBeneficiaryAddress) external; function claim() external; function lastInterval(address _beneficiaryAddress) external view returns (uint256); function claimCooldown(address _beneficiaryAddress) external view returns (uint256); function lock() external; function unlock() external; function requestFunds() external; function beneficiaryJoinFromMigrated(address _beneficiaryAddress) external; function getInitialMaxClaim() external view returns (uint256); function addCopy(ICommunity _copy) external; function copyCommunityDetails(ICommunity _originalCommunity) external; }
/contracts/community/interfaces/ICommunityAdmin.sol
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.4; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "./ICommunity.sol"; import "../../treasury/interfaces/ITreasury.sol"; import "../../governor/impactMarketCouncil/interfaces/IImpactMarketCouncil.sol"; import "../../ambassadors/interfaces/IAmbassadors.sol"; interface ICommunityAdmin { enum CommunityState { NONE, Valid, Removed, Migrated } function getVersion() external pure returns(uint256); function cUSD() external view returns(IERC20); function treasury() external view returns(ITreasury); function impactMarketCouncil() external view returns(IImpactMarketCouncil); function ambassadors() external view returns(IAmbassadors); function communityMiddleProxy() external view returns(address); function authorizedWalletAddress() external view returns(address); function minClaimAmountRatio() external view returns(uint256); function minClaimAmountRatioPrecision() external view returns(uint256); function communities(address _community) external view returns(CommunityState); function communityImplementation() external view returns(ICommunity); function communityProxyAdmin() external view returns(ProxyAdmin); function communityListAt(uint256 _index) external view returns (address); function communityListLength() external view returns (uint256); function treasurySafetyPercentage() external view returns (uint256); function treasuryMinBalance() external view returns (uint256); function isAmbassadorOrEntityOfCommunity(address _community, address _ambassadorOrEntity) external view returns (bool); function updateTreasury(ITreasury _newTreasury) external; function updateImpactMarketCouncil(IImpactMarketCouncil _newImpactMarketCouncil) external; function updateAmbassadors(IAmbassadors _newAmbassadors) external; function updateCommunityMiddleProxy(address _communityMiddleProxy) external; function updateCommunityImplementation(ICommunity _communityImplementation_) external; function updateAuthorizedWalletAddress(address _newSignerAddress) external; function updateMinClaimAmountRatio(uint256 _newMinClaimAmountRatio) external; function updateTreasurySafetyPercentage(uint256 _newTreasurySafetyPercentage) external; function updateTreasuryMinBalance(uint256 _newTreasuryMinBalance) external; function setCommunityToAmbassador(address _ambassador, ICommunity _communityAddress) external; function updateBeneficiaryParams( ICommunity _community, uint256 _claimAmount, uint256 _maxClaim, uint256 _decreaseStep, uint256 _baseInterval, uint256 _incrementInterval, uint256 _maxBeneficiaries ) external; function updateCommunityParams( ICommunity _community, uint256 _minTranche, uint256 _maxTranche ) external; function updateProxyImplementation(address _communityMiddleProxy, address _newLogic) external; function updateCommunityToken( ICommunity _community, IERC20 _newToken, address[] memory _exchangePath, uint256 _claimAmount, uint256 _maxClaim, uint256 _decreaseStep, uint256 _baseInterval, uint256 _incrementInterval ) external; function addCommunity( address _tokenAddress, address[] memory _managers, address _ambassador, uint256 _claimAmount, uint256 _maxClaim, uint256 _decreaseStep, uint256 _baseInterval, uint256 _incrementInterval, uint256 _minTranche, uint256 _maxTranche, uint256 _maxBeneficiaries ) external; function migrateCommunity( address[] memory _managers, ICommunity _previousCommunity ) external; function splitCommunity( ICommunity _community, uint256 _numberOfCopies, address _ambassador, address[] memory _managers ) external; function removeCommunity(ICommunity _community) external; function fundCommunity() external returns(uint256); function calculateCommunityTrancheAmount(ICommunity _community) external view returns (uint256); function transfer(IERC20 _token, address _to, uint256 _amount) external; function transferFromCommunity( ICommunity _community, IERC20 _token, address _to, uint256 _amount ) external; function getCommunityProxyImplementation(address _communityProxyAddress) external view returns(address); }
/contracts/governor/impactMarketCouncil/interfaces/IImpactMarketCouncil.sol
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.4; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; interface IImpactMarketCouncil { struct Proposal { // Unique id for looking up a proposal uint256 id; // Creator of the proposal address proposer; // The block at which voting ends: votes must be cast prior to this block uint256 endBlock; // Current number of votes in favor of this proposal uint256 forVotes; // Current number of votes in opposition to this proposal uint256 againstVotes; // Current number of votes for abstaining for this proposal uint256 abstainVotes; // Flag marking whether the proposal has been canceled bool canceled; // Flag marking whether the proposal has been executed bool executed; } /// @notice Ballot receipt record for a voter struct Receipt { // Whether or not a vote has been cast bool hasVoted; // Whether or not the voter supports the proposal or abstains uint8 support; // The number of votes the voter had, which were cast uint96 votes; } /// @notice Possible states that a proposal may be in enum ProposalState { Pending, Active, Canceled, Expired, Succeeded, Executed } }
/contracts/governor/impactMarketCouncil/interfaces/ImpactMarketCouncilStorageV1.sol
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.4; import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol"; import "@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol"; import "../../../community/interfaces/ICommunityAdmin.sol"; import "./IImpactMarketCouncil.sol"; abstract contract ImpactMarketCouncilStorageV1 is IImpactMarketCouncil { ProxyAdmin public communityProxyAdmin; ICommunityAdmin public communityAdmin; /// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed uint256 public quorumVotes; /// @notice The total number of proposals uint256 public proposalCount; /// @notice The council members mapping(address => bool) public members; /// @notice The official record of all proposals ever proposed mapping(uint256 => Proposal) public proposals; /// @notice The official each proposal's signatures: /// An ordered list of function signatures to be called mapping(uint256 => string[]) public proposalSignatures; /// @notice The official each proposal's calldatas: /// An ordered list of calldata to be passed to each call mapping(uint256 => bytes[]) public proposalCalldatas; /// @notice The official each proposal's receipts: /// Receipts of ballots for the entire set of voters mapping(uint256 => mapping(address => Receipt)) public proposalReceipts; /// @notice The latest proposal for each proposer mapping(address => uint256) public latestProposalIds; /// @notice The official each proposal's targets: /// An ordered list of target addresses for calls to be made mapping(uint256 => address[]) public proposalTargets; }
/contracts/treasury/interfaces/ITreasury.sol
//SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.4; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import "../../community/interfaces/ICommunityAdmin.sol"; import "./IUniswapV2Router.sol"; interface ITreasury { struct Token { uint256 rate; address[] exchangePath; } function getVersion() external pure returns(uint256); function communityAdmin() external view returns(ICommunityAdmin); function uniswapRouter() external view returns(IUniswapV2Router); function updateCommunityAdmin(ICommunityAdmin _communityAdmin) external; function updateUniswapRouter(IUniswapV2Router _uniswapRouter) external; function transfer(IERC20 _token, address _to, uint256 _amount) external; function isToken(address _tokenAddress) external view returns (bool); function tokenListLength() external view returns (uint256); function tokenListAt(uint256 _index) external view returns (address); function tokens(address _tokenAddress) external view returns (uint256 rate, address[] memory exchangePath); function setToken(address _tokenAddress, uint256 _rate, address[] calldata _exchangePath) external; function removeToken(address _tokenAddress) external; function getConvertedAmount(address _tokenAddress, uint256 _amount) external view returns (uint256); function convertAmount( address _tokenAddress, uint256 _amountIn, uint256 _amountOutMin, address[] memory _exchangePath, uint256 _deadline ) external; }
/contracts/treasury/interfaces/IUniswapV2Router.sol
// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.4; interface IUniswapV2Router { function factory() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function pairFor(address tokenA, address tokenB) external view returns (address); }
Contract ABI
[{"type":"event","name":"MemberAdded","inputs":[{"type":"address","name":"member","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"MemberRemoved","inputs":[{"type":"address","name":"member","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"NewImplementation","inputs":[{"type":"address","name":"oldImplementation","internalType":"address","indexed":false},{"type":"address","name":"newImplementation","internalType":"address","indexed":false}],"anonymous":false},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"ProposalCanceled","inputs":[{"type":"uint256","name":"id","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalCreated","inputs":[{"type":"uint256","name":"id","internalType":"uint256","indexed":false},{"type":"address","name":"proposer","internalType":"address","indexed":false},{"type":"address[]","name":"targets","internalType":"address[]","indexed":false},{"type":"string[]","name":"signatures","internalType":"string[]","indexed":false},{"type":"bytes[]","name":"calldatas","internalType":"bytes[]","indexed":false},{"type":"uint256","name":"endBlock","internalType":"uint256","indexed":false},{"type":"string","name":"description","internalType":"string","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalExecuted","inputs":[{"type":"uint256","name":"id","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"QuorumVotesSet","inputs":[{"type":"uint256","name":"oldQuorumVotes","internalType":"uint256","indexed":false},{"type":"uint256","name":"newQuorumVotes","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"TransferERC20","inputs":[{"type":"address","name":"token","internalType":"address","indexed":true},{"type":"address","name":"to","internalType":"address","indexed":true},{"type":"uint256","name":"amount","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"event","name":"VoteCast","inputs":[{"type":"address","name":"voter","internalType":"address","indexed":true},{"type":"uint256","name":"proposalId","internalType":"uint256","indexed":false},{"type":"uint8","name":"support","internalType":"uint8","indexed":false},{"type":"uint256","name":"votes","internalType":"uint256","indexed":false},{"type":"string","name":"reason","internalType":"string","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"MAX_VOTING_PERIOD","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"PROPOSAL_MAX_OPERATIONS","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addMember","inputs":[{"type":"address","name":"_member","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancel","inputs":[{"type":"uint256","name":"_proposalId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"castVote","inputs":[{"type":"uint256","name":"_proposalId","internalType":"uint256"},{"type":"uint8","name":"_support","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ICommunityAdmin"}],"name":"communityAdmin","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"contract ProxyAdmin"}],"name":"communityProxyAdmin","inputs":[]},{"type":"function","stateMutability":"payable","outputs":[],"name":"execute","inputs":[{"type":"uint256","name":"_proposalId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string[]","name":"signatures","internalType":"string[]"},{"type":"bytes[]","name":"calldatas","internalType":"bytes[]"}],"name":"getActions","inputs":[{"type":"uint256","name":"_proposalId","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct IImpactMarketCouncil.Receipt","components":[{"type":"bool","name":"hasVoted","internalType":"bool"},{"type":"uint8","name":"support","internalType":"uint8"},{"type":"uint96","name":"votes","internalType":"uint96"}]}],"name":"getReceipt","inputs":[{"type":"uint256","name":"_proposalId","internalType":"uint256"},{"type":"address","name":"_voter","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"initialize","inputs":[{"type":"uint256","name":"_quorumVotes","internalType":"uint256"},{"type":"address","name":"_communityAdmin","internalType":"contract ICommunityAdmin"},{"type":"address[]","name":"_members","internalType":"address[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"latestProposalIds","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"members","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"proposalCalldatas","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"proposalCount","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"hasVoted","internalType":"bool"},{"type":"uint8","name":"support","internalType":"uint8"},{"type":"uint96","name":"votes","internalType":"uint96"}],"name":"proposalReceipts","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"string","name":"","internalType":"string"}],"name":"proposalSignatures","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"proposalTargets","inputs":[{"type":"uint256","name":"","internalType":"uint256"},{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"id","internalType":"uint256"},{"type":"address","name":"proposer","internalType":"address"},{"type":"uint256","name":"endBlock","internalType":"uint256"},{"type":"uint256","name":"forVotes","internalType":"uint256"},{"type":"uint256","name":"againstVotes","internalType":"uint256"},{"type":"uint256","name":"abstainVotes","internalType":"uint256"},{"type":"bool","name":"canceled","internalType":"bool"},{"type":"bool","name":"executed","internalType":"bool"}],"name":"proposals","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"propose","inputs":[{"type":"address[]","name":"_targets","internalType":"address[]"},{"type":"string[]","name":"_signatures","internalType":"string[]"},{"type":"bytes[]","name":"_calldatas","internalType":"bytes[]"},{"type":"string","name":"_description","internalType":"string"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"quorumVotes","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeMember","inputs":[{"type":"address","name":"_member","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setQuorumVotes","inputs":[{"type":"uint256","name":"_newQuorumVotes","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"enum IImpactMarketCouncil.ProposalState"}],"name":"state","inputs":[{"type":"uint256","name":"_proposalId","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
Contract Creation Code
0x608060405234801561001057600080fd5b5061351e806100206000396000f3fe608060405260043610620001be5760003560e01c80634e42b06d11620000ff578063a64e024a1162000095578063da35c664116200006c578063da35c6641462000652578063e23a9a52146200066a578063f2fde38b1462000735578063fe0d94c1146200075a57600080fd5b8063a64e024a14620005ef578063ac6746641462000608578063ca6d56dc146200062d57600080fd5b80636617674311620000d657806366176743146200050f578063715018a614620005925780638da5cb5b14620005aa578063a4a53a1314620005ca57600080fd5b80634e42b06d14620004945780635678138814620004c85780635fac917a14620004ed57600080fd5b806317977c61116200017557806336e7048a116200014c57806336e7048a14620003ff5780633e4f49e6146200041657806340e58ee5146200044a578063463e34be146200046f57600080fd5b806317977c61146200038157806324bc1a6414620003b2578063328dd98214620003ca57600080fd5b8063013cf08b14620001c3578063016a0416146200028157806302ec8f9e14620002bc57806308ae4b0c14620002e35780630b1ca49a146200032857806311e91b9a146200034d575b600080fd5b348015620001d057600080fd5b5062000235620001e236600462002650565b609c60205260009081526040902080546001820154600283015460038401546004850154600586015460069096015494956001600160a01b03909416949293919290919060ff8082169161010090041688565b604080519889526001600160a01b039097166020890152958701949094526060860192909252608085015260a0840152151560c0830152151560e0820152610100015b60405180910390f35b3480156200028e57600080fd5b50609754620002a3906001600160a01b031681565b6040516001600160a01b03909116815260200162000278565b348015620002c957600080fd5b50620002e1620002db36600462002650565b62000771565b005b348015620002f057600080fd5b50620003176200030236600462002513565b609b6020526000908152604090205460ff1681565b604051901515815260200162000278565b3480156200033557600080fd5b50620002e16200034736600462002513565b6200084f565b3480156200035a57600080fd5b50620003726200036c36600462002532565b62000943565b60405190815260200162000278565b3480156200038e57600080fd5b5062000372620003a036600462002513565b60a06020526000908152604090205481565b348015620003bf57600080fd5b506200037260995481565b348015620003d757600080fd5b50620003ef620003e936600462002650565b62000c88565b6040516200027892919062002979565b3480156200040c57600080fd5b5062000372600a81565b3480156200042357600080fd5b506200043b6200043536600462002650565b62000e63565b604051620002789190620029c0565b3480156200045757600080fd5b50620002e16200046936600462002650565b62000f4b565b3480156200047c57600080fd5b50620002e16200048e3660046200269b565b620010da565b348015620004a157600080fd5b50620004b9620004b336600462002729565b6200152e565b604051620002789190620029ab565b348015620004d557600080fd5b50620002e1620004e73660046200274b565b620015f0565b348015620004fa57600080fd5b50609854620002a3906001600160a01b031681565b3480156200051c57600080fd5b50620005696200052e36600462002669565b609f60209081526000928352604080842090915290825290205460ff808216916101008104909116906201000090046001600160601b031683565b60408051931515845260ff90921660208401526001600160601b03169082015260600162000278565b3480156200059f57600080fd5b50620002e162001694565b348015620005b757600080fd5b506033546001600160a01b0316620002a3565b348015620005d757600080fd5b50620004b9620005e936600462002729565b620016cf565b348015620005fc57600080fd5b50620003726207e90081565b3480156200061557600080fd5b50620002a36200062736600462002729565b620016ec565b3480156200063a57600080fd5b50620002e16200064c36600462002513565b62001725565b3480156200065f57600080fd5b5062000372609a5481565b3480156200067757600080fd5b50620007046200068936600462002669565b6040805160608101825260008082526020820181905291810191909152506000918252609f602090815260408084206001600160a01b03939093168452918152918190208151606081018352905460ff8082161515835261010082041693820193909352620100009092046001600160601b03169082015290565b6040805182511515815260208084015160ff1690820152918101516001600160601b03169082015260600162000278565b3480156200074257600080fd5b50620002e16200075436600462002513565b6200181c565b620002e16200076b36600462002650565b620018be565b6033546001600160a01b03163314620007a75760405162461bcd60e51b81526004016200079e90620029e9565b60405180910390fd5b60018110156200080e5760405162461bcd60e51b815260206004820152602b60248201527f504143543a3a5f73657451756f72756d566f7465733a20696e76616c6964207160448201526a756f72756d20766f74657360a81b60648201526084016200079e565b60995460408051918252602082018390527fffff0a251408cb8f05a4fc2ab0bdffe28e1519cb8ee5bdb6531e5d6ca51aaf75910160405180910390a1609955565b6033546001600160a01b031633146200087c5760405162461bcd60e51b81526004016200079e90620029e9565b6001600160a01b0381166000908152609b602052604090205460ff161515600114620008eb5760405162461bcd60e51b815260206004820181905260248201527f504143543a3a72656d6f76654d656d6265723a206e6f742061206d656d62657260448201526064016200079e565b6001600160a01b0381166000818152609b6020908152604091829020805460ff1916905590519182527f6e76fb4c77256006d9c38ec7d82b45a8c8f3c27b1d6766fffc42dfb8de68449291015b60405180910390a150565b336000908152609b602052604081205460ff1615156001146200097a5760405162461bcd60e51b81526004016200079e9062002a1e565b825185511480156200098d575082518451145b62000a015760405162461bcd60e51b815260206004820152603b60248201527f504143543a3a70726f706f73653a2070726f706f73616c2066756e6374696f6e60448201527f20696e666f726d6174696f6e206172697479206d69736d61746368000000000060648201526084016200079e565b835162000a5d5760405162461bcd60e51b815260206004820152602360248201527f504143543a3a70726f706f73653a206d7573742070726f7669646520616374696044820152626f6e7360e81b60648201526084016200079e565b600a8451111562000ab15760405162461bcd60e51b815260206004820152601f60248201527f504143543a3a70726f706f73653a20746f6f206d616e7920616374696f6e730060448201526064016200079e565b600062000ac2436207e90062001cfb565b6040805161010081018252609a80548083523360208401529282018490526000606083018190526080830181905260a0830181905260c0830181905260e08301819052939450909262000b158362002cf1565b909155505080516000908152609c602090815260408083208451808255838601516001830180546001600160a01b039092166001600160a01b0319909216919091179055828601516002830155606086015160038301556080860151600483015560a0860151600583015560c08601516006909201805460e088015115156101000261ff00199415159490941661ffff199091161792909217909155835260a18252909120885162000bca928a01906200210b565b5080516000908152609d60209081526040909120875162000bee9289019062002175565b5080516000908152609e60209081526040909120865162000c1292880190620021d5565b5080516020808301516001600160a01b0316600090815260a090915260409081902091909155815190517f52e57357458ad3ae6b8f4c5f1bf4aa2faca39f6020ff350a7b5db813633d4aed9162000c759133908b908b908b9089908c9062002a96565b60405180910390a1519695505050505050565b6000818152609d60209081526040808320609e835281842081548351818602810186019094528084526060958695939492938592919084015b8282101562000d7757838290600052602060002001805462000ce39062002cba565b80601f016020809104026020016040519081016040528092919081815260200182805462000d119062002cba565b801562000d625780601f1062000d365761010080835404028352916020019162000d62565b820191906000526020600020905b81548152906001019060200180831162000d4457829003601f168201915b50505050508152602001906001019062000cc1565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101562000e5457838290600052602060002001805462000dc09062002cba565b80601f016020809104026020016040519081016040528092919081815260200182805462000dee9062002cba565b801562000e3f5780601f1062000e135761010080835404028352916020019162000e3f565b820191906000526020600020905b81548152906001019060200180831162000e2157829003601f168201915b50505050508152602001906001019062000d9e565b50505050905091509150915091565b600081609a541162000eb85760405162461bcd60e51b815260206004820181905260248201527f504143543a3a73746174653a20696e76616c69642070726f706f73616c20696460448201526064016200079e565b6000828152609c60205260409020600681015460ff161562000edd5750600292915050565b6006810154610100900460ff161562000ef95750600592915050565b806002015443111562000f0f5750600392915050565b8060040154816003015411801562000f2d5750609954816003015410155b1562000f3c5750600492915050565b50600192915050565b50919050565b336000908152609b602052604090205460ff16151560011462000f825760405162461bcd60e51b81526004016200079e9062002a1e565b600562000f8f8262000e63565b600581111562000faf57634e487b7160e01b600052602160045260246000fd5b1415620010155760405162461bcd60e51b815260206004820152602d60248201527f504143543a3a63616e63656c3a2063616e6e6f742063616e63656c206578656360448201526c1d5d1959081c1c9bdc1bdcd85b609a1b60648201526084016200079e565b6000818152609c6020526040902060018101546001600160a01b031633146200108c5760405162461bcd60e51b815260206004820152602260248201527f504143543a3a63616e63656c3a2070726f706f736572206e6f7420616c6c6f77604482015261195960f21b60648201526084016200079e565b60068101805460ff191660011790556040517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90620010ce9084815260200190565b60405180910390a15050565b600054610100900460ff16620010f75760005460ff1615620010fb565b303b155b620011605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200079e565b600054610100900460ff1615801562001183576000805461ffff19166101011790555b6001851015620011eb5760405162461bcd60e51b815260206004820152602c60248201527f504143543a3a696e697469616c697a653a20696e76616c69642070726f706f7360448201526b185b081d1a1c995cda1bdb1960a21b60648201526084016200079e565b81851115620012475760405162461bcd60e51b815260206004820152602160248201527f504143543a3a696e697469616c697a653a20706172616d73206d69736d6174636044820152600d60fb1b60648201526084016200079e565b6200125162001d59565b6200125b62001d97565b604051620012699062002235565b604051809103906000f08015801562001286573d6000803e3d6000fd5b50609780546001600160a01b03199081166001600160a01b03938416179091556098805490911691861691909117905560998590556040805161010081018252609a80548083523060208401526000938301849052606083018490526080830184905260a08301849052600160c084015260e0830184905291926200130b8362002cf1565b909155505080516000908152609c602090815260408083208451808255838601516001830180546001600160a01b039092166001600160a01b031990921682179055838701516002840155606087015160038401556080870151600484015560a080880151600585015560c08801516006909401805460e08a015115156101000261ff00199615159690961661ffff19909116179490941790935585529252822055835b80821015620014a7576001609b6000888886818110620013df57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190620013f6919062002513565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557fb251eb052afc73ffd02ffe85ad79990a8b3fed60d76dbc2fa2fdd7123dffd9148686848181106200146057634e487b7160e01b600052603260045260246000fd5b905060200201602081019062001477919062002513565b6040516001600160a01b03909116815260200160405180910390a1816200149e8162002cf1565b925050620013af565b8251600081815260a16020908152604080832087518452609d835281842088518552609e90935281842091517f52e57357458ad3ae6b8f4c5f1bf4aa2faca39f6020ff350a7b5db813633d4aed95620015099590943094909290919062002b4d565b60405180910390a1505050801562001527576000805461ff00191690555b5050505050565b609e60205281600052604060002081815481106200154b57600080fd5b90600052602060002001600091509150508054620015699062002cba565b80601f0160208091040260200160405190810160405280929190818152602001828054620015979062002cba565b8015620015e85780601f10620015bc57610100808354040283529160200191620015e8565b820191906000526020600020905b815481529060010190602001808311620015ca57829003601f168201915b505050505081565b336000908152609b602052604090205460ff161515600114620016275760405162461bcd60e51b81526004016200079e9062002a1e565b337fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda483836200165884838362001dcb565b6040805193845260ff90921660208401526001600160601b03169082015260806060820181905260009082015260a00160405180910390a25050565b6033546001600160a01b03163314620016c15760405162461bcd60e51b81526004016200079e90620029e9565b620016cd600062002029565b565b609d60205281600052604060002081815481106200154b57600080fd5b60a160205281600052604060002081815481106200170957600080fd5b6000918252602090912001546001600160a01b03169150829050565b6033546001600160a01b03163314620017525760405162461bcd60e51b81526004016200079e90620029e9565b6001600160a01b0381166000908152609b602052604090205460ff1615620017c75760405162461bcd60e51b815260206004820152602160248201527f504143543a3a6164644d656d6265723a20616c72656164792061206d656d62656044820152603960f91b60648201526084016200079e565b6001600160a01b0381166000818152609b6020908152604091829020805460ff1916600117905590519182527fb251eb052afc73ffd02ffe85ad79990a8b3fed60d76dbc2fa2fdd7123dffd914910162000938565b6033546001600160a01b03163314620018495760405162461bcd60e51b81526004016200079e90620029e9565b6001600160a01b038116620018b05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200079e565b620018bb8162002029565b50565b336000908152609b602052604090205460ff161515600114620018f55760405162461bcd60e51b81526004016200079e9062002a1e565b6004620019028262000e63565b60058111156200192257634e487b7160e01b600052602160045260246000fd5b14620019975760405162461bcd60e51b815260206004820152603f60248201527f504143543a3a657865637574653a2070726f706f73616c2063616e206f6e6c7960448201527f206265206578656375746564206966206974206973207375636365656465640060648201526084016200079e565b6000818152609c6020908152604080832060068101805461ff001916610100179055609e9092528220549091905b8082101562001cc2576000848152609d602052604090208054606091908490811062001a0157634e487b7160e01b600052603260045260246000fd5b90600052602060002001805462001a189062002cba565b1515905062001af3576000858152609e6020526040902080548490811062001a5057634e487b7160e01b600052603260045260246000fd5b90600052602060002001805462001a679062002cba565b80601f016020809104026020016040519081016040528092919081815260200182805462001a959062002cba565b801562001ae65780601f1062001aba5761010080835404028352916020019162001ae6565b820191906000526020600020905b81548152906001019060200180831162001ac857829003601f168201915b5050505050905062001ba5565b6000858152609d6020526040902080548490811062001b2257634e487b7160e01b600052603260045260246000fd5b9060005260206000200160405162001b3b91906200296b565b6040518091039020609e6000878152602001908152602001600020848154811062001b7657634e487b7160e01b600052603260045260246000fd5b9060005260206000200160405160200162001b9392919062002927565b60405160208183030381529060405290505b600085815260a16020526040812080548590811062001bd457634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516001600160a01b03909116919062001bfc9085906200294d565b60006040518083038185875af1925050503d806000811462001c3b576040519150601f19603f3d011682016040523d82523d6000602084013e62001c40565b606091505b505090508062001caa5760405162461bcd60e51b815260206004820152602e60248201527f504143543a3a657865637574653a205472616e73616374696f6e20657865637560448201526d3a34b7b7103932bb32b93a32b21760911b60648201526084016200079e565b5050818062001cb99062002cf1565b925050620019c5565b6040518481527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f9060200160405180910390a150505050565b60008062001d0a838562002c6c565b90508381101562001d525760405162461bcd60e51b81526020600482015260116024820152706164646974696f6e206f766572666c6f7760781b60448201526064016200079e565b9392505050565b600054610100900460ff1662001d835760405162461bcd60e51b81526004016200079e9062002a4b565b62001d8d6200207b565b620016cd620020a5565b600054610100900460ff1662001dc15760405162461bcd60e51b81526004016200079e9062002a4b565b620016cd620020da565b6000600162001dda8462000e63565b600581111562001dfa57634e487b7160e01b600052602160045260246000fd5b1462001e5a5760405162461bcd60e51b815260206004820152602860248201527f504143543a3a63617374566f7465496e7465726e616c3a20766f74696e6720696044820152671cc818db1bdcd95960c21b60648201526084016200079e565b60028260ff16111562001ec25760405162461bcd60e51b815260206004820152602960248201527f504143543a3a63617374566f7465496e7465726e616c3a20696e76616c696420604482015268766f7465207479706560b81b60648201526084016200079e565b6000838152609c60209081526040808320609f83528184206001600160a01b0389168552909252909120805460ff161562001f545760405162461bcd60e51b815260206004820152602b60248201527f504143543a3a63617374566f7465496e7465726e616c3a20766f74657220616c60448201526a1c9958591e481d9bdd195960aa1b60648201526084016200079e565b600160ff851662001f835762001f788360040154826001600160601b031662001cfb565b600484015562001fe0565b8460ff166001141562001fb45762001fa98360030154826001600160601b031662001cfb565b600384015562001fe0565b8460ff166002141562001fe05762001fda8360050154826001600160601b031662001cfb565b60058401555b81546001600160601b03821662010000026dffffffffffffffffffffffff00001960ff88166101000261ffff199093169290921760011791909116179091559150509392505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620016cd5760405162461bcd60e51b81526004016200079e9062002a4b565b600054610100900460ff16620020cf5760405162461bcd60e51b81526004016200079e9062002a4b565b620016cd3362002029565b600054610100900460ff16620021045760405162461bcd60e51b81526004016200079e9062002a4b565b6001606555565b82805482825590600052602060002090810192821562002163579160200282015b828111156200216357825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200212c565b506200217192915062002243565b5090565b828054828255906000526020600020908101928215620021c7579160200282015b82811115620021c75782518051620021b69184916020909101906200225a565b509160200191906001019062002196565b5062002171929150620022d7565b82805482825590600052602060002090810192821562002227579160200282015b82811115620022275782518051620022169184916020909101906200225a565b5091602001919060010190620021f6565b5062002171929150620022f8565b6107978062002d5283390190565b5b8082111562002171576000815560010162002244565b828054620022689062002cba565b90600052602060002090601f0160209004810192826200228c576000855562002163565b82601f10620022a757805160ff191683800117855562002163565b8280016001018555821562002163579182015b8281111562002163578251825591602001919060010190620022ba565b8082111562002171576000620022ee828262002319565b50600101620022d7565b80821115620021715760006200230f828262002319565b50600101620022f8565b508054620023279062002cba565b6000825580601f1062002338575050565b601f016020900490600052602060002090810190620018bb919062002243565b600067ffffffffffffffff83111562002375576200237562002d25565b6200238a601f8401601f191660200162002c11565b90508281528383830111156200239f57600080fd5b828260208301376000602084830101529392505050565b600082601f830112620023c7578081fd5b81356020620023e0620023da8362002c45565b62002c11565b80838252828201915082860187848660051b890101111562002400578586fd5b855b858110156200245a57813567ffffffffffffffff81111562002422578788fd5b8801603f81018a1362002433578788fd5b620024468a878301356040840162002358565b855250928401929084019060010162002402565b5090979650505050505050565b600082601f83011262002478578081fd5b813560206200248b620023da8362002c45565b80838252828201915082860187848660051b8901011115620024ab578586fd5b855b858110156200245a57813567ffffffffffffffff811115620024cd578788fd5b620024dd8a87838c0101620024f1565b8552509284019290840190600101620024ad565b600082601f83011262002502578081fd5b62001d528383356020850162002358565b60006020828403121562002525578081fd5b813562001d528162002d3b565b6000806000806080858703121562002548578283fd5b843567ffffffffffffffff8082111562002560578485fd5b818701915087601f83011262002574578485fd5b8135602062002587620023da8362002c45565b8083825282820191508286018c848660051b8901011115620025a757898afd5b8996505b84871015620025d6578035620025c18162002d3b565b835260019690960195918301918301620025ab565b5098505088013592505080821115620025ed578485fd5b620025fb8883890162002467565b9450604087013591508082111562002611578384fd5b6200261f88838901620023b6565b9350606087013591508082111562002635578283fd5b506200264487828801620024f1565b91505092959194509250565b60006020828403121562002662578081fd5b5035919050565b600080604083850312156200267c578182fd5b823591506020830135620026908162002d3b565b809150509250929050565b60008060008060608587031215620026b1578384fd5b843593506020850135620026c58162002d3b565b9250604085013567ffffffffffffffff80821115620026e2578384fd5b818701915087601f830112620026f6578384fd5b81358181111562002705578485fd5b8860208260051b85010111156200271a578485fd5b95989497505060200194505050565b600080604083850312156200273c578182fd5b50508035926020909101359150565b600080604083850312156200275e578182fd5b82359150602083013560ff8116811462002690578182fd5b600081518084526020808501808196508360051b81019150828601855b85811015620027c1578284038952620027ae84835162002882565b9885019893509084019060010162002793565b5091979650505050505050565b600081548084526020808501808196508360051b81019150858552828520855b85811015620027c15782840389528682546200280a8162002cba565b808752600182811680156200282857600181146200283d576200286a565b60ff198416898b01526040890194506200286a565b868c52898c208c5b84811015620028625781548b82018d0152908301908b0162002845565b8a018b019550505b509b88019b92965050509190910190600101620027ee565b600081518084526200289c81602086016020860162002c87565b601f01601f19169290920160200192915050565b60008154620028bf8162002cba565b60018281168015620028da5760018114620028ec576200291d565b60ff198416875282870194506200291d565b8560005260208060002060005b85811015620029145781548a820152908401908201620028f9565b50505082870194505b5050505092915050565b6001600160e01b0319831681526000620029456004830184620028b0565b949350505050565b600082516200296181846020870162002c87565b9190910192915050565b600062001d528284620028b0565b6040815260006200298e604083018562002776565b8281036020840152620029a2818562002776565b95945050505050565b60208152600062001d52602083018462002882565b6020810160068310620029e357634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601390820152722820a1aa1d1d102737ba10309036b2b6b132b960691b604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b8781526001600160a01b03871660208083019190915260e060408301819052875190830181905260009188810191610100850190845b8181101562002af55784516001600160a01b031683526020830194840194925060010162002acc565b5050848103606086015262002b0b818a62002776565b92505050828103608084015262002b23818762002776565b90508460a084015282810360c084015262002b3f818562002882565b9a9950505050505050505050565b600060e0820188835260018060a01b03808916602085015260e0604085015281885480845261010086019150898552602085209350845b8181101562002bb75762002ba783858754166001600160a01b0316815260200190565b6001958601959093500162002b84565b5050848103606086015262002bcd8189620027ce565b92505050828103608084015262002be58186620027ce565b90508360a084015282810360c084015262002c04816000815260200190565b9998505050505050505050565b604051601f8201601f1916810167ffffffffffffffff8111828210171562002c3d5762002c3d62002d25565b604052919050565b600067ffffffffffffffff82111562002c625762002c6262002d25565b5060051b60200190565b6000821982111562002c825762002c8262002d0f565b500190565b60005b8381101562002ca457818101518382015260200162002c8a565b8381111562002cb4576000848401525b50505050565b600181811c9082168062002ccf57607f821691505b6020821081141562000f4557634e487b7160e01b600052602260045260246000fd5b600060001982141562002d085762002d0862002d0f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620018bb57600080fdfe608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6107198061007e6000396000f3fe60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead1461016457600080fd5b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b3660046104d8565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610517565b610254565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f36600461054f565b6102de565b34801561013057600080fd5b506100d161013f366004610517565b61036f565b34801561015057600080fd5b506100d161015f3660046104d8565b6103c7565b34801561017057600080fd5b506100a061017f3660046104d8565b610462565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d91906104fb565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f90610683565b60405180910390fd5b6102526000610488565b565b6000546001600160a01b0316331461027e5760405162461bcd60e51b815260040161023f90610683565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103085760405162461bcd60e51b815260040161023f90610683565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103389086908690600401610620565b6000604051808303818588803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161023f90610683565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102a8565b6000546001600160a01b031633146103f15760405162461bcd60e51b815260040161023f90610683565b6001600160a01b0381166104565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b61045f81610488565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156104e9578081fd5b81356104f4816106ce565b9392505050565b60006020828403121561050c578081fd5b81516104f4816106ce565b60008060408385031215610529578081fd5b8235610534816106ce565b91506020830135610544816106ce565b809150509250929050565b600080600060608486031215610563578081fd5b833561056e816106ce565b9250602084013561057e816106ce565b9150604084013567ffffffffffffffff8082111561059a578283fd5b818601915086601f8301126105ad578283fd5b8135818111156105bf576105bf6106b8565b604051601f8201601f19908116603f011681019083821181831017156105e7576105e76106b8565b816040528281528960208487010111156105ff578586fd5b82602086016020830137856020848301015280955050505050509250925092565b60018060a01b0383168152600060206040818401528351806040850152825b8181101561065b5785810183015185820160600152820161063f565b8181111561066c5783606083870101525b50601f01601f191692909201606001949350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461045f57600080fdfea2646970667358221220e38caf5ca305d28cfea5924808a41fd6f9ab62ed165ed1becf8858d95ea882a264736f6c63430008040033a264697066735822122021b9d93eb31554b79a3333de11dee2e3734f3a1f648f068cfa676c0982e45c9664736f6c63430008040033
Deployed ByteCode
0x608060405260043610620001be5760003560e01c80634e42b06d11620000ff578063a64e024a1162000095578063da35c664116200006c578063da35c6641462000652578063e23a9a52146200066a578063f2fde38b1462000735578063fe0d94c1146200075a57600080fd5b8063a64e024a14620005ef578063ac6746641462000608578063ca6d56dc146200062d57600080fd5b80636617674311620000d657806366176743146200050f578063715018a614620005925780638da5cb5b14620005aa578063a4a53a1314620005ca57600080fd5b80634e42b06d14620004945780635678138814620004c85780635fac917a14620004ed57600080fd5b806317977c61116200017557806336e7048a116200014c57806336e7048a14620003ff5780633e4f49e6146200041657806340e58ee5146200044a578063463e34be146200046f57600080fd5b806317977c61146200038157806324bc1a6414620003b2578063328dd98214620003ca57600080fd5b8063013cf08b14620001c3578063016a0416146200028157806302ec8f9e14620002bc57806308ae4b0c14620002e35780630b1ca49a146200032857806311e91b9a146200034d575b600080fd5b348015620001d057600080fd5b5062000235620001e236600462002650565b609c60205260009081526040902080546001820154600283015460038401546004850154600586015460069096015494956001600160a01b03909416949293919290919060ff8082169161010090041688565b604080519889526001600160a01b039097166020890152958701949094526060860192909252608085015260a0840152151560c0830152151560e0820152610100015b60405180910390f35b3480156200028e57600080fd5b50609754620002a3906001600160a01b031681565b6040516001600160a01b03909116815260200162000278565b348015620002c957600080fd5b50620002e1620002db36600462002650565b62000771565b005b348015620002f057600080fd5b50620003176200030236600462002513565b609b6020526000908152604090205460ff1681565b604051901515815260200162000278565b3480156200033557600080fd5b50620002e16200034736600462002513565b6200084f565b3480156200035a57600080fd5b50620003726200036c36600462002532565b62000943565b60405190815260200162000278565b3480156200038e57600080fd5b5062000372620003a036600462002513565b60a06020526000908152604090205481565b348015620003bf57600080fd5b506200037260995481565b348015620003d757600080fd5b50620003ef620003e936600462002650565b62000c88565b6040516200027892919062002979565b3480156200040c57600080fd5b5062000372600a81565b3480156200042357600080fd5b506200043b6200043536600462002650565b62000e63565b604051620002789190620029c0565b3480156200045757600080fd5b50620002e16200046936600462002650565b62000f4b565b3480156200047c57600080fd5b50620002e16200048e3660046200269b565b620010da565b348015620004a157600080fd5b50620004b9620004b336600462002729565b6200152e565b604051620002789190620029ab565b348015620004d557600080fd5b50620002e1620004e73660046200274b565b620015f0565b348015620004fa57600080fd5b50609854620002a3906001600160a01b031681565b3480156200051c57600080fd5b50620005696200052e36600462002669565b609f60209081526000928352604080842090915290825290205460ff808216916101008104909116906201000090046001600160601b031683565b60408051931515845260ff90921660208401526001600160601b03169082015260600162000278565b3480156200059f57600080fd5b50620002e162001694565b348015620005b757600080fd5b506033546001600160a01b0316620002a3565b348015620005d757600080fd5b50620004b9620005e936600462002729565b620016cf565b348015620005fc57600080fd5b50620003726207e90081565b3480156200061557600080fd5b50620002a36200062736600462002729565b620016ec565b3480156200063a57600080fd5b50620002e16200064c36600462002513565b62001725565b3480156200065f57600080fd5b5062000372609a5481565b3480156200067757600080fd5b50620007046200068936600462002669565b6040805160608101825260008082526020820181905291810191909152506000918252609f602090815260408084206001600160a01b03939093168452918152918190208151606081018352905460ff8082161515835261010082041693820193909352620100009092046001600160601b03169082015290565b6040805182511515815260208084015160ff1690820152918101516001600160601b03169082015260600162000278565b3480156200074257600080fd5b50620002e16200075436600462002513565b6200181c565b620002e16200076b36600462002650565b620018be565b6033546001600160a01b03163314620007a75760405162461bcd60e51b81526004016200079e90620029e9565b60405180910390fd5b60018110156200080e5760405162461bcd60e51b815260206004820152602b60248201527f504143543a3a5f73657451756f72756d566f7465733a20696e76616c6964207160448201526a756f72756d20766f74657360a81b60648201526084016200079e565b60995460408051918252602082018390527fffff0a251408cb8f05a4fc2ab0bdffe28e1519cb8ee5bdb6531e5d6ca51aaf75910160405180910390a1609955565b6033546001600160a01b031633146200087c5760405162461bcd60e51b81526004016200079e90620029e9565b6001600160a01b0381166000908152609b602052604090205460ff161515600114620008eb5760405162461bcd60e51b815260206004820181905260248201527f504143543a3a72656d6f76654d656d6265723a206e6f742061206d656d62657260448201526064016200079e565b6001600160a01b0381166000818152609b6020908152604091829020805460ff1916905590519182527f6e76fb4c77256006d9c38ec7d82b45a8c8f3c27b1d6766fffc42dfb8de68449291015b60405180910390a150565b336000908152609b602052604081205460ff1615156001146200097a5760405162461bcd60e51b81526004016200079e9062002a1e565b825185511480156200098d575082518451145b62000a015760405162461bcd60e51b815260206004820152603b60248201527f504143543a3a70726f706f73653a2070726f706f73616c2066756e6374696f6e60448201527f20696e666f726d6174696f6e206172697479206d69736d61746368000000000060648201526084016200079e565b835162000a5d5760405162461bcd60e51b815260206004820152602360248201527f504143543a3a70726f706f73653a206d7573742070726f7669646520616374696044820152626f6e7360e81b60648201526084016200079e565b600a8451111562000ab15760405162461bcd60e51b815260206004820152601f60248201527f504143543a3a70726f706f73653a20746f6f206d616e7920616374696f6e730060448201526064016200079e565b600062000ac2436207e90062001cfb565b6040805161010081018252609a80548083523360208401529282018490526000606083018190526080830181905260a0830181905260c0830181905260e08301819052939450909262000b158362002cf1565b909155505080516000908152609c602090815260408083208451808255838601516001830180546001600160a01b039092166001600160a01b0319909216919091179055828601516002830155606086015160038301556080860151600483015560a0860151600583015560c08601516006909201805460e088015115156101000261ff00199415159490941661ffff199091161792909217909155835260a18252909120885162000bca928a01906200210b565b5080516000908152609d60209081526040909120875162000bee9289019062002175565b5080516000908152609e60209081526040909120865162000c1292880190620021d5565b5080516020808301516001600160a01b0316600090815260a090915260409081902091909155815190517f52e57357458ad3ae6b8f4c5f1bf4aa2faca39f6020ff350a7b5db813633d4aed9162000c759133908b908b908b9089908c9062002a96565b60405180910390a1519695505050505050565b6000818152609d60209081526040808320609e835281842081548351818602810186019094528084526060958695939492938592919084015b8282101562000d7757838290600052602060002001805462000ce39062002cba565b80601f016020809104026020016040519081016040528092919081815260200182805462000d119062002cba565b801562000d625780601f1062000d365761010080835404028352916020019162000d62565b820191906000526020600020905b81548152906001019060200180831162000d4457829003601f168201915b50505050508152602001906001019062000cc1565b50505050915080805480602002602001604051908101604052809291908181526020016000905b8282101562000e5457838290600052602060002001805462000dc09062002cba565b80601f016020809104026020016040519081016040528092919081815260200182805462000dee9062002cba565b801562000e3f5780601f1062000e135761010080835404028352916020019162000e3f565b820191906000526020600020905b81548152906001019060200180831162000e2157829003601f168201915b50505050508152602001906001019062000d9e565b50505050905091509150915091565b600081609a541162000eb85760405162461bcd60e51b815260206004820181905260248201527f504143543a3a73746174653a20696e76616c69642070726f706f73616c20696460448201526064016200079e565b6000828152609c60205260409020600681015460ff161562000edd5750600292915050565b6006810154610100900460ff161562000ef95750600592915050565b806002015443111562000f0f5750600392915050565b8060040154816003015411801562000f2d5750609954816003015410155b1562000f3c5750600492915050565b50600192915050565b50919050565b336000908152609b602052604090205460ff16151560011462000f825760405162461bcd60e51b81526004016200079e9062002a1e565b600562000f8f8262000e63565b600581111562000faf57634e487b7160e01b600052602160045260246000fd5b1415620010155760405162461bcd60e51b815260206004820152602d60248201527f504143543a3a63616e63656c3a2063616e6e6f742063616e63656c206578656360448201526c1d5d1959081c1c9bdc1bdcd85b609a1b60648201526084016200079e565b6000818152609c6020526040902060018101546001600160a01b031633146200108c5760405162461bcd60e51b815260206004820152602260248201527f504143543a3a63616e63656c3a2070726f706f736572206e6f7420616c6c6f77604482015261195960f21b60648201526084016200079e565b60068101805460ff191660011790556040517f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c90620010ce9084815260200190565b60405180910390a15050565b600054610100900460ff16620010f75760005460ff1615620010fb565b303b155b620011605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016200079e565b600054610100900460ff1615801562001183576000805461ffff19166101011790555b6001851015620011eb5760405162461bcd60e51b815260206004820152602c60248201527f504143543a3a696e697469616c697a653a20696e76616c69642070726f706f7360448201526b185b081d1a1c995cda1bdb1960a21b60648201526084016200079e565b81851115620012475760405162461bcd60e51b815260206004820152602160248201527f504143543a3a696e697469616c697a653a20706172616d73206d69736d6174636044820152600d60fb1b60648201526084016200079e565b6200125162001d59565b6200125b62001d97565b604051620012699062002235565b604051809103906000f08015801562001286573d6000803e3d6000fd5b50609780546001600160a01b03199081166001600160a01b03938416179091556098805490911691861691909117905560998590556040805161010081018252609a80548083523060208401526000938301849052606083018490526080830184905260a08301849052600160c084015260e0830184905291926200130b8362002cf1565b909155505080516000908152609c602090815260408083208451808255838601516001830180546001600160a01b039092166001600160a01b031990921682179055838701516002840155606087015160038401556080870151600484015560a080880151600585015560c08801516006909401805460e08a015115156101000261ff00199615159690961661ffff19909116179490941790935585529252822055835b80821015620014a7576001609b6000888886818110620013df57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190620013f6919062002513565b6001600160a01b031681526020810191909152604001600020805460ff19169115159190911790557fb251eb052afc73ffd02ffe85ad79990a8b3fed60d76dbc2fa2fdd7123dffd9148686848181106200146057634e487b7160e01b600052603260045260246000fd5b905060200201602081019062001477919062002513565b6040516001600160a01b03909116815260200160405180910390a1816200149e8162002cf1565b925050620013af565b8251600081815260a16020908152604080832087518452609d835281842088518552609e90935281842091517f52e57357458ad3ae6b8f4c5f1bf4aa2faca39f6020ff350a7b5db813633d4aed95620015099590943094909290919062002b4d565b60405180910390a1505050801562001527576000805461ff00191690555b5050505050565b609e60205281600052604060002081815481106200154b57600080fd5b90600052602060002001600091509150508054620015699062002cba565b80601f0160208091040260200160405190810160405280929190818152602001828054620015979062002cba565b8015620015e85780601f10620015bc57610100808354040283529160200191620015e8565b820191906000526020600020905b815481529060010190602001808311620015ca57829003601f168201915b505050505081565b336000908152609b602052604090205460ff161515600114620016275760405162461bcd60e51b81526004016200079e9062002a1e565b337fb8e138887d0aa13bab447e82de9d5c1777041ecd21ca36ba824ff1e6c07ddda483836200165884838362001dcb565b6040805193845260ff90921660208401526001600160601b03169082015260806060820181905260009082015260a00160405180910390a25050565b6033546001600160a01b03163314620016c15760405162461bcd60e51b81526004016200079e90620029e9565b620016cd600062002029565b565b609d60205281600052604060002081815481106200154b57600080fd5b60a160205281600052604060002081815481106200170957600080fd5b6000918252602090912001546001600160a01b03169150829050565b6033546001600160a01b03163314620017525760405162461bcd60e51b81526004016200079e90620029e9565b6001600160a01b0381166000908152609b602052604090205460ff1615620017c75760405162461bcd60e51b815260206004820152602160248201527f504143543a3a6164644d656d6265723a20616c72656164792061206d656d62656044820152603960f91b60648201526084016200079e565b6001600160a01b0381166000818152609b6020908152604091829020805460ff1916600117905590519182527fb251eb052afc73ffd02ffe85ad79990a8b3fed60d76dbc2fa2fdd7123dffd914910162000938565b6033546001600160a01b03163314620018495760405162461bcd60e51b81526004016200079e90620029e9565b6001600160a01b038116620018b05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016200079e565b620018bb8162002029565b50565b336000908152609b602052604090205460ff161515600114620018f55760405162461bcd60e51b81526004016200079e9062002a1e565b6004620019028262000e63565b60058111156200192257634e487b7160e01b600052602160045260246000fd5b14620019975760405162461bcd60e51b815260206004820152603f60248201527f504143543a3a657865637574653a2070726f706f73616c2063616e206f6e6c7960448201527f206265206578656375746564206966206974206973207375636365656465640060648201526084016200079e565b6000818152609c6020908152604080832060068101805461ff001916610100179055609e9092528220549091905b8082101562001cc2576000848152609d602052604090208054606091908490811062001a0157634e487b7160e01b600052603260045260246000fd5b90600052602060002001805462001a189062002cba565b1515905062001af3576000858152609e6020526040902080548490811062001a5057634e487b7160e01b600052603260045260246000fd5b90600052602060002001805462001a679062002cba565b80601f016020809104026020016040519081016040528092919081815260200182805462001a959062002cba565b801562001ae65780601f1062001aba5761010080835404028352916020019162001ae6565b820191906000526020600020905b81548152906001019060200180831162001ac857829003601f168201915b5050505050905062001ba5565b6000858152609d6020526040902080548490811062001b2257634e487b7160e01b600052603260045260246000fd5b9060005260206000200160405162001b3b91906200296b565b6040518091039020609e6000878152602001908152602001600020848154811062001b7657634e487b7160e01b600052603260045260246000fd5b9060005260206000200160405160200162001b9392919062002927565b60405160208183030381529060405290505b600085815260a16020526040812080548590811062001bd457634e487b7160e01b600052603260045260246000fd5b60009182526020822001546040516001600160a01b03909116919062001bfc9085906200294d565b60006040518083038185875af1925050503d806000811462001c3b576040519150601f19603f3d011682016040523d82523d6000602084013e62001c40565b606091505b505090508062001caa5760405162461bcd60e51b815260206004820152602e60248201527f504143543a3a657865637574653a205472616e73616374696f6e20657865637560448201526d3a34b7b7103932bb32b93a32b21760911b60648201526084016200079e565b5050818062001cb99062002cf1565b925050620019c5565b6040518481527f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f9060200160405180910390a150505050565b60008062001d0a838562002c6c565b90508381101562001d525760405162461bcd60e51b81526020600482015260116024820152706164646974696f6e206f766572666c6f7760781b60448201526064016200079e565b9392505050565b600054610100900460ff1662001d835760405162461bcd60e51b81526004016200079e9062002a4b565b62001d8d6200207b565b620016cd620020a5565b600054610100900460ff1662001dc15760405162461bcd60e51b81526004016200079e9062002a4b565b620016cd620020da565b6000600162001dda8462000e63565b600581111562001dfa57634e487b7160e01b600052602160045260246000fd5b1462001e5a5760405162461bcd60e51b815260206004820152602860248201527f504143543a3a63617374566f7465496e7465726e616c3a20766f74696e6720696044820152671cc818db1bdcd95960c21b60648201526084016200079e565b60028260ff16111562001ec25760405162461bcd60e51b815260206004820152602960248201527f504143543a3a63617374566f7465496e7465726e616c3a20696e76616c696420604482015268766f7465207479706560b81b60648201526084016200079e565b6000838152609c60209081526040808320609f83528184206001600160a01b0389168552909252909120805460ff161562001f545760405162461bcd60e51b815260206004820152602b60248201527f504143543a3a63617374566f7465496e7465726e616c3a20766f74657220616c60448201526a1c9958591e481d9bdd195960aa1b60648201526084016200079e565b600160ff851662001f835762001f788360040154826001600160601b031662001cfb565b600484015562001fe0565b8460ff166001141562001fb45762001fa98360030154826001600160601b031662001cfb565b600384015562001fe0565b8460ff166002141562001fe05762001fda8360050154826001600160601b031662001cfb565b60058401555b81546001600160601b03821662010000026dffffffffffffffffffffffff00001960ff88166101000261ffff199093169290921760011791909116179091559150509392505050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16620016cd5760405162461bcd60e51b81526004016200079e9062002a4b565b600054610100900460ff16620020cf5760405162461bcd60e51b81526004016200079e9062002a4b565b620016cd3362002029565b600054610100900460ff16620021045760405162461bcd60e51b81526004016200079e9062002a4b565b6001606555565b82805482825590600052602060002090810192821562002163579160200282015b828111156200216357825182546001600160a01b0319166001600160a01b039091161782556020909201916001909101906200212c565b506200217192915062002243565b5090565b828054828255906000526020600020908101928215620021c7579160200282015b82811115620021c75782518051620021b69184916020909101906200225a565b509160200191906001019062002196565b5062002171929150620022d7565b82805482825590600052602060002090810192821562002227579160200282015b82811115620022275782518051620022169184916020909101906200225a565b5091602001919060010190620021f6565b5062002171929150620022f8565b6107978062002d5283390190565b5b8082111562002171576000815560010162002244565b828054620022689062002cba565b90600052602060002090601f0160209004810192826200228c576000855562002163565b82601f10620022a757805160ff191683800117855562002163565b8280016001018555821562002163579182015b8281111562002163578251825591602001919060010190620022ba565b8082111562002171576000620022ee828262002319565b50600101620022d7565b80821115620021715760006200230f828262002319565b50600101620022f8565b508054620023279062002cba565b6000825580601f1062002338575050565b601f016020900490600052602060002090810190620018bb919062002243565b600067ffffffffffffffff83111562002375576200237562002d25565b6200238a601f8401601f191660200162002c11565b90508281528383830111156200239f57600080fd5b828260208301376000602084830101529392505050565b600082601f830112620023c7578081fd5b81356020620023e0620023da8362002c45565b62002c11565b80838252828201915082860187848660051b890101111562002400578586fd5b855b858110156200245a57813567ffffffffffffffff81111562002422578788fd5b8801603f81018a1362002433578788fd5b620024468a878301356040840162002358565b855250928401929084019060010162002402565b5090979650505050505050565b600082601f83011262002478578081fd5b813560206200248b620023da8362002c45565b80838252828201915082860187848660051b8901011115620024ab578586fd5b855b858110156200245a57813567ffffffffffffffff811115620024cd578788fd5b620024dd8a87838c0101620024f1565b8552509284019290840190600101620024ad565b600082601f83011262002502578081fd5b62001d528383356020850162002358565b60006020828403121562002525578081fd5b813562001d528162002d3b565b6000806000806080858703121562002548578283fd5b843567ffffffffffffffff8082111562002560578485fd5b818701915087601f83011262002574578485fd5b8135602062002587620023da8362002c45565b8083825282820191508286018c848660051b8901011115620025a757898afd5b8996505b84871015620025d6578035620025c18162002d3b565b835260019690960195918301918301620025ab565b5098505088013592505080821115620025ed578485fd5b620025fb8883890162002467565b9450604087013591508082111562002611578384fd5b6200261f88838901620023b6565b9350606087013591508082111562002635578283fd5b506200264487828801620024f1565b91505092959194509250565b60006020828403121562002662578081fd5b5035919050565b600080604083850312156200267c578182fd5b823591506020830135620026908162002d3b565b809150509250929050565b60008060008060608587031215620026b1578384fd5b843593506020850135620026c58162002d3b565b9250604085013567ffffffffffffffff80821115620026e2578384fd5b818701915087601f830112620026f6578384fd5b81358181111562002705578485fd5b8860208260051b85010111156200271a578485fd5b95989497505060200194505050565b600080604083850312156200273c578182fd5b50508035926020909101359150565b600080604083850312156200275e578182fd5b82359150602083013560ff8116811462002690578182fd5b600081518084526020808501808196508360051b81019150828601855b85811015620027c1578284038952620027ae84835162002882565b9885019893509084019060010162002793565b5091979650505050505050565b600081548084526020808501808196508360051b81019150858552828520855b85811015620027c15782840389528682546200280a8162002cba565b808752600182811680156200282857600181146200283d576200286a565b60ff198416898b01526040890194506200286a565b868c52898c208c5b84811015620028625781548b82018d0152908301908b0162002845565b8a018b019550505b509b88019b92965050509190910190600101620027ee565b600081518084526200289c81602086016020860162002c87565b601f01601f19169290920160200192915050565b60008154620028bf8162002cba565b60018281168015620028da5760018114620028ec576200291d565b60ff198416875282870194506200291d565b8560005260208060002060005b85811015620029145781548a820152908401908201620028f9565b50505082870194505b5050505092915050565b6001600160e01b0319831681526000620029456004830184620028b0565b949350505050565b600082516200296181846020870162002c87565b9190910192915050565b600062001d528284620028b0565b6040815260006200298e604083018562002776565b8281036020840152620029a2818562002776565b95945050505050565b60208152600062001d52602083018462002882565b6020810160068310620029e357634e487b7160e01b600052602160045260246000fd5b91905290565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601390820152722820a1aa1d1d102737ba10309036b2b6b132b960691b604082015260600190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b8781526001600160a01b03871660208083019190915260e060408301819052875190830181905260009188810191610100850190845b8181101562002af55784516001600160a01b031683526020830194840194925060010162002acc565b5050848103606086015262002b0b818a62002776565b92505050828103608084015262002b23818762002776565b90508460a084015282810360c084015262002b3f818562002882565b9a9950505050505050505050565b600060e0820188835260018060a01b03808916602085015260e0604085015281885480845261010086019150898552602085209350845b8181101562002bb75762002ba783858754166001600160a01b0316815260200190565b6001958601959093500162002b84565b5050848103606086015262002bcd8189620027ce565b92505050828103608084015262002be58186620027ce565b90508360a084015282810360c084015262002c04816000815260200190565b9998505050505050505050565b604051601f8201601f1916810167ffffffffffffffff8111828210171562002c3d5762002c3d62002d25565b604052919050565b600067ffffffffffffffff82111562002c625762002c6262002d25565b5060051b60200190565b6000821982111562002c825762002c8262002d0f565b500190565b60005b8381101562002ca457818101518382015260200162002c8a565b8381111562002cb4576000848401525b50505050565b600181811c9082168062002ccf57607f821691505b6020821081141562000f4557634e487b7160e01b600052602260045260246000fd5b600060001982141562002d085762002d0862002d0f565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114620018bb57600080fdfe608060405234801561001057600080fd5b5061001a3361001f565b61006f565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6107198061007e6000396000f3fe60806040526004361061007b5760003560e01c80639623609d1161004e5780639623609d1461011157806399a88ec414610124578063f2fde38b14610144578063f3b7dead1461016457600080fd5b8063204e1c7a14610080578063715018a6146100bc5780637eff275e146100d35780638da5cb5b146100f3575b600080fd5b34801561008c57600080fd5b506100a061009b3660046104d8565b610184565b6040516001600160a01b03909116815260200160405180910390f35b3480156100c857600080fd5b506100d1610215565b005b3480156100df57600080fd5b506100d16100ee366004610517565b610254565b3480156100ff57600080fd5b506000546001600160a01b03166100a0565b6100d161011f36600461054f565b6102de565b34801561013057600080fd5b506100d161013f366004610517565b61036f565b34801561015057600080fd5b506100d161015f3660046104d8565b6103c7565b34801561017057600080fd5b506100a061017f3660046104d8565b610462565b6000806000836001600160a01b03166040516101aa90635c60da1b60e01b815260040190565b600060405180830381855afa9150503d80600081146101e5576040519150601f19603f3d011682016040523d82523d6000602084013e6101ea565b606091505b5091509150816101f957600080fd5b8080602001905181019061020d91906104fb565b949350505050565b6000546001600160a01b031633146102485760405162461bcd60e51b815260040161023f90610683565b60405180910390fd5b6102526000610488565b565b6000546001600160a01b0316331461027e5760405162461bcd60e51b815260040161023f90610683565b6040516308f2839760e41b81526001600160a01b038281166004830152831690638f283970906024015b600060405180830381600087803b1580156102c257600080fd5b505af11580156102d6573d6000803e3d6000fd5b505050505050565b6000546001600160a01b031633146103085760405162461bcd60e51b815260040161023f90610683565b60405163278f794360e11b81526001600160a01b03841690634f1ef2869034906103389086908690600401610620565b6000604051808303818588803b15801561035157600080fd5b505af1158015610365573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146103995760405162461bcd60e51b815260040161023f90610683565b604051631b2ce7f360e11b81526001600160a01b038281166004830152831690633659cfe6906024016102a8565b6000546001600160a01b031633146103f15760405162461bcd60e51b815260040161023f90610683565b6001600160a01b0381166104565760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023f565b61045f81610488565b50565b6000806000836001600160a01b03166040516101aa906303e1469160e61b815260040190565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156104e9578081fd5b81356104f4816106ce565b9392505050565b60006020828403121561050c578081fd5b81516104f4816106ce565b60008060408385031215610529578081fd5b8235610534816106ce565b91506020830135610544816106ce565b809150509250929050565b600080600060608486031215610563578081fd5b833561056e816106ce565b9250602084013561057e816106ce565b9150604084013567ffffffffffffffff8082111561059a578283fd5b818601915086601f8301126105ad578283fd5b8135818111156105bf576105bf6106b8565b604051601f8201601f19908116603f011681019083821181831017156105e7576105e76106b8565b816040528281528960208487010111156105ff578586fd5b82602086016020830137856020848301015280955050505050509250925092565b60018060a01b0383168152600060206040818401528351806040850152825b8181101561065b5785810183015185820160600152820161063f565b8181111561066c5783606083870101525b50601f01601f191692909201606001949350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461045f57600080fdfea2646970667358221220e38caf5ca305d28cfea5924808a41fd6f9ab62ed165ed1becf8858d95ea882a264736f6c63430008040033a264697066735822122021b9d93eb31554b79a3333de11dee2e3734f3a1f648f068cfa676c0982e45c9664736f6c63430008040033