Source Code
Overview
ETH Balance
0 ETH
ETH Value
$0.00View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
CrowdfundingModule
Compiler Version
v0.8.6+commit.11564f7e
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.6;
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/AccessControlEnumerableUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol";
import "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/IERC20MetadataUpgradeable.sol";
import "../interfaces/IDao.sol";
import "../interfaces/IFactory.sol";
import "../interfaces/IDaoVestingModule.sol";
import "../interfaces/IShop.sol";
import "../interfaces/IPrivateExitModule.sol";
contract CrowdfundingModule is
Initializable,
UUPSUpgradeable,
AccessControlEnumerableUpgradeable
{
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;
using SafeERC20Upgradeable for IERC20Upgradeable;
IFactory public factory;
IShop public shop;
IPrivateExitModule public privateExitModule;
IDaoVestingModule public vestingModule;
address public feeAddress;
uint32 public regularFeeRate;
uint32 public discountFeeRate;
struct Sale {
address currency;
address tokenAddress;
bool isFinite;
bool isVesting;
bool isWhitelist;
bool isAllocation;
uint256 rate;
uint256 saleAmount;
uint256 minimumEntranceAmount;
uint256 maximumEntranceAmount;
uint256 endTimestamp;
uint256 vestingId;
EnumerableSetUpgradeable.AddressSet whitelist;
}
struct InvestorInfo {
uint256 boughtAmount;
uint256 allocation;
}
struct Whitelist {
address investor;
uint256 allocation;
}
mapping(address => uint256) public saleIndexes;
// dao address => current sale index
mapping(address => mapping(uint256 => Sale)) private crowdfundings;
// dao address => sale index => sale info
mapping(address => mapping(uint256 => mapping(address => InvestorInfo)))
public investorsInfo;
// dao address => sale index => investor address => bought amount
mapping(address => mapping(uint256 => uint256)) public totalBoughtAmount;
// dao address => sale index => total bought amount
mapping(address => mapping(uint256 => uint256)) public filledTokenAmount;
// dao address => sale index => total filled token amount
event InitSale(
address indexed daoAddress,
uint256 indexed saleId,
address currency,
address token,
uint256 rate,
uint256 saleAmount,
uint256 _endTimestamp,
uint256 _vestingId,
bool isFinite,
bool isVesting,
bool isWhitelist,
bool isAllocation
);
event CloseSale(address indexed daoAddress, uint256 indexed saleId);
event Buy(
address indexed daoAddress,
uint256 indexed saleId,
address indexed buyer,
address currencyAddress,
address tokenAddress,
uint256 currencyAmount,
uint256 tokenAmount
);
/// @custom:oz-upgrades-unsafe-allow constructor
constructor() initializer {}
function initialize() public initializer {
__AccessControl_init();
__UUPSUpgradeable_init();
_grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
}
function setCoreAddresses(
IFactory _factory,
IShop _shop,
IPrivateExitModule _privateExitModule,
IDaoVestingModule _vestingModule
) external onlyRole(DEFAULT_ADMIN_ROLE) {
factory = _factory;
shop = _shop;
privateExitModule = _privateExitModule;
vestingModule = _vestingModule;
}
function setFee(
address _feeAddress,
uint32 _regularFeeRate,
uint32 _discountFeeRate
) external onlyRole(DEFAULT_ADMIN_ROLE) {
feeAddress = _feeAddress;
regularFeeRate = _regularFeeRate;
discountFeeRate = _discountFeeRate;
}
modifier onlyDao() {
_checkDao();
_;
}
function _checkDao() internal view {
require(
factory.containsDao(msg.sender),
"CrowdfundingModule: only for DAOs"
);
}
function initSale(
address _currency,
address _token,
uint256 _rate,
uint256 _saleAmount,
uint256 _endTimestamp,
uint256 _vestingId,
uint256[] calldata _entranceLimits,
// minimumEntranceAmount, maximumEntranceAmount
bool[4] calldata _limits,
// isFinite, isVesting, isWhitelist, isAllocation
Whitelist[] calldata _whitelist
) external onlyDao {
if (_limits[1]) {
require(
vestingModule.getVesting(msg.sender, _vestingId).currency ==
_token,
"CrowdfundingModule: Invalid vesting"
);
}
Sale storage sale = crowdfundings[msg.sender][saleIndexes[msg.sender]];
require(
sale.saleAmount == 0,
"CrowdfundingModule: Crowdfunding already exists"
);
sale.currency = _currency;
sale.tokenAddress = _token;
sale.rate = _rate;
sale.isFinite = _limits[0];
sale.isVesting = _limits[1];
sale.isWhitelist = _limits[2];
sale.isAllocation = _limits[3];
sale.vestingId = _vestingId;
_editSale(
msg.sender,
_saleAmount,
_endTimestamp,
_entranceLimits,
new address[](0),
_whitelist
);
emit InitSale(
msg.sender,
saleIndexes[msg.sender],
sale.currency,
sale.tokenAddress,
sale.rate,
sale.saleAmount,
sale.endTimestamp,
sale.vestingId,
sale.isFinite,
sale.isVesting,
sale.isWhitelist,
sale.isAllocation
);
}
function editSale(
uint256 _saleAmount,
uint256 _endTimestamp,
uint256[] calldata _entranceLimits,
// minimumEntranceAmount, maximumEntranceAmount
address[] calldata _removeWhitelist,
Whitelist[] calldata _addWhitelist
) external onlyDao {
Sale storage sale = crowdfundings[msg.sender][saleIndexes[msg.sender]];
require(
sale.saleAmount != 0,
"CrowdfundingModule: Crowdfunding doesn't exists"
);
_editSale(
msg.sender,
_saleAmount,
_endTimestamp,
_entranceLimits,
_removeWhitelist,
_addWhitelist
);
}
function _editSale(
address _dao,
uint256 _saleAmount,
uint256 _endTimestamp,
uint256[] memory _entranceLimits,
// minimumEntranceAmount, maximumEntranceAmount
address[] memory _removeWhitelist,
Whitelist[] memory _addWhitelist
) internal {
require(
_entranceLimits.length <= 2,
"CrowdfundingModule: Invalid Entrance Amount Limits"
);
require(_saleAmount > 0, "CrowdfundingModule: Invalid Sale Amount");
uint256 currentIndex = saleIndexes[_dao];
Sale storage sale = crowdfundings[_dao][currentIndex];
if (_entranceLimits.length == 2) {
require(
_entranceLimits[0] <= _entranceLimits[1],
"CrowdfundingModule: Invalid Entrance Amount Limits"
);
sale.minimumEntranceAmount = _entranceLimits[0];
sale.maximumEntranceAmount = _entranceLimits[1];
} else {
if (_entranceLimits.length == 1) {
sale.maximumEntranceAmount = _entranceLimits[0];
} else {
sale.maximumEntranceAmount = _saleAmount;
}
}
sale.saleAmount = _saleAmount;
sale.endTimestamp = _endTimestamp;
for (uint256 i = 0; i < _addWhitelist.length; ++i) {
sale.whitelist.add(_addWhitelist[i].investor);
investorsInfo[_dao][currentIndex][_addWhitelist[i].investor]
.allocation = _addWhitelist[i].allocation;
}
for (uint256 i = 0; i < _removeWhitelist.length; ++i) {
sale.whitelist.remove(_removeWhitelist[i]);
}
}
function fillLpBalance(address _dao, uint256 _id) external {
uint256 currentIndex = saleIndexes[_dao];
require(shop.buyPrivateOffer(_dao, _id));
filledTokenAmount[_dao][currentIndex] += shop
.privateOffers(_dao, _id)
.lpAmount;
}
function fillTokenBalance(address _dao, uint256 _amount) external {
require(factory.containsDao(_dao), "CrowdfundingModule: only for DAOs");
uint256 currentIndex = saleIndexes[_dao];
Sale storage sale = crowdfundings[_dao][currentIndex];
IERC20Upgradeable(sale.tokenAddress).safeTransferFrom(
msg.sender,
address(this),
_amount
);
filledTokenAmount[_dao][currentIndex] += _amount;
}
function closeSale() external onlyDao {
uint256 currentIndex = saleIndexes[msg.sender];
address tokenAddress = crowdfundings[msg.sender][currentIndex]
.tokenAddress;
uint256 tokenAmount = filledTokenAmount[msg.sender][currentIndex];
IERC20Upgradeable(tokenAddress).safeTransfer(msg.sender, tokenAmount);
++saleIndexes[msg.sender];
filledTokenAmount[msg.sender][currentIndex] = 0;
emit CloseSale(msg.sender, currentIndex);
}
function burnLp(address _dao, uint256 _id) external {
require(factory.containsDao(_dao), "CrowdfundingModule: only for DAOs");
uint256 currentIndex = saleIndexes[_dao];
uint256 lpAmount = privateExitModule
.privateExitOffers(_dao, _id)
.lpAmount;
require(
filledTokenAmount[_dao][currentIndex] >= lpAmount,
"CrowdfundingModule: not enough balance"
);
IERC20Upgradeable lp = IERC20Upgradeable(IDao(_dao).lp());
require(
lp.approve(address(privateExitModule), lp.balanceOf(address(this)))
);
require(privateExitModule.privateExit(_dao, _id));
filledTokenAmount[_dao][currentIndex] -= lpAmount;
}
function buy(
address _dao,
uint256 _currencyAmount,
bool _isRegularFee
) external {
uint256 saleIndex = saleIndexes[_dao];
Sale storage sale = crowdfundings[_dao][saleIndex];
if (sale.isFinite) {
require(
block.timestamp <= sale.endTimestamp,
"CrowdfundingModule: sale is over"
);
}
if (sale.isWhitelist) {
require(
sale.whitelist.contains(msg.sender),
"CrowdfundingModule: the buyer is not whitelisted"
);
}
uint256 currencyAmount;
uint256 boughtAmount = investorsInfo[_dao][saleIndex][msg.sender]
.boughtAmount;
if (sale.isAllocation) {
currencyAmount =
investorsInfo[_dao][saleIndex][msg.sender].allocation -
boughtAmount;
require(currencyAmount > 0, "CrowdfundingModule: already bought");
} else {
require(
_currencyAmount + boughtAmount >= sale.minimumEntranceAmount &&
_currencyAmount + boughtAmount <=
sale.maximumEntranceAmount,
"CrowdfundingModule: amount is off the limits"
);
currencyAmount = _currencyAmount;
}
require(
totalBoughtAmount[_dao][saleIndex] + currencyAmount <=
sale.saleAmount,
"CrowdfundingModule: limit exceeded"
);
investorsInfo[_dao][saleIndex][msg.sender]
.boughtAmount += currencyAmount;
totalBoughtAmount[_dao][saleIndex] += currencyAmount;
uint256 feeAmount;
if (_isRegularFee) {
feeAmount = (currencyAmount * regularFeeRate) / 10000;
} else {
feeAmount = (currencyAmount * discountFeeRate) / 10000;
}
IERC20Upgradeable(sale.currency).safeTransferFrom(
msg.sender,
feeAddress,
feeAmount
);
IERC20Upgradeable(sale.currency).safeTransferFrom(
msg.sender,
_dao,
currencyAmount - feeAmount
);
uint256 tokenAmount = ((currencyAmount - feeAmount) *
10 ** IERC20MetadataUpgradeable(sale.tokenAddress).decimals()) /
sale.rate;
require(
filledTokenAmount[_dao][saleIndex] >= tokenAmount,
"CrowdfundingModule: not enough balance"
);
filledTokenAmount[_dao][saleIndex] -= tokenAmount;
if (sale.isVesting) {
IERC20Upgradeable(sale.tokenAddress).safeTransfer(
address(vestingModule),
tokenAmount
);
vestingModule.addAllocation(
_dao,
sale.vestingId,
msg.sender,
tokenAmount
);
} else {
IERC20Upgradeable(sale.tokenAddress).safeTransfer(
msg.sender,
tokenAmount
);
}
emit Buy(
_dao,
saleIndex,
msg.sender,
sale.currency,
sale.tokenAddress,
currencyAmount,
tokenAmount
);
}
struct SaleInfo {
address currency;
address tokenAddress;
uint256 rate;
uint256 saleAmount;
uint256 minimumEntranceAmount;
uint256 maximumEntranceAmount;
bool isFinite;
bool isVesting;
bool isWhitelist;
bool isAllocation;
uint256 endTimestamp;
uint256 vestingId;
address[] whitelist;
uint256[] allocations;
}
function getSaleInfo(
address _dao,
uint256 _saleIndex
) external view returns (SaleInfo memory) {
Sale storage sale = crowdfundings[_dao][_saleIndex];
address[] memory whitelist = sale.whitelist.values();
uint256[] memory allocations = new uint256[](whitelist.length);
for (uint256 i = 0; i < allocations.length; ++i) {
allocations[i] = investorsInfo[_dao][_saleIndex][whitelist[i]]
.allocation;
}
return
SaleInfo({
currency: sale.currency,
tokenAddress: sale.tokenAddress,
rate: sale.rate,
saleAmount: sale.saleAmount,
minimumEntranceAmount: sale.minimumEntranceAmount,
maximumEntranceAmount: sale.maximumEntranceAmount,
isFinite: sale.isFinite,
isVesting: sale.isVesting,
isWhitelist: sale.isWhitelist,
isAllocation: sale.isAllocation,
endTimestamp: sale.endTimestamp,
vestingId: sale.vestingId,
whitelist: whitelist,
allocations: allocations
});
}
function _authorizeUpgrade(
address newImplementation
) internal override onlyRole(DEFAULT_ADMIN_ROLE) {}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (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 proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the
* initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() initializer {}
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private _initializing;
/**
* @dev Modifier to protect an initializer function from being invoked twice.
*/
modifier initializer() {
// If the contract is initializing we ignore whether _initialized is set in order to support multiple
// inheritance patterns, but we only do this in the context of a constructor, because in other contexts the
// contract may have been reentered.
require(_initializing ? _isConstructor() : !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} modifier, directly or indirectly.
*/
modifier onlyInitializing() {
require(_initializing, "Initializable: contract is not initializing");
_;
}
function _isConstructor() private view returns (bool) {
return !AddressUpgradeable.isContract(address(this));
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/UUPSUpgradeable.sol)
pragma solidity ^0.8.0;
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../ERC1967/ERC1967UpgradeUpgradeable.sol";
import "./Initializable.sol";
/**
* @dev An upgradeability mechanism designed for UUPS proxies. The functions included here can perform an upgrade of an
* {ERC1967Proxy}, when this contract is set as the implementation behind such a proxy.
*
* A security mechanism ensures that an upgrade does not turn off upgradeability accidentally, although this risk is
* reinstated if the upgrade retains upgradeability but removes the security mechanism, e.g. by replacing
* `UUPSUpgradeable` with a custom implementation of upgrades.
*
* The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism.
*
* _Available since v4.1._
*/
abstract contract UUPSUpgradeable is Initializable, IERC1822ProxiableUpgradeable, ERC1967UpgradeUpgradeable {
function __UUPSUpgradeable_init() internal onlyInitializing {
}
function __UUPSUpgradeable_init_unchained() internal onlyInitializing {
}
/// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment
address private immutable __self = address(this);
/**
* @dev Check that the execution is being performed through a delegatecall call and that the execution context is
* a proxy contract with an implementation (as defined in ERC1967) pointing to self. This should only be the case
* for UUPS and transparent proxies that are using the current contract as their implementation. Execution of a
* function through ERC1167 minimal proxies (clones) would not normally pass this test, but is not guaranteed to
* fail.
*/
modifier onlyProxy() {
require(address(this) != __self, "Function must be called through delegatecall");
require(_getImplementation() == __self, "Function must be called through active proxy");
_;
}
/**
* @dev Check that the execution is not being performed through a delegate call. This allows a function to be
* callable on the implementing contract but not through proxies.
*/
modifier notDelegated() {
require(address(this) == __self, "UUPSUpgradeable: must not be called through delegatecall");
_;
}
/**
* @dev Implementation of the ERC1822 {proxiableUUID} function. This returns the storage slot used by the
* implementation. It is used to validate that the this implementation remains valid after an upgrade.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier.
*/
function proxiableUUID() external view virtual override notDelegated returns (bytes32) {
return _IMPLEMENTATION_SLOT;
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeTo(address newImplementation) external virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, new bytes(0), false);
}
/**
* @dev Upgrade the implementation of the proxy to `newImplementation`, and subsequently execute the function call
* encoded in `data`.
*
* Calls {_authorizeUpgrade}.
*
* Emits an {Upgraded} event.
*/
function upgradeToAndCall(address newImplementation, bytes memory data) external payable virtual onlyProxy {
_authorizeUpgrade(newImplementation);
_upgradeToAndCallUUPS(newImplementation, data, true);
}
/**
* @dev Function that should revert when `msg.sender` is not authorized to upgrade the contract. Called by
* {upgradeTo} and {upgradeToAndCall}.
*
* Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}.
*
* ```solidity
* function _authorizeUpgrade(address) internal override onlyOwner {}
* ```
*/
function _authorizeUpgrade(address newImplementation) internal virtual;
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControlEnumerableUpgradeable.sol";
import "./AccessControlUpgradeable.sol";
import "../utils/structs/EnumerableSetUpgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Extension of {AccessControl} that allows enumerating the members of each role.
*/
abstract contract AccessControlEnumerableUpgradeable is Initializable, IAccessControlEnumerableUpgradeable, AccessControlUpgradeable {
function __AccessControlEnumerable_init() internal onlyInitializing {
}
function __AccessControlEnumerable_init_unchained() internal onlyInitializing {
}
using EnumerableSetUpgradeable for EnumerableSetUpgradeable.AddressSet;
mapping(bytes32 => EnumerableSetUpgradeable.AddressSet) private _roleMembers;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlEnumerableUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) {
return _roleMembers[role].at(index);
}
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) {
return _roleMembers[role].length();
}
/**
* @dev Overload {_grantRole} to track enumerable memberships
*/
function _grantRole(bytes32 role, address account) internal virtual override {
super._grantRole(role, account);
_roleMembers[role].add(account);
}
/**
* @dev Overload {_revokeRole} to track enumerable memberships
*/
function _revokeRole(bytes32 role, address account) internal virtual override {
super._revokeRole(role, account);
_roleMembers[role].remove(account);
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
import "../../../utils/AddressUpgradeable.sol";
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20Upgradeable {
using AddressUpgradeable for address;
function safeTransfer(
IERC20Upgradeable token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20Upgradeable token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20Upgradeable token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20Upgradeable token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20Upgradeable token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts 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 EnumerableSetUpgradeable {
// 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;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20Upgradeable.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20MetadataUpgradeable is IERC20Upgradeable {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
interface IDao {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function lp() external view returns (address);
function burnLp(
address _recipient,
uint256 _share,
address[] memory _tokens,
address[] memory _adapters,
address[] memory _pools
) external returns (bool);
function setLp(address _lp) external returns (bool);
function quorum() external view returns (uint8);
function executedTx(bytes32 _txHash) external view returns (bool);
function mintable() external view returns (bool);
function burnable() external view returns (bool);
function numberOfPermitted() external view returns (uint256);
function numberOfAdapters() external view returns (uint256);
function executePermitted(
address _target,
bytes calldata _data,
uint256 _value
) external returns (bool);
function execute(
address _target,
bytes calldata _data,
uint256 _value,
uint256 _nonce,
uint256 _timestamp,
bytes[] memory _sigs
) external returns (bool);
struct ExecutedVoting {
address target;
bytes data;
uint256 value;
uint256 nonce;
uint256 timestamp;
uint256 executionTimestamp;
bytes32 txHash;
bytes[] sigs;
}
function getExecutedVoting()
external
view
returns (ExecutedVoting[] memory);
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
interface IFactory {
function getDaos() external view returns (address[] memory);
function shop() external view returns (address);
function monthlyCost() external view returns (uint256);
function subscriptions(address _dao) external view returns (uint256);
function containsDao(address _dao) external view returns (bool);
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
interface IDaoVestingModule {
struct Vesting {
address currency;
uint256 start;
uint256 duration;
address[] claimers;
uint256[] allocations;
}
function addAllocation(
address _dao,
uint256 _vestingId,
address _claimer,
uint256 _allocation
) external;
function getVesting(
address _dao,
uint256 _vestingId
) external view returns (Vesting memory);
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
interface IShop {
struct PublicOffer {
bool isActive;
address currency;
uint256 rate;
}
function publicOffers(address _dao)
external
view
returns (PublicOffer memory);
struct PrivateOffer {
bool isActive;
address recipient;
address currency;
uint256 currencyAmount;
uint256 lpAmount;
}
function privateOffers(address _dao, uint256 _index)
external
view
returns (PrivateOffer memory);
function numberOfPrivateOffers(address _dao)
external
view
returns (uint256);
function buyPrivateOffer(address _dao, uint256 _id) external returns (bool);
}//SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
interface IPrivateExitModule {
function privateExit(
address _daoAddress,
uint256 _offerId
) external returns (bool success);
struct PrivateExitOffer {
bool isActive;
address recipient;
uint256 lpAmount;
uint256 ethAmount;
}
function privateExitOffers(
address _dao,
uint256 _index
) external view returns (PrivateExitOffer memory);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library AddressUpgradeable {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)
pragma solidity ^0.8.0;
/**
* @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified
* proxy whose upgrades are fully controlled by the current implementation.
*/
interface IERC1822ProxiableUpgradeable {
/**
* @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation
* address.
*
* IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks
* bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this
* function revert if invoked through a proxy.
*/
function proxiableUUID() external view returns (bytes32);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)
pragma solidity ^0.8.2;
import "../beacon/IBeaconUpgradeable.sol";
import "../../interfaces/draft-IERC1822Upgradeable.sol";
import "../../utils/AddressUpgradeable.sol";
import "../../utils/StorageSlotUpgradeable.sol";
import "../utils/Initializable.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 ERC1967UpgradeUpgradeable is Initializable {
function __ERC1967Upgrade_init() internal onlyInitializing {
}
function __ERC1967Upgrade_init_unchained() internal onlyInitializing {
}
// 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 StorageSlotUpgradeable.getAddressSlot(_IMPLEMENTATION_SLOT).value;
}
/**
* @dev Stores a new address in the EIP1967 implementation slot.
*/
function _setImplementation(address newImplementation) private {
require(AddressUpgradeable.isContract(newImplementation), "ERC1967: new implementation is not a contract");
StorageSlotUpgradeable.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) {
_functionDelegateCall(newImplementation, data);
}
}
/**
* @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.
*
* Emits an {Upgraded} event.
*/
function _upgradeToAndCallUUPS(
address newImplementation,
bytes memory data,
bool forceCall
) internal {
// Upgrades from old implementations will perform a rollback test. This test requires the new
// implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing
// this special case will break upgrade paths from old UUPS implementation to new ones.
if (StorageSlotUpgradeable.getBooleanSlot(_ROLLBACK_SLOT).value) {
_setImplementation(newImplementation);
} else {
try IERC1822ProxiableUpgradeable(newImplementation).proxiableUUID() returns (bytes32 slot) {
require(slot == _IMPLEMENTATION_SLOT, "ERC1967Upgrade: unsupported proxiableUUID");
} catch {
revert("ERC1967Upgrade: new implementation is not UUPS");
}
_upgradeToAndCall(newImplementation, data, forceCall);
}
}
/**
* @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 StorageSlotUpgradeable.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");
StorageSlotUpgradeable.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 StorageSlotUpgradeable.getAddressSlot(_BEACON_SLOT).value;
}
/**
* @dev Stores a new beacon in the EIP1967 beacon slot.
*/
function _setBeacon(address newBeacon) private {
require(AddressUpgradeable.isContract(newBeacon), "ERC1967: new beacon is not a contract");
require(
AddressUpgradeable.isContract(IBeaconUpgradeable(newBeacon).implementation()),
"ERC1967: beacon implementation is not a contract"
);
StorageSlotUpgradeable.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) {
_functionDelegateCall(IBeaconUpgradeable(newBeacon).implementation(), data);
}
}
/**
* @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) private returns (bytes memory) {
require(AddressUpgradeable.isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return AddressUpgradeable.verifyCallResult(success, returndata, "Address: low-level delegate call failed");
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)
pragma solidity ^0.8.0;
/**
* @dev This is the interface that {BeaconProxy} expects of its beacon.
*/
interface IBeaconUpgradeable {
/**
* @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);
}// 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 StorageSlotUpgradeable {
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
}
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControlEnumerable.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
/**
* @dev External interface of AccessControlEnumerable declared to support ERC165 detection.
*/
interface IAccessControlEnumerableUpgradeable is IAccessControlUpgradeable {
/**
* @dev Returns one of the accounts that have `role`. `index` must be a
* value between 0 and {getRoleMemberCount}, non-inclusive.
*
* Role bearers are not sorted in any particular way, and their ordering may
* change at any point.
*
* WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
* you perform all queries on the same block. See the following
* https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
* for more information.
*/
function getRoleMember(bytes32 role, uint256 index) external view returns (address);
/**
* @dev Returns the number of accounts that have `role`. Can be used
* together with {getRoleMember} to enumerate all bearers of a role.
*/
function getRoleMemberCount(bytes32 role) external view returns (uint256);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)
pragma solidity ^0.8.0;
import "./IAccessControlUpgradeable.sol";
import "../utils/ContextUpgradeable.sol";
import "../utils/StringsUpgradeable.sol";
import "../utils/introspection/ERC165Upgradeable.sol";
import "../proxy/utils/Initializable.sol";
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it.
*/
abstract contract AccessControlUpgradeable is Initializable, ContextUpgradeable, IAccessControlUpgradeable, ERC165Upgradeable {
function __AccessControl_init() internal onlyInitializing {
}
function __AccessControl_init_unchained() internal onlyInitializing {
}
struct RoleData {
mapping(address => bool) members;
bytes32 adminRole;
}
mapping(bytes32 => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with a standardized message including the required role.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*
* _Available since v4.1._
*/
modifier onlyRole(bytes32 role) {
_checkRole(role, _msgSender());
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControlUpgradeable).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
return _roles[role].members[account];
}
/**
* @dev Revert with a standard message if `account` is missing `role`.
*
* The format of the revert reason is given by the following regular expression:
*
* /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert(
string(
abi.encodePacked(
"AccessControl: account ",
StringsUpgradeable.toHexString(uint160(account), 20),
" is missing role ",
StringsUpgradeable.toHexString(uint256(role), 32)
)
)
);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `account`.
*/
function renounceRole(bytes32 role, address account) public virtual override {
require(account == _msgSender(), "AccessControl: can only renounce roles for self");
_revokeRole(role, account);
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event. Note that unlike {grantRole}, this function doesn't perform any
* checks on the calling account.
*
* [WARNING]
* ====
* This function should only be called from the constructor when setting
* up the initial roles for the system.
*
* Using this function in any other way is effectively circumventing the admin
* system imposed by {AccessControl}.
* ====
*
* NOTE: This function is deprecated in favor of {_grantRole}.
*/
function _setupRole(bytes32 role, address account) internal virtual {
_grantRole(role, account);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Grants `role` to `account`.
*
* Internal function without access restriction.
*/
function _grantRole(bytes32 role, address account) internal virtual {
if (!hasRole(role, account)) {
_roles[role].members[account] = true;
emit RoleGranted(role, account, _msgSender());
}
}
/**
* @dev Revokes `role` from `account`.
*
* Internal function without access restriction.
*/
function _revokeRole(bytes32 role, address account) internal virtual {
if (hasRole(role, account)) {
_roles[role].members[account] = false;
emit RoleRevoked(role, account, _msgSender());
}
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[49] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts 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;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
import "../proxy/utils/Initializable.sol";
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract ContextUpgradeable is Initializable {
function __Context_init() internal onlyInitializing {
}
function __Context_init_unchained() internal onlyInitializing {
}
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)
pragma solidity ^0.8.0;
/**
* @dev String operations.
*/
library StringsUpgradeable {
bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";
/**
* @dev Converts a `uint256` to its ASCII `string` decimal representation.
*/
function toString(uint256 value) internal pure returns (string memory) {
// Inspired by OraclizeAPI's implementation - MIT licence
// https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol
if (value == 0) {
return "0";
}
uint256 temp = value;
uint256 digits;
while (temp != 0) {
digits++;
temp /= 10;
}
bytes memory buffer = new bytes(digits);
while (value != 0) {
digits -= 1;
buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
value /= 10;
}
return string(buffer);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
*/
function toHexString(uint256 value) internal pure returns (string memory) {
if (value == 0) {
return "0x00";
}
uint256 temp = value;
uint256 length = 0;
while (temp != 0) {
length++;
temp >>= 8;
}
return toHexString(value, length);
}
/**
* @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
*/
function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
bytes memory buffer = new bytes(2 * length + 2);
buffer[0] = "0";
buffer[1] = "x";
for (uint256 i = 2 * length + 1; i > 1; --i) {
buffer[i] = _HEX_SYMBOLS[value & 0xf];
value >>= 4;
}
require(value == 0, "Strings: hex length insufficient");
return string(buffer);
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165Upgradeable.sol";
import "../../proxy/utils/Initializable.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165Upgradeable is Initializable, IERC165Upgradeable {
function __ERC165_init() internal onlyInitializing {
}
function __ERC165_init_unchained() internal onlyInitializing {
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165Upgradeable).interfaceId;
}
/**
* @dev This empty reserved space is put in place to allow future versions to add new
* variables without shifting down storage in the inheritance chain.
* See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps
*/
uint256[50] private __gap;
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165Upgradeable {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (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 `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
/**
* @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);
}{
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"libraries": {}
}Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"previousAdmin","type":"address"},{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"AdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"beacon","type":"address"}],"name":"BeaconUpgraded","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"daoAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"saleId","type":"uint256"},{"indexed":true,"internalType":"address","name":"buyer","type":"address"},{"indexed":false,"internalType":"address","name":"currencyAddress","type":"address"},{"indexed":false,"internalType":"address","name":"tokenAddress","type":"address"},{"indexed":false,"internalType":"uint256","name":"currencyAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"tokenAmount","type":"uint256"}],"name":"Buy","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"daoAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"saleId","type":"uint256"}],"name":"CloseSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"daoAddress","type":"address"},{"indexed":true,"internalType":"uint256","name":"saleId","type":"uint256"},{"indexed":false,"internalType":"address","name":"currency","type":"address"},{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"rate","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"saleAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_endTimestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_vestingId","type":"uint256"},{"indexed":false,"internalType":"bool","name":"isFinite","type":"bool"},{"indexed":false,"internalType":"bool","name":"isVesting","type":"bool"},{"indexed":false,"internalType":"bool","name":"isWhitelist","type":"bool"},{"indexed":false,"internalType":"bool","name":"isAllocation","type":"bool"}],"name":"InitSale","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"implementation","type":"address"}],"name":"Upgraded","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_dao","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"burnLp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dao","type":"address"},{"internalType":"uint256","name":"_currencyAmount","type":"uint256"},{"internalType":"bool","name":"_isRegularFee","type":"bool"}],"name":"buy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"closeSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"discountFeeRate","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_saleAmount","type":"uint256"},{"internalType":"uint256","name":"_endTimestamp","type":"uint256"},{"internalType":"uint256[]","name":"_entranceLimits","type":"uint256[]"},{"internalType":"address[]","name":"_removeWhitelist","type":"address[]"},{"components":[{"internalType":"address","name":"investor","type":"address"},{"internalType":"uint256","name":"allocation","type":"uint256"}],"internalType":"struct CrowdfundingModule.Whitelist[]","name":"_addWhitelist","type":"tuple[]"}],"name":"editSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"factory","outputs":[{"internalType":"contract IFactory","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_dao","type":"address"},{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"fillLpBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_dao","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"fillTokenBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"filledTokenAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_dao","type":"address"},{"internalType":"uint256","name":"_saleIndex","type":"uint256"}],"name":"getSaleInfo","outputs":[{"components":[{"internalType":"address","name":"currency","type":"address"},{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"uint256","name":"rate","type":"uint256"},{"internalType":"uint256","name":"saleAmount","type":"uint256"},{"internalType":"uint256","name":"minimumEntranceAmount","type":"uint256"},{"internalType":"uint256","name":"maximumEntranceAmount","type":"uint256"},{"internalType":"bool","name":"isFinite","type":"bool"},{"internalType":"bool","name":"isVesting","type":"bool"},{"internalType":"bool","name":"isWhitelist","type":"bool"},{"internalType":"bool","name":"isAllocation","type":"bool"},{"internalType":"uint256","name":"endTimestamp","type":"uint256"},{"internalType":"uint256","name":"vestingId","type":"uint256"},{"internalType":"address[]","name":"whitelist","type":"address[]"},{"internalType":"uint256[]","name":"allocations","type":"uint256[]"}],"internalType":"struct CrowdfundingModule.SaleInfo","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_currency","type":"address"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_rate","type":"uint256"},{"internalType":"uint256","name":"_saleAmount","type":"uint256"},{"internalType":"uint256","name":"_endTimestamp","type":"uint256"},{"internalType":"uint256","name":"_vestingId","type":"uint256"},{"internalType":"uint256[]","name":"_entranceLimits","type":"uint256[]"},{"internalType":"bool[4]","name":"_limits","type":"bool[4]"},{"components":[{"internalType":"address","name":"investor","type":"address"},{"internalType":"uint256","name":"allocation","type":"uint256"}],"internalType":"struct CrowdfundingModule.Whitelist[]","name":"_whitelist","type":"tuple[]"}],"name":"initSale","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"investorsInfo","outputs":[{"internalType":"uint256","name":"boughtAmount","type":"uint256"},{"internalType":"uint256","name":"allocation","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"privateExitModule","outputs":[{"internalType":"contract IPrivateExitModule","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"proxiableUUID","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"regularFeeRate","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"saleIndexes","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IFactory","name":"_factory","type":"address"},{"internalType":"contract IShop","name":"_shop","type":"address"},{"internalType":"contract IPrivateExitModule","name":"_privateExitModule","type":"address"},{"internalType":"contract IDaoVestingModule","name":"_vestingModule","type":"address"}],"name":"setCoreAddresses","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeAddress","type":"address"},{"internalType":"uint32","name":"_regularFeeRate","type":"uint32"},{"internalType":"uint32","name":"_discountFeeRate","type":"uint32"}],"name":"setFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"shop","outputs":[{"internalType":"contract IShop","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"totalBoughtAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"}],"name":"upgradeTo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newImplementation","type":"address"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"upgradeToAndCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"vestingModule","outputs":[{"internalType":"contract IDaoVestingModule","name":"","type":"address"}],"stateMutability":"view","type":"function"}]Contract Creation Code
60a06040523060601b6080523480156200001857600080fd5b50600054610100900460ff16620000365760005460ff161562000040565b62000040620000e5565b620000a85760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff16158015620000cb576000805461ffff19166101011790555b8015620000de576000805461ff00191690555b5062000112565b6000620000fd306200010360201b620021fc1760201c565b15905090565b6001600160a01b03163b151590565b60805160601c61410e6200014d60003960008181610b7001528181610bb001528181610dac01528181610dec0152610e7b015261410e6000f3fe6080604052600436106101f95760003560e01c80636ddecb0d1161010d578063bcf02ab0116100a0578063d547741f1161006f578063d547741f14610669578063dda429d614610689578063e62153c0146106a9578063ee55efee146106c9578063f0790e0e146106de57600080fd5b8063bcf02ab0146105e7578063c45a015514610607578063c76af7b014610628578063ca15c8731461064957600080fd5b80639010d07c116100dc5780639010d07c1461056d57806391d148541461058d57806396732794146105ad578063a217fddf146105d257600080fd5b80636ddecb0d146104dd57806380ce7b25146105175780638129fc1c1461053757806388ea41b11461054c57600080fd5b80632f2ff15d11610190578063417d3a171161015f578063417d3a171461043c5780634e87a01d1461045c5780634f1ef2861461049557806352d1902d146104a85780635e2a4127146104bd57600080fd5b80632f2ff15d146103bb57806336568abe146103db5780633659cfe6146103fb578063412753581461041b57600080fd5b80630e39c944116101cc5780630e39c944146102e05780631575b0531461033b578063248a9ca31461035d5780632c537d241461038d57600080fd5b806301ffc9a7146101fe578063087db5b8146102335780630881fa0d146102605780630de228a614610299575b600080fd5b34801561020a57600080fd5b5061021e610219366004613662565b6106fe565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b5061025361024e3660046134ba565b610729565b60405161022a9190613ccc565b34801561026c57600080fd5b5061012e54610281906001600160a01b031681565b6040516001600160a01b03909116815260200161022a565b3480156102a557600080fd5b506102d26102b43660046134ba565b61013660209081526000928352604080842090915290825290205481565b60405190815260200161022a565b3480156102ec57600080fd5b506103266102fb3660046134e6565b6101346020908152600093845260408085208252928452828420905282529020805460019091015482565b6040805192835260208301919091520161022a565b34801561034757600080fd5b5061035b6103563660046134ba565b610995565b005b34801561036957600080fd5b506102d26103783660046135de565b600090815260c9602052604090206001015490565b34801561039957600080fd5b506102d26103a8366004613300565b6101326020526000908152604090205481565b3480156103c757600080fd5b5061035b6103d6366004613610565b610abc565b3480156103e757600080fd5b5061035b6103f6366004613610565b610ae7565b34801561040757600080fd5b5061035b610416366004613300565b610b65565b34801561042757600080fd5b5061013154610281906001600160a01b031681565b34801561044857600080fd5b5061035b610457366004613954565b610c45565b34801561046857600080fd5b506102d26104773660046134ba565b61013560209081526000928352604080842090915290825290205481565b61035b6104a3366004613413565b610da1565b3480156104b457600080fd5b506102d2610e6e565b3480156104c957600080fd5b5061035b6104d836600461333a565b610f21565b3480156104e957600080fd5b506101315461050290600160c01b900463ffffffff1681565b60405163ffffffff909116815260200161022a565b34801561052357600080fd5b5061035b6105323660046134ba565b611343565b34801561054357600080fd5b5061035b6114ad565b34801561055857600080fd5b5061012f54610281906001600160a01b031681565b34801561057957600080fd5b50610281610588366004613640565b611580565b34801561059957600080fd5b5061021e6105a8366004613610565b61159f565b3480156105b957600080fd5b506101315461050290600160a01b900463ffffffff1681565b3480156105de57600080fd5b506102d2600081565b3480156105f357600080fd5b5061035b61060236600461355f565b6115ca565b34801561061357600080fd5b5061012d54610281906001600160a01b031681565b34801561063457600080fd5b5061013054610281906001600160a01b031681565b34801561065557600080fd5b506102d26106643660046135de565b611620565b34801561067557600080fd5b5061035b610684366004613610565b611637565b34801561069557600080fd5b5061035b6106a436600461368c565b61165d565b3480156106b557600080fd5b5061035b6106c43660046134ba565b6116be565b3480156106d557600080fd5b5061035b611a94565b3480156106ea57600080fd5b5061035b6106f9366004613528565b611b60565b60006001600160e01b03198216635a05180f60e01b148061072357506107238261220b565b92915050565b6107b5604051806101c0016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600015158152602001600015158152602001600015158152602001600015158152602001600081526020016000815260200160608152602001606081525090565b6001600160a01b0383166000908152610133602090815260408083208584529091528120906107e660088301612240565b9050600081516001600160401b0381111561080357610803614058565b60405190808252806020026020018201604052801561082c578160200160208202803683370190505b50905060005b81518110156108cf576001600160a01b0387166000908152610134602090815260408083208984529091528120845190919085908490811061087657610876614042565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600101548282815181106108b4576108b4614042565b60209081029190910101526108c881613ffb565b9050610832565b50604080516101c08101825284546001600160a01b039081168252600186015490811660208301526002860154928201929092526003850154606082015260048501546080820152600585015460a082015260ff600160a01b83048116151560c0830152600160a81b83048116151560e0830152600160b01b830481161515610100830152600160b81b909204909116151561012082015260068401546101408201526007909301546101608401526101808301919091526101a0820152905092915050565b61012d546040516396d054e560e01b81526001600160a01b038481166004830152909116906396d054e59060240160206040518083038186803b1580156109db57600080fd5b505afa1580156109ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1391906135c1565b610a385760405162461bcd60e51b8152600401610a2f90613c45565b60405180910390fd5b6001600160a01b03808316600090815261013260209081526040808320546101338352818420818552909252909120600181015491929091610a7d911633308661224d565b6001600160a01b03841660009081526101366020908152604080832085845290915281208054859290610ab1908490613e5a565b909155505050505050565b600082815260c96020526040902060010154610ad881336122be565b610ae28383612322565b505050565b6001600160a01b0381163314610b575760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610a2f565b610b618282612344565b5050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610bae5760405162461bcd60e51b8152600401610a2f90613b5b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610bf7600080516020614092833981519152546001600160a01b031690565b6001600160a01b031614610c1d5760405162461bcd60e51b8152600401610a2f90613ba7565b610c2681612366565b60408051600080825260208201909252610c4291839190612372565b50565b610c4d6124ec565b33600090815261013360209081526040808320610132835281842054845290915290206003810154610cd95760405162461bcd60e51b815260206004820152602f60248201527f43726f776466756e64696e674d6f64756c653a2043726f776466756e64696e6760448201526e20646f65736e27742065786973747360881b6064820152608401610a2f565b610d96338a8a8a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c9182918501908490808284376000920182905250604080516020808f02820181019092528d815294508d93508c925082919085015b82821015610d8c57610d7d604083028601368190038101906138fd565b81526020019060010190610d60565b5050505050612586565b505050505050505050565b306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161415610dea5760405162461bcd60e51b8152600401610a2f90613b5b565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316610e33600080516020614092833981519152546001600160a01b031690565b6001600160a01b031614610e595760405162461bcd60e51b8152600401610a2f90613ba7565b610e6282612366565b610b6182826001612372565b6000306001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001614610f0e5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610a2f565b5060008051602061409283398151915290565b610f296124ec565b610f3960408401602085016135a4565b1561102a5761013054604051633e05a36d60e01b8152336004820152602481018890526001600160a01b038c8116921690633e05a36d9060440160006040518083038186803b158015610f8b57600080fd5b505afa158015610f9f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fc791908101906137e3565b516001600160a01b03161461102a5760405162461bcd60e51b815260206004820152602360248201527f43726f776466756e64696e674d6f64756c653a20496e76616c69642076657374604482015262696e6760e81b6064820152608401610a2f565b33600090815261013360209081526040808320610132835281842054845290915290206003810154156110b75760405162461bcd60e51b815260206004820152602f60248201527f43726f776466756e64696e674d6f64756c653a2043726f776466756e64696e6760448201526e20616c72656164792065786973747360881b6064820152608401610a2f565b80546001600160a01b038d81166001600160a01b0319928316178355600183018054918e1691909216179055600281018a90556110f760208501856135a4565b600182018054911515600160a01b0260ff60a01b1990921691909117905561112560408501602086016135a4565b600182018054911515600160a81b0260ff60a81b1990921691909117905561115360608501604086016135a4565b600182018054911515600160b01b0260ff60b01b1990921691909117905561118160808501606086016135a4565b8160010160176101000a81548160ff02191690831515021790555086816007018190555061125c338a8a898980806020026020016040519081016040528093929190818152602001838360200280828437600092018290525092506111e4915050565b60405190808252806020026020018201604052801561120d578160200160208202803683370190505b508888808060200260200160405190810160405280939291908181526020016000905b82821015610d8c5761124d604083028601368190038101906138fd565b81526020019060010190611230565b3360008181526101326020908152604091829020548454600186015460028701546003880154600689015460078a015488516001600160a01b03968716815295851697860197909752848801929092526060840152608083015260a0820193909352600160a01b830460ff908116151560c0830152600160a81b84048116151560e0830152600160b01b840481161515610100830152600160b81b909304909216151561012083015291519192917f27e515f54887348ef73eed5211f2aaa4d6954d42214210375b49212d1fb80375918190036101400190a3505050505050505050505050565b6001600160a01b0382811660008181526101326020526040908190205461012e54915163745de41b60e11b815260048101939093526024830185905292169063e8bbc83690604401602060405180830381600087803b1580156113a557600080fd5b505af11580156113b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dd91906135c1565b6113e657600080fd5b61012e5460405163b892342960e01b81526001600160a01b038581166004830152602482018590529091169063b89234299060440160a06040518083038186803b15801561143357600080fd5b505afa158015611447573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146b919061375c565b608001516001600160a01b038416600090815261013660209081526040808320858452909152812080549091906114a3908490613e5a565b9091555050505050565b600054610100900460ff166114c85760005460ff16156114cc565b303b155b61152f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a2f565b600054610100900460ff16158015611551576000805461ffff19166101011790555b611559612840565b611561612840565b61156c600033612322565b8015610c42576000805461ff001916905550565b600082815260fb6020526040812061159890836128ab565b9392505050565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60006115d681336122be565b5061013180546001600160a01b03949094166001600160c01b031990941693909317600160a01b63ffffffff938416021763ffffffff60c01b1916600160c01b9190921602179055565b600081815260fb60205260408120610723906128b7565b600082815260c9602052604090206001015461165381336122be565b610ae28383612344565b600061166981336122be565b5061012d80546001600160a01b039586166001600160a01b03199182161790915561012e80549486169482169490941790935561012f8054928516928416929092179091556101308054919093169116179055565b61012d546040516396d054e560e01b81526001600160a01b038481166004830152909116906396d054e59060240160206040518083038186803b15801561170457600080fd5b505afa158015611718573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173c91906135c1565b6117585760405162461bcd60e51b8152600401610a2f90613c45565b6001600160a01b03828116600081815261013260205260408082205461012f54915163979d951360e01b815260048101949094526024840186905293919291169063979d95139060440160806040518083038186803b1580156117ba57600080fd5b505afa1580156117ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f291906136e8565b6040908101516001600160a01b038616600090815261013660209081528382208683529052919091205490915081111561183e5760405162461bcd60e51b8152600401610a2f90613c86565b6000846001600160a01b031663313c06a06040518163ffffffff1660e01b815260040160206040518083038186803b15801561187957600080fd5b505afa15801561188d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b1919061331d565b61012f546040516370a0823160e01b81523060048201529192506001600160a01b038084169263095ea7b392919091169083906370a082319060240160206040518083038186803b15801561190557600080fd5b505afa158015611919573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193d91906135f7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561198357600080fd5b505af1158015611997573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bb91906135c1565b6119c457600080fd5b61012f5460405163155c574760e21b81526001600160a01b03878116600483015260248201879052909116906355715d1c90604401602060405180830381600087803b158015611a1357600080fd5b505af1158015611a27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4b91906135c1565b611a5457600080fd5b6001600160a01b03851660009081526101366020908152604080832086845290915281208054849290611a88908490613fa1565b90915550505050505050565b611a9c6124ec565b33600081815261013260209081526040808320546101338352818420818552835281842060010154858552610136845282852082865290935292205491926001600160a01b039091169190611af3908390836128c1565b336000908152610132602052604081208054909190611b1190613ffb565b9091555033600081815261013660209081526040808320878452909152808220829055518592917fd620608bd8229f655e280e25ab6d2854da9c3375d79f28ec46bd6eaad75d0fb191a3505050565b6001600160a01b0383166000908152610132602090815260408083205461013383528184208185529092529091206001810154600160a01b900460ff1615611bf6578060060154421115611bf65760405162461bcd60e51b815260206004820181905260248201527f43726f776466756e64696e674d6f64756c653a2073616c65206973206f7665726044820152606401610a2f565b6001810154600160b01b900460ff1615611c7c57611c1760088201336128f1565b611c7c5760405162461bcd60e51b815260206004820152603060248201527f43726f776466756e64696e674d6f64756c653a2074686520627579657220697360448201526f081b9bdd081dda1a5d195b1a5cdd195960821b6064820152608401610a2f565b6001600160a01b03851660009081526101346020908152604080832085845282528083203384529091528120546001830154600160b81b900460ff1615611d5a576001600160a01b0387166000908152610134602090815260408083208784528252808320338452909152902060010154611cf8908290613fa1565b915060008211611d555760405162461bcd60e51b815260206004820152602260248201527f43726f776466756e64696e674d6f64756c653a20616c726561647920626f75676044820152611a1d60f21b6064820152608401610a2f565b611de9565b6004830154611d698288613e5a565b10158015611d8457506005830154611d818288613e5a565b11155b611de55760405162461bcd60e51b815260206004820152602c60248201527f43726f776466756e64696e674d6f64756c653a20616d6f756e74206973206f6660448201526b6620746865206c696d69747360a01b6064820152608401610a2f565b8591505b60038301546001600160a01b038816600090815261013560209081526040808320888452909152902054611e1e908490613e5a565b1115611e775760405162461bcd60e51b815260206004820152602260248201527f43726f776466756e64696e674d6f64756c653a206c696d697420657863656564604482015261195960f21b6064820152608401610a2f565b6001600160a01b038716600090815261013460209081526040808320878452825280832033845290915281208054849290611eb3908490613e5a565b90915550506001600160a01b03871660009081526101356020908152604080832087845290915281208054849290611eec908490613e5a565b90915550600090508515611f2a576101315461271090611f1990600160a01b900463ffffffff1685613f82565b611f239190613e72565b9050611f56565b6101315461271090611f4990600160c01b900463ffffffff1685613f82565b611f539190613e72565b90505b610131548454611f75916001600160a01b03918216913391168461224d565b611f973389611f848487613fa1565b87546001600160a01b031692919061224d565b600284015460018501546040805163313ce56760e01b81529051600093926001600160a01b03169163313ce567916004808301926020929190829003018186803b158015611fe457600080fd5b505afa158015611ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201c9190613a00565b61202790600a613ed7565b6120318487613fa1565b61203b9190613f82565b6120459190613e72565b6001600160a01b038a166000908152610136602090815260408083208a845290915290205490915081111561208c5760405162461bcd60e51b8152600401610a2f90613c86565b6001600160a01b038916600090815261013660209081526040808320898452909152812080548392906120c0908490613fa1565b90915550506001850154600160a81b900460ff1615612177576101305460018601546120f9916001600160a01b039182169116836128c1565b61013054600786015460405163d4a0d6bf60e01b81526001600160a01b038c8116600483015260248201929092523360448201526064810184905291169063d4a0d6bf90608401600060405180830381600087803b15801561215a57600080fd5b505af115801561216e573d6000803e3d6000fd5b50505050612190565b6001850154612190906001600160a01b031633836128c1565b84546001860154604080516001600160a01b039384168152918316602083015281018690526060810183905233918891908c16907fd842d7e5d4909d2611a84cbb48a59cdc08f054129cbd16c5a8358147240e405f9060800160405180910390a4505050505050505050565b6001600160a01b03163b151590565b60006001600160e01b03198216637965db0b60e01b148061072357506301ffc9a760e01b6001600160e01b0319831614610723565b6060600061159883612913565b6040516001600160a01b03808516602483015283166044820152606481018290526122b89085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261296f565b50505050565b6122c8828261159f565b610b61576122e0816001600160a01b03166014612a41565b6122eb836020612a41565b6040516020016122fc929190613ab3565b60408051601f198184030181529082905262461bcd60e51b8252610a2f91600401613b28565b61232c8282612bdc565b600082815260fb60205260409020610ae29082612c62565b61234e8282612c77565b600082815260fb60205260409020610ae29082612cde565b6000610b6181336122be565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156123a557610ae283612cf3565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156123de57600080fd5b505afa92505050801561240e575060408051601f3d908101601f1916820190925261240b918101906135f7565b60015b6124715760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610a2f565b60008051602061409283398151915281146124e05760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610a2f565b50610ae2838383612d8f565b61012d546040516396d054e560e01b81523360048201526001600160a01b03909116906396d054e59060240160206040518083038186803b15801561253057600080fd5b505afa158015612544573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061256891906135c1565b6125845760405162461bcd60e51b8152600401610a2f90613c45565b565b6002835111156125a85760405162461bcd60e51b8152600401610a2f90613bf3565b600085116126085760405162461bcd60e51b815260206004820152602760248201527f43726f776466756e64696e674d6f64756c653a20496e76616c69642053616c6560448201526608105b5bdd5b9d60ca1b6064820152608401610a2f565b6001600160a01b0386166000908152610132602090815260408083205461013383528184208185529092529091208451600214156126df578460018151811061265357612653614042565b60200260200101518560008151811061266e5761266e614042565b602002602001015111156126945760405162461bcd60e51b8152600401610a2f90613bf3565b846000815181106126a7576126a7614042565b60200260200101518160040181905550846001815181106126ca576126ca614042565b60200260200101518160050181905550612704565b8451600114156126fc57846000815181106126ca576126ca614042565b600581018790555b600381018790556006810186905560005b83518110156127f35761275184828151811061273357612733614042565b60200260200101516000015183600801612c6290919063ffffffff16565b5083818151811061276457612764614042565b60200260200101516020015161013460008b6001600160a01b03166001600160a01b03168152602001908152602001600020600085815260200190815260200160002060008684815181106127bb576127bb614042565b602090810291909101810151516001600160a01b03168252810191909152604001600020600101556127ec81613ffb565b9050612715565b5060005b8451811015610d965761282f85828151811061281557612815614042565b602002602001015183600801612cde90919063ffffffff16565b5061283981613ffb565b90506127f7565b600054610100900460ff166125845760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610a2f565b60006115988383612db4565b6000610723825490565b6040516001600160a01b038316602482015260448101829052610ae290849063a9059cbb60e01b90606401612281565b6001600160a01b03811660009081526001830160205260408120541515611598565b60608160000180548060200260200160405190810160405280929190818152602001828054801561296357602002820191906000526020600020905b81548152602001906001019080831161294f575b50505050509050919050565b60006129c4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612dde9092919063ffffffff16565b805190915015610ae257808060200190518101906129e291906135c1565b610ae25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a2f565b60606000612a50836002613f82565b612a5b906002613e5a565b6001600160401b03811115612a7257612a72614058565b6040519080825280601f01601f191660200182016040528015612a9c576020820181803683370190505b509050600360fc1b81600081518110612ab757612ab7614042565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612ae657612ae6614042565b60200101906001600160f81b031916908160001a9053506000612b0a846002613f82565b612b15906001613e5a565b90505b6001811115612b8d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612b4957612b49614042565b1a60f81b828281518110612b5f57612b5f614042565b60200101906001600160f81b031916908160001a90535060049490941c93612b8681613fe4565b9050612b18565b5083156115985760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a2f565b612be6828261159f565b610b6157600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612c1e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611598836001600160a01b038416612df5565b612c81828261159f565b15610b6157600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611598836001600160a01b038416612e44565b6001600160a01b0381163b612d605760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610a2f565b60008051602061409283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612d9883612f37565b600082511180612da55750805b15610ae2576122b88383612f77565b6000826000018281548110612dcb57612dcb614042565b9060005260206000200154905092915050565b6060612ded848460008561306b565b949350505050565b6000818152600183016020526040812054612e3c57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610723565b506000610723565b60008181526001830160205260408120548015612f2d576000612e68600183613fa1565b8554909150600090612e7c90600190613fa1565b9050818114612ee1576000866000018281548110612e9c57612e9c614042565b9060005260206000200154905080876000018481548110612ebf57612ebf614042565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612ef257612ef261402c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610723565b6000915050610723565b612f4081612cf3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b612fdf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610a2f565b600080846001600160a01b031684604051612ffa9190613a97565b600060405180830381855af49150503d8060008114613035576040519150601f19603f3d011682016040523d82523d6000602084013e61303a565b606091505b509150915061306282826040518060600160405280602781526020016140b26027913961319c565b95945050505050565b6060824710156130cc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610a2f565b6001600160a01b0385163b6131235760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a2f565b600080866001600160a01b0316858760405161313f9190613a97565b60006040518083038185875af1925050503d806000811461317c576040519150601f19603f3d011682016040523d82523d6000602084013e613181565b606091505b509150915061319182828661319c565b979650505050505050565b606083156131ab575081611598565b8251156131bb5782518084602001fd5b8160405162461bcd60e51b8152600401610a2f9190613b28565b60008083601f8401126131e757600080fd5b5081356001600160401b038111156131fe57600080fd5b6020830191508360208260051b850101111561321957600080fd5b9250929050565b806080810183101561072357600080fd5b60008083601f84011261324357600080fd5b5081356001600160401b0381111561325a57600080fd5b6020830191508360208260061b850101111561321957600080fd5b600082601f83011261328657600080fd5b8151602061329b61329683613e37565b613e07565b80838252828201915082860187848660051b89010111156132bb57600080fd5b60005b858110156132da578151845292840192908401906001016132be565b5090979650505050505050565b803563ffffffff811681146132fb57600080fd5b919050565b60006020828403121561331257600080fd5b81356115988161406e565b60006020828403121561332f57600080fd5b81516115988161406e565b60008060008060008060008060008060006101808c8e03121561335c57600080fd5b6133668c3561406e565b8b359a5061337760208d013561406e565b60208c0135995060408c0135985060608c0135975060808c0135965060a08c013595506001600160401b038060c08e013511156133b357600080fd5b6133c38e60c08f01358f016131d5565b90965094506133d58e60e08f01613220565b9350806101608e013511156133e957600080fd5b506133fb8d6101608e01358e01613231565b81935080925050509295989b509295989b9093969950565b6000806040838503121561342657600080fd5b82356134318161406e565b91506020838101356001600160401b038082111561344e57600080fd5b818601915086601f83011261346257600080fd5b81358181111561347457613474614058565b613486601f8201601f19168501613e07565b9150808252878482850101111561349c57600080fd5b80848401858401376000848284010152508093505050509250929050565b600080604083850312156134cd57600080fd5b82356134d88161406e565b946020939093013593505050565b6000806000606084860312156134fb57600080fd5b83356135068161406e565b925060208401359150604084013561351d8161406e565b809150509250925092565b60008060006060848603121561353d57600080fd5b83356135488161406e565b925060208401359150604084013561351d81614083565b60008060006060848603121561357457600080fd5b833561357f8161406e565b925061358d602085016132e7565b915061359b604085016132e7565b90509250925092565b6000602082840312156135b657600080fd5b813561159881614083565b6000602082840312156135d357600080fd5b815161159881614083565b6000602082840312156135f057600080fd5b5035919050565b60006020828403121561360957600080fd5b5051919050565b6000806040838503121561362357600080fd5b8235915060208301356136358161406e565b809150509250929050565b6000806040838503121561365357600080fd5b50508035926020909101359150565b60006020828403121561367457600080fd5b81356001600160e01b03198116811461159857600080fd5b600080600080608085870312156136a257600080fd5b84356136ad8161406e565b935060208501356136bd8161406e565b925060408501356136cd8161406e565b915060608501356136dd8161406e565b939692955090935050565b6000608082840312156136fa57600080fd5b604051608081018181106001600160401b038211171561371c5761371c614058565b604052825161372a81614083565b8152602083015161373a8161406e565b6020820152604083810151908201526060928301519281019290925250919050565b600060a0828403121561376e57600080fd5b60405160a081018181106001600160401b038211171561379057613790614058565b604052825161379e81614083565b815260208301516137ae8161406e565b602082015260408301516137c18161406e565b6040820152606083810151908201526080928301519281019290925250919050565b600060208083850312156137f657600080fd5b82516001600160401b038082111561380d57600080fd5b9084019060a0828703121561382157600080fd5b613829613ddf565b82516138348161406e565b815282840151848201526040808401519082015260608301518281111561385a57600080fd5b8301601f8101881361386b57600080fd5b805161387961329682613e37565b8082825287820191508784018b898560051b870101111561389957600080fd5b600094505b838510156138c55780516138b18161406e565b83526001949094019391880191880161389e565b50606085015250505060808301519350818411156138e257600080fd5b6138ee87858501613275565b60808201529695505050505050565b60006040828403121561390f57600080fd5b604051604081018181106001600160401b038211171561393157613931614058565b604052823561393f8161406e565b81526020928301359281019290925250919050565b60008060008060008060008060a0898b03121561397057600080fd5b883597506020890135965060408901356001600160401b038082111561399557600080fd5b6139a18c838d016131d5565b909850965060608b01359150808211156139ba57600080fd5b6139c68c838d016131d5565b909650945060808b01359150808211156139df57600080fd5b506139ec8b828c01613231565b999c989b5096995094979396929594505050565b600060208284031215613a1257600080fd5b815160ff8116811461159857600080fd5b600081518084526020808501945080840160005b83811015613a5c5781516001600160a01b031687529582019590820190600101613a37565b509495945050505050565b600081518084526020808501945080840160005b83811015613a5c57815187529582019590820190600101613a7b565b60008251613aa9818460208701613fb8565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613aeb816017850160208801613fb8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613b1c816028840160208801613fb8565b01602801949350505050565b6020815260008251806020840152613b47816040850160208701613fb8565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526032908201527f43726f776466756e64696e674d6f64756c653a20496e76616c696420456e7472604082015271616e636520416d6f756e74204c696d69747360701b606082015260800190565b60208082526021908201527f43726f776466756e64696e674d6f64756c653a206f6e6c7920666f722044414f6040820152607360f81b606082015260800190565b60208082526026908201527f43726f776466756e64696e674d6f64756c653a206e6f7420656e6f7567682062604082015265616c616e636560d01b606082015260800190565b60208152613ce66020820183516001600160a01b03169052565b60006020830151613d0260408401826001600160a01b03169052565b506040830151606083015260608301516080830152608083015160a083015260a083015160c083015260c0830151613d3e60e084018215159052565b5060e0830151610100613d548185018315159052565b8401519050610120613d698482018315159052565b8401519050610140613d7e8482018315159052565b84015161016084810191909152840151610180808501919091528401516101c06101a080860182905291925090613db96101e0860184613a23565b90860151858203601f190183870152909250613dd58382613a67565b9695505050505050565b60405160a081016001600160401b0381118282101715613e0157613e01614058565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613e2f57613e2f614058565b604052919050565b60006001600160401b03821115613e5057613e50614058565b5060051b60200190565b60008219821115613e6d57613e6d614016565b500190565b600082613e8f57634e487b7160e01b600052601260045260246000fd5b500490565b600181815b80851115613ecf578160001904821115613eb557613eb5614016565b80851615613ec257918102915b93841c9390800290613e99565b509250929050565b600061159860ff841683600082613ef057506001610723565b81613efd57506000610723565b8160018114613f135760028114613f1d57613f39565b6001915050610723565b60ff841115613f2e57613f2e614016565b50506001821b610723565b5060208310610133831016604e8410600b8410161715613f5c575081810a610723565b613f668383613e94565b8060001904821115613f7a57613f7a614016565b029392505050565b6000816000190483118215151615613f9c57613f9c614016565b500290565b600082821015613fb357613fb3614016565b500390565b60005b83811015613fd3578181015183820152602001613fbb565b838111156122b85750506000910152565b600081613ff357613ff3614016565b506000190190565b600060001982141561400f5761400f614016565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c4257600080fd5b8015158114610c4257600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212203c12b646905ad4ea00e7547e57aa767f2e1b3f0c1bb912f8049bd3dcbecbb8bc64736f6c63430008060033
Deployed Bytecode
0x6080604052600436106101f95760003560e01c80636ddecb0d1161010d578063bcf02ab0116100a0578063d547741f1161006f578063d547741f14610669578063dda429d614610689578063e62153c0146106a9578063ee55efee146106c9578063f0790e0e146106de57600080fd5b8063bcf02ab0146105e7578063c45a015514610607578063c76af7b014610628578063ca15c8731461064957600080fd5b80639010d07c116100dc5780639010d07c1461056d57806391d148541461058d57806396732794146105ad578063a217fddf146105d257600080fd5b80636ddecb0d146104dd57806380ce7b25146105175780638129fc1c1461053757806388ea41b11461054c57600080fd5b80632f2ff15d11610190578063417d3a171161015f578063417d3a171461043c5780634e87a01d1461045c5780634f1ef2861461049557806352d1902d146104a85780635e2a4127146104bd57600080fd5b80632f2ff15d146103bb57806336568abe146103db5780633659cfe6146103fb578063412753581461041b57600080fd5b80630e39c944116101cc5780630e39c944146102e05780631575b0531461033b578063248a9ca31461035d5780632c537d241461038d57600080fd5b806301ffc9a7146101fe578063087db5b8146102335780630881fa0d146102605780630de228a614610299575b600080fd5b34801561020a57600080fd5b5061021e610219366004613662565b6106fe565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b5061025361024e3660046134ba565b610729565b60405161022a9190613ccc565b34801561026c57600080fd5b5061012e54610281906001600160a01b031681565b6040516001600160a01b03909116815260200161022a565b3480156102a557600080fd5b506102d26102b43660046134ba565b61013660209081526000928352604080842090915290825290205481565b60405190815260200161022a565b3480156102ec57600080fd5b506103266102fb3660046134e6565b6101346020908152600093845260408085208252928452828420905282529020805460019091015482565b6040805192835260208301919091520161022a565b34801561034757600080fd5b5061035b6103563660046134ba565b610995565b005b34801561036957600080fd5b506102d26103783660046135de565b600090815260c9602052604090206001015490565b34801561039957600080fd5b506102d26103a8366004613300565b6101326020526000908152604090205481565b3480156103c757600080fd5b5061035b6103d6366004613610565b610abc565b3480156103e757600080fd5b5061035b6103f6366004613610565b610ae7565b34801561040757600080fd5b5061035b610416366004613300565b610b65565b34801561042757600080fd5b5061013154610281906001600160a01b031681565b34801561044857600080fd5b5061035b610457366004613954565b610c45565b34801561046857600080fd5b506102d26104773660046134ba565b61013560209081526000928352604080842090915290825290205481565b61035b6104a3366004613413565b610da1565b3480156104b457600080fd5b506102d2610e6e565b3480156104c957600080fd5b5061035b6104d836600461333a565b610f21565b3480156104e957600080fd5b506101315461050290600160c01b900463ffffffff1681565b60405163ffffffff909116815260200161022a565b34801561052357600080fd5b5061035b6105323660046134ba565b611343565b34801561054357600080fd5b5061035b6114ad565b34801561055857600080fd5b5061012f54610281906001600160a01b031681565b34801561057957600080fd5b50610281610588366004613640565b611580565b34801561059957600080fd5b5061021e6105a8366004613610565b61159f565b3480156105b957600080fd5b506101315461050290600160a01b900463ffffffff1681565b3480156105de57600080fd5b506102d2600081565b3480156105f357600080fd5b5061035b61060236600461355f565b6115ca565b34801561061357600080fd5b5061012d54610281906001600160a01b031681565b34801561063457600080fd5b5061013054610281906001600160a01b031681565b34801561065557600080fd5b506102d26106643660046135de565b611620565b34801561067557600080fd5b5061035b610684366004613610565b611637565b34801561069557600080fd5b5061035b6106a436600461368c565b61165d565b3480156106b557600080fd5b5061035b6106c43660046134ba565b6116be565b3480156106d557600080fd5b5061035b611a94565b3480156106ea57600080fd5b5061035b6106f9366004613528565b611b60565b60006001600160e01b03198216635a05180f60e01b148061072357506107238261220b565b92915050565b6107b5604051806101c0016040528060006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600015158152602001600015158152602001600015158152602001600015158152602001600081526020016000815260200160608152602001606081525090565b6001600160a01b0383166000908152610133602090815260408083208584529091528120906107e660088301612240565b9050600081516001600160401b0381111561080357610803614058565b60405190808252806020026020018201604052801561082c578160200160208202803683370190505b50905060005b81518110156108cf576001600160a01b0387166000908152610134602090815260408083208984529091528120845190919085908490811061087657610876614042565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020600101548282815181106108b4576108b4614042565b60209081029190910101526108c881613ffb565b9050610832565b50604080516101c08101825284546001600160a01b039081168252600186015490811660208301526002860154928201929092526003850154606082015260048501546080820152600585015460a082015260ff600160a01b83048116151560c0830152600160a81b83048116151560e0830152600160b01b830481161515610100830152600160b81b909204909116151561012082015260068401546101408201526007909301546101608401526101808301919091526101a0820152905092915050565b61012d546040516396d054e560e01b81526001600160a01b038481166004830152909116906396d054e59060240160206040518083038186803b1580156109db57600080fd5b505afa1580156109ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1391906135c1565b610a385760405162461bcd60e51b8152600401610a2f90613c45565b60405180910390fd5b6001600160a01b03808316600090815261013260209081526040808320546101338352818420818552909252909120600181015491929091610a7d911633308661224d565b6001600160a01b03841660009081526101366020908152604080832085845290915281208054859290610ab1908490613e5a565b909155505050505050565b600082815260c96020526040902060010154610ad881336122be565b610ae28383612322565b505050565b6001600160a01b0381163314610b575760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610a2f565b610b618282612344565b5050565b306001600160a01b037f0000000000000000000000007d9eb5e6691aae14b2c80e978c5c81ec9c660b50161415610bae5760405162461bcd60e51b8152600401610a2f90613b5b565b7f0000000000000000000000007d9eb5e6691aae14b2c80e978c5c81ec9c660b506001600160a01b0316610bf7600080516020614092833981519152546001600160a01b031690565b6001600160a01b031614610c1d5760405162461bcd60e51b8152600401610a2f90613ba7565b610c2681612366565b60408051600080825260208201909252610c4291839190612372565b50565b610c4d6124ec565b33600090815261013360209081526040808320610132835281842054845290915290206003810154610cd95760405162461bcd60e51b815260206004820152602f60248201527f43726f776466756e64696e674d6f64756c653a2043726f776466756e64696e6760448201526e20646f65736e27742065786973747360881b6064820152608401610a2f565b610d96338a8a8a8a8080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525050604080516020808e0282810182019093528d82529093508d92508c9182918501908490808284376000920182905250604080516020808f02820181019092528d815294508d93508c925082919085015b82821015610d8c57610d7d604083028601368190038101906138fd565b81526020019060010190610d60565b5050505050612586565b505050505050505050565b306001600160a01b037f0000000000000000000000007d9eb5e6691aae14b2c80e978c5c81ec9c660b50161415610dea5760405162461bcd60e51b8152600401610a2f90613b5b565b7f0000000000000000000000007d9eb5e6691aae14b2c80e978c5c81ec9c660b506001600160a01b0316610e33600080516020614092833981519152546001600160a01b031690565b6001600160a01b031614610e595760405162461bcd60e51b8152600401610a2f90613ba7565b610e6282612366565b610b6182826001612372565b6000306001600160a01b037f0000000000000000000000007d9eb5e6691aae14b2c80e978c5c81ec9c660b501614610f0e5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c00000000000000006064820152608401610a2f565b5060008051602061409283398151915290565b610f296124ec565b610f3960408401602085016135a4565b1561102a5761013054604051633e05a36d60e01b8152336004820152602481018890526001600160a01b038c8116921690633e05a36d9060440160006040518083038186803b158015610f8b57600080fd5b505afa158015610f9f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610fc791908101906137e3565b516001600160a01b03161461102a5760405162461bcd60e51b815260206004820152602360248201527f43726f776466756e64696e674d6f64756c653a20496e76616c69642076657374604482015262696e6760e81b6064820152608401610a2f565b33600090815261013360209081526040808320610132835281842054845290915290206003810154156110b75760405162461bcd60e51b815260206004820152602f60248201527f43726f776466756e64696e674d6f64756c653a2043726f776466756e64696e6760448201526e20616c72656164792065786973747360881b6064820152608401610a2f565b80546001600160a01b038d81166001600160a01b0319928316178355600183018054918e1691909216179055600281018a90556110f760208501856135a4565b600182018054911515600160a01b0260ff60a01b1990921691909117905561112560408501602086016135a4565b600182018054911515600160a81b0260ff60a81b1990921691909117905561115360608501604086016135a4565b600182018054911515600160b01b0260ff60b01b1990921691909117905561118160808501606086016135a4565b8160010160176101000a81548160ff02191690831515021790555086816007018190555061125c338a8a898980806020026020016040519081016040528093929190818152602001838360200280828437600092018290525092506111e4915050565b60405190808252806020026020018201604052801561120d578160200160208202803683370190505b508888808060200260200160405190810160405280939291908181526020016000905b82821015610d8c5761124d604083028601368190038101906138fd565b81526020019060010190611230565b3360008181526101326020908152604091829020548454600186015460028701546003880154600689015460078a015488516001600160a01b03968716815295851697860197909752848801929092526060840152608083015260a0820193909352600160a01b830460ff908116151560c0830152600160a81b84048116151560e0830152600160b01b840481161515610100830152600160b81b909304909216151561012083015291519192917f27e515f54887348ef73eed5211f2aaa4d6954d42214210375b49212d1fb80375918190036101400190a3505050505050505050505050565b6001600160a01b0382811660008181526101326020526040908190205461012e54915163745de41b60e11b815260048101939093526024830185905292169063e8bbc83690604401602060405180830381600087803b1580156113a557600080fd5b505af11580156113b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113dd91906135c1565b6113e657600080fd5b61012e5460405163b892342960e01b81526001600160a01b038581166004830152602482018590529091169063b89234299060440160a06040518083038186803b15801561143357600080fd5b505afa158015611447573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061146b919061375c565b608001516001600160a01b038416600090815261013660209081526040808320858452909152812080549091906114a3908490613e5a565b9091555050505050565b600054610100900460ff166114c85760005460ff16156114cc565b303b155b61152f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610a2f565b600054610100900460ff16158015611551576000805461ffff19166101011790555b611559612840565b611561612840565b61156c600033612322565b8015610c42576000805461ff001916905550565b600082815260fb6020526040812061159890836128ab565b9392505050565b600091825260c9602090815260408084206001600160a01b0393909316845291905290205460ff1690565b60006115d681336122be565b5061013180546001600160a01b03949094166001600160c01b031990941693909317600160a01b63ffffffff938416021763ffffffff60c01b1916600160c01b9190921602179055565b600081815260fb60205260408120610723906128b7565b600082815260c9602052604090206001015461165381336122be565b610ae28383612344565b600061166981336122be565b5061012d80546001600160a01b039586166001600160a01b03199182161790915561012e80549486169482169490941790935561012f8054928516928416929092179091556101308054919093169116179055565b61012d546040516396d054e560e01b81526001600160a01b038481166004830152909116906396d054e59060240160206040518083038186803b15801561170457600080fd5b505afa158015611718573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061173c91906135c1565b6117585760405162461bcd60e51b8152600401610a2f90613c45565b6001600160a01b03828116600081815261013260205260408082205461012f54915163979d951360e01b815260048101949094526024840186905293919291169063979d95139060440160806040518083038186803b1580156117ba57600080fd5b505afa1580156117ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117f291906136e8565b6040908101516001600160a01b038616600090815261013660209081528382208683529052919091205490915081111561183e5760405162461bcd60e51b8152600401610a2f90613c86565b6000846001600160a01b031663313c06a06040518163ffffffff1660e01b815260040160206040518083038186803b15801561187957600080fd5b505afa15801561188d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b1919061331d565b61012f546040516370a0823160e01b81523060048201529192506001600160a01b038084169263095ea7b392919091169083906370a082319060240160206040518083038186803b15801561190557600080fd5b505afa158015611919573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193d91906135f7565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b15801561198357600080fd5b505af1158015611997573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119bb91906135c1565b6119c457600080fd5b61012f5460405163155c574760e21b81526001600160a01b03878116600483015260248201879052909116906355715d1c90604401602060405180830381600087803b158015611a1357600080fd5b505af1158015611a27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a4b91906135c1565b611a5457600080fd5b6001600160a01b03851660009081526101366020908152604080832086845290915281208054849290611a88908490613fa1565b90915550505050505050565b611a9c6124ec565b33600081815261013260209081526040808320546101338352818420818552835281842060010154858552610136845282852082865290935292205491926001600160a01b039091169190611af3908390836128c1565b336000908152610132602052604081208054909190611b1190613ffb565b9091555033600081815261013660209081526040808320878452909152808220829055518592917fd620608bd8229f655e280e25ab6d2854da9c3375d79f28ec46bd6eaad75d0fb191a3505050565b6001600160a01b0383166000908152610132602090815260408083205461013383528184208185529092529091206001810154600160a01b900460ff1615611bf6578060060154421115611bf65760405162461bcd60e51b815260206004820181905260248201527f43726f776466756e64696e674d6f64756c653a2073616c65206973206f7665726044820152606401610a2f565b6001810154600160b01b900460ff1615611c7c57611c1760088201336128f1565b611c7c5760405162461bcd60e51b815260206004820152603060248201527f43726f776466756e64696e674d6f64756c653a2074686520627579657220697360448201526f081b9bdd081dda1a5d195b1a5cdd195960821b6064820152608401610a2f565b6001600160a01b03851660009081526101346020908152604080832085845282528083203384529091528120546001830154600160b81b900460ff1615611d5a576001600160a01b0387166000908152610134602090815260408083208784528252808320338452909152902060010154611cf8908290613fa1565b915060008211611d555760405162461bcd60e51b815260206004820152602260248201527f43726f776466756e64696e674d6f64756c653a20616c726561647920626f75676044820152611a1d60f21b6064820152608401610a2f565b611de9565b6004830154611d698288613e5a565b10158015611d8457506005830154611d818288613e5a565b11155b611de55760405162461bcd60e51b815260206004820152602c60248201527f43726f776466756e64696e674d6f64756c653a20616d6f756e74206973206f6660448201526b6620746865206c696d69747360a01b6064820152608401610a2f565b8591505b60038301546001600160a01b038816600090815261013560209081526040808320888452909152902054611e1e908490613e5a565b1115611e775760405162461bcd60e51b815260206004820152602260248201527f43726f776466756e64696e674d6f64756c653a206c696d697420657863656564604482015261195960f21b6064820152608401610a2f565b6001600160a01b038716600090815261013460209081526040808320878452825280832033845290915281208054849290611eb3908490613e5a565b90915550506001600160a01b03871660009081526101356020908152604080832087845290915281208054849290611eec908490613e5a565b90915550600090508515611f2a576101315461271090611f1990600160a01b900463ffffffff1685613f82565b611f239190613e72565b9050611f56565b6101315461271090611f4990600160c01b900463ffffffff1685613f82565b611f539190613e72565b90505b610131548454611f75916001600160a01b03918216913391168461224d565b611f973389611f848487613fa1565b87546001600160a01b031692919061224d565b600284015460018501546040805163313ce56760e01b81529051600093926001600160a01b03169163313ce567916004808301926020929190829003018186803b158015611fe457600080fd5b505afa158015611ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201c9190613a00565b61202790600a613ed7565b6120318487613fa1565b61203b9190613f82565b6120459190613e72565b6001600160a01b038a166000908152610136602090815260408083208a845290915290205490915081111561208c5760405162461bcd60e51b8152600401610a2f90613c86565b6001600160a01b038916600090815261013660209081526040808320898452909152812080548392906120c0908490613fa1565b90915550506001850154600160a81b900460ff1615612177576101305460018601546120f9916001600160a01b039182169116836128c1565b61013054600786015460405163d4a0d6bf60e01b81526001600160a01b038c8116600483015260248201929092523360448201526064810184905291169063d4a0d6bf90608401600060405180830381600087803b15801561215a57600080fd5b505af115801561216e573d6000803e3d6000fd5b50505050612190565b6001850154612190906001600160a01b031633836128c1565b84546001860154604080516001600160a01b039384168152918316602083015281018690526060810183905233918891908c16907fd842d7e5d4909d2611a84cbb48a59cdc08f054129cbd16c5a8358147240e405f9060800160405180910390a4505050505050505050565b6001600160a01b03163b151590565b60006001600160e01b03198216637965db0b60e01b148061072357506301ffc9a760e01b6001600160e01b0319831614610723565b6060600061159883612913565b6040516001600160a01b03808516602483015283166044820152606481018290526122b89085906323b872dd60e01b906084015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b03199093169290921790915261296f565b50505050565b6122c8828261159f565b610b61576122e0816001600160a01b03166014612a41565b6122eb836020612a41565b6040516020016122fc929190613ab3565b60408051601f198184030181529082905262461bcd60e51b8252610a2f91600401613b28565b61232c8282612bdc565b600082815260fb60205260409020610ae29082612c62565b61234e8282612c77565b600082815260fb60205260409020610ae29082612cde565b6000610b6181336122be565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff16156123a557610ae283612cf3565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b815260040160206040518083038186803b1580156123de57600080fd5b505afa92505050801561240e575060408051601f3d908101601f1916820190925261240b918101906135f7565b60015b6124715760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b6064820152608401610a2f565b60008051602061409283398151915281146124e05760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b6064820152608401610a2f565b50610ae2838383612d8f565b61012d546040516396d054e560e01b81523360048201526001600160a01b03909116906396d054e59060240160206040518083038186803b15801561253057600080fd5b505afa158015612544573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061256891906135c1565b6125845760405162461bcd60e51b8152600401610a2f90613c45565b565b6002835111156125a85760405162461bcd60e51b8152600401610a2f90613bf3565b600085116126085760405162461bcd60e51b815260206004820152602760248201527f43726f776466756e64696e674d6f64756c653a20496e76616c69642053616c6560448201526608105b5bdd5b9d60ca1b6064820152608401610a2f565b6001600160a01b0386166000908152610132602090815260408083205461013383528184208185529092529091208451600214156126df578460018151811061265357612653614042565b60200260200101518560008151811061266e5761266e614042565b602002602001015111156126945760405162461bcd60e51b8152600401610a2f90613bf3565b846000815181106126a7576126a7614042565b60200260200101518160040181905550846001815181106126ca576126ca614042565b60200260200101518160050181905550612704565b8451600114156126fc57846000815181106126ca576126ca614042565b600581018790555b600381018790556006810186905560005b83518110156127f35761275184828151811061273357612733614042565b60200260200101516000015183600801612c6290919063ffffffff16565b5083818151811061276457612764614042565b60200260200101516020015161013460008b6001600160a01b03166001600160a01b03168152602001908152602001600020600085815260200190815260200160002060008684815181106127bb576127bb614042565b602090810291909101810151516001600160a01b03168252810191909152604001600020600101556127ec81613ffb565b9050612715565b5060005b8451811015610d965761282f85828151811061281557612815614042565b602002602001015183600801612cde90919063ffffffff16565b5061283981613ffb565b90506127f7565b600054610100900460ff166125845760405162461bcd60e51b815260206004820152602b60248201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960448201526a6e697469616c697a696e6760a81b6064820152608401610a2f565b60006115988383612db4565b6000610723825490565b6040516001600160a01b038316602482015260448101829052610ae290849063a9059cbb60e01b90606401612281565b6001600160a01b03811660009081526001830160205260408120541515611598565b60608160000180548060200260200160405190810160405280929190818152602001828054801561296357602002820191906000526020600020905b81548152602001906001019080831161294f575b50505050509050919050565b60006129c4826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612dde9092919063ffffffff16565b805190915015610ae257808060200190518101906129e291906135c1565b610ae25760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610a2f565b60606000612a50836002613f82565b612a5b906002613e5a565b6001600160401b03811115612a7257612a72614058565b6040519080825280601f01601f191660200182016040528015612a9c576020820181803683370190505b509050600360fc1b81600081518110612ab757612ab7614042565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612ae657612ae6614042565b60200101906001600160f81b031916908160001a9053506000612b0a846002613f82565b612b15906001613e5a565b90505b6001811115612b8d576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612b4957612b49614042565b1a60f81b828281518110612b5f57612b5f614042565b60200101906001600160f81b031916908160001a90535060049490941c93612b8681613fe4565b9050612b18565b5083156115985760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610a2f565b612be6828261159f565b610b6157600082815260c9602090815260408083206001600160a01b03851684529091529020805460ff19166001179055612c1e3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611598836001600160a01b038416612df5565b612c81828261159f565b15610b6157600082815260c9602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611598836001600160a01b038416612e44565b6001600160a01b0381163b612d605760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610a2f565b60008051602061409283398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b612d9883612f37565b600082511180612da55750805b15610ae2576122b88383612f77565b6000826000018281548110612dcb57612dcb614042565b9060005260206000200154905092915050565b6060612ded848460008561306b565b949350505050565b6000818152600183016020526040812054612e3c57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610723565b506000610723565b60008181526001830160205260408120548015612f2d576000612e68600183613fa1565b8554909150600090612e7c90600190613fa1565b9050818114612ee1576000866000018281548110612e9c57612e9c614042565b9060005260206000200154905080876000018481548110612ebf57612ebf614042565b6000918252602080832090910192909255918252600188019052604090208390555b8554869080612ef257612ef261402c565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610723565b6000915050610723565b612f4081612cf3565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606001600160a01b0383163b612fdf5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610a2f565b600080846001600160a01b031684604051612ffa9190613a97565b600060405180830381855af49150503d8060008114613035576040519150601f19603f3d011682016040523d82523d6000602084013e61303a565b606091505b509150915061306282826040518060600160405280602781526020016140b26027913961319c565b95945050505050565b6060824710156130cc5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610a2f565b6001600160a01b0385163b6131235760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610a2f565b600080866001600160a01b0316858760405161313f9190613a97565b60006040518083038185875af1925050503d806000811461317c576040519150601f19603f3d011682016040523d82523d6000602084013e613181565b606091505b509150915061319182828661319c565b979650505050505050565b606083156131ab575081611598565b8251156131bb5782518084602001fd5b8160405162461bcd60e51b8152600401610a2f9190613b28565b60008083601f8401126131e757600080fd5b5081356001600160401b038111156131fe57600080fd5b6020830191508360208260051b850101111561321957600080fd5b9250929050565b806080810183101561072357600080fd5b60008083601f84011261324357600080fd5b5081356001600160401b0381111561325a57600080fd5b6020830191508360208260061b850101111561321957600080fd5b600082601f83011261328657600080fd5b8151602061329b61329683613e37565b613e07565b80838252828201915082860187848660051b89010111156132bb57600080fd5b60005b858110156132da578151845292840192908401906001016132be565b5090979650505050505050565b803563ffffffff811681146132fb57600080fd5b919050565b60006020828403121561331257600080fd5b81356115988161406e565b60006020828403121561332f57600080fd5b81516115988161406e565b60008060008060008060008060008060006101808c8e03121561335c57600080fd5b6133668c3561406e565b8b359a5061337760208d013561406e565b60208c0135995060408c0135985060608c0135975060808c0135965060a08c013595506001600160401b038060c08e013511156133b357600080fd5b6133c38e60c08f01358f016131d5565b90965094506133d58e60e08f01613220565b9350806101608e013511156133e957600080fd5b506133fb8d6101608e01358e01613231565b81935080925050509295989b509295989b9093969950565b6000806040838503121561342657600080fd5b82356134318161406e565b91506020838101356001600160401b038082111561344e57600080fd5b818601915086601f83011261346257600080fd5b81358181111561347457613474614058565b613486601f8201601f19168501613e07565b9150808252878482850101111561349c57600080fd5b80848401858401376000848284010152508093505050509250929050565b600080604083850312156134cd57600080fd5b82356134d88161406e565b946020939093013593505050565b6000806000606084860312156134fb57600080fd5b83356135068161406e565b925060208401359150604084013561351d8161406e565b809150509250925092565b60008060006060848603121561353d57600080fd5b83356135488161406e565b925060208401359150604084013561351d81614083565b60008060006060848603121561357457600080fd5b833561357f8161406e565b925061358d602085016132e7565b915061359b604085016132e7565b90509250925092565b6000602082840312156135b657600080fd5b813561159881614083565b6000602082840312156135d357600080fd5b815161159881614083565b6000602082840312156135f057600080fd5b5035919050565b60006020828403121561360957600080fd5b5051919050565b6000806040838503121561362357600080fd5b8235915060208301356136358161406e565b809150509250929050565b6000806040838503121561365357600080fd5b50508035926020909101359150565b60006020828403121561367457600080fd5b81356001600160e01b03198116811461159857600080fd5b600080600080608085870312156136a257600080fd5b84356136ad8161406e565b935060208501356136bd8161406e565b925060408501356136cd8161406e565b915060608501356136dd8161406e565b939692955090935050565b6000608082840312156136fa57600080fd5b604051608081018181106001600160401b038211171561371c5761371c614058565b604052825161372a81614083565b8152602083015161373a8161406e565b6020820152604083810151908201526060928301519281019290925250919050565b600060a0828403121561376e57600080fd5b60405160a081018181106001600160401b038211171561379057613790614058565b604052825161379e81614083565b815260208301516137ae8161406e565b602082015260408301516137c18161406e565b6040820152606083810151908201526080928301519281019290925250919050565b600060208083850312156137f657600080fd5b82516001600160401b038082111561380d57600080fd5b9084019060a0828703121561382157600080fd5b613829613ddf565b82516138348161406e565b815282840151848201526040808401519082015260608301518281111561385a57600080fd5b8301601f8101881361386b57600080fd5b805161387961329682613e37565b8082825287820191508784018b898560051b870101111561389957600080fd5b600094505b838510156138c55780516138b18161406e565b83526001949094019391880191880161389e565b50606085015250505060808301519350818411156138e257600080fd5b6138ee87858501613275565b60808201529695505050505050565b60006040828403121561390f57600080fd5b604051604081018181106001600160401b038211171561393157613931614058565b604052823561393f8161406e565b81526020928301359281019290925250919050565b60008060008060008060008060a0898b03121561397057600080fd5b883597506020890135965060408901356001600160401b038082111561399557600080fd5b6139a18c838d016131d5565b909850965060608b01359150808211156139ba57600080fd5b6139c68c838d016131d5565b909650945060808b01359150808211156139df57600080fd5b506139ec8b828c01613231565b999c989b5096995094979396929594505050565b600060208284031215613a1257600080fd5b815160ff8116811461159857600080fd5b600081518084526020808501945080840160005b83811015613a5c5781516001600160a01b031687529582019590820190600101613a37565b509495945050505050565b600081518084526020808501945080840160005b83811015613a5c57815187529582019590820190600101613a7b565b60008251613aa9818460208701613fb8565b9190910192915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613aeb816017850160208801613fb8565b7001034b99036b4b9b9b4b733903937b6329607d1b6017918401918201528351613b1c816028840160208801613fb8565b01602801949350505050565b6020815260008251806020840152613b47816040850160208701613fb8565b601f01601f19169190910160400192915050565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b60208082526032908201527f43726f776466756e64696e674d6f64756c653a20496e76616c696420456e7472604082015271616e636520416d6f756e74204c696d69747360701b606082015260800190565b60208082526021908201527f43726f776466756e64696e674d6f64756c653a206f6e6c7920666f722044414f6040820152607360f81b606082015260800190565b60208082526026908201527f43726f776466756e64696e674d6f64756c653a206e6f7420656e6f7567682062604082015265616c616e636560d01b606082015260800190565b60208152613ce66020820183516001600160a01b03169052565b60006020830151613d0260408401826001600160a01b03169052565b506040830151606083015260608301516080830152608083015160a083015260a083015160c083015260c0830151613d3e60e084018215159052565b5060e0830151610100613d548185018315159052565b8401519050610120613d698482018315159052565b8401519050610140613d7e8482018315159052565b84015161016084810191909152840151610180808501919091528401516101c06101a080860182905291925090613db96101e0860184613a23565b90860151858203601f190183870152909250613dd58382613a67565b9695505050505050565b60405160a081016001600160401b0381118282101715613e0157613e01614058565b60405290565b604051601f8201601f191681016001600160401b0381118282101715613e2f57613e2f614058565b604052919050565b60006001600160401b03821115613e5057613e50614058565b5060051b60200190565b60008219821115613e6d57613e6d614016565b500190565b600082613e8f57634e487b7160e01b600052601260045260246000fd5b500490565b600181815b80851115613ecf578160001904821115613eb557613eb5614016565b80851615613ec257918102915b93841c9390800290613e99565b509250929050565b600061159860ff841683600082613ef057506001610723565b81613efd57506000610723565b8160018114613f135760028114613f1d57613f39565b6001915050610723565b60ff841115613f2e57613f2e614016565b50506001821b610723565b5060208310610133831016604e8410600b8410161715613f5c575081810a610723565b613f668383613e94565b8060001904821115613f7a57613f7a614016565b029392505050565b6000816000190483118215151615613f9c57613f9c614016565b500290565b600082821015613fb357613fb3614016565b500390565b60005b83811015613fd3578181015183820152602001613fbb565b838111156122b85750506000910152565b600081613ff357613ff3614016565b506000190190565b600060001982141561400f5761400f614016565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610c4257600080fd5b8015158114610c4257600080fdfe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212203c12b646905ad4ea00e7547e57aa767f2e1b3f0c1bb912f8049bd3dcbecbb8bc64736f6c63430008060033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 34 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.